]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-17228 Making title as optional for authentication use case
authorRevanshu Paliwal <revanshu.paliwal@sonarsource.com>
Mon, 29 Aug 2022 13:21:30 +0000 (15:21 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 30 Aug 2022 20:03:14 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/settings/components/CategoryDefinitionsList.tsx
server/sonar-web/src/main/js/apps/settings/components/SubCategoryDefinitionsList.tsx
server/sonar-web/src/main/js/apps/settings/components/authentication/Authentication.tsx
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 473ef4189959ecab279bf6f5449e615f26613ea2..683fd3404c048cb2132006ff68475af857078a54 100644 (file)
@@ -33,6 +33,7 @@ interface Props {
   component?: Component;
   definitions: ExtendedSettingDefinition[];
   subCategory?: string;
+  displaySubCategoryTitle?: boolean;
 }
 
 interface State {
@@ -86,7 +87,7 @@ export default class CategoryDefinitionsList extends React.PureComponent<Props,
   }
 
   render() {
-    const { category, component, subCategory } = this.props;
+    const { category, component, subCategory, displaySubCategoryTitle } = this.props;
     const { settings } = this.state;
 
     return (
@@ -95,6 +96,7 @@ export default class CategoryDefinitionsList extends React.PureComponent<Props,
         component={component}
         settings={settings}
         subCategory={subCategory}
+        displaySubCategoryTitle={displaySubCategoryTitle}
       />
     );
   }
index a133d64cc907a95f8f9361ee31bb6291b6dd6e7e..975c87a54f9033557578b1dc6a27996f047581c1 100644 (file)
@@ -33,6 +33,7 @@ export interface SubCategoryDefinitionsListProps {
   location: Location;
   settings: Array<SettingDefinitionAndValue>;
   subCategory?: string;
+  displaySubCategoryTitle?: boolean;
 }
 
 export class SubCategoryDefinitionsList extends React.PureComponent<
@@ -65,7 +66,8 @@ export class SubCategoryDefinitionsList extends React.PureComponent<
   };
 
   render() {
-    const bySubCategory = groupBy(this.props.settings, setting => setting.definition.subCategory);
+    const { displaySubCategoryTitle = true, settings, subCategory, component } = this.props;
+    const bySubCategory = groupBy(settings, setting => setting.definition.subCategory);
     const subCategories = Object.keys(bySubCategory).map(key => ({
       key,
       name: getSubCategoryName(bySubCategory[key][0].definition.category, key),
@@ -74,19 +76,21 @@ export class SubCategoryDefinitionsList extends React.PureComponent<
     const sortedSubCategories = sortBy(subCategories, subCategory =>
       subCategory.name.toLowerCase()
     );
-    const filteredSubCategories = this.props.subCategory
-      ? sortedSubCategories.filter(c => c.key === this.props.subCategory)
+    const filteredSubCategories = subCategory
+      ? sortedSubCategories.filter(c => c.key === subCategory)
       : sortedSubCategories;
     return (
       <ul className="settings-sub-categories-list">
         {filteredSubCategories.map(subCategory => (
           <li key={subCategory.key}>
-            <h2
-              className="settings-sub-category-name"
-              data-key={subCategory.key}
-              ref={this.scrollToSubCategoryOrDefinition}>
-              {subCategory.name}
-            </h2>
+            {displaySubCategoryTitle && (
+              <h2
+                className="settings-sub-category-name"
+                data-key={subCategory.key}
+                ref={this.scrollToSubCategoryOrDefinition}>
+                {subCategory.name}
+              </h2>
+            )}
             {subCategory.description != null && (
               <div
                 className="settings-sub-category-description markdown"
@@ -97,7 +101,7 @@ export class SubCategoryDefinitionsList extends React.PureComponent<
               />
             )}
             <DefinitionsList
-              component={this.props.component}
+              component={component}
               scrollToDefinition={this.scrollToSubCategoryOrDefinition}
               settings={bySubCategory[subCategory.key]}
             />
index 0aeb3c0f3412961b1a355248573a8c1416ca53d8..5b9360ed0eb5184ce167572e34f299e3ee826cda 100644 (file)
@@ -155,6 +155,7 @@ export default function Authentication(props: Props) {
                 category={AUTHENTICATION_CATEGORY}
                 definitions={definitions}
                 subCategory={currentTab}
+                displaySubCategoryTitle={false}
               />
             </div>
           </div>
index 633911af4fef27dfbcc57c6802c042888c2aa49c..2050505e6aa7135a5ae7455d756ee8507e7bf5fc 100644 (file)
@@ -1308,10 +1308,6 @@ property.category.general.qualityGate=Quality Gate
 property.category.general.subProjects=Sub-projects
 property.category.almintegration=DevOps Platform Integrations
 property.category.authentication=Authentication
-property.category.authentication.github= 
-property.category.authentication.gitlab= 
-property.category.authentication.bitbucket= 
-property.category.authentication.saml= 
 property.category.organizations=Organizations
 property.category.security=Security
 property.category.security.encryption=Encryption