]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-11571 drop ability to set warning threshold from UI
authorStas Vilchik <stas.vilchik@sonarsource.com>
Mon, 10 Dec 2018 11:01:24 +0000 (12:01 +0100)
committerSonarTech <sonartech@sonarsource.com>
Tue, 8 Jan 2019 19:21:05 +0000 (20:21 +0100)
server/sonar-web/src/main/js/app/types.d.ts
server/sonar-web/src/main/js/apps/quality-gates/components/Condition.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/ConditionModal.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx

index 7a8d8da249931eb517daa049735892a8bf67d9ec..4fb1cfccffedaf82ad70e1c6d2f88f93e2db8876 100644 (file)
@@ -182,7 +182,6 @@ declare namespace T {
     metric: string;
     op?: string;
     period?: number;
-    warning: string;
   }
 
   export interface CoveredFile {
index a1960f1507b5d8340a24d6f5d8bc0238a346aa2d..6905dfb2b882bc4165f49f7ad7430d7b09cd5b0c 100644 (file)
@@ -39,11 +39,7 @@ interface Props {
 
 interface State {
   deleteFormOpen: boolean;
-  error: string;
   modal: boolean;
-  op?: string;
-  period?: number;
-  warning: string;
 }
 
 export default class Condition extends React.PureComponent<Props, State> {
@@ -51,11 +47,7 @@ export default class Condition extends React.PureComponent<Props, State> {
     super(props);
     this.state = {
       deleteFormOpen: false,
-      error: props.condition.error || '',
-      modal: false,
-      op: props.condition.op,
-      period: props.condition.period,
-      warning: props.condition.warning || ''
+      modal: false
     };
   }
 
@@ -105,8 +97,6 @@ export default class Condition extends React.PureComponent<Props, State> {
           <ConditionOperator canEdit={false} metric={metric} op={condition.op} />
         </td>
 
-        <td className="thin text-middle nowrap">{formatMeasure(condition.warning, metric.type)}</td>
-
         <td className="thin text-middle nowrap">{formatMeasure(condition.error, metric.type)}</td>
 
         {canEdit && (
index 19a57ae35f026401dd5154494d2666d27e5729ab..686450f80d84dedda09df349f904084b4d2a1628 100644 (file)
@@ -45,7 +45,6 @@ interface State {
   metric?: T.Metric;
   op?: string;
   period: boolean;
-  warning: string;
 }
 
 export default class ConditionModal extends React.PureComponent<Props, State> {
@@ -56,7 +55,6 @@ export default class ConditionModal extends React.PureComponent<Props, State> {
     this.state = {
       error: props.condition ? props.condition.error : '',
       period: props.condition ? props.condition.period === 1 : false,
-      warning: props.condition ? props.condition.warning : '',
       metric: props.metric ? props.metric : undefined,
       op: props.condition ? props.condition.op : undefined
     };
@@ -74,7 +72,6 @@ export default class ConditionModal extends React.PureComponent<Props, State> {
     const data: T.Omit<T.Condition, 'id'> = {
       metric: metric.key,
       op: metric.type === 'RATING' ? 'GT' : this.state.op,
-      warning: this.state.warning,
       error: this.state.error
     };
 
@@ -116,17 +113,13 @@ export default class ConditionModal extends React.PureComponent<Props, State> {
     this.setState({ op });
   };
 
-  handleWarningChange = (warning: string) => {
-    this.setState({ warning });
-  };
-
   handleErrorChange = (error: string) => {
     this.setState({ error });
   };
 
   render() {
     const { header, metrics, onClose } = this.props;
-    const { period, op, warning, error, metric } = this.state;
+    const { period, op, error, metric } = this.state;
     return (
       <ConfirmModal
         confirmButtonText={header}
@@ -164,15 +157,6 @@ export default class ConditionModal extends React.PureComponent<Props, State> {
                 op={op}
               />
             </div>
-            <div className="modal-field">
-              <label>{translate('quality_gates.conditions.warning')}</label>
-              <ThresholdInput
-                metric={metric}
-                name="warning"
-                onChange={this.handleWarningChange}
-                value={warning}
-              />
-            </div>
             <div className="modal-field">
               <label>{translate('quality_gates.conditions.error')}</label>
               <ThresholdInput
index dbc30650e41f5ce4449182dba2e97dce42bb66b7..a1f169b969696a1da4d0f424bf3143167a3b8663 100644 (file)
@@ -134,7 +134,6 @@ export default class Conditions extends React.PureComponent<Props> {
                 </th>
                 <th className="thin nowrap">{translate('quality_gates.conditions.new_code')}</th>
                 <th className="thin nowrap">{translate('quality_gates.conditions.operator')}</th>
-                <th className="thin nowrap">{translate('quality_gates.conditions.warning')}</th>
                 <th className="thin nowrap">{translate('quality_gates.conditions.error')}</th>
                 {canEdit && <th />}
               </tr>