diff --git a/src/portal/lib/src/config/system/system-settings.component.scss b/src/portal/lib/src/config/system/system-settings.component.scss index 18a577cc38a52dd6641ffc5db473a28c368b752b..5b708737f901d2587742409b517320d7cc253c37 100644 --- a/src/portal/lib/src/config/system/system-settings.component.scss +++ b/src/portal/lib/src/config/system/system-settings.component.scss @@ -27,8 +27,6 @@ width: 222px; color: #0079bb; overflow-y: auto; - white-space: nowrap; - li { height: 24px; line-height: 24px; diff --git a/src/portal/lib/src/project-policy-config/project-policy-config.component.html b/src/portal/lib/src/project-policy-config/project-policy-config.component.html index 31912edc3e6e206b85d9e942704168e83582b9ad..01df1bbba39995a419b56d201983fc5aa767466a 100644 --- a/src/portal/lib/src/project-policy-config/project-policy-config.component.html +++ b/src/portal/lib/src/project-policy-config/project-policy-config.component.html @@ -89,12 +89,12 @@ </div> <clr-radio-container clrInline> <clr-radio-wrapper> - <input type="radio" clrRadio name="systemWhitelistOrProjectWhitelist" required value="true" + <input [disabled]="!hasChangeConfigRole" type="radio" clrRadio name="systemWhitelistOrProjectWhitelist" required value="true" [(ngModel)]="systemWhitelistOrProjectWhitelist"/> <label>{{'CVE_WHITELIST.SYS_WHITELIST'|translate}}</label> </clr-radio-wrapper> <clr-radio-wrapper> - <input type="radio" clrRadio name="systemWhitelistOrProjectWhitelist" required value="false" + <input [disabled]="!hasChangeConfigRole" type="radio" clrRadio name="systemWhitelistOrProjectWhitelist" required value="false" [(ngModel)]="systemWhitelistOrProjectWhitelist"/> <label>{{'CVE_WHITELIST.PRO_WHITELIST'|translate}}</label> </clr-radio-wrapper> @@ -102,10 +102,10 @@ <div class="clr-row width-70per"> <div class="clr-col position-relative"> <div> - <button [disabled]="isUseSystemWhitelist()" + <button [disabled]="isUseSystemWhitelist() || !hasChangeConfigRole" (click)="showAddModal=!showAddModal" class="btn btn-link">{{'CVE_WHITELIST.ADD'|translate}}</button> - <button [disabled]="isUseSystemWhitelist()" (click)="addSystem()" + <button [disabled]="isUseSystemWhitelist() || !hasChangeConfigRole" (click)="addSystem()" class="btn btn-link ml-1">{{'CVE_WHITELIST.ADD_SYSTEM'|translate}}</button> </div> <div class="add-modal" *ngIf="showAddModal && !isUseSystemWhitelist()"> @@ -144,17 +144,17 @@ <label for="expires">{{'CVE_WHITELIST.EXPIRES_AT'|translate}}</label> <div class="underline"> <input #dateSystemInput readonly type="date" [(clrDate)]="systemExpiresDate"> - <input *ngIf="!isUseSystemWhitelist()" #dateInput + <input [disabled]="!hasChangeConfigRole" *ngIf="!isUseSystemWhitelist()" #dateInput placeholder="{{'CVE_WHITELIST.NEVER_EXPIRES'|translate}}" readonly type="date" [(clrDate)]="expiresDate" newFormLayout="true"> - <input *ngIf="isUseSystemWhitelist()" + <input [disabled]="!hasChangeConfigRole" *ngIf="isUseSystemWhitelist()" placeholder="{{'CVE_WHITELIST.NEVER_EXPIRES'|translate}}" readonly type="text" value="{{systemExpiresDateString}}"> </div> </div> <div class="form-group padding-left-80"> <clr-checkbox-wrapper> - <input [disabled]="isUseSystemWhitelist()" [checked]="neverExpires" + <input [disabled]="isUseSystemWhitelist() || !hasChangeConfigRole" [checked]="neverExpires" [(ngModel)]="neverExpires" type="checkbox" clrCheckbox name="neverExpires" id="neverExpires"/> <label> @@ -168,10 +168,10 @@ </div> </div> <button type="button" class="btn btn-primary" (click)="save()" - [disabled]="(!isValid() || !hasChanges() || !hasChangeConfigRole) && !hasWhitelistChanged">{{'BUTTON.SAVE' + [disabled]="((!isValid() || !hasChanges()) && !hasWhitelistChanged) || !hasChangeConfigRole">{{'BUTTON.SAVE' | translate}}</button> <button type="button" class="btn btn-outline" (click)="cancel()" - [disabled]="(!isValid() || !hasChanges() || !hasChangeConfigRole) && !hasWhitelistChanged">{{'BUTTON.CANCEL' + [disabled]="((!isValid() || !hasChanges()) && !hasWhitelistChanged) || !hasChangeConfigRole">{{'BUTTON.CANCEL' | translate}}</button> <confirmation-dialog #cfgConfirmationDialog (confirmAction)="confirmCancel($event)"></confirmation-dialog> </section> diff --git a/src/portal/lib/src/project-policy-config/project-policy-config.component.scss b/src/portal/lib/src/project-policy-config/project-policy-config.component.scss index 4b7cab6414da79f69e0d331d9bfe3288826befcc..05d4bc5d172587dd8dde6394e1e7194d4ea42a66 100644 --- a/src/portal/lib/src/project-policy-config/project-policy-config.component.scss +++ b/src/portal/lib/src/project-policy-config/project-policy-config.component.scss @@ -17,8 +17,6 @@ width: 222px; color: #0079bb; overflow-y: auto; - white-space: nowrap; - li { height: 24px; line-height: 24px; diff --git a/src/portal/lib/src/project-policy-config/project-policy-config.component.ts b/src/portal/lib/src/project-policy-config/project-policy-config.component.ts index 58a68227e44e3f49879ddbb37173ed1c4e7f57d0..a6ab59495a2eb56f9000c8dbd996b3ad5d24bf7f 100644 --- a/src/portal/lib/src/project-policy-config/project-policy-config.component.ts +++ b/src/portal/lib/src/project-policy-config/project-policy-config.component.ts @@ -170,6 +170,9 @@ export class ProjectPolicyConfigComponent implements OnInit { if (!response.cve_whitelist['expires_at']) { response.cve_whitelist['expires_at'] = null; } + if (!response.metadata.reuse_sys_cve_whitelist) { + response.metadata.reuse_sys_cve_whitelist = "true"; + } if (response && response.cve_whitelist) { this.projectWhitelist = clone(response.cve_whitelist); this.projectWhitelistOrigin = clone(response.cve_whitelist);