Remove new-change-summary feature flag from gr-change-requirements
Change-Id: I77e6f174a73979b8c6e52f67953909e97964ae9e (cherry picked from commit a6c7da990e3421a72f0b697076880964d8bee8c1)
This commit is contained in:
parent
28fe0eef71
commit
182e3f146e
|
@ -34,7 +34,6 @@ import {
|
|||
} from '../../../types/common';
|
||||
import {PolymerDeepPropertyChange} from '@polymer/polymer/interfaces';
|
||||
import {appContext} from '../../../services/app-context';
|
||||
import {KnownExperimentId} from '../../../services/flags/flags';
|
||||
import {labelCompare} from '../../../utils/label-util';
|
||||
|
||||
interface ChangeRequirement extends Requirement {
|
||||
|
@ -85,11 +84,6 @@ class GrChangeRequirements extends PolymerElement {
|
|||
@property({type: Boolean})
|
||||
_showOptionalLabels = true;
|
||||
|
||||
@property({type: Boolean})
|
||||
_isNewChangeSummaryUiEnabled = appContext.flagsService.isEnabled(
|
||||
KnownExperimentId.NEW_CHANGE_SUMMARY_UI
|
||||
);
|
||||
|
||||
private readonly reporting = appContext.reportingService;
|
||||
|
||||
_computeShowWip(change: ChangeInfo) {
|
||||
|
@ -181,10 +175,6 @@ class GrChangeRequirements extends PolymerElement {
|
|||
return `${value > 0 ? '+' : ''}${value}`;
|
||||
}
|
||||
|
||||
_computeShowHideIcon(showOptionalLabels: boolean) {
|
||||
return showOptionalLabels ? 'gr-icons:expand-less' : 'gr-icons:expand-more';
|
||||
}
|
||||
|
||||
_computeSectionClass(show: boolean) {
|
||||
return show ? '' : 'hidden';
|
||||
}
|
||||
|
|
|
@ -104,9 +104,7 @@ export const htmlTemplate = html`
|
|||
padding-left: 0;
|
||||
}
|
||||
</style>
|
||||
<template is="dom-if" if="[[_isNewChangeSummaryUiEnabled]]">
|
||||
<h3 class="metadata-title">Submit requirements</h3>
|
||||
</template>
|
||||
<h3 class="metadata-title">Submit requirements</h3>
|
||||
<template is="dom-repeat" items="[[_requirements]]">
|
||||
<gr-endpoint-decorator
|
||||
class="submit-requirement-endpoints"
|
||||
|
@ -161,42 +159,24 @@ export const htmlTemplate = html`
|
|||
<section
|
||||
class$="spacer [[_computeShowOptional(_optionalLabels.*)]]"
|
||||
></section>
|
||||
<template is="dom-if" if="[[_isNewChangeSummaryUiEnabled]]">
|
||||
<section class$="showHide [[_computeShowOptional(_optionalLabels.*)]]">
|
||||
<div class="title">
|
||||
<h3 class="metadata-title">Other labels</h3>
|
||||
</div>
|
||||
<div class="value">
|
||||
<gr-button link="" class="show-all-button" on-click="_handleShowHide"
|
||||
>[[_computeShowAllLabelText(_showOptionalLabels)]]
|
||||
<iron-icon
|
||||
icon="gr-icons:expand-more"
|
||||
hidden$="[[_showOptionalLabels]]"
|
||||
></iron-icon
|
||||
><iron-icon
|
||||
icon="gr-icons:expand-less"
|
||||
hidden$="[[!_showOptionalLabels]]"
|
||||
></iron-icon>
|
||||
</gr-button>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
<template is="dom-if" if="[[!_isNewChangeSummaryUiEnabled]]">
|
||||
<section
|
||||
show-bottom-border$="[[_showOptionalLabels]]"
|
||||
on-click="_handleShowHide"
|
||||
class$="showHide [[_computeShowOptional(_optionalLabels.*)]]"
|
||||
>
|
||||
<div class="title">Other labels</div>
|
||||
<div class="value">
|
||||
<section class$="showHide [[_computeShowOptional(_optionalLabels.*)]]">
|
||||
<div class="title">
|
||||
<h3 class="metadata-title">Other labels</h3>
|
||||
</div>
|
||||
<div class="value">
|
||||
<gr-button link="" class="show-all-button" on-click="_handleShowHide"
|
||||
>[[_computeShowAllLabelText(_showOptionalLabels)]]
|
||||
<iron-icon
|
||||
id="showHide"
|
||||
icon="[[_computeShowHideIcon(_showOptionalLabels)]]"
|
||||
>
|
||||
</iron-icon>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
icon="gr-icons:expand-more"
|
||||
hidden$="[[_showOptionalLabels]]"
|
||||
></iron-icon
|
||||
><iron-icon
|
||||
icon="gr-icons:expand-less"
|
||||
hidden$="[[!_showOptionalLabels]]"
|
||||
></iron-icon>
|
||||
</gr-button>
|
||||
</div>
|
||||
</section>
|
||||
<template is="dom-repeat" items="[[_optionalLabels]]">
|
||||
<section class$="optional [[_computeSectionClass(_showOptionalLabels)]]">
|
||||
<div class="title">
|
||||
|
|
|
@ -88,7 +88,7 @@ suite('gr-change-metadata tests', () => {
|
|||
assert.ok(element.shadowRoot
|
||||
.querySelector('section.optional'));
|
||||
MockInteractions.tap(element.shadowRoot
|
||||
.querySelector('.showHide'));
|
||||
.querySelector('.show-all-button'));
|
||||
flush();
|
||||
|
||||
assert.isFalse(element._showOptionalLabels);
|
||||
|
|
Loading…
Reference in New Issue