Submit Requirements - show only important labels columns in dashboard Change-Id: I77bfeb60e370331d48458fd0a550f5997ecc338a
diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.ts b/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.ts index 66cef20..12cf314 100644 --- a/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.ts +++ b/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.ts
@@ -51,6 +51,7 @@ import {ScrollMode} from '../../../constants/constants'; import {listen} from '../../../services/shortcuts/shortcuts-service'; import {KnownExperimentId} from '../../../services/flags/flags'; +import {PRIORITY_REQUIREMENTS_ORDER} from '../../../utils/label-util'; const NUMBER_FIXED_COLUMNS = 3; const CLOSED_STATUS = ['MERGED', 'ABANDONED']; @@ -320,6 +321,13 @@ labels = labels.concat(currentLabels.filter(nonExistingLabel)); } } + if ( + this.flagsService.enabledExperiments.includes( + KnownExperimentId.SUBMIT_REQUIREMENTS_UI + ) + ) { + labels = labels.filter(l => PRIORITY_REQUIREMENTS_ORDER.includes(l)); + } return labels.sort(); }
diff --git a/polygerrit-ui/app/utils/label-util.ts b/polygerrit-ui/app/utils/label-util.ts index b95fa4d..9e9d0a3 100644 --- a/polygerrit-ui/app/utils/label-util.ts +++ b/polygerrit-ui/app/utils/label-util.ts
@@ -244,7 +244,7 @@ } // TODO(milutin): This may be temporary for demo purposes -const PRIORITY_REQUIREMENTS_ORDER: string[] = [ +export const PRIORITY_REQUIREMENTS_ORDER: string[] = [ StandardLabels.CODE_REVIEW, StandardLabels.CODE_OWNERS, StandardLabels.PRESUBMIT_VERIFIED,