--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2020 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
+import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { AlmKeys, ProjectAlmBindingResponse } from '../../../../types/alm-settings';
+import InputForBoolean from '../inputs/InputForBoolean';
+
+export interface AlmSpecificFormProps {
+ alm: AlmKeys;
+ formData: T.Omit<ProjectAlmBindingResponse, 'alm'>;
+ onFieldChange: (id: keyof ProjectAlmBindingResponse, value: string | boolean) => void;
+}
+
+interface LabelProps {
+ help?: boolean;
+ helpParams?: T.Dict<string | JSX.Element>;
+ id: string;
+ optional?: boolean;
+}
+
+interface CommonFieldProps extends LabelProps {
+ onFieldChange: (id: keyof ProjectAlmBindingResponse, value: string | boolean) => void;
+ propKey: keyof ProjectAlmBindingResponse;
+}
+
+function renderLabel(props: LabelProps) {
+ const { help, helpParams, optional, id } = props;
+ return (
+ <label className="display-flex-center" htmlFor={id}>
+ {translate('settings.pr_decoration.binding.form', id)}
+ {!optional && <em className="mandatory">*</em>}
+ {help && (
+ <HelpTooltip
+ className="spacer-left"
+ overlay={
+ <FormattedMessage
+ defaultMessage={translate('settings.pr_decoration.binding.form', id, 'help')}
+ id={`settings.pr_decoration.binding.form.${id}.help`}
+ values={helpParams}
+ />
+ }
+ placement="right"
+ />
+ )}
+ </label>
+ );
+}
+
+function renderBooleanField(
+ props: Omit<CommonFieldProps, 'optional'> & {
+ value: boolean;
+ }
+) {
+ const { id, value, onFieldChange, propKey } = props;
+ return (
+ <div className="form-field">
+ {renderLabel({ ...props, optional: true })}
+ <InputForBoolean
+ isDefault={true}
+ name={id}
+ onChange={v => onFieldChange(propKey, v)}
+ value={value}
+ />
+ </div>
+ );
+}
+
+function renderField(
+ props: CommonFieldProps & {
+ value: string;
+ }
+) {
+ const { id, propKey, value, onFieldChange } = props;
+ return (
+ <div className="form-field">
+ {renderLabel(props)}
+ <input
+ className="input-super-large"
+ id={id}
+ maxLength={256}
+ name={id}
+ onChange={e => onFieldChange(propKey, e.currentTarget.value)}
+ type="text"
+ value={value}
+ />
+ </div>
+ );
+}
+
+export default function AlmSpecificForm(props: AlmSpecificFormProps) {
+ const {
+ alm,
+ formData: { repository, slug, summaryCommentEnabled }
+ } = props;
+
+ switch (alm) {
+ case AlmKeys.Azure:
+ return (
+ <>
+ {renderField({
+ help: true,
+ id: 'azure.project',
+ onFieldChange: props.onFieldChange,
+ propKey: 'slug',
+ value: slug || ''
+ })}
+ {renderField({
+ help: true,
+ id: 'azure.repository',
+ onFieldChange: props.onFieldChange,
+ propKey: 'repository',
+ value: repository || ''
+ })}
+ </>
+ );
+ case AlmKeys.Bitbucket:
+ return (
+ <>
+ {renderField({
+ help: true,
+ helpParams: {
+ example: (
+ <>
+ {'.../projects/'}
+ <strong>{'{KEY}'}</strong>
+ {'/repos/{SLUG}/browse'}
+ </>
+ )
+ },
+ id: 'bitbucket.repository',
+ onFieldChange: props.onFieldChange,
+ propKey: 'repository',
+ value: repository || ''
+ })}
+ {renderField({
+ help: true,
+ helpParams: {
+ example: (
+ <>
+ {'.../projects/{KEY}/repos/'}
+ <strong>{'{SLUG}'}</strong>
+ {'/browse'}
+ </>
+ )
+ },
+ id: 'bitbucket.slug',
+ onFieldChange: props.onFieldChange,
+ propKey: 'slug',
+ value: slug || ''
+ })}
+ </>
+ );
+ case AlmKeys.GitHub:
+ return (
+ <>
+ {renderField({
+ help: true,
+ helpParams: { example: 'SonarSource/sonarqube' },
+ id: 'github.repository',
+ onFieldChange: props.onFieldChange,
+ propKey: 'repository',
+ value: repository || ''
+ })}
+ {renderBooleanField({
+ help: true,
+ id: 'github.summary_comment_setting',
+ onFieldChange: props.onFieldChange,
+ propKey: 'summaryCommentEnabled',
+ value: summaryCommentEnabled === undefined ? true : summaryCommentEnabled
+ })}
+ </>
+ );
+ case AlmKeys.GitLab:
+ return renderField({
+ id: 'gitlab.repository',
+ onFieldChange: props.onFieldChange,
+ propKey: 'repository',
+ value: repository || ''
+ });
+ default:
+ return null;
+ }
+}
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { HttpStatus } from 'sonar-ui-common/helpers/request';
import {
deleteProjectAlmBinding,
getAlmSettings,
const REQUIRED_FIELDS_BY_ALM: {
[almKey in AlmKeys]: Array<keyof T.Omit<FormData, 'key'>>;
} = {
- [AlmKeys.Azure]: [],
+ [AlmKeys.Azure]: ['repository', 'slug'],
[AlmKeys.Bitbucket]: ['repository', 'slug'],
[AlmKeys.GitHub]: ['repository'],
[AlmKeys.GitLab]: ['repository']
getProjectBinding(project: string): Promise<ProjectAlmBindingResponse | undefined> {
return getProjectAlmBinding(project).catch((response: Response) => {
- if (response && response.status === 404) {
+ if (response && response.status === HttpStatus.NotFound) {
return undefined;
}
return throwGlobalError(response);
const project = this.props.component.key;
switch (alm) {
- case AlmKeys.Azure:
+ case AlmKeys.Azure: {
+ const projectName = almSpecificFields?.slug;
+ const repositoryName = almSpecificFields?.repository;
+ if (!projectName || !repositoryName) {
+ return Promise.reject();
+ }
return setProjectAzureBinding({
almSetting,
- project
+ project,
+ projectName,
+ repositoryName
});
+ }
case AlmKeys.Bitbucket: {
if (!almSpecificFields) {
return Promise.reject();
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
import { Button, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
-import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import Select from 'sonar-ui-common/components/controls/Select';
import AlertSuccessIcon from 'sonar-ui-common/components/icons/AlertSuccessIcon';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import {
- AlmKeys,
- AlmSettingsInstance,
- ProjectAlmBindingResponse
-} from '../../../../types/alm-settings';
-import InputForBoolean from '../inputs/InputForBoolean';
+import { AlmSettingsInstance, ProjectAlmBindingResponse } from '../../../../types/alm-settings';
+import AlmSpecificForm from './AlmSpecificForm';
export interface PRDecorationBindingRendererProps {
formData: T.Omit<ProjectAlmBindingResponse, 'alm'>;
success: boolean;
}
-interface LabelProps {
- help?: boolean;
- helpParams?: T.Dict<string | JSX.Element>;
- id: string;
- optional?: boolean;
-}
-
-interface CommonFieldProps extends LabelProps {
- onFieldChange: (id: keyof ProjectAlmBindingResponse, value: string | boolean) => void;
- propKey: keyof ProjectAlmBindingResponse;
-}
-
function optionRenderer(instance: AlmSettingsInstance) {
return instance.url ? (
<>
);
}
-function renderLabel(props: LabelProps) {
- const { help, helpParams, optional, id } = props;
- return (
- <label className="display-flex-center" htmlFor={id}>
- {translate('settings.pr_decoration.binding.form', id)}
- {!optional && <em className="mandatory">*</em>}
- {help && (
- <HelpTooltip
- className="spacer-left"
- overlay={
- <FormattedMessage
- defaultMessage={translate('settings.pr_decoration.binding.form', id, 'help')}
- id={`settings.pr_decoration.binding.form.${id}.help`}
- values={helpParams}
- />
- }
- placement="right"
- />
- )}
- </label>
- );
-}
-
-function renderBooleanField(
- props: Omit<CommonFieldProps, 'optional'> & {
- value: boolean;
- }
-) {
- const { id, value, onFieldChange, propKey } = props;
- return (
- <div className="form-field">
- {renderLabel({ ...props, optional: true })}
- <InputForBoolean
- isDefault={true}
- name={id}
- onChange={v => onFieldChange(propKey, v)}
- value={value}
- />
- </div>
- );
-}
-
-function renderField(
- props: CommonFieldProps & {
- value: string;
- }
-) {
- const { id, propKey, value, onFieldChange } = props;
- return (
- <div className="form-field">
- {renderLabel(props)}
- <input
- className="input-super-large"
- id={id}
- maxLength={256}
- name={id}
- onChange={e => onFieldChange(propKey, e.currentTarget.value)}
- type="text"
- value={value}
- />
- </div>
- );
-}
-
export default function PRDecorationBindingRenderer(props: PRDecorationBindingRendererProps) {
- const {
- formData: { key, repository, slug, summaryCommentEnabled },
- instances,
- isChanged,
- isConfigured,
- isValid,
- loading,
- saving,
- success
- } = props;
+ const { formData, instances, isChanged, isConfigured, isValid, loading, saving, success } = props;
if (loading) {
return <DeferredSpinner />;
);
}
- const selected = key && instances.find(i => i.key === key);
+ const selected = formData.key && instances.find(i => i.key === formData.key);
const alm = selected && selected.alm;
return (
optionRenderer={optionRenderer}
options={instances}
searchable={false}
- value={key}
+ value={formData.key}
valueKey="key"
valueRenderer={optionRenderer}
/>
</div>
- {alm === AlmKeys.Bitbucket && (
- <>
- {renderField({
- help: true,
- helpParams: {
- example: (
- <>
- {'.../projects/'}
- <strong>{'{KEY}'}</strong>
- {'/repos/{SLUG}/browse'}
- </>
- )
- },
- id: 'bitbucket.repository',
- onFieldChange: props.onFieldChange,
- propKey: 'repository',
- value: repository || ''
- })}
- {renderField({
- help: true,
- helpParams: {
- example: (
- <>
- {'.../projects/{KEY}/repos/'}
- <strong>{'{SLUG}'}</strong>
- {'/browse'}
- </>
- )
- },
- id: 'bitbucket.slug',
- onFieldChange: props.onFieldChange,
- propKey: 'slug',
- value: slug || ''
- })}
- </>
+ {alm && (
+ <AlmSpecificForm alm={alm} formData={formData} onFieldChange={props.onFieldChange} />
)}
- {alm === AlmKeys.GitHub && (
- <>
- {renderField({
- help: true,
- helpParams: { example: 'SonarSource/sonarqube' },
- id: 'github.repository',
- onFieldChange: props.onFieldChange,
- propKey: 'repository',
- value: repository || ''
- })}
- {renderBooleanField({
- help: true,
- id: 'github.summary_comment_setting',
- onFieldChange: props.onFieldChange,
- propKey: 'summaryCommentEnabled',
- value: summaryCommentEnabled === undefined ? true : summaryCommentEnabled
- })}
- </>
- )}
-
- {alm === AlmKeys.GitLab &&
- renderField({
- id: 'gitlab.repository',
- onFieldChange: props.onFieldChange,
- propKey: 'repository',
- value: repository || ''
- })}
-
<div className="display-flex-center">
<DeferredSpinner className="spacer-right" loading={saving} />
{isChanged && (
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2020 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import { AlmKeys } from '../../../../../types/alm-settings';
+import AlmSpecificForm, { AlmSpecificFormProps } from '../AlmSpecificForm';
+
+it.each([[AlmKeys.Azure], [AlmKeys.Bitbucket], [AlmKeys.GitHub], [AlmKeys.GitLab]])(
+ 'it should render correctly for %s',
+ alm => {
+ expect(shallowRender(alm)).toMatchSnapshot();
+ }
+);
+
+function shallowRender(alm: AlmKeys, props: Partial<AlmSpecificFormProps> = {}) {
+ return shallow(
+ <AlmSpecificForm
+ alm={alm}
+ formData={{
+ key: '',
+ repository: ''
+ }}
+ onFieldChange={jest.fn()}
+ {...props}
+ />
+ );
+}
const wrapper = shallowRender();
await waitAndUpdate(wrapper);
const azureKey = 'azure';
- wrapper.setState({ formData: { key: azureKey }, instances });
+ const repository = 'az-rep';
+ const slug = 'az-project';
+ wrapper.setState({
+ formData: { key: azureKey, repository, slug },
+ instances
+ });
wrapper.instance().handleSubmit();
await waitAndUpdate(wrapper);
expect(setProjectAzureBinding).toBeCalledWith({
almSetting: azureKey,
- project: PROJECT_KEY
+ project: PROJECT_KEY,
+ projectName: slug,
+ repositoryName: repository
});
expect(wrapper.state().success).toBe(true);
});
});
});
+it('should reject submitted azure settings', async () => {
+ const wrapper = shallowRender();
+
+ expect.assertions(2);
+ await expect(
+ wrapper.instance().submitProjectAlmBinding(AlmKeys.Azure, 'azure-binding', { slug: 'project' })
+ ).rejects.toBeUndefined();
+ await expect(
+ wrapper
+ .instance()
+ .submitProjectAlmBinding(AlmKeys.Azure, 'azure-binding', { repository: 'repo' })
+ ).rejects.toBeUndefined();
+});
+
+it('should accept submit azure settings', async () => {
+ const wrapper = shallowRender();
+ await wrapper
+ .instance()
+ .submitProjectAlmBinding(AlmKeys.Azure, 'azure', { repository: 'az-repo', slug: 'az-project' });
+ expect(setProjectAzureBinding).toHaveBeenCalledWith({
+ almSetting: 'azure',
+ project: PROJECT_KEY,
+ repositoryName: 'az-repo',
+ projectName: 'az-project'
+ });
+});
+
it('should reject submit github settings', async () => {
const wrapper = shallowRender();
]
});
- expect(wrapper.instance().validateForm({ key: 'azure' })).toBe(true);
+ expect(wrapper.instance().validateForm({ key: 'azure', repository: 'rep' })).toBe(false);
+ expect(wrapper.instance().validateForm({ key: 'azure', slug: 'project' })).toBe(false);
+ expect(
+ wrapper.instance().validateForm({ key: 'azure', repository: 'repo', slug: 'project' })
+ ).toBe(true);
expect(wrapper.instance().validateForm({ key: 'github', repository: '' })).toBe(false);
expect(wrapper.instance().validateForm({ key: 'github', repository: 'asdf' })).toBe(true);
expect(optionRenderer!(instances[1])).toMatchSnapshot();
});
-it('should render optional fields correctly', () => {
- expect(
- shallowRender({
- formData: {
- key: 'key'
- },
- isChanged: true,
- isConfigured: false,
- instances: [{ key: 'key', url: 'http://example.com', alm: AlmKeys.GitHub }],
- loading: false
- }).find('label[htmlFor="github.summary_comment_setting"]')
- ).toMatchSnapshot();
-});
-
function shallowRender(props: Partial<PRDecorationBindingRendererProps> = {}) {
return shallow(
<PRDecorationBindingRenderer
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`it should render correctly for azure 1`] = `
+<Fragment>
+ <div
+ className="form-field"
+ >
+ <label
+ className="display-flex-center"
+ htmlFor="azure.project"
+ >
+ settings.pr_decoration.binding.form.azure.project
+ <em
+ className="mandatory"
+ >
+ *
+ </em>
+ <HelpTooltip
+ className="spacer-left"
+ overlay={
+ <FormattedMessage
+ defaultMessage="settings.pr_decoration.binding.form.azure.project.help"
+ id="settings.pr_decoration.binding.form.azure.project.help"
+ values={Object {}}
+ />
+ }
+ placement="right"
+ />
+ </label>
+ <input
+ className="input-super-large"
+ id="azure.project"
+ maxLength={256}
+ name="azure.project"
+ onChange={[Function]}
+ type="text"
+ value=""
+ />
+ </div>
+ <div
+ className="form-field"
+ >
+ <label
+ className="display-flex-center"
+ htmlFor="azure.repository"
+ >
+ settings.pr_decoration.binding.form.azure.repository
+ <em
+ className="mandatory"
+ >
+ *
+ </em>
+ <HelpTooltip
+ className="spacer-left"
+ overlay={
+ <FormattedMessage
+ defaultMessage="settings.pr_decoration.binding.form.azure.repository.help"
+ id="settings.pr_decoration.binding.form.azure.repository.help"
+ values={Object {}}
+ />
+ }
+ placement="right"
+ />
+ </label>
+ <input
+ className="input-super-large"
+ id="azure.repository"
+ maxLength={256}
+ name="azure.repository"
+ onChange={[Function]}
+ type="text"
+ value=""
+ />
+ </div>
+</Fragment>
+`;
+
+exports[`it should render correctly for bitbucket 1`] = `
+<Fragment>
+ <div
+ className="form-field"
+ >
+ <label
+ className="display-flex-center"
+ htmlFor="bitbucket.repository"
+ >
+ settings.pr_decoration.binding.form.bitbucket.repository
+ <em
+ className="mandatory"
+ >
+ *
+ </em>
+ <HelpTooltip
+ className="spacer-left"
+ overlay={
+ <FormattedMessage
+ defaultMessage="settings.pr_decoration.binding.form.bitbucket.repository.help"
+ id="settings.pr_decoration.binding.form.bitbucket.repository.help"
+ values={
+ Object {
+ "example": <React.Fragment>
+ .../projects/
+ <strong>
+ {KEY}
+ </strong>
+ /repos/{SLUG}/browse
+ </React.Fragment>,
+ }
+ }
+ />
+ }
+ placement="right"
+ />
+ </label>
+ <input
+ className="input-super-large"
+ id="bitbucket.repository"
+ maxLength={256}
+ name="bitbucket.repository"
+ onChange={[Function]}
+ type="text"
+ value=""
+ />
+ </div>
+ <div
+ className="form-field"
+ >
+ <label
+ className="display-flex-center"
+ htmlFor="bitbucket.slug"
+ >
+ settings.pr_decoration.binding.form.bitbucket.slug
+ <em
+ className="mandatory"
+ >
+ *
+ </em>
+ <HelpTooltip
+ className="spacer-left"
+ overlay={
+ <FormattedMessage
+ defaultMessage="settings.pr_decoration.binding.form.bitbucket.slug.help"
+ id="settings.pr_decoration.binding.form.bitbucket.slug.help"
+ values={
+ Object {
+ "example": <React.Fragment>
+ .../projects/{KEY}/repos/
+ <strong>
+ {SLUG}
+ </strong>
+ /browse
+ </React.Fragment>,
+ }
+ }
+ />
+ }
+ placement="right"
+ />
+ </label>
+ <input
+ className="input-super-large"
+ id="bitbucket.slug"
+ maxLength={256}
+ name="bitbucket.slug"
+ onChange={[Function]}
+ type="text"
+ value=""
+ />
+ </div>
+</Fragment>
+`;
+
+exports[`it should render correctly for github 1`] = `
+<Fragment>
+ <div
+ className="form-field"
+ >
+ <label
+ className="display-flex-center"
+ htmlFor="github.repository"
+ >
+ settings.pr_decoration.binding.form.github.repository
+ <em
+ className="mandatory"
+ >
+ *
+ </em>
+ <HelpTooltip
+ className="spacer-left"
+ overlay={
+ <FormattedMessage
+ defaultMessage="settings.pr_decoration.binding.form.github.repository.help"
+ id="settings.pr_decoration.binding.form.github.repository.help"
+ values={
+ Object {
+ "example": "SonarSource/sonarqube",
+ }
+ }
+ />
+ }
+ placement="right"
+ />
+ </label>
+ <input
+ className="input-super-large"
+ id="github.repository"
+ maxLength={256}
+ name="github.repository"
+ onChange={[Function]}
+ type="text"
+ value=""
+ />
+ </div>
+ <div
+ className="form-field"
+ >
+ <label
+ className="display-flex-center"
+ htmlFor="github.summary_comment_setting"
+ >
+ settings.pr_decoration.binding.form.github.summary_comment_setting
+ <HelpTooltip
+ className="spacer-left"
+ overlay={
+ <FormattedMessage
+ defaultMessage="settings.pr_decoration.binding.form.github.summary_comment_setting.help"
+ id="settings.pr_decoration.binding.form.github.summary_comment_setting.help"
+ values={Object {}}
+ />
+ }
+ placement="right"
+ />
+ </label>
+ <InputForBoolean
+ isDefault={true}
+ name="github.summary_comment_setting"
+ onChange={[Function]}
+ value={true}
+ />
+ </div>
+</Fragment>
+`;
+
+exports[`it should render correctly for gitlab 1`] = `
+<div
+ className="form-field"
+>
+ <label
+ className="display-flex-center"
+ htmlFor="gitlab.repository"
+ >
+ settings.pr_decoration.binding.form.gitlab.repository
+ <em
+ className="mandatory"
+ >
+ *
+ </em>
+ </label>
+ <input
+ className="input-super-large"
+ id="gitlab.repository"
+ maxLength={256}
+ name="gitlab.repository"
+ onChange={[Function]}
+ type="text"
+ value=""
+ />
+</div>
+`;
valueRenderer={[Function]}
/>
</div>
- <div
- className="form-field"
- >
- <label
- className="display-flex-center"
- htmlFor="github.repository"
- >
- settings.pr_decoration.binding.form.github.repository
- <em
- className="mandatory"
- >
- *
- </em>
- <HelpTooltip
- className="spacer-left"
- overlay={
- <FormattedMessage
- defaultMessage="settings.pr_decoration.binding.form.github.repository.help"
- id="settings.pr_decoration.binding.form.github.repository.help"
- values={
- Object {
- "example": "SonarSource/sonarqube",
- }
- }
- />
- }
- placement="right"
- />
- </label>
- <input
- className="input-super-large"
- id="github.repository"
- maxLength={256}
- name="github.repository"
- onChange={[Function]}
- type="text"
- value="account/repo"
- />
- </div>
- <div
- className="form-field"
- >
- <label
- className="display-flex-center"
- htmlFor="github.summary_comment_setting"
- >
- settings.pr_decoration.binding.form.github.summary_comment_setting
- <HelpTooltip
- className="spacer-left"
- overlay={
- <FormattedMessage
- defaultMessage="settings.pr_decoration.binding.form.github.summary_comment_setting.help"
- id="settings.pr_decoration.binding.form.github.summary_comment_setting.help"
- values={Object {}}
- />
- }
- placement="right"
- />
- </label>
- <InputForBoolean
- isDefault={true}
- name="github.summary_comment_setting"
- onChange={[Function]}
- value={true}
- />
- </div>
+ <AlmSpecificForm
+ alm="github"
+ formData={
+ Object {
+ "key": "i1",
+ "repository": "account/repo",
+ }
+ }
+ onFieldChange={[MockFunction]}
+ />
<div
className="display-flex-center"
>
</div>
`;
-exports[`should render optional fields correctly 1`] = `
-<label
- className="display-flex-center"
- htmlFor="github.summary_comment_setting"
->
- settings.pr_decoration.binding.form.github.summary_comment_setting
- <HelpTooltip
- className="spacer-left"
- overlay={
- <FormattedMessage
- defaultMessage="settings.pr_decoration.binding.form.github.summary_comment_setting.help"
- id="settings.pr_decoration.binding.form.github.summary_comment_setting.help"
- values={Object {}}
- />
- }
- placement="right"
- />
-</label>
-`;
-
exports[`should render select options correctly 1`] = `
<span>
azure
project: string;
}
-export interface AzureProjectAlmBindingParams extends ProjectAlmBindingParams {}
+export interface AzureProjectAlmBindingParams extends ProjectAlmBindingParams {
+ projectName: string;
+ repositoryName: string;
+}
export interface BitbucketProjectAlmBindingParams extends ProjectAlmBindingParams {
repository: string;
settings.pr_decoration.binding.description=Enable Pull Request Decoration for this project.
settings.pr_decoration.binding.form.url=Project location
settings.pr_decoration.binding.form.name=Configuration name
+settings.pr_decoration.binding.form.azure.project=Project Name
+settings.pr_decoration.binding.form.azure.project.help=The name of the Azure DevOps Server project containing your repository.
+settings.pr_decoration.binding.form.azure.repository=Repository Name
+settings.pr_decoration.binding.form.azure.repository.help=The name of your Azure DevOps Server repository.
settings.pr_decoration.binding.form.github.repository=Repository identifier
settings.pr_decoration.binding.form.github.repository.help=The path of your repository URL. Example: {example}
settings.pr_decoration.binding.form.github.summary_comment_setting=Enable analysis summary under the GitHub Conversation tab