return (
<div>
<Alert className="spacer-top huge-spacer-bottom" variant="info">
- <FormattedMessage
- defaultMessage={translate('settings.pr_decoration.binding.no_bindings')}
- id="settings.pr_decoration.binding.no_bindings"
- values={{
- link: (
- <Link to="/documentation/analysis/pull-request/#pr-decoration">
- {translate('learn_more')}
- </Link>
- )
- }}
- />
+ {isSysAdmin ? (
+ <FormattedMessage
+ defaultMessage={translate('settings.pr_decoration.binding.no_bindings.admin')}
+ id="settings.pr_decoration.binding.no_bindings.admin"
+ values={{
+ link: (
+ <Link to={getGlobalSettingsUrl(ALM_INTEGRATION)}>
+ {translate('settings.pr_decoration.binding.no_bindings.link')}
+ </Link>
+ )
+ }}
+ />
+ ) : (
+ translate('settings.pr_decoration.binding.no_bindings')
+ )}
</Alert>
</div>
);
it.each([
['when loading', { loading: true }],
- ['with no ALM instances', {}],
+ ['with no ALM instances (admin user)', { isSysAdmin: true }],
+ ['with no ALM instances (non-admin user)', {}],
['with a single ALM instance', { instances: [instances[0]] }],
['with an empty form', { instances }],
[
</div>
`;
-exports[`should render correctly: with no ALM instances 1`] = `
+exports[`should render correctly: with no ALM instances (admin user) 1`] = `
<div>
<Alert
className="spacer-top huge-spacer-bottom"
variant="info"
>
<FormattedMessage
- defaultMessage="settings.pr_decoration.binding.no_bindings"
- id="settings.pr_decoration.binding.no_bindings"
+ defaultMessage="settings.pr_decoration.binding.no_bindings.admin"
+ id="settings.pr_decoration.binding.no_bindings.admin"
values={
Object {
"link": <Link
onlyActiveOnIndex={false}
style={Object {}}
- to="/documentation/analysis/pull-request/#pr-decoration"
+ to={
+ Object {
+ "pathname": "/admin/settings",
+ "query": Object {
+ "category": "almintegration",
+ },
+ }
+ }
>
- learn_more
+ settings.pr_decoration.binding.no_bindings.link
</Link>,
}
}
</div>
`;
+exports[`should render correctly: with no ALM instances (non-admin user) 1`] = `
+<div>
+ <Alert
+ className="spacer-top huge-spacer-bottom"
+ variant="info"
+ >
+ settings.pr_decoration.binding.no_bindings
+ </Alert>
+</div>
+`;
+
exports[`should render select options correctly 1`] = `
<React.Fragment>
<span>
settings.almintegration.feature.alm_repo_import.disabled.no_url=This feature is disabled because your configured instance has no URL.
settings.pr_decoration.binding.category=DevOps Platform Integration
-settings.pr_decoration.binding.no_bindings=This feature must first be enabled in the global settings. {link}
+settings.pr_decoration.binding.no_bindings=A system administrator needs to enable this feature in the global settings.
+settings.pr_decoration.binding.no_bindings.admin=Set up a {link} first before you and your team can enable Pull Request Decoration.
+settings.pr_decoration.binding.no_bindings.link=global configuration
settings.pr_decoration.binding.title=DevOps Platform Integration
settings.pr_decoration.binding.description=Display your Quality Gate status directly in your DevOps Platform.
settings.pr_decoration.binding.check_configuration=Check configuration