return `${url.replace(/\/$/, '')}/plugins/servlet/access-tokens/add`;
} else if (alm === AlmKeys.BitbucketCloud) {
return 'https://bitbucket.org/account/settings/app-passwords/new';
- } else {
- // GitLab
- return url.endsWith('/api/v4')
- ? `${url.replace('/api/v4', '').replace(/\/$/, '')}/profile/personal_access_tokens`
- : 'https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token';
+ } else if (alm === AlmKeys.GitLab) {
+ return 'https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html';
}
+
+ return '';
}
export default class PersonalAccessTokenForm extends React.PureComponent<Props, State> {
src="/images/alm/gitlab.svg"
/>
<a
- href="https://gitlab.com/profile/personal_access_tokens"
+ href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html"
rel="noopener noreferrer"
target="_blank"
>
src="/images/alm/gitlab.svg"
/>
<a
- href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token"
+ href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html"
rel="noopener noreferrer"
target="_blank"
>
*/
import * as React from 'react';
import { ButtonLink } from '../../../../components/controls/buttons';
-import HelpTooltip from '../../../../components/controls/HelpTooltip';
import MandatoryFieldMarker from '../../../../components/ui/MandatoryFieldMarker';
import { translate } from '../../../../helpers/l10n';
import { AlmBindingDefinitionBase } from '../../../../types/alm-settings';
+import '../../styles.css';
export interface AlmBindingDefinitionFormFieldProps<B extends AlmBindingDefinitionBase> {
autoFocus?: boolean;
const [showField, setShowField] = React.useState(!overwriteOnly);
return (
- <div className="modal-field">
- <label className="display-flex-center" htmlFor={id}>
- {translate('settings.almintegration.form', id)}
+ <div className="settings-definition">
+ <div className="settings-definition-left">
+ <label className="h3" htmlFor={id}>
+ {translate('settings.almintegration.form', id)}
+ </label>
{!optional && <MandatoryFieldMarker />}
- {help && <HelpTooltip className="spacer-left" overlay={help} placement="right" />}
- </label>
+ {help && <div className="markdown small spacer-top">{help}</div>}
+ </div>
+ <div className="settings-definition-right big-padded-top">
+ {!showField && overwriteOnly && (
+ <div>
+ <p>{translate('settings.almintegration.form.secret_field')}</p>
+ <ButtonLink
+ onClick={() => {
+ props.onFieldChange(propKey, '');
+ setShowField(true);
+ }}>
+ {translate('settings.almintegration.form.update_secret_field')}
+ </ButtonLink>
+ </div>
+ )}
- {!showField && overwriteOnly && (
- <div>
- <p>{translate('settings.almintegration.form.secret_field')}</p>
- <ButtonLink
- onClick={() => {
- props.onFieldChange(propKey, '');
- setShowField(true);
- }}>
- {translate('settings.almintegration.form.update_secret_field')}
- </ButtonLink>
- </div>
- )}
+ {showField && isTextArea && (
+ <textarea
+ className="settings-large-input"
+ id={id}
+ maxLength={maxLength || 2000}
+ onChange={e => props.onFieldChange(propKey, e.currentTarget.value)}
+ required={!optional}
+ rows={5}
+ value={value}
+ />
+ )}
- {showField && isTextArea && (
- <textarea
- className="settings-large-input"
- id={id}
- maxLength={maxLength || 2000}
- onChange={e => props.onFieldChange(propKey, e.currentTarget.value)}
- required={!optional}
- rows={5}
- value={value}
- />
- )}
-
- {showField && !isTextArea && (
- <input
- autoFocus={autoFocus}
- className="input-super-large"
- id={id}
- maxLength={maxLength || 100}
- name={id}
- onChange={e => props.onFieldChange(propKey, e.currentTarget.value)}
- size={50}
- type="text"
- value={value}
- />
- )}
+ {showField && !isTextArea && (
+ <input
+ autoFocus={autoFocus}
+ className="settings-large-input"
+ id={id}
+ maxLength={maxLength || 100}
+ name={id}
+ onChange={e => props.onFieldChange(propKey, e.currentTarget.value)}
+ size={50}
+ type="text"
+ value={value}
+ />
+ )}
+ </div>
</div>
);
}
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
-import { Alert } from '../../../../components/ui/Alert';
import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants';
import { translate } from '../../../../helpers/l10n';
import { AlmKeys, AzureBindingDefinition } from '../../../../types/alm-settings';
const { formData, onFieldChange } = props;
return (
- <div className="display-flex-start">
- <div className="flex-1">
- <AlmBindingDefinitionFormField
- autoFocus={true}
- help={translate('settings.almintegration.form.name.azure.help')}
- id="name.azure"
- onFieldChange={onFieldChange}
- propKey="key"
- value={formData.key}
- />
- <AlmBindingDefinitionFormField
- help={
- <>
- {translate('settings.almintegration.form.url.azure.help1')}
- <br />
- <em>https://ado.your-company.com/your_collection</em>
- <br />
- <br />
- {translate('settings.almintegration.form.url.azure.help2')}
- <br />
- <em>https://dev.azure.com/your_organization</em>
- </>
- }
- id="url.azure"
- maxLength={2000}
- onFieldChange={onFieldChange}
- propKey="url"
- value={formData.url || ''}
- />
- <AlmBindingDefinitionFormField
- help={translate('settings.almintegration.form.personal_access_token.azure.help')}
- id="personal_access_token"
- isTextArea={true}
- onFieldChange={onFieldChange}
- overwriteOnly={Boolean(formData.key)}
- propKey="personalAccessToken"
- value={formData.personalAccessToken}
- />
- </div>
- <Alert className="huge-spacer-left flex-1" variant="info">
- <FormattedMessage
- defaultMessage={translate(`settings.almintegration.azure.info`)}
- id="settings.almintegration.azure.info"
- values={{
- link: (
- <Link target="_blank" to={ALM_DOCUMENTATION_PATHS[AlmKeys.Azure]}>
- {translate('learn_more')}
- </Link>
- )
- }}
- />
- </Alert>
- </div>
+ <>
+ <AlmBindingDefinitionFormField
+ autoFocus={true}
+ help={translate('settings.almintegration.form.name.azure.help')}
+ id="name.azure"
+ onFieldChange={onFieldChange}
+ propKey="key"
+ value={formData.key}
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <>
+ {translate('settings.almintegration.form.url.azure.help1')}
+ <br />
+ <em>https://ado.your-company.com/your_collection</em>
+ <br />
+ <br />
+ {translate('settings.almintegration.form.url.azure.help2')}
+ <br />
+ <em>https://dev.azure.com/your_organization</em>
+ </>
+ }
+ id="url.azure"
+ maxLength={2000}
+ onFieldChange={onFieldChange}
+ propKey="url"
+ value={formData.url || ''}
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <FormattedMessage
+ defaultMessage={translate(
+ 'settings.almintegration.form.personal_access_token.azure.help'
+ )}
+ id="settings.almintegration.form.personal_access_token.azure.help"
+ values={{
+ pat: (
+ <a
+ href="https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate"
+ rel="noopener noreferrer"
+ target="_blank">
+ {translate('settings.almintegration.form.personal_access_token.azure.help.url')}
+ </a>
+ ),
+ permission: <strong>{'Code > Read & Write'}</strong>,
+ doc_link: (
+ <Link target="_blank" to={ALM_DOCUMENTATION_PATHS[AlmKeys.Azure]}>
+ {translate('learn_more')}
+ </Link>
+ )
+ }}
+ />
+ }
+ id="personal_access_token"
+ isTextArea={true}
+ onFieldChange={onFieldChange}
+ overwriteOnly={Boolean(formData.key)}
+ propKey="personalAccessToken"
+ value={formData.personalAccessToken}
+ />
+ </>
);
}
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
+import { Link } from 'react-router';
+import { Alert } from '../../../../components/ui/Alert';
+import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants';
import { translate } from '../../../../helpers/l10n';
-import { BitbucketCloudBindingDefinition } from '../../../../types/alm-settings';
+import { AlmKeys, BitbucketCloudBindingDefinition } from '../../../../types/alm-settings';
import { AlmBindingDefinitionFormField } from './AlmBindingDefinitionFormField';
export interface BitbucketCloudFormProps {
propKey="workspace"
value={formData.workspace || ''}
/>
+ <Alert className="big-spacer-top big-spacer-right" variant="info">
+ <FormattedMessage
+ defaultMessage={translate(`settings.almintegration.bitbucketcloud.info`)}
+ id="settings.almintegration.bitbucketcloud.info"
+ values={{
+ oauth: (
+ <a
+ href="https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/"
+ rel="noopener noreferrer"
+ target="_blank">
+ {translate('settings.almintegration.bitbucketcloud.oauth')}
+ </a>
+ ),
+ permission: <strong>Pull Requests: Read</strong>,
+ doc_link: (
+ <Link target="_blank" to={ALM_DOCUMENTATION_PATHS[AlmKeys.BitbucketCloud]}>
+ {translate('learn_more')}
+ </Link>
+ )
+ }}
+ />
+ </Alert>
<AlmBindingDefinitionFormField
id="client_id.bitbucketcloud"
help={translate('settings.almintegration.form.oauth_key.bitbucketcloud.help')}
* 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 RadioToggle from '../../../../components/controls/RadioToggle';
-import { Alert } from '../../../../components/ui/Alert';
-import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants';
import { translate } from '../../../../helpers/l10n';
import {
AlmKeys,
{variant !== undefined && (
<>
{variant === AlmKeys.BitbucketServer && (
- <div className="display-flex-start">
- <div className="flex-1">
- <BitbucketServerForm
- onFieldChange={props.onFieldChange}
- formData={formData as BitbucketServerBindingDefinition}
- />
- </div>
- <Alert className="huge-spacer-left flex-1" variant="info">
- <>
- <h3>{translate('onboarding.create_project.pat_help.title')}</h3>
-
- <p className="big-spacer-top">
- {translate('settings.almintegration.bitbucket.help_1')}
- </p>
-
- <ul className="big-spacer-top list-styled">
- <li>{translate('settings.almintegration.bitbucket.help_2')}</li>
- <li>{translate('settings.almintegration.bitbucket.help_3')}</li>
- </ul>
-
- <p className="big-spacer-top big-spacer-bottom">
- <Link target="_blank" to={ALM_DOCUMENTATION_PATHS[AlmKeys.BitbucketServer]}>
- {translate('learn_more')}
- </Link>
- </p>
- </>
- </Alert>
- </div>
+ <BitbucketServerForm
+ onFieldChange={props.onFieldChange}
+ formData={formData as BitbucketServerBindingDefinition}
+ />
)}
{variant === AlmKeys.BitbucketCloud && (
- <div className="display-flex-start">
- <div className="flex-1">
- <BitbucketCloudForm
- onFieldChange={props.onFieldChange}
- formData={formData as BitbucketCloudBindingDefinition}
- />
- </div>
- <Alert className="huge-spacer-left flex-1" variant="info">
- <FormattedMessage
- defaultMessage={translate(`settings.almintegration.bitbucketcloud.info`)}
- id="settings.almintegration.bitbucketcloud.info"
- values={{
- link: (
- <Link target="_blank" to={ALM_DOCUMENTATION_PATHS[AlmKeys.BitbucketCloud]}>
- {translate('learn_more')}
- </Link>
- )
- }}
- />
- </Alert>
- </div>
+ <BitbucketCloudForm
+ onFieldChange={props.onFieldChange}
+ formData={formData as BitbucketCloudBindingDefinition}
+ />
)}
</>
)}
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
+import { Link } from 'react-router';
+import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants';
import { translate } from '../../../../helpers/l10n';
-import { BitbucketServerBindingDefinition } from '../../../../types/alm-settings';
+import { AlmKeys, BitbucketServerBindingDefinition } from '../../../../types/alm-settings';
import { AlmBindingDefinitionFormField } from './AlmBindingDefinitionFormField';
export interface BitbucketServerFormProps {
return (
<>
- {' '}
<AlmBindingDefinitionFormField
autoFocus={true}
help={translate('settings.almintegration.form.name.bitbucket.help')}
'settings.almintegration.form.personal_access_token.bitbucket.help.url'
)}
</a>
+ ),
+ permission: <strong>Read</strong>,
+ doc_link: (
+ <Link target="_blank" to={ALM_DOCUMENTATION_PATHS[AlmKeys.BitbucketServer]}>
+ {translate('learn_more')}
+ </Link>
)
}}
/>
const { formData, onFieldChange } = props;
return (
- <div className="display-flex-start">
- <div className="flex-1">
- <AlmBindingDefinitionFormField
- autoFocus={true}
- help={translate('settings.almintegration.form.name.github.help')}
- id="name.github"
- onFieldChange={onFieldChange}
- propKey="key"
- value={formData.key}
- />
- <AlmBindingDefinitionFormField
- help={
- <>
- {translate('settings.almintegration.form.url.github.help1')}
- <br />
- <em>https://github.company.com/api/v3</em>
- <br />
- <br />
- {translate('settings.almintegration.form.url.github.help2')}
- <br />
- <em>https://api.github.com/</em>
- </>
- }
- id="url.github"
- maxLength={2000}
- onFieldChange={onFieldChange}
- propKey="url"
- value={formData.url}
- />
- <AlmBindingDefinitionFormField
- id="app_id"
- help={translate('settings.almintegration.form.app_id.github.help')}
- maxLength={80}
- onFieldChange={onFieldChange}
- propKey="appId"
- value={formData.appId}
- />
- <AlmBindingDefinitionFormField
- id="client_id.github"
- help={translate('settings.almintegration.form.client_id.github.help')}
- maxLength={80}
- onFieldChange={onFieldChange}
- propKey="clientId"
- value={formData.clientId}
- />
- <AlmBindingDefinitionFormField
- id="client_secret.github"
- help={translate('settings.almintegration.form.client_secret.github.help')}
- maxLength={80}
- onFieldChange={onFieldChange}
- overwriteOnly={Boolean(formData.key)}
- propKey="clientSecret"
- value={formData.clientSecret}
- />
- <AlmBindingDefinitionFormField
- id="private_key"
- help={translate('settings.almintegration.form.private_key.github.help')}
- isTextArea={true}
- onFieldChange={onFieldChange}
- overwriteOnly={Boolean(formData.key)}
- propKey="privateKey"
- value={formData.privateKey}
- />
- </div>
- <Alert className="huge-spacer-left flex-1" variant="info">
+ <>
+ <AlmBindingDefinitionFormField
+ autoFocus={true}
+ help={translate('settings.almintegration.form.name.github.help')}
+ id="name.github"
+ onFieldChange={onFieldChange}
+ propKey="key"
+ value={formData.key}
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <>
+ {translate('settings.almintegration.form.url.github.help1')}
+ <br />
+ <em>https://github.company.com/api/v3</em>
+ <br />
+ <br />
+ {translate('settings.almintegration.form.url.github.help2')}
+ <br />
+ <em>https://api.github.com/</em>
+ </>
+ }
+ id="url.github"
+ maxLength={2000}
+ onFieldChange={onFieldChange}
+ propKey="url"
+ value={formData.url}
+ />
+ <Alert className="big-spacer-top big-spacer-right" variant="info">
<FormattedMessage
defaultMessage={translate(`settings.almintegration.github.info`)}
id="settings.almintegration.github.info"
}}
/>
</Alert>
- </div>
+ <AlmBindingDefinitionFormField
+ id="app_id"
+ help={translate('settings.almintegration.form.app_id.github.help')}
+ maxLength={80}
+ onFieldChange={onFieldChange}
+ propKey="appId"
+ value={formData.appId}
+ />
+ <AlmBindingDefinitionFormField
+ id="client_id.github"
+ help={translate('settings.almintegration.form.client_id.github.help')}
+ maxLength={80}
+ onFieldChange={onFieldChange}
+ propKey="clientId"
+ value={formData.clientId}
+ />
+ <AlmBindingDefinitionFormField
+ id="client_secret.github"
+ help={translate('settings.almintegration.form.client_secret.github.help')}
+ maxLength={80}
+ onFieldChange={onFieldChange}
+ overwriteOnly={Boolean(formData.key)}
+ propKey="clientSecret"
+ value={formData.clientSecret}
+ />
+ <AlmBindingDefinitionFormField
+ id="private_key"
+ help={translate('settings.almintegration.form.private_key.github.help')}
+ isTextArea={true}
+ onFieldChange={onFieldChange}
+ overwriteOnly={Boolean(formData.key)}
+ propKey="privateKey"
+ value={formData.privateKey}
+ />
+ </>
);
}
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
-import { Alert } from '../../../../components/ui/Alert';
import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants';
import { translate } from '../../../../helpers/l10n';
import { AlmKeys, GitlabBindingDefinition } from '../../../../types/alm-settings';
const { formData, onFieldChange } = props;
return (
- <div className="display-flex-start">
- <div className="flex-1">
- <AlmBindingDefinitionFormField
- autoFocus={true}
- help={translate('settings.almintegration.form.name.gitlab.help')}
- id="name.gitlab"
- onFieldChange={onFieldChange}
- propKey="key"
- value={formData.key}
- />
- <AlmBindingDefinitionFormField
- help={
- <>
- {translate('settings.almintegration.form.url.gitlab.help')}
- <br />
- <em>https://gitlab.com/api/v4</em>
- </>
- }
- id="url.gitlab"
- maxLength={2000}
- onFieldChange={onFieldChange}
- propKey="url"
- value={formData.url || ''}
- />
- <AlmBindingDefinitionFormField
- help={translate('settings.almintegration.form.personal_access_token.gitlab.help')}
- id="personal_access_token"
- isTextArea={true}
- onFieldChange={onFieldChange}
- overwriteOnly={Boolean(formData.key)}
- propKey="personalAccessToken"
- value={formData.personalAccessToken}
- />
- </div>
- <Alert className="huge-spacer-left flex-1" variant="info">
- <FormattedMessage
- defaultMessage={translate(`settings.almintegration.gitlab.info`)}
- id="settings.almintegration.gitlab.info"
- values={{
- link: (
- <Link target="_blank" to={ALM_DOCUMENTATION_PATHS[AlmKeys.GitLab]}>
- {translate('learn_more')}
- </Link>
- )
- }}
- />
- </Alert>
- </div>
+ <>
+ <AlmBindingDefinitionFormField
+ autoFocus={true}
+ help={translate('settings.almintegration.form.name.gitlab.help')}
+ id="name.gitlab"
+ onFieldChange={onFieldChange}
+ propKey="key"
+ value={formData.key}
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <>
+ {translate('settings.almintegration.form.url.gitlab.help')}
+ <br />
+ <em>https://gitlab.com/api/v4</em>
+ </>
+ }
+ id="url.gitlab"
+ maxLength={2000}
+ onFieldChange={onFieldChange}
+ propKey="url"
+ value={formData.url || ''}
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <FormattedMessage
+ defaultMessage={translate(
+ `settings.almintegration.form.personal_access_token.gitlab.help`
+ )}
+ id="settings.almintegration.form.personal_access_token.gitlab.help"
+ values={{
+ pat: (
+ <a
+ href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html"
+ rel="noopener noreferrer"
+ target="_blank">
+ {translate('settings.almintegration.form.personal_access_token.gitlab.help.url')}
+ </a>
+ ),
+ permission: <strong>Reporter</strong>,
+ scope: <strong>api</strong>,
+ doc_link: (
+ <Link target="_blank" to={ALM_DOCUMENTATION_PATHS[AlmKeys.GitLab]}>
+ {translate('learn_more')}
+ </Link>
+ )
+ }}
+ />
+ }
+ id="personal_access_token"
+ isTextArea={true}
+ onFieldChange={onFieldChange}
+ overwriteOnly={Boolean(formData.key)}
+ propKey="personalAccessToken"
+ value={formData.personalAccessToken}
+ />
+ </>
);
}
exports[`should render correctly: default 1`] = `
<div
- className="modal-field"
+ className="settings-definition"
>
- <label
- className="display-flex-center"
- htmlFor="key"
+ <div
+ className="settings-definition-left"
>
- settings.almintegration.form.key
+ <label
+ className="h3"
+ htmlFor="key"
+ >
+ settings.almintegration.form.key
+ </label>
<MandatoryFieldMarker />
- </label>
- <input
- className="input-super-large"
- id="key"
- maxLength={40}
- name="key"
- onChange={[Function]}
- size={50}
- type="text"
- value="key"
- />
+ </div>
+ <div
+ className="settings-definition-right big-padded-top"
+ >
+ <input
+ className="settings-large-input"
+ id="key"
+ maxLength={40}
+ name="key"
+ onChange={[Function]}
+ size={50}
+ type="text"
+ value="key"
+ />
+ </div>
</div>
`;
exports[`should render correctly: optional 1`] = `
<div
- className="modal-field"
+ className="settings-definition"
>
- <label
- className="display-flex-center"
- htmlFor="key"
+ <div
+ className="settings-definition-left"
+ >
+ <label
+ className="h3"
+ htmlFor="key"
+ >
+ settings.almintegration.form.key
+ </label>
+ </div>
+ <div
+ className="settings-definition-right big-padded-top"
>
- settings.almintegration.form.key
- </label>
- <input
- className="input-super-large"
- id="key"
- maxLength={40}
- name="key"
- onChange={[Function]}
- size={50}
- type="text"
- value="key"
- />
+ <input
+ className="settings-large-input"
+ id="key"
+ maxLength={40}
+ name="key"
+ onChange={[Function]}
+ size={50}
+ type="text"
+ value="key"
+ />
+ </div>
</div>
`;
exports[`should render correctly: secret 1`] = `
<div
- className="modal-field"
+ className="settings-definition"
>
- <label
- className="display-flex-center"
- htmlFor="key"
+ <div
+ className="settings-definition-left"
>
- settings.almintegration.form.key
- <MandatoryFieldMarker />
- </label>
- <div>
- <p>
- settings.almintegration.form.secret_field
- </p>
- <ButtonLink
- onClick={[Function]}
+ <label
+ className="h3"
+ htmlFor="key"
>
- settings.almintegration.form.update_secret_field
- </ButtonLink>
+ settings.almintegration.form.key
+ </label>
+ <MandatoryFieldMarker />
+ </div>
+ <div
+ className="settings-definition-right big-padded-top"
+ >
+ <div>
+ <p>
+ settings.almintegration.form.secret_field
+ </p>
+ <ButtonLink
+ onClick={[Function]}
+ >
+ settings.almintegration.form.update_secret_field
+ </ButtonLink>
+ </div>
</div>
</div>
`;
exports[`should render correctly: textarea 1`] = `
<div
- className="modal-field"
+ className="settings-definition"
>
- <label
- className="display-flex-center"
- htmlFor="key"
+ <div
+ className="settings-definition-left"
>
- settings.almintegration.form.key
+ <label
+ className="h3"
+ htmlFor="key"
+ >
+ settings.almintegration.form.key
+ </label>
<MandatoryFieldMarker />
- </label>
- <textarea
- className="settings-large-input"
- id="key"
- maxLength={40}
- onChange={[Function]}
- required={true}
- rows={5}
- value="key"
- />
+ </div>
+ <div
+ className="settings-definition-right big-padded-top"
+ >
+ <textarea
+ className="settings-large-input"
+ id="key"
+ maxLength={40}
+ onChange={[Function]}
+ required={true}
+ rows={5}
+ value="key"
+ />
+ </div>
</div>
`;
exports[`should render correctly: with help 1`] = `
<div
- className="modal-field"
+ className="settings-definition"
>
- <label
- className="display-flex-center"
- htmlFor="key"
+ <div
+ className="settings-definition-left"
>
- settings.almintegration.form.key
+ <label
+ className="h3"
+ htmlFor="key"
+ >
+ settings.almintegration.form.key
+ </label>
<MandatoryFieldMarker />
- <HelpTooltip
- className="spacer-left"
- overlay="help"
- placement="right"
+ <div
+ className="markdown small spacer-top"
+ >
+ help
+ </div>
+ </div>
+ <div
+ className="settings-definition-right big-padded-top"
+ >
+ <input
+ className="settings-large-input"
+ id="key"
+ maxLength={40}
+ name="key"
+ onChange={[Function]}
+ size={50}
+ type="text"
+ value="key"
/>
- </label>
- <input
- className="input-super-large"
- id="key"
- maxLength={40}
- name="key"
- onChange={[Function]}
- size={50}
- type="text"
- value="key"
- />
+ </div>
</div>
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render correctly: create 1`] = `
-<div
- className="display-flex-start"
->
- <div
- className="flex-1"
- >
- <AlmBindingDefinitionFormField
- autoFocus={true}
- help="settings.almintegration.form.name.azure.help"
- id="name.azure"
- onFieldChange={[MockFunction]}
- propKey="key"
- value=""
- />
- <AlmBindingDefinitionFormField
- help={
- <React.Fragment>
- settings.almintegration.form.url.azure.help1
- <br />
- <em>
- https://ado.your-company.com/your_collection
- </em>
- <br />
- <br />
- settings.almintegration.form.url.azure.help2
- <br />
- <em>
- https://dev.azure.com/your_organization
- </em>
- </React.Fragment>
- }
- id="url.azure"
- maxLength={2000}
- onFieldChange={[MockFunction]}
- propKey="url"
- value=""
- />
- <AlmBindingDefinitionFormField
- help="settings.almintegration.form.personal_access_token.azure.help"
- id="personal_access_token"
- isTextArea={true}
- onFieldChange={[MockFunction]}
- overwriteOnly={false}
- propKey="personalAccessToken"
- value=""
- />
- </div>
- <Alert
- className="huge-spacer-left flex-1"
- variant="info"
- >
- <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>,
+<Fragment>
+ <AlmBindingDefinitionFormField
+ autoFocus={true}
+ help="settings.almintegration.form.name.azure.help"
+ id="name.azure"
+ onFieldChange={[MockFunction]}
+ propKey="key"
+ value=""
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <React.Fragment>
+ settings.almintegration.form.url.azure.help1
+ <br />
+ <em>
+ https://ado.your-company.com/your_collection
+ </em>
+ <br />
+ <br />
+ settings.almintegration.form.url.azure.help2
+ <br />
+ <em>
+ https://dev.azure.com/your_organization
+ </em>
+ </React.Fragment>
+ }
+ id="url.azure"
+ maxLength={2000}
+ onFieldChange={[MockFunction]}
+ propKey="url"
+ value=""
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <FormattedMessage
+ defaultMessage="settings.almintegration.form.personal_access_token.azure.help"
+ id="settings.almintegration.form.personal_access_token.azure.help"
+ values={
+ Object {
+ "doc_link": <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ target="_blank"
+ to="/documentation/analysis/azuredevops-integration/"
+ >
+ learn_more
+ </Link>,
+ "pat": <a
+ href="https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ settings.almintegration.form.personal_access_token.azure.help.url
+ </a>,
+ "permission": <strong>
+ Code > Read & Write
+ </strong>,
+ }
}
- }
- />
- </Alert>
-</div>
+ />
+ }
+ id="personal_access_token"
+ isTextArea={true}
+ onFieldChange={[MockFunction]}
+ overwriteOnly={false}
+ propKey="personalAccessToken"
+ value=""
+ />
+</Fragment>
`;
exports[`should render correctly: edit 1`] = `
-<div
- className="display-flex-start"
->
- <div
- className="flex-1"
- >
- <AlmBindingDefinitionFormField
- autoFocus={true}
- help="settings.almintegration.form.name.azure.help"
- id="name.azure"
- onFieldChange={[MockFunction]}
- propKey="key"
- value="key"
- />
- <AlmBindingDefinitionFormField
- help={
- <React.Fragment>
- settings.almintegration.form.url.azure.help1
- <br />
- <em>
- https://ado.your-company.com/your_collection
- </em>
- <br />
- <br />
- settings.almintegration.form.url.azure.help2
- <br />
- <em>
- https://dev.azure.com/your_organization
- </em>
- </React.Fragment>
- }
- id="url.azure"
- maxLength={2000}
- onFieldChange={[MockFunction]}
- propKey="url"
- value=""
- />
- <AlmBindingDefinitionFormField
- help="settings.almintegration.form.personal_access_token.azure.help"
- id="personal_access_token"
- isTextArea={true}
- onFieldChange={[MockFunction]}
- overwriteOnly={true}
- propKey="personalAccessToken"
- value="asdf1234"
- />
- </div>
- <Alert
- className="huge-spacer-left flex-1"
- variant="info"
- >
- <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>,
+<Fragment>
+ <AlmBindingDefinitionFormField
+ autoFocus={true}
+ help="settings.almintegration.form.name.azure.help"
+ id="name.azure"
+ onFieldChange={[MockFunction]}
+ propKey="key"
+ value="key"
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <React.Fragment>
+ settings.almintegration.form.url.azure.help1
+ <br />
+ <em>
+ https://ado.your-company.com/your_collection
+ </em>
+ <br />
+ <br />
+ settings.almintegration.form.url.azure.help2
+ <br />
+ <em>
+ https://dev.azure.com/your_organization
+ </em>
+ </React.Fragment>
+ }
+ id="url.azure"
+ maxLength={2000}
+ onFieldChange={[MockFunction]}
+ propKey="url"
+ value=""
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <FormattedMessage
+ defaultMessage="settings.almintegration.form.personal_access_token.azure.help"
+ id="settings.almintegration.form.personal_access_token.azure.help"
+ values={
+ Object {
+ "doc_link": <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ target="_blank"
+ to="/documentation/analysis/azuredevops-integration/"
+ >
+ learn_more
+ </Link>,
+ "pat": <a
+ href="https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ settings.almintegration.form.personal_access_token.azure.help.url
+ </a>,
+ "permission": <strong>
+ Code > Read & Write
+ </strong>,
+ }
}
- }
- />
- </Alert>
-</div>
+ />
+ }
+ id="personal_access_token"
+ isTextArea={true}
+ onFieldChange={[MockFunction]}
+ overwriteOnly={true}
+ propKey="personalAccessToken"
+ value="asdf1234"
+ />
+</Fragment>
`;
propKey="workspace"
value="workspace"
/>
+ <Alert
+ className="big-spacer-top big-spacer-right"
+ variant="info"
+ >
+ <FormattedMessage
+ defaultMessage="settings.almintegration.bitbucketcloud.info"
+ id="settings.almintegration.bitbucketcloud.info"
+ values={
+ Object {
+ "doc_link": <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ target="_blank"
+ to="/documentation/analysis/bitbucket-cloud-integration/"
+ >
+ learn_more
+ </Link>,
+ "oauth": <a
+ href="https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ settings.almintegration.bitbucketcloud.oauth
+ </a>,
+ "permission": <strong>
+ Pull Requests: Read
+ </strong>,
+ }
+ }
+ />
+ </Alert>
<AlmBindingDefinitionFormField
help="settings.almintegration.form.oauth_key.bitbucketcloud.help"
id="client_id.bitbucketcloud"
value="bitbucketcloud"
/>
</div>
- <div
- className="display-flex-start"
- >
- <div
- className="flex-1"
- >
- <BitbucketCloudForm
- formData={
- Object {
- "clientId": "client1",
- "clientSecret": "**clientsecret**",
- "key": "key",
- "workspace": "workspace",
- }
- }
- onFieldChange={[MockFunction]}
- />
- </div>
- <Alert
- className="huge-spacer-left flex-1"
- variant="info"
- >
- <FormattedMessage
- defaultMessage="settings.almintegration.bitbucketcloud.info"
- id="settings.almintegration.bitbucketcloud.info"
- values={
- Object {
- "link": <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/bitbucket-cloud-integration/"
- >
- learn_more
- </Link>,
- }
- }
- />
- </Alert>
- </div>
+ <BitbucketCloudForm
+ formData={
+ Object {
+ "clientId": "client1",
+ "clientSecret": "**clientsecret**",
+ "key": "key",
+ "workspace": "workspace",
+ }
+ }
+ onFieldChange={[MockFunction]}
+ />
</Fragment>
`;
value="bitbucket"
/>
</div>
- <div
- className="display-flex-start"
- >
- <div
- className="flex-1"
- >
- <BitbucketServerForm
- formData={
- Object {
- "key": "key",
- "personalAccessToken": "asdf1234",
- "url": "http://bbs.enterprise.com",
- }
- }
- onFieldChange={[MockFunction]}
- />
- </div>
- <Alert
- className="huge-spacer-left flex-1"
- variant="info"
- >
- <h3>
- onboarding.create_project.pat_help.title
- </h3>
- <p
- className="big-spacer-top"
- >
- settings.almintegration.bitbucket.help_1
- </p>
- <ul
- className="big-spacer-top list-styled"
- >
- <li>
- settings.almintegration.bitbucket.help_2
- </li>
- <li>
- settings.almintegration.bitbucket.help_3
- </li>
- </ul>
- <p
- className="big-spacer-top big-spacer-bottom"
- >
- <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/bitbucket-integration/"
- >
- learn_more
- </Link>
- </p>
- </Alert>
- </div>
+ <BitbucketServerForm
+ formData={
+ Object {
+ "key": "key",
+ "personalAccessToken": "asdf1234",
+ "url": "http://bbs.enterprise.com",
+ }
+ }
+ onFieldChange={[MockFunction]}
+ />
</Fragment>
`;
exports[`should render correctly: update bbc 1`] = `
<Fragment>
- <div
- className="display-flex-start"
- >
- <div
- className="flex-1"
- >
- <BitbucketCloudForm
- formData={
- Object {
- "clientId": "client1",
- "clientSecret": "**clientsecret**",
- "key": "key",
- "workspace": "workspace",
- }
- }
- onFieldChange={[MockFunction]}
- />
- </div>
- <Alert
- className="huge-spacer-left flex-1"
- variant="info"
- >
- <FormattedMessage
- defaultMessage="settings.almintegration.bitbucketcloud.info"
- id="settings.almintegration.bitbucketcloud.info"
- values={
- Object {
- "link": <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/bitbucket-cloud-integration/"
- >
- learn_more
- </Link>,
- }
- }
- />
- </Alert>
- </div>
+ <BitbucketCloudForm
+ formData={
+ Object {
+ "clientId": "client1",
+ "clientSecret": "**clientsecret**",
+ "key": "key",
+ "workspace": "workspace",
+ }
+ }
+ onFieldChange={[MockFunction]}
+ />
</Fragment>
`;
exports[`should render correctly: update bbs 1`] = `
<Fragment>
- <div
- className="display-flex-start"
- >
- <div
- className="flex-1"
- >
- <BitbucketServerForm
- formData={
- Object {
- "key": "key",
- "personalAccessToken": "asdf1234",
- "url": "http://bbs.enterprise.com",
- }
- }
- onFieldChange={[MockFunction]}
- />
- </div>
- <Alert
- className="huge-spacer-left flex-1"
- variant="info"
- >
- <h3>
- onboarding.create_project.pat_help.title
- </h3>
- <p
- className="big-spacer-top"
- >
- settings.almintegration.bitbucket.help_1
- </p>
- <ul
- className="big-spacer-top list-styled"
- >
- <li>
- settings.almintegration.bitbucket.help_2
- </li>
- <li>
- settings.almintegration.bitbucket.help_3
- </li>
- </ul>
- <p
- className="big-spacer-top big-spacer-bottom"
- >
- <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/bitbucket-integration/"
- >
- learn_more
- </Link>
- </p>
- </Alert>
- </div>
+ <BitbucketServerForm
+ formData={
+ Object {
+ "key": "key",
+ "personalAccessToken": "asdf1234",
+ "url": "http://bbs.enterprise.com",
+ }
+ }
+ onFieldChange={[MockFunction]}
+ />
</Fragment>
`;
exports[`should render correctly 1`] = `
<Fragment>
-
<AlmBindingDefinitionFormField
autoFocus={true}
help="settings.almintegration.form.name.bitbucket.help"
id="settings.almintegration.form.personal_access_token.bitbucket.help"
values={
Object {
+ "doc_link": <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ target="_blank"
+ to="/documentation/analysis/bitbucket-integration/"
+ >
+ learn_more
+ </Link>,
"pat": <a
href="https://confluence.atlassian.com/bitbucketserver0515/personal-access-tokens-961275199.html"
rel="noopener noreferrer"
>
settings.almintegration.form.personal_access_token.bitbucket.help.url
</a>,
+ "permission": <strong>
+ Read
+ </strong>,
}
}
/>
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render correctly 1`] = `
-<div
- className="display-flex-start"
->
- <div
- className="flex-1"
- >
- <AlmBindingDefinitionFormField
- autoFocus={true}
- help="settings.almintegration.form.name.github.help"
- id="name.github"
- onFieldChange={[MockFunction]}
- propKey="key"
- value=""
- />
- <AlmBindingDefinitionFormField
- help={
- <React.Fragment>
- settings.almintegration.form.url.github.help1
- <br />
- <em>
- https://github.company.com/api/v3
- </em>
- <br />
- <br />
- settings.almintegration.form.url.github.help2
- <br />
- <em>
- https://api.github.com/
- </em>
- </React.Fragment>
- }
- id="url.github"
- maxLength={2000}
- onFieldChange={[MockFunction]}
- propKey="url"
- value=""
- />
- <AlmBindingDefinitionFormField
- help="settings.almintegration.form.app_id.github.help"
- id="app_id"
- maxLength={80}
- onFieldChange={[MockFunction]}
- propKey="appId"
- value=""
- />
- <AlmBindingDefinitionFormField
- help="settings.almintegration.form.client_id.github.help"
- id="client_id.github"
- maxLength={80}
- onFieldChange={[MockFunction]}
- propKey="clientId"
- value=""
- />
- <AlmBindingDefinitionFormField
- help="settings.almintegration.form.client_secret.github.help"
- id="client_secret.github"
- maxLength={80}
- onFieldChange={[MockFunction]}
- overwriteOnly={false}
- propKey="clientSecret"
- value=""
- />
- <AlmBindingDefinitionFormField
- help="settings.almintegration.form.private_key.github.help"
- id="private_key"
- isTextArea={true}
- onFieldChange={[MockFunction]}
- overwriteOnly={false}
- propKey="privateKey"
- value=""
- />
- </div>
+<Fragment>
+ <AlmBindingDefinitionFormField
+ autoFocus={true}
+ help="settings.almintegration.form.name.github.help"
+ id="name.github"
+ onFieldChange={[MockFunction]}
+ propKey="key"
+ value=""
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <React.Fragment>
+ settings.almintegration.form.url.github.help1
+ <br />
+ <em>
+ https://github.company.com/api/v3
+ </em>
+ <br />
+ <br />
+ settings.almintegration.form.url.github.help2
+ <br />
+ <em>
+ https://api.github.com/
+ </em>
+ </React.Fragment>
+ }
+ id="url.github"
+ maxLength={2000}
+ onFieldChange={[MockFunction]}
+ propKey="url"
+ value=""
+ />
<Alert
- className="huge-spacer-left flex-1"
+ className="big-spacer-top big-spacer-right"
variant="info"
>
<FormattedMessage
}
/>
</Alert>
-</div>
+ <AlmBindingDefinitionFormField
+ help="settings.almintegration.form.app_id.github.help"
+ id="app_id"
+ maxLength={80}
+ onFieldChange={[MockFunction]}
+ propKey="appId"
+ value=""
+ />
+ <AlmBindingDefinitionFormField
+ help="settings.almintegration.form.client_id.github.help"
+ id="client_id.github"
+ maxLength={80}
+ onFieldChange={[MockFunction]}
+ propKey="clientId"
+ value=""
+ />
+ <AlmBindingDefinitionFormField
+ help="settings.almintegration.form.client_secret.github.help"
+ id="client_secret.github"
+ maxLength={80}
+ onFieldChange={[MockFunction]}
+ overwriteOnly={false}
+ propKey="clientSecret"
+ value=""
+ />
+ <AlmBindingDefinitionFormField
+ help="settings.almintegration.form.private_key.github.help"
+ id="private_key"
+ isTextArea={true}
+ onFieldChange={[MockFunction]}
+ overwriteOnly={false}
+ propKey="privateKey"
+ value=""
+ />
+</Fragment>
`;
exports[`should render correctly 2`] = `
-<div
- className="display-flex-start"
->
- <div
- className="flex-1"
- >
- <AlmBindingDefinitionFormField
- autoFocus={true}
- help="settings.almintegration.form.name.github.help"
- id="name.github"
- onFieldChange={[MockFunction]}
- propKey="key"
- value="key"
- />
- <AlmBindingDefinitionFormField
- help={
- <React.Fragment>
- settings.almintegration.form.url.github.help1
- <br />
- <em>
- https://github.company.com/api/v3
- </em>
- <br />
- <br />
- settings.almintegration.form.url.github.help2
- <br />
- <em>
- https://api.github.com/
- </em>
- </React.Fragment>
- }
- id="url.github"
- maxLength={2000}
- onFieldChange={[MockFunction]}
- propKey="url"
- value="http://github.enterprise.com"
- />
- <AlmBindingDefinitionFormField
- help="settings.almintegration.form.app_id.github.help"
- id="app_id"
- maxLength={80}
- onFieldChange={[MockFunction]}
- propKey="appId"
- value="123456"
- />
- <AlmBindingDefinitionFormField
- help="settings.almintegration.form.client_id.github.help"
- id="client_id.github"
- maxLength={80}
- onFieldChange={[MockFunction]}
- propKey="clientId"
- value="client1"
- />
- <AlmBindingDefinitionFormField
- help="settings.almintegration.form.client_secret.github.help"
- id="client_secret.github"
- maxLength={80}
- onFieldChange={[MockFunction]}
- overwriteOnly={true}
- propKey="clientSecret"
- value="**clientsecret**"
- />
- <AlmBindingDefinitionFormField
- help="settings.almintegration.form.private_key.github.help"
- id="private_key"
- isTextArea={true}
- onFieldChange={[MockFunction]}
- overwriteOnly={true}
- propKey="privateKey"
- value="asdf1234"
- />
- </div>
+<Fragment>
+ <AlmBindingDefinitionFormField
+ autoFocus={true}
+ help="settings.almintegration.form.name.github.help"
+ id="name.github"
+ onFieldChange={[MockFunction]}
+ propKey="key"
+ value="key"
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <React.Fragment>
+ settings.almintegration.form.url.github.help1
+ <br />
+ <em>
+ https://github.company.com/api/v3
+ </em>
+ <br />
+ <br />
+ settings.almintegration.form.url.github.help2
+ <br />
+ <em>
+ https://api.github.com/
+ </em>
+ </React.Fragment>
+ }
+ id="url.github"
+ maxLength={2000}
+ onFieldChange={[MockFunction]}
+ propKey="url"
+ value="http://github.enterprise.com"
+ />
<Alert
- className="huge-spacer-left flex-1"
+ className="big-spacer-top big-spacer-right"
variant="info"
>
<FormattedMessage
}
/>
</Alert>
-</div>
+ <AlmBindingDefinitionFormField
+ help="settings.almintegration.form.app_id.github.help"
+ id="app_id"
+ maxLength={80}
+ onFieldChange={[MockFunction]}
+ propKey="appId"
+ value="123456"
+ />
+ <AlmBindingDefinitionFormField
+ help="settings.almintegration.form.client_id.github.help"
+ id="client_id.github"
+ maxLength={80}
+ onFieldChange={[MockFunction]}
+ propKey="clientId"
+ value="client1"
+ />
+ <AlmBindingDefinitionFormField
+ help="settings.almintegration.form.client_secret.github.help"
+ id="client_secret.github"
+ maxLength={80}
+ onFieldChange={[MockFunction]}
+ overwriteOnly={true}
+ propKey="clientSecret"
+ value="**clientsecret**"
+ />
+ <AlmBindingDefinitionFormField
+ help="settings.almintegration.form.private_key.github.help"
+ id="private_key"
+ isTextArea={true}
+ onFieldChange={[MockFunction]}
+ overwriteOnly={true}
+ propKey="privateKey"
+ value="asdf1234"
+ />
+</Fragment>
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render correctly 1`] = `
-<div
- className="display-flex-start"
->
- <div
- className="flex-1"
- >
- <AlmBindingDefinitionFormField
- autoFocus={true}
- help="settings.almintegration.form.name.gitlab.help"
- id="name.gitlab"
- onFieldChange={[MockFunction]}
- propKey="key"
- value=""
- />
- <AlmBindingDefinitionFormField
- help={
- <React.Fragment>
- settings.almintegration.form.url.gitlab.help
- <br />
- <em>
- https://gitlab.com/api/v4
- </em>
- </React.Fragment>
- }
- id="url.gitlab"
- maxLength={2000}
- onFieldChange={[MockFunction]}
- propKey="url"
- value=""
- />
- <AlmBindingDefinitionFormField
- help="settings.almintegration.form.personal_access_token.gitlab.help"
- id="personal_access_token"
- isTextArea={true}
- onFieldChange={[MockFunction]}
- overwriteOnly={false}
- propKey="personalAccessToken"
- value=""
- />
- </div>
- <Alert
- className="huge-spacer-left flex-1"
- variant="info"
- >
- <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>,
+<Fragment>
+ <AlmBindingDefinitionFormField
+ autoFocus={true}
+ help="settings.almintegration.form.name.gitlab.help"
+ id="name.gitlab"
+ onFieldChange={[MockFunction]}
+ propKey="key"
+ value=""
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <React.Fragment>
+ settings.almintegration.form.url.gitlab.help
+ <br />
+ <em>
+ https://gitlab.com/api/v4
+ </em>
+ </React.Fragment>
+ }
+ id="url.gitlab"
+ maxLength={2000}
+ onFieldChange={[MockFunction]}
+ propKey="url"
+ value=""
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <FormattedMessage
+ defaultMessage="settings.almintegration.form.personal_access_token.gitlab.help"
+ id="settings.almintegration.form.personal_access_token.gitlab.help"
+ values={
+ Object {
+ "doc_link": <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ target="_blank"
+ to="/documentation/analysis/gitlab-integration/"
+ >
+ learn_more
+ </Link>,
+ "pat": <a
+ href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ settings.almintegration.form.personal_access_token.gitlab.help.url
+ </a>,
+ "permission": <strong>
+ Reporter
+ </strong>,
+ "scope": <strong>
+ api
+ </strong>,
+ }
}
- }
- />
- </Alert>
-</div>
+ />
+ }
+ id="personal_access_token"
+ isTextArea={true}
+ onFieldChange={[MockFunction]}
+ overwriteOnly={false}
+ propKey="personalAccessToken"
+ value=""
+ />
+</Fragment>
`;
exports[`should render correctly 2`] = `
-<div
- className="display-flex-start"
->
- <div
- className="flex-1"
- >
- <AlmBindingDefinitionFormField
- autoFocus={true}
- help="settings.almintegration.form.name.gitlab.help"
- id="name.gitlab"
- onFieldChange={[MockFunction]}
- propKey="key"
- value="foo"
- />
- <AlmBindingDefinitionFormField
- help={
- <React.Fragment>
- settings.almintegration.form.url.gitlab.help
- <br />
- <em>
- https://gitlab.com/api/v4
- </em>
- </React.Fragment>
- }
- id="url.gitlab"
- maxLength={2000}
- onFieldChange={[MockFunction]}
- propKey="url"
- value=""
- />
- <AlmBindingDefinitionFormField
- help="settings.almintegration.form.personal_access_token.gitlab.help"
- id="personal_access_token"
- isTextArea={true}
- onFieldChange={[MockFunction]}
- overwriteOnly={true}
- propKey="personalAccessToken"
- value="foobar"
- />
- </div>
- <Alert
- className="huge-spacer-left flex-1"
- variant="info"
- >
- <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>,
+<Fragment>
+ <AlmBindingDefinitionFormField
+ autoFocus={true}
+ help="settings.almintegration.form.name.gitlab.help"
+ id="name.gitlab"
+ onFieldChange={[MockFunction]}
+ propKey="key"
+ value="foo"
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <React.Fragment>
+ settings.almintegration.form.url.gitlab.help
+ <br />
+ <em>
+ https://gitlab.com/api/v4
+ </em>
+ </React.Fragment>
+ }
+ id="url.gitlab"
+ maxLength={2000}
+ onFieldChange={[MockFunction]}
+ propKey="url"
+ value=""
+ />
+ <AlmBindingDefinitionFormField
+ help={
+ <FormattedMessage
+ defaultMessage="settings.almintegration.form.personal_access_token.gitlab.help"
+ id="settings.almintegration.form.personal_access_token.gitlab.help"
+ values={
+ Object {
+ "doc_link": <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ target="_blank"
+ to="/documentation/analysis/gitlab-integration/"
+ >
+ learn_more
+ </Link>,
+ "pat": <a
+ href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ settings.almintegration.form.personal_access_token.gitlab.help.url
+ </a>,
+ "permission": <strong>
+ Reporter
+ </strong>,
+ "scope": <strong>
+ api
+ </strong>,
+ }
}
- }
- />
- </Alert>
-</div>
+ />
+ }
+ id="personal_access_token"
+ isTextArea={true}
+ onFieldChange={[MockFunction]}
+ overwriteOnly={true}
+ propKey="personalAccessToken"
+ value="foobar"
+ />
+</Fragment>
`;
settings.almintegration.title=Integration configurations
settings.almintegration.description=ALM integrations allow SonarQube to interact with your ALM. This enables things like authentication, or providing analysis details and a Quality Gate to your Pull Requests directly in your ALM provider's interface.
-settings.almintegration.azure.info=Accounts that will be used to decorate Pull Requests need Code: Read & Write permission. {link}
settings.almintegration.github.info=You need to install a GitHub App with specific settings and permissions to enable Pull Request Decoration on your Organization or Repository. {link}
settings.almintegration.github.additional_permission=If Quality Gate status reporting fails on private projects, you might need to add an additional permission to the GitHub App. {link}
-settings.almintegration.gitlab.info=Accounts that will be used to decorate Merge Requests need comment permissions on projects. The personal key needs the API scope permission. {link}
-settings.almintegration.bitbucket.help_1=SonarQube needs a Personal Access Token to communicate with Bitbucket Server. This token will be used to decorate Pull Requests.
-settings.almintegration.bitbucket.help_2=The account used for integration needs Read permission.
-settings.almintegration.bitbucket.help_3=We recommend to integrate with SonarQube using a Bitbucket Server Service Account.
-settings.almintegration.bitbucketcloud.info=You need to create an OAuth consumer in your Bitbucket Cloud workspace settings to decorate your Pull Requests. It needs to be a private consumer with Pull requests: Read permission. Bitbucket requires an OAuth callback URL, but it's not used by SonarQube so any URL works. {link}
+settings.almintegration.bitbucketcloud.info=SonarQube needs you to create an {oauth} in your Bitbucket Cloud workspace settings to report the Quality Gate status on Pull Requests. It needs to be a private consumer with {permission} permission. An OAuth callback URL is required by Bitbucket Cloud but not used by SonarQube so any URL works. {doc_link}
+settings.almintegration.bitbucketcloud.oauth=OAuth consumer
settings.almintegration.empty.azure=Create your first Azure DevOps configuration to start analyzing your repositories on SonarQube.
settings.almintegration.empty.bitbucket=Create your first Bitbucket configuration to start analyzing your repositories on SonarQube.
settings.almintegration.empty.bitbucketcloud=Create your first Bitbucket Cloud configuration to start analyzing your repositories on SonarQube.
settings.almintegration.form.private_key=Private Key
settings.almintegration.form.private_key.github.help=Your GitHub App's private key. You can generate a .pem file from your GitHub App's page under Private keys. Copy and paste the whole contents of the file here.
settings.almintegration.form.personal_access_token=Personal Access token
-settings.almintegration.form.personal_access_token.azure.help=Token of the user that will be used to decorate the Pull Requests. Needs authorized scope: "Code (read and write)".
-settings.almintegration.form.personal_access_token.gitlab.help=Token of the user that will be used to decorate the Merge Requests. Needs API scope authorization.
-settings.almintegration.form.personal_access_token.bitbucket.help=A Bitbucket Server user account is used to decorate Pull Requests. We recommend using a dedicated Bitbucket Server account with Administrator permissions. You need a {pat} from this account with Read permission for the repositories that will be analyzed. This personal access token is used to report the Quality Gate status on your pull requests.
+settings.almintegration.form.personal_access_token.azure.help=SonarQube needs a {pat} to report the Quality Gate status on Pull Requests in Azure DevOps. To create this token, we recommend using a dedicated Azure DevOps account with administration permissions. The token itself needs {permission} permission. {doc_link}
+settings.almintegration.form.personal_access_token.azure.help.url=Personal Access Token
+settings.almintegration.form.personal_access_token.gitlab.help=SonarQube needs a {pat} to report the Quality Gate status on Merge Requests in GitLab. To create this token, we recommend using a dedicated GitLab account with {permission} permission to all target projects. The token itself needs the {scope} scope. {doc_link}
+settings.almintegration.form.personal_access_token.gitlab.help.url=Personal Access Token
+settings.almintegration.form.personal_access_token.bitbucket.help=SonarQube needs a {pat} to report the Quality Gate status on Pull Requests in Bitbucket Server. To create this token, we recommend using a dedicated Bitbucket Server account with administration permissions. The token itself needs {permission} permission. {doc_link}
settings.almintegration.form.personal_access_token.bitbucket.help.url=Personal Access Token
settings.almintegration.form.save=Save configuration
settings.almintegration.form.cancel=Cancel