From ebf79cb40ad25f92dcd37dc2fd39a7e659906f58 Mon Sep 17 00:00:00 2001 From: Tibor Blenessy Date: Thu, 9 Jul 2020 13:10:17 +0200 Subject: [PATCH] Add configuration category override for js/ts (#2942) --- .../main/js/apps/settings/components/AllCategoriesList.tsx | 2 +- .../src/main/js/apps/settings/components/AppContainer.tsx | 2 +- .../main/js/apps/settings/components/CategoryOverrides.ts | 5 ++++- .../src/main/js/apps/settings/components/Languages.tsx | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/settings/components/AllCategoriesList.tsx b/server/sonar-web/src/main/js/apps/settings/components/AllCategoriesList.tsx index 480e35bd727..375b4e1dd73 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/AllCategoriesList.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/AllCategoriesList.tsx @@ -25,7 +25,7 @@ import { IndexLink } from 'react-router'; import { getAppState, getSettingsAppAllCategories, Store } from '../../../store/rootReducer'; import { getCategoryName } from '../utils'; import { ADDITIONAL_CATEGORIES } from './AdditionalCategories'; -import { CATEGORY_OVERRIDES } from './CategoryOverrides'; +import CATEGORY_OVERRIDES from './CategoryOverrides'; interface Category { key: string; diff --git a/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx b/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx index eba2be3ae79..4659329d9d5 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx @@ -31,7 +31,7 @@ import '../styles.css'; import { ADDITIONAL_CATEGORIES } from './AdditionalCategories'; import AllCategoriesList from './AllCategoriesList'; import CategoryDefinitionsList from './CategoryDefinitionsList'; -import { CATEGORY_OVERRIDES } from './CategoryOverrides'; +import CATEGORY_OVERRIDES from './CategoryOverrides'; import PageHeader from './PageHeader'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/settings/components/CategoryOverrides.ts b/server/sonar-web/src/main/js/apps/settings/components/CategoryOverrides.ts index 3687ad55a23..978b6973ffd 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/CategoryOverrides.ts +++ b/server/sonar-web/src/main/js/apps/settings/components/CategoryOverrides.ts @@ -19,7 +19,7 @@ */ import { LANGUAGES_CATEGORY } from './AdditionalCategoryKeys'; -export const CATEGORY_OVERRIDES: T.Dict = { +const CATEGORY_OVERRIDES: T.Dict = { abap: LANGUAGES_CATEGORY, apex: LANGUAGES_CATEGORY, 'c / c++ / objective-c': LANGUAGES_CATEGORY, @@ -31,6 +31,7 @@ export const CATEGORY_OVERRIDES: T.Dict = { html: LANGUAGES_CATEGORY, java: LANGUAGES_CATEGORY, javascript: LANGUAGES_CATEGORY, + 'javascript / typescript': LANGUAGES_CATEGORY, kotlin: LANGUAGES_CATEGORY, php: LANGUAGES_CATEGORY, 'pl/i': LANGUAGES_CATEGORY, @@ -46,3 +47,5 @@ export const CATEGORY_OVERRIDES: T.Dict = { 'visual basic': LANGUAGES_CATEGORY, xml: LANGUAGES_CATEGORY }; + +export default CATEGORY_OVERRIDES; diff --git a/server/sonar-web/src/main/js/apps/settings/components/Languages.tsx b/server/sonar-web/src/main/js/apps/settings/components/Languages.tsx index 09923492a38..3d55524a88c 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/Languages.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/Languages.tsx @@ -27,7 +27,7 @@ import { getCategoryName } from '../utils'; import { AdditionalCategoryComponentProps } from './AdditionalCategories'; import { LANGUAGES_CATEGORY } from './AdditionalCategoryKeys'; import CategoryDefinitionsList from './CategoryDefinitionsList'; -import { CATEGORY_OVERRIDES } from './CategoryOverrides'; +import CATEGORY_OVERRIDES from './CategoryOverrides'; export interface LanguagesProps extends AdditionalCategoryComponentProps { categories: string[]; -- 2.39.5