import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
-import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../../../../apps/settings/components/AdditionalCategoryKeys';
+import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../../../../apps/settings/constants';
import { Alert } from '../../../../components/ui/Alert';
import { translate } from '../../../../helpers/l10n';
import { getProjectSettingsUrl } from '../../../../helpers/urls';
import { AzureProject, AzureRepository } from '../../../types/alm-integration';
import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings';
import { Dict } from '../../../types/types';
-import { ALM_INTEGRATION } from '../../settings/components/AdditionalCategoryKeys';
+import { ALM_INTEGRATION_CATEGORY } from '../../settings/constants';
import AzurePersonalAccessTokenForm from './AzurePersonalAccessTokenForm';
import AzureProjectsList from './AzureProjectsList';
import CreateProjectPageHeader from './CreateProjectPageHeader';
values={{
alm: translate('onboarding.alm', AlmKeys.Azure),
url: (
- <Link to={getGlobalSettingsUrl(ALM_INTEGRATION)}>
+ <Link to={getGlobalSettingsUrl(ALM_INTEGRATION_CATEGORY)}>
{translate('settings.page')}
</Link>
)
import { translate } from '../../../helpers/l10n';
import { getGlobalSettingsUrl } from '../../../helpers/urls';
import { AlmKeys } from '../../../types/alm-settings';
-import { ALM_INTEGRATION } from '../../settings/components/AdditionalCategoryKeys';
+import { ALM_INTEGRATION_CATEGORY } from '../../settings/constants';
export interface WrongBindingCountAlertProps {
alm: AlmKeys;
values={{
alm: translate('onboarding.alm', alm),
url: (
- <Link to={getGlobalSettingsUrl(ALM_INTEGRATION)}>{translate('settings.page')}</Link>
+ <Link to={getGlobalSettingsUrl(ALM_INTEGRATION_CATEGORY)}>
+ {translate('settings.page')}
+ </Link>
)
}}
/>
import { ComponentQualifier } from '../../../types/component';
import { Component } from '../../../types/types';
import { CurrentUser, isLoggedIn } from '../../../types/users';
-import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../../settings/components/AdditionalCategoryKeys';
+import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../../settings/constants';
export interface FirstAnalysisNextStepsNotifProps {
branchesEnabled?: boolean;
import { ExtendedSettingDefinition } from '../../../types/settings';
import { Component } from '../../../types/types';
import {
- ALM_INTEGRATION,
+ ALM_INTEGRATION_CATEGORY,
ANALYSIS_SCOPE_CATEGORY,
LANGUAGES_CATEGORY,
NEW_CODE_PERIOD_CATEGORY,
PULL_REQUEST_DECORATION_BINDING_CATEGORY
-} from './AdditionalCategoryKeys';
+} from '../constants';
import AlmIntegration from './almIntegration/AlmIntegration';
import { AnalysisScope } from './AnalysisScope';
import Languages from './Languages';
displayTab: false
},
{
- key: ALM_INTEGRATION,
+ key: ALM_INTEGRATION_CATEGORY,
name: translate('property.category.almintegration'),
renderComponent: getAlmIntegrationComponent,
availableGlobally: true,
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2022 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.
- */
-export const ALM_INTEGRATION = 'almintegration';
-export const ANALYSIS_SCOPE_CATEGORY = 'exclusions';
-export const LANGUAGES_CATEGORY = 'languages';
-export const NEW_CODE_PERIOD_CATEGORY = 'new_code_period';
-export const PULL_REQUEST_DECORATION_BINDING_CATEGORY = 'pull_request_decoration_binding';
import { getGlobalSettingsUrl, getProjectSettingsUrl } from '../../../helpers/urls';
import { AppState } from '../../../types/appstate';
import { Component } from '../../../types/types';
+import { CATEGORY_OVERRIDES } from '../constants';
import { getCategoryName } from '../utils';
import { ADDITIONAL_CATEGORIES } from './AdditionalCategories';
-import CATEGORY_OVERRIDES from './CategoryOverrides';
export interface CategoriesListProps {
appState: AppState;
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2022 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 { Dict } from '../../../types/types';
-import { LANGUAGES_CATEGORY } from './AdditionalCategoryKeys';
-
-const CATEGORY_OVERRIDES: Dict<string> = {
- abap: LANGUAGES_CATEGORY,
- apex: LANGUAGES_CATEGORY,
- 'c / c++ / objective-c': LANGUAGES_CATEGORY,
- 'c#': LANGUAGES_CATEGORY,
- cloudformation: LANGUAGES_CATEGORY,
- cobol: LANGUAGES_CATEGORY,
- css: LANGUAGES_CATEGORY,
- flex: LANGUAGES_CATEGORY,
- go: LANGUAGES_CATEGORY,
- html: LANGUAGES_CATEGORY,
- java: LANGUAGES_CATEGORY,
- javascript: LANGUAGES_CATEGORY,
- 'javascript / typescript': LANGUAGES_CATEGORY,
- json: LANGUAGES_CATEGORY,
- kotlin: LANGUAGES_CATEGORY,
- php: LANGUAGES_CATEGORY,
- 'pl/i': LANGUAGES_CATEGORY,
- 'pl/sql': LANGUAGES_CATEGORY,
- python: LANGUAGES_CATEGORY,
- rpg: LANGUAGES_CATEGORY,
- ruby: LANGUAGES_CATEGORY,
- scala: LANGUAGES_CATEGORY,
- swift: LANGUAGES_CATEGORY,
- 't-sql': LANGUAGES_CATEGORY,
- terraform: LANGUAGES_CATEGORY,
- typescript: LANGUAGES_CATEGORY,
- 'vb.net': LANGUAGES_CATEGORY,
- 'visual basic': LANGUAGES_CATEGORY,
- xml: LANGUAGES_CATEGORY,
- yaml: LANGUAGES_CATEGORY
-};
-
-export default CATEGORY_OVERRIDES;
import Select from '../../../components/controls/Select';
import { Location, Router, withRouter } from '../../../components/hoc/withRouter';
import { translate } from '../../../helpers/l10n';
+import { CATEGORY_OVERRIDES, LANGUAGES_CATEGORY } from '../constants';
import { getCategoryName } from '../utils';
import { AdditionalCategoryComponentProps } from './AdditionalCategories';
-import { LANGUAGES_CATEGORY } from './AdditionalCategoryKeys';
import CategoryDefinitionsList from './CategoryDefinitionsList';
-import CATEGORY_OVERRIDES from './CategoryOverrides';
export interface LanguagesProps extends AdditionalCategoryComponentProps {
location: Location;
import { translate } from '../../../helpers/l10n';
import { ExtendedSettingDefinition } from '../../../types/settings';
import { Component } from '../../../types/types';
+import { CATEGORY_OVERRIDES } from '../constants';
import { getDefaultCategory } from '../utils';
import { ADDITIONAL_CATEGORIES } from './AdditionalCategories';
import AllCategoriesList from './AllCategoriesList';
import CategoryDefinitionsList from './CategoryDefinitionsList';
-import CATEGORY_OVERRIDES from './CategoryOverrides';
import PageHeader from './PageHeader';
export interface SettingsAppRendererProps {
*/
import { find } from 'lodash';
import { mockComponent } from '../../../../helpers/mocks/component';
+import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../../constants';
import { ADDITIONAL_CATEGORIES } from '../AdditionalCategories';
-import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../AdditionalCategoryKeys';
it('should render additional categories component correctly', () => {
ADDITIONAL_CATEGORIES.forEach(cat => {
import { mockDefinition } from '../../../../helpers/mocks/settings';
import { mockLocation } from '../../../../helpers/testMocks';
import {
- ALM_INTEGRATION,
+ ALM_INTEGRATION_CATEGORY,
ANALYSIS_SCOPE_CATEGORY,
LANGUAGES_CATEGORY,
NEW_CODE_PERIOD_CATEGORY,
PULL_REQUEST_DECORATION_BINDING_CATEGORY
-} from '../AdditionalCategoryKeys';
+} from '../../constants';
import { SettingsAppRenderer, SettingsAppRendererProps } from '../SettingsAppRenderer';
it('should render loading correctly', () => {
[NEW_CODE_PERIOD_CATEGORY],
[LANGUAGES_CATEGORY],
[ANALYSIS_SCOPE_CATEGORY],
- [ALM_INTEGRATION],
+ [ALM_INTEGRATION_CATEGORY],
[PULL_REQUEST_DECORATION_BINDING_CATEGORY]
])('should render %s correctly', category => {
const wrapper = shallowRender({
} from '../../../../types/alm-settings';
import { ExtendedSettingDefinition } from '../../../../types/settings';
import { Dict } from '../../../../types/types';
-import { ALM_INTEGRATION } from '../AdditionalCategoryKeys';
+import { ALM_INTEGRATION_CATEGORY } from '../../constants';
import CategoryDefinitionsList from '../CategoryDefinitionsList';
import AlmBindingDefinitionBox from './AlmBindingDefinitionBox';
import AlmBindingDefinitionForm from './AlmBindingDefinitionForm';
<div className="big-padded">
<CategoryDefinitionsList
- category={ALM_INTEGRATION}
+ category={ALM_INTEGRATION_CATEGORY}
definitions={settingsDefinitions}
subCategory={almTab}
/>
ProjectAlmBindingConfigurationErrorScope,
ProjectAlmBindingResponse
} from '../../../../types/alm-settings';
-import { ALM_INTEGRATION } from '../AdditionalCategoryKeys';
+import { ALM_INTEGRATION_CATEGORY } from '../../constants';
import AlmSpecificForm from './AlmSpecificForm';
export interface PRDecorationBindingRendererProps {
id="settings.pr_decoration.binding.no_bindings.admin"
values={{
link: (
- <Link to={getGlobalSettingsUrl(ALM_INTEGRATION)}>
+ <Link to={getGlobalSettingsUrl(ALM_INTEGRATION_CATEGORY)}>
{translate('settings.pr_decoration.binding.no_bindings.link')}
</Link>
)
)}
values={{
link: (
- <Link to={getGlobalSettingsUrl(ALM_INTEGRATION, { alm })}>
+ <Link to={getGlobalSettingsUrl(ALM_INTEGRATION_CATEGORY, { alm })}>
{translate(
'settings.pr_decoration.binding.check_configuration.failure.check_global_settings.link'
)}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2022 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 { Dict } from '../../types/types';
+
+export const ALM_INTEGRATION_CATEGORY = 'almintegration';
+export const ANALYSIS_SCOPE_CATEGORY = 'exclusions';
+export const LANGUAGES_CATEGORY = 'languages';
+export const NEW_CODE_PERIOD_CATEGORY = 'new_code_period';
+export const PULL_REQUEST_DECORATION_BINDING_CATEGORY = 'pull_request_decoration_binding';
+
+export const CATEGORY_OVERRIDES: Dict<string> = {
+ abap: LANGUAGES_CATEGORY,
+ apex: LANGUAGES_CATEGORY,
+ 'c / c++ / objective-c': LANGUAGES_CATEGORY,
+ 'c#': LANGUAGES_CATEGORY,
+ cloudformation: LANGUAGES_CATEGORY,
+ cobol: LANGUAGES_CATEGORY,
+ css: LANGUAGES_CATEGORY,
+ flex: LANGUAGES_CATEGORY,
+ go: LANGUAGES_CATEGORY,
+ html: LANGUAGES_CATEGORY,
+ java: LANGUAGES_CATEGORY,
+ javascript: LANGUAGES_CATEGORY,
+ 'javascript / typescript': LANGUAGES_CATEGORY,
+ json: LANGUAGES_CATEGORY,
+ kotlin: LANGUAGES_CATEGORY,
+ php: LANGUAGES_CATEGORY,
+ 'pl/i': LANGUAGES_CATEGORY,
+ 'pl/sql': LANGUAGES_CATEGORY,
+ python: LANGUAGES_CATEGORY,
+ rpg: LANGUAGES_CATEGORY,
+ ruby: LANGUAGES_CATEGORY,
+ scala: LANGUAGES_CATEGORY,
+ swift: LANGUAGES_CATEGORY,
+ 't-sql': LANGUAGES_CATEGORY,
+ terraform: LANGUAGES_CATEGORY,
+ typescript: LANGUAGES_CATEGORY,
+ 'vb.net': LANGUAGES_CATEGORY,
+ 'visual basic': LANGUAGES_CATEGORY,
+ xml: LANGUAGES_CATEGORY,
+ yaml: LANGUAGES_CATEGORY
+};
+
+// As per Bitbucket Cloud's documentation, Workspace ID's can only contain lowercase letters,
+// numbers, dashes, and underscores.
+export const BITBUCKET_CLOUD_WORKSPACE_ID_FORMAT = /^[a-z0-9\-_]+$/;