definitions: B[];
definitionStatus: T.Dict<AlmSettingsBindingStatus>;
form: (props: AlmBindingDefinitionFormChildrenProps<B>) => React.ReactNode;
- help?: React.ReactNode;
+ help: React.ReactNode;
loadingAlmDefinitions: boolean;
loadingProjectCount: boolean;
multipleAlmEnabled: boolean;
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { Link } from 'react-router';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
defaultBinding: B;
definitions: B[];
form: (props: AlmBindingDefinitionFormChildrenProps<B>) => React.ReactNode;
- help?: React.ReactNode;
+ help: React.ReactNode;
loadingAlmDefinitions: boolean;
loadingProjectCount: boolean;
multipleAlmEnabled: boolean;
success: boolean;
}
-const renderDefaultHelp = (alm: AlmKeys) => (
- <FormattedMessage
- defaultMessage={translate(`settings.almintegration.${alm}.info`)}
- id={`settings.almintegration.${alm}.info`}
- values={{
- link: (
- <Link target="_blank" to="/documentation/analysis/pr-decoration/">
- {translate('learn_more')}
- </Link>
- )
- }}
- />
-);
-
export default function AlmTabRenderer<B extends AlmBindingDefinition>(
props: AlmTabRendererProps<B>
) {
loadingProjectCount,
multipleAlmEnabled,
optionalFields,
- help = renderDefaultHelp(alm)
+ help
} = props;
const preventCreation = loadingProjectCount || (!multipleAlmEnabled && definitions.length > 0);
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
+import { Link } from 'react-router';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { createAzureConfiguration, updateAzureConfiguration } from '../../../../api/alm-settings';
import {
AlmKeys,
definitions={definitions}
definitionStatus={definitionStatus}
form={childProps => <AzureForm {...childProps} />}
+ help={
+ <FormattedMessage
+ defaultMessage={translate(`settings.almintegration.azure.info`)}
+ id="settings.almintegration.azure.info"
+ values={{
+ link: (
+ <Link target="_blank" to="/documentation/analysis/azuredevops-integration/">
+ {translate('learn_more')}
+ </Link>
+ )
+ }}
+ />
+ }
loadingAlmDefinitions={loadingAlmDefinitions}
loadingProjectCount={loadingProjectCount}
multipleAlmEnabled={multipleAlmEnabled}
</ul>
<p className="big-spacer-top big-spacer-bottom">
- <Link target="_blank" to="/documentation/analysis/pr-decoration/">
+ <Link target="_blank" to="/documentation/analysis/bitbucket-integration/">
{translate('learn_more')}
</Link>
</p>
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
+import { Link } from 'react-router';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { createGithubConfiguration, updateGithubConfiguration } from '../../../../api/alm-settings';
import {
AlmKeys,
definitions={definitions}
definitionStatus={definitionStatus}
form={childProps => <GithubForm {...childProps} />}
+ help={
+ <FormattedMessage
+ defaultMessage={translate(`settings.almintegration.github.info`)}
+ id="settings.almintegration.github.info"
+ values={{
+ link: (
+ <Link target="_blank" to="/documentation/analysis/github-integration/">
+ {translate('learn_more')}
+ </Link>
+ )
+ }}
+ />
+ }
loadingAlmDefinitions={loadingAlmDefinitions}
loadingProjectCount={loadingProjectCount}
multipleAlmEnabled={multipleAlmEnabled}
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
+import { Link } from 'react-router';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { createGitlabConfiguration, updateGitlabConfiguration } from '../../../../api/alm-settings';
import {
AlmKeys,
definitions={definitions}
definitionStatus={definitionStatus}
form={childProps => <GitlabForm {...childProps} />}
+ help={
+ <FormattedMessage
+ defaultMessage={translate(`settings.almintegration.gitlab.info`)}
+ id="settings.almintegration.gitlab.info"
+ values={{
+ link: (
+ <Link target="_blank" to="/documentation/analysis/gitlab-integration/">
+ {translate('learn_more')}
+ </Link>
+ )
+ }}
+ />
+ }
loadingAlmDefinitions={loadingAlmDefinitions}
loadingProjectCount={loadingProjectCount}
multipleAlmEnabled={multipleAlmEnabled}
definitions={[mockAzureBindingDefinition()]}
definitionStatus={{}}
form={jest.fn()}
+ help={<div />}
loadingAlmDefinitions={false}
loadingProjectCount={false}
multipleAlmEnabled={true}
definitions={[]}
definitionStatus={{}}
form={jest.fn()}
+ help={<div />}
loadingAlmDefinitions={false}
loadingProjectCount={false}
multipleAlmEnabled={true}
]
}
form={[MockFunction]}
+ help={<div />}
loadingAlmDefinitions={false}
loadingProjectCount={false}
multipleAlmEnabled={true}
"personalAccessToken": "asdf1234",
}
}
- help={
- <FormattedMessage
- defaultMessage="settings.almintegration.azure.info"
- id="settings.almintegration.azure.info"
- values={
- Object {
- "link": <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/pr-decoration/"
- >
- learn_more
- </Link>,
- }
- }
- />
- }
+ help={<div />}
isSecondInstance={true}
onCancel={[MockFunction]}
onSubmit={[MockFunction]}
"url": "http://github.enterprise.com",
}
}
- help={
- <FormattedMessage
- defaultMessage="settings.almintegration.github.info"
- id="settings.almintegration.github.info"
- values={
- Object {
- "link": <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/pr-decoration/"
- >
- learn_more
- </Link>,
- }
- }
- />
- }
+ help={<div />}
isSecondInstance={false}
onCancel={[MockFunction]}
onSubmit={[MockFunction]}
"url": "http://github.enterprise.com",
}
}
- help={
- <FormattedMessage
- defaultMessage="settings.almintegration.github.info"
- id="settings.almintegration.github.info"
- values={
- Object {
- "link": <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/pr-decoration/"
- >
- learn_more
- </Link>,
- }
- }
- />
- }
+ help={<div />}
isSecondInstance={true}
onCancel={[MockFunction]}
onSubmit={[MockFunction]}
]
}
form={[Function]}
+ help={
+ <FormattedMessage
+ defaultMessage="settings.almintegration.azure.info"
+ id="settings.almintegration.azure.info"
+ values={
+ Object {
+ "link": <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ target="_blank"
+ to="/documentation/analysis/azuredevops-integration/"
+ >
+ learn_more
+ </Link>,
+ }
+ }
+ />
+ }
loadingAlmDefinitions={false}
loadingProjectCount={false}
multipleAlmEnabled={true}
onlyActiveOnIndex={false}
style={Object {}}
target="_blank"
- to="/documentation/analysis/pr-decoration/"
+ to="/documentation/analysis/bitbucket-integration/"
>
learn_more
</Link>
]
}
form={[Function]}
+ help={
+ <FormattedMessage
+ defaultMessage="settings.almintegration.github.info"
+ id="settings.almintegration.github.info"
+ values={
+ Object {
+ "link": <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ target="_blank"
+ to="/documentation/analysis/github-integration/"
+ >
+ learn_more
+ </Link>,
+ }
+ }
+ />
+ }
loadingAlmDefinitions={false}
loadingProjectCount={false}
multipleAlmEnabled={true}
]
}
form={[Function]}
+ help={
+ <FormattedMessage
+ defaultMessage="settings.almintegration.gitlab.info"
+ id="settings.almintegration.gitlab.info"
+ values={
+ Object {
+ "link": <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ target="_blank"
+ to="/documentation/analysis/gitlab-integration/"
+ >
+ learn_more
+ </Link>,
+ }
+ }
+ />
+ }
loadingAlmDefinitions={false}
loadingProjectCount={false}
multipleAlmEnabled={true}
]
}
form={[Function]}
+ help={
+ <FormattedMessage
+ defaultMessage="settings.almintegration.gitlab.info"
+ id="settings.almintegration.gitlab.info"
+ values={
+ Object {
+ "link": <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ target="_blank"
+ to="/documentation/analysis/gitlab-integration/"
+ >
+ learn_more
+ </Link>,
+ }
+ }
+ />
+ }
loadingAlmDefinitions={false}
loadingProjectCount={false}
multipleAlmEnabled={true}
definitionStatus={Object {}}
definitions={Array []}
form={[Function]}
+ help={
+ <FormattedMessage
+ defaultMessage="settings.almintegration.gitlab.info"
+ id="settings.almintegration.gitlab.info"
+ values={
+ Object {
+ "link": <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ target="_blank"
+ to="/documentation/analysis/gitlab-integration/"
+ >
+ learn_more
+ </Link>,
+ }
+ }
+ />
+ }
loadingAlmDefinitions={false}
loadingProjectCount={false}
multipleAlmEnabled={true}