]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-16993 [893826] Form elements must have labels
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Fri, 7 Oct 2022 09:37:41 +0000 (11:37 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 11 Oct 2022 20:03:59 +0000 (20:03 +0000)
server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 318f96634e26e1e5b1ab32636fdb4af0cfb0722a..6f8559169b4166d9d43067e09f77e504916276a5 100644 (file)
@@ -65,24 +65,32 @@ export default class GraphsHeader extends React.PureComponent<Props> {
 
     return (
       <div className={classNames(className, 'position-relative')}>
-        <Select
-          className="pull-left input-medium"
-          isSearchable={false}
-          onChange={this.handleGraphChange}
-          options={selectOptions}
-          value={selectOptions.find(option => option.value === graph)}
-        />
-        {isCustomGraph(graph) &&
-          addCustomMetric !== undefined &&
-          removeCustomMetric !== undefined && (
-            <AddGraphMetric
-              addMetric={addCustomMetric}
-              metrics={metrics}
-              metricsTypeFilter={metricsTypeFilter}
-              removeMetric={removeCustomMetric}
-              selectedMetrics={selectedMetrics}
+        <div className="display-flex-end">
+          <div className="display-flex-column">
+            <label className="text-bold little-spacer-bottom" htmlFor="graph-select">
+              {translate('project_activity.graphs.choose_type')}
+            </label>
+            <Select
+              id="graph-select"
+              className="input-medium"
+              isSearchable={false}
+              onChange={this.handleGraphChange}
+              options={selectOptions}
+              value={selectOptions.find(option => option.value === graph)}
             />
-          )}
+          </div>
+          {isCustomGraph(graph) &&
+            addCustomMetric !== undefined &&
+            removeCustomMetric !== undefined && (
+              <AddGraphMetric
+                addMetric={addCustomMetric}
+                metrics={metrics}
+                metricsTypeFilter={metricsTypeFilter}
+                removeMetric={removeCustomMetric}
+                selectedMetrics={selectedMetrics}
+              />
+            )}
+        </div>
       </div>
     );
   }
index 225ba7538015148d505ebf0d689060b984d71233..6a4b4fd5f5adec44fb1daa796de5311cd9da55f7 100644 (file)
@@ -1534,6 +1534,7 @@ project_activity.events.tooltip.delete=Delete this event
 project_activity.new_code_period_start=New Code Period starts here
 project_activity.new_code_period_start.help=The analysis before this mark is the baseline for New Code comparison
 
+project_activity.graphs.choose_type=Choose graph type
 project_activity.graphs.new_code=New Code
 project_activity.graphs.new_code_long=New Code is indicated in yellow on the graph.
 project_activity.graphs.issues=Issues