return post('/api/alm_settings/update_azure', data).catch(throwGlobalError);
}
+export function createBitbucketConfiguration(data: T.BitbucketBindingDefinition) {
+ return post('/api/alm_settings/create_bitbucket', data).catch(throwGlobalError);
+}
+
+export function updateBitbucketConfiguration(
+ data: T.BitbucketBindingDefinition & { newKey: string }
+) {
+ return post('/api/alm_settings/update_bitbucket', data).catch(throwGlobalError);
+}
+
export function deleteConfiguration(key: string) {
return post('/api/alm_settings/delete', { key }).catch(throwGlobalError);
}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 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 { AlmDefinitionFormField } from './AlmDefinitionFormField';
+
+export interface BitbucketFormModalProps {
+ formData: T.BitbucketBindingDefinition;
+ onFieldChange: (fieldId: keyof T.BitbucketBindingDefinition, value: string) => void;
+}
+
+export default function BitbucketFormModal(props: BitbucketFormModalProps) {
+ const { formData, onFieldChange } = props;
+
+ return (
+ <>
+ <AlmDefinitionFormField
+ autoFocus={true}
+ formData={formData}
+ help={true}
+ id="name"
+ isTextArea={false}
+ maxLength={40}
+ onFieldChange={onFieldChange}
+ propKey="key"
+ />
+ <AlmDefinitionFormField
+ formData={formData}
+ help={false}
+ id="url.bitbucket"
+ isTextArea={false}
+ maxLength={2000}
+ onFieldChange={onFieldChange}
+ propKey="url"
+ />
+ <AlmDefinitionFormField
+ formData={formData}
+ help={false}
+ id="personal_access_token"
+ isTextArea={true}
+ maxLength={2000}
+ onFieldChange={onFieldChange}
+ propKey="personalAccessToken"
+ />
+ </>
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 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 {
+ createBitbucketConfiguration,
+ updateBitbucketConfiguration
+} from '../../../../api/almSettings';
+import BitbucketTabRenderer from './BitbucketTabRenderer';
+
+interface Props {
+ definitions: T.BitbucketBindingDefinition[];
+ loading: boolean;
+ onDelete: (definitionKey: string) => void;
+ onUpdateDefinitions: () => void;
+}
+
+interface State {
+ editedDefinition?: T.BitbucketBindingDefinition;
+ projectCount?: number;
+}
+
+export default class BitbucketTab extends React.PureComponent<Props, State> {
+ mounted = false;
+ state: State = {};
+
+ componentDidMount() {
+ this.mounted = true;
+ }
+
+ componentWillUnmount() {
+ this.mounted = false;
+ }
+
+ handleCancel = () => {
+ this.setState({
+ editedDefinition: undefined
+ });
+ };
+
+ handleCreate = () => {
+ this.setState({ editedDefinition: { key: '', url: '', personalAccessToken: '' } });
+ };
+
+ handleEdit = (config: T.BitbucketBindingDefinition) => {
+ this.setState({ editedDefinition: config });
+ };
+
+ handleSubmit = (config: T.BitbucketBindingDefinition, originalKey: string) => {
+ const call = originalKey
+ ? updateBitbucketConfiguration({ newKey: config.key, ...config, key: originalKey })
+ : createBitbucketConfiguration(config);
+ return call
+ .then(() => {
+ if (this.mounted) {
+ this.setState({ editedDefinition: undefined });
+ }
+ })
+ .then(this.props.onUpdateDefinitions);
+ };
+
+ render() {
+ const { definitions, loading } = this.props;
+ const { editedDefinition } = this.state;
+ return (
+ <BitbucketTabRenderer
+ definitions={definitions}
+ editedDefinition={editedDefinition}
+ loading={loading}
+ onCancel={this.handleCancel}
+ onCreate={this.handleCreate}
+ onDelete={this.props.onDelete}
+ onEdit={this.handleEdit}
+ onSubmit={this.handleSubmit}
+ />
+ );
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 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 { ALM_KEYS } from '../../utils';
+import AlmPRDecorationFormModal from './AlmPRDecorationFormModal';
+import BitbucketFormModal from './BitbucketFormModal';
+import BitbucketTable from './BitbucketTable';
+import TabHeader from './TabHeader';
+
+export interface BitbucketTabRendererProps {
+ editedDefinition?: T.BitbucketBindingDefinition;
+ definitions: T.BitbucketBindingDefinition[];
+ loading: boolean;
+ onCancel: () => void;
+ onCreate: () => void;
+ onDelete: (definitionKey: string) => void;
+ onEdit: (config: T.BitbucketBindingDefinition) => void;
+ onSubmit: (config: T.BitbucketBindingDefinition, originalKey: string) => void;
+}
+
+export default function BitbucketTabRenderer(props: BitbucketTabRendererProps) {
+ const { definitions, editedDefinition, loading } = props;
+ return (
+ <>
+ <TabHeader alm={ALM_KEYS.BITBUCKET} onCreate={props.onCreate} />
+
+ <BitbucketTable
+ definitions={definitions}
+ loading={loading}
+ onDelete={props.onDelete}
+ onEdit={props.onEdit}
+ />
+
+ {editedDefinition && (
+ <AlmPRDecorationFormModal
+ bindingDefinition={editedDefinition}
+ onCancel={props.onCancel}
+ onSubmit={props.onSubmit}>
+ {childProps => <BitbucketFormModal {...childProps} />}
+ </AlmPRDecorationFormModal>
+ )}
+ </>
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 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 { ButtonIcon, DeleteButton } from 'sonar-ui-common/components/controls/buttons';
+import EditIcon from 'sonar-ui-common/components/icons/EditIcon';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+
+export interface BitbucketTableProps {
+ definitions: T.BitbucketBindingDefinition[];
+ loading: boolean;
+ onDelete: (definitionKey: string) => void;
+ onEdit: (config: T.BitbucketBindingDefinition) => void;
+}
+
+export default function BitbucketTable(props: BitbucketTableProps) {
+ const { definitions, loading } = props;
+
+ if (loading) {
+ return <DeferredSpinner />;
+ }
+
+ return (
+ <table className="data zebra spacer-bottom">
+ <thead>
+ <tr>
+ <th>{translate('settings.pr_decoration.table.column.name')}</th>
+ <th>{translate(`settings.pr_decoration.table.column.bitbucket.url`)}</th>
+ <th className="thin">{translate('settings.pr_decoration.table.column.edit')}</th>
+ <th className="thin">{translate('settings.pr_decoration.table.column.delete')}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {definitions.length < 1 ? (
+ <tr>
+ <td colSpan={4}>{translate('settings.pr_decoration.table.empty.bitbucket')}</td>
+ </tr>
+ ) : (
+ definitions.map(definition => (
+ <tr key={definition.key}>
+ <td>{definition.key}</td>
+ <td>{definition.url}</td>
+ <td>
+ <ButtonIcon onClick={() => props.onEdit(definition)}>
+ <EditIcon />
+ </ButtonIcon>
+ </td>
+ <td>
+ <DeleteButton onClick={() => props.onDelete(definition.key)} />
+ </td>
+ </tr>
+ ))
+ )}
+ </tbody>
+ </table>
+ );
+}
import { translate } from 'sonar-ui-common/helpers/l10n';
import { almName, ALM_KEYS } from '../../utils';
import AzureTab from './AzureTab';
+import BitbucketTab from './BitbucketTab';
import DeleteModal from './DeleteModal';
import GithubTab from './GithubTab';
key: ALM_KEYS.GITHUB,
label: almName[ALM_KEYS.GITHUB]
},
+ {
+ key: ALM_KEYS.BITBUCKET,
+ label: almName[ALM_KEYS.BITBUCKET]
+ },
{
key: ALM_KEYS.AZURE,
label: almName[ALM_KEYS.AZURE]
onUpdateDefinitions={props.onUpdateDefinitions}
/>
)}
+ {currentAlm === ALM_KEYS.BITBUCKET && (
+ <BitbucketTab
+ definitions={definitions.bitbucket}
+ loading={loading}
+ onDelete={props.onDelete}
+ onUpdateDefinitions={props.onUpdateDefinitions}
+ />
+ )}
{currentAlm === ALM_KEYS.GITHUB && (
<GithubTab
definitions={definitions.github}
currentAlm: ALM_KEYS.GITHUB,
definitions: {
[ALM_KEYS.AZURE]: [],
+ [ALM_KEYS.BITBUCKET]: [],
[ALM_KEYS.GITHUB]: []
},
loading: true
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 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 { mockBitbucketDefinition } from '../../../../../helpers/testMocks';
+import BitbucketFormModal, { BitbucketFormModalProps } from '../BitbucketFormModal';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+ expect(shallowRender({ formData: mockBitbucketDefinition() })).toMatchSnapshot();
+});
+
+function shallowRender(props: Partial<BitbucketFormModalProps> = {}) {
+ return shallow(
+ <BitbucketFormModal
+ formData={{ key: '', personalAccessToken: '', url: '' }}
+ onFieldChange={jest.fn()}
+ {...props}
+ />
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 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 { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import {
+ createBitbucketConfiguration,
+ updateBitbucketConfiguration
+} from '../../../../../api/almSettings';
+import { mockBitbucketDefinition } from '../../../../../helpers/testMocks';
+import BitbucketTab from '../BitbucketTab';
+
+jest.mock('../../../../../api/almSettings', () => ({
+ countBindedProjects: jest.fn().mockResolvedValue(2),
+ createBitbucketConfiguration: jest.fn().mockResolvedValue({}),
+ deleteConfiguration: jest.fn().mockResolvedValue({}),
+ updateBitbucketConfiguration: jest.fn().mockResolvedValue({})
+}));
+
+beforeEach(() => {
+ jest.clearAllMocks();
+});
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+});
+
+it('should handle cancel', async () => {
+ const wrapper = shallowRender();
+
+ wrapper.setState({
+ editedDefinition: mockBitbucketDefinition()
+ });
+
+ wrapper.instance().handleCancel();
+
+ await waitAndUpdate(wrapper);
+
+ expect(wrapper.state().editedDefinition).toBeUndefined();
+});
+
+it('should create config', async () => {
+ const onUpdateDefinitions = jest.fn();
+ const config = mockBitbucketDefinition();
+ const wrapper = shallowRender({ onUpdateDefinitions });
+ wrapper.setState({ editedDefinition: config });
+
+ await wrapper.instance().handleSubmit(config, '');
+
+ expect(createBitbucketConfiguration).toBeCalledWith(config);
+ expect(onUpdateDefinitions).toBeCalled();
+ expect(wrapper.state().editedDefinition).toBeUndefined();
+});
+
+it('should update config', async () => {
+ const onUpdateDefinitions = jest.fn();
+ const config = mockBitbucketDefinition();
+ const wrapper = shallowRender({ onUpdateDefinitions });
+ wrapper.setState({ editedDefinition: config });
+
+ await wrapper.instance().handleSubmit(config, 'originalKey');
+
+ expect(updateBitbucketConfiguration).toBeCalledWith({
+ newKey: 'key',
+ ...config,
+ key: 'originalKey'
+ });
+ expect(onUpdateDefinitions).toBeCalled();
+ expect(wrapper.state().editedDefinition).toBeUndefined();
+});
+
+function shallowRender(props: Partial<BitbucketTab['props']> = {}) {
+ return shallow<BitbucketTab>(
+ <BitbucketTab
+ definitions={[]}
+ loading={false}
+ onDelete={jest.fn()}
+ onUpdateDefinitions={jest.fn()}
+ {...props}
+ />
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 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 { mockBitbucketDefinition } from '../../../../../helpers/testMocks';
+import BitbucketTable, { BitbucketTableProps } from '../BitbucketTable';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+ expect(shallowRender({ definitions: [mockBitbucketDefinition()] })).toMatchSnapshot();
+});
+
+function shallowRender(props: Partial<BitbucketTableProps> = {}) {
+ return shallow(
+ <BitbucketTable
+ definitions={[]}
+ loading={false}
+ onDelete={jest.fn()}
+ onEdit={jest.fn()}
+ {...props}
+ />
+ );
+}
return shallow(
<PRDecorationTabs
currentAlm={ALM_KEYS.GITHUB}
- definitions={{ azure: [], github: [] }}
+ definitions={{ azure: [], bitbucket: [], github: [] }}
loading={false}
onCancel={jest.fn()}
onConfirmDelete={jest.fn()}
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<Fragment>
+ <AlmDefinitionFormField
+ autoFocus={true}
+ formData={
+ Object {
+ "key": "",
+ "personalAccessToken": "",
+ "url": "",
+ }
+ }
+ help={true}
+ id="name"
+ isTextArea={false}
+ maxLength={40}
+ onFieldChange={[MockFunction]}
+ propKey="key"
+ />
+ <AlmDefinitionFormField
+ formData={
+ Object {
+ "key": "",
+ "personalAccessToken": "",
+ "url": "",
+ }
+ }
+ help={false}
+ id="url.bitbucket"
+ isTextArea={false}
+ maxLength={2000}
+ onFieldChange={[MockFunction]}
+ propKey="url"
+ />
+ <AlmDefinitionFormField
+ formData={
+ Object {
+ "key": "",
+ "personalAccessToken": "",
+ "url": "",
+ }
+ }
+ help={false}
+ id="personal_access_token"
+ isTextArea={true}
+ maxLength={2000}
+ onFieldChange={[MockFunction]}
+ propKey="personalAccessToken"
+ />
+</Fragment>
+`;
+
+exports[`should render correctly 2`] = `
+<Fragment>
+ <AlmDefinitionFormField
+ autoFocus={true}
+ formData={
+ Object {
+ "key": "key",
+ "personalAccessToken": "asdf1234",
+ "url": "http://bbs.enterprise.com",
+ }
+ }
+ help={true}
+ id="name"
+ isTextArea={false}
+ maxLength={40}
+ onFieldChange={[MockFunction]}
+ propKey="key"
+ />
+ <AlmDefinitionFormField
+ formData={
+ Object {
+ "key": "key",
+ "personalAccessToken": "asdf1234",
+ "url": "http://bbs.enterprise.com",
+ }
+ }
+ help={false}
+ id="url.bitbucket"
+ isTextArea={false}
+ maxLength={2000}
+ onFieldChange={[MockFunction]}
+ propKey="url"
+ />
+ <AlmDefinitionFormField
+ formData={
+ Object {
+ "key": "key",
+ "personalAccessToken": "asdf1234",
+ "url": "http://bbs.enterprise.com",
+ }
+ }
+ help={false}
+ id="personal_access_token"
+ isTextArea={true}
+ maxLength={2000}
+ onFieldChange={[MockFunction]}
+ propKey="personalAccessToken"
+ />
+</Fragment>
+`;
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<BitbucketTabRenderer
+ definitions={Array []}
+ loading={false}
+ onCancel={[Function]}
+ onCreate={[Function]}
+ onDelete={[MockFunction]}
+ onEdit={[Function]}
+ onSubmit={[Function]}
+/>
+`;
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<table
+ className="data zebra spacer-bottom"
+>
+ <thead>
+ <tr>
+ <th>
+ settings.pr_decoration.table.column.name
+ </th>
+ <th>
+ settings.pr_decoration.table.column.bitbucket.url
+ </th>
+ <th
+ className="thin"
+ >
+ settings.pr_decoration.table.column.edit
+ </th>
+ <th
+ className="thin"
+ >
+ settings.pr_decoration.table.column.delete
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td
+ colSpan={4}
+ >
+ settings.pr_decoration.table.empty.bitbucket
+ </td>
+ </tr>
+ </tbody>
+</table>
+`;
+
+exports[`should render correctly 2`] = `
+<table
+ className="data zebra spacer-bottom"
+>
+ <thead>
+ <tr>
+ <th>
+ settings.pr_decoration.table.column.name
+ </th>
+ <th>
+ settings.pr_decoration.table.column.bitbucket.url
+ </th>
+ <th
+ className="thin"
+ >
+ settings.pr_decoration.table.column.edit
+ </th>
+ <th
+ className="thin"
+ >
+ settings.pr_decoration.table.column.delete
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr
+ key="key"
+ >
+ <td>
+ key
+ </td>
+ <td>
+ http://bbs.enterprise.com
+ </td>
+ <td>
+ <ButtonIcon
+ onClick={[Function]}
+ >
+ <EditIcon />
+ </ButtonIcon>
+ </td>
+ <td>
+ <DeleteButton
+ onClick={[Function]}
+ />
+ </td>
+ </tr>
+ </tbody>
+</table>
+`;
definitions={
Object {
"azure": Array [],
+ "bitbucket": Array [],
"github": Array [],
}
}
export enum ALM_KEYS {
AZURE = 'azure',
- // BITBUCKET = 'bitbucket',
+ BITBUCKET = 'bitbucket',
GITHUB = 'github'
}
export const almName = {
[ALM_KEYS.AZURE]: 'Azure DevOps Server',
- // [ALM_KEYS.BITBUCKET]: 'Bitbucket Server',
+ [ALM_KEYS.BITBUCKET]: 'Bitbucket Server',
[ALM_KEYS.GITHUB]: 'Github Enterprise'
};
};
}
+export function mockBitbucketDefinition(
+ overrides: Partial<T.BitbucketBindingDefinition> = {}
+): T.BitbucketBindingDefinition {
+ return {
+ key: 'key',
+ personalAccessToken: 'asdf1234',
+ url: 'http://bbs.enterprise.com',
+ ...overrides
+ };
+}
+
export function mockGithubDefinition(
overrides: Partial<T.GithubBindingDefinition> = {}
): T.GithubBindingDefinition {
return {
key: 'key',
- url: 'http:alm.enterprise.com',
+ url: 'http://github.enterprise.com',
appId: '123456',
privateKey: 'asdf1234',
...overrides
export interface AlmSettingsBindingDefinitions {
azure: AzureBindingDefinition[];
+ bitbucket: BitbucketBindingDefinition[];
github: GithubBindingDefinition[];
}
- export interface GithubBindingDefinition extends AlmSettingsBinding {
+ export interface AzureBindingDefinition extends AlmSettingsBinding {
+ personalAccessToken: string;
+ }
+
+ export interface BitbucketBindingDefinition extends AlmSettingsBinding {
+ personalAccessToken: string;
url: string;
+ }
+
+ export interface GithubBindingDefinition extends AlmSettingsBinding {
appId: string;
privateKey: string;
+ url: string;
}
- export interface AzureBindingDefinition extends AlmSettingsBinding {
- personalAccessToken: string;
- }
+
export interface ProjectAlmBinding {
key: string;
settings.pr_decoration.title=Pull Requests decoration
settings.pr_decoration.description=When Pull Request decoration is enabled, SonarQube publishes the status of the analysis directly in your ALM Pull requests.
settings.pr_decoration.manage_instances=Manage instances
-settings.pr_decoration.azure.info=The account that will be used to decorate Pull Requests needs write permission. {link}
+settings.pr_decoration.azure.info=Accounts that will be used to decorate Pull Requests needs Code: Read & Write permission. {link}
+settings.pr_decoration.bitbucket.info=Accounts that will be used to decorate Pull Requests needs write permission. {link}
settings.pr_decoration.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.pr_decoration.table.title=Pull Request decoration configurations
+settings.pr_decoration.table.empty.azure=Create your first Azure DevOps configuration to enable Pull Request decoration on your projects.
+settings.pr_decoration.table.empty.bitbucket=Create your first Bitbucket configuration to enable Pull Request decoration on your projects.
+settings.pr_decoration.table.empty.github=Create your first Github configuration to enable Pull Request decoration on your organization or repository.
settings.pr_decoration.table.create=Create configuration
settings.pr_decoration.table.column.name=Name
+settings.pr_decoration.table.column.bitbucket.url=BitBucket server URL
settings.pr_decoration.table.column.github.url=Github instance URL
settings.pr_decoration.table.column.app_id=App ID
settings.pr_decoration.table.column.edit=Edit
settings.pr_decoration.form.header.edit=Edit the Pull Request decoration configuration
settings.pr_decoration.form.name=Configuration name
settings.pr_decoration.form.name.help=Give your configuration a clear and succinct name. This name will be used at project level to identify the correct configured GitHub App for a project.
+settings.pr_decoration.form.url.bitbucket=Bitbucket Server URL
settings.pr_decoration.form.url.github=GitHub Enterprise URL
settings.pr_decoration.form.app_id=GitHub App ID
settings.pr_decoration.form.private_key=Private Key