diff --git a/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.html b/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.html index 9f55b5c0a..d32ce3417 100644 --- a/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.html +++ b/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.html @@ -4,27 +4,32 @@ + name="public" [disabled]="!hasChangeConfigRole" /> {{ 'PROJECT_CONFIG.PUBLIC_POLICY' | translate }} - - - - - + + + + + + + + + {{ 'PROJECT_CONFIG.CONTENT_TRUST_POLCIY' | translate }} - + + name="prevent-vulenrability-image-input" [disabled]="!hasChangeConfigRole" /> @@ -34,8 +39,8 @@
{{ 'PROJECT_CONFIG.PREVENT_VULNERABLE_1' | translate }}
@@ -50,14 +55,14 @@ + [disabled]="!hasChangeConfigRole" name="scan-image-on-push" /> {{ 'PROJECT_CONFIG.AUTOSCAN_POLICY' | translate }}
- +
@@ -71,22 +76,22 @@
{{'CVE_ALLOWLIST.WARNING_SYS'|translate}} + class="label label-warning">{{'CVE_ALLOWLIST.WARNING_SYS'|translate}} {{'CVE_ALLOWLIST.WARNING_PRO'|translate}} + class="label label-warning">{{'CVE_ALLOWLIST.WARNING_PRO'|translate}}
+ name="systemAllowlistOrProjectAllowlist" required value="true" + [(ngModel)]="systemAllowlistOrProjectAllowlist" /> + name="systemAllowlistOrProjectAllowlist" required value="false" + [(ngModel)]="systemAllowlistOrProjectAllowlist" /> @@ -94,27 +99,27 @@
+ (click)="showAddModal=!showAddModal" + class="btn btn-link">{{'CVE_ALLOWLIST.ADD'|translate}} + (click)="addSystem()" + class="btn btn-link ml-1">{{'CVE_ALLOWLIST.ADD_SYSTEM'|translate}}
+ shape="window-close">
+ name="cveIds"> {{'CVE_ALLOWLIST.HELP'|translate}}
+ (click)="addToProjectAllowlist()" + class="btn btn-link">{{'CVE_ALLOWLIST.ADD'|translate}}
    @@ -137,24 +142,23 @@
- +
+ placeholder="{{'CVE_ALLOWLIST.NEVER_EXPIRES'|translate}}" readonly type="date" + [(clrDate)]="expiresDate" newFormLayout="true"> + placeholder="{{'CVE_ALLOWLIST.NEVER_EXPIRES'|translate}}" readonly type="text" + value="{{systemExpiresDateString}}">
- + + [checked]="neverExpires" [(ngModel)]="neverExpires" type="checkbox" clrCheckbox + name="neverExpires" id="neverExpires" /> @@ -165,10 +169,10 @@
diff --git a/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.ts b/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.ts index 2831c4dd9..85ef4db51 100644 --- a/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.ts +++ b/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.ts @@ -23,6 +23,7 @@ const TARGET_BLANK = "_blank"; export class ProjectPolicy { Public: boolean; ContentTrust: boolean; + ContentTrustCosign: boolean; PreventVulImg: boolean; PreventVulImgSeverity: string; ScanImgOnPush: boolean; @@ -30,6 +31,7 @@ export class ProjectPolicy { constructor() { this.Public = false; this.ContentTrust = false; + this.ContentTrustCosign = false; this.PreventVulImg = false; this.PreventVulImgSeverity = LOW; this.ScanImgOnPush = false; @@ -38,6 +40,7 @@ export class ProjectPolicy { initByProject(pro: Project) { this.Public = pro.metadata.public === 'true'; this.ContentTrust = pro.metadata.enable_content_trust === 'true'; + this.ContentTrustCosign = pro.metadata.enable_content_trust_cosign === 'true'; this.PreventVulImg = pro.metadata.prevent_vul === 'true'; if (pro.metadata.severity) { this.PreventVulImgSeverity = pro.metadata.severity; diff --git a/src/portal/src/app/base/project/project-config/project-policy-config/project.ts b/src/portal/src/app/base/project/project-config/project-policy-config/project.ts index 8499d2ba8..0eb5d6779 100644 --- a/src/portal/src/app/base/project/project-config/project-policy-config/project.ts +++ b/src/portal/src/app/base/project/project-config/project-policy-config/project.ts @@ -15,6 +15,7 @@ export class Project { metadata?: { public: string | boolean; enable_content_trust: string | boolean; + enable_content_trust_cosign?: string | boolean; prevent_vul: string | boolean; severity: string; auto_scan: string | boolean; @@ -24,6 +25,7 @@ export class Project { constructor () { this.metadata.public = false; this.metadata.enable_content_trust = false; + this.metadata.enable_content_trust_cosign = false; this.metadata.prevent_vul = false; this.metadata.severity = 'low'; this.metadata.auto_scan = false; diff --git a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html index e7459f489..35ac7a564 100644 --- a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html +++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html @@ -157,7 +157,7 @@ {{'REPOSITORY.PULL_COMMAND' | translate}} {{'REPOSITORY.PLATFORM' | translate}} - {{'REPOSITORY.TAGS' | translate}} + {{'REPOSITORY.TAGS' | translate}} {{'ACCESSORY.CO_SIGNED' | translate}} {{'REPOSITORY.SIZE' | translate}} {{'REPOSITORY.VULNERABILITY' | translate}} @@ -166,7 +166,7 @@ {{'REPOSITORY.PUSH_TIME' | translate}} {{'REPOSITORY.PULL_TIME' | translate}} {{'ARTIFACT.PLACEHOLDER' | translate }} - +
@@ -203,10 +203,8 @@
- {{artifact?.tags[0]?.name}} - ... - ({{artifact?.tagNumber}}) + {{tagsString(artifact?.tags)}} + ({{artifact?.tagNumber}})
diff --git a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.scss b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.scss index 02e7e3698..fa31ba0b7 100644 --- a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.scss +++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.scss @@ -422,7 +422,7 @@ clr-datagrid { width: 6rem !important; } .co-signed-column { - width: 6rem !important; + width: 7rem !important; } .vul-column { width: 11rem !important; @@ -430,6 +430,9 @@ clr-datagrid { .annotations-column { width: 5rem !important; } +.tag-column { + width: 7rem !important; +} .signed { color: #00d40f; } diff --git a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts index 971181f0a..384c02211 100644 --- a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts +++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts @@ -16,7 +16,6 @@ import { forkJoin, Observable, of, Subject, Subscription } from "rxjs"; import { catchError, debounceTime, distinctUntilChanged, finalize, map } from 'rxjs/operators'; import { TranslateService } from "@ngx-translate/core"; import { ClrDatagridComparatorInterface, ClrDatagridStateInterface, ClrLoadingState } from "@clr/angular"; - import { ActivatedRoute, Router } from "@angular/router"; import { Comparator, } from "../../../../../../../shared/services"; import { @@ -62,6 +61,7 @@ import { AppConfigService } from "src/app/services/app-config.service"; import { ArtifactListPageService } from "../../artifact-list-page.service"; import { ACCESSORY_PAGE_SIZE } from "./sub-accessories/sub-accessories.component"; import { Accessory } from "ng-swagger-gen/models/accessory"; +import { Tag } from '../../../../../../../../../ng-swagger-gen/models/tag'; export interface LabelState { iconsShow: boolean; @@ -176,8 +176,6 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy { onScanArtifactsLength: number = 0; stopBtnState: ClrLoadingState = ClrLoadingState.DEFAULT; updateArtifactSub: Subscription; - @ViewChild('tagName') nameSpan: ElementRef; - constructor( private errorHandlerService: ErrorHandler, private artifactService: ArtifactService, @@ -1200,11 +1198,15 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy { }); } } - isOverflow(): boolean { - if (!this.nameSpan) { - return false; + tagsString(tags: Tag[]): string { + if (tags?.length) { + const arr: string[] = []; + tags.forEach(item => { + arr.push(item.name); + }); + return arr.join(', '); } - return !(this.nameSpan?.nativeElement?.clientWidth >= this.nameSpan?.nativeElement?.scrollWidth); + return null; } deleteAccessory(a: Accessory) { let titleKey: string, summaryKey: string, content: string, buttons: ConfirmationButtons; diff --git a/src/portal/src/app/shared/services/project.service.ts b/src/portal/src/app/shared/services/project.service.ts index b0256ed85..8a229ec22 100644 --- a/src/portal/src/app/shared/services/project.service.ts +++ b/src/portal/src/app/shared/services/project.service.ts @@ -115,6 +115,7 @@ export class ProjectDefaultService extends ProjectService { metadata: { public: projectPolicy.Public ? "true" : "false", enable_content_trust: projectPolicy.ContentTrust ? "true" : "false", + enable_content_trust_cosign: projectPolicy.ContentTrustCosign ? "true" : "false", prevent_vul: projectPolicy.PreventVulImg ? "true" : "false", severity: projectPolicy.PreventVulImgSeverity, auto_scan: projectPolicy.ScanImgOnPush ? "true" : "false", diff --git a/src/portal/src/i18n/lang/de-de-lang.json b/src/portal/src/i18n/lang/de-de-lang.json index f61d46fd2..e6b55a5b9 100644 --- a/src/portal/src/i18n/lang/de-de-lang.json +++ b/src/portal/src/i18n/lang/de-de-lang.json @@ -1713,12 +1713,12 @@ "DELETE_ACCESSORY": "Delete Accessory", "DELETED_SUCCESS": "Accessory deleted successfully", "DELETED_FAILED": "Deleting accessory failed", - "CO_SIGNED": "Co-signed", - "NOTARY_SIGNED": "Notary signed", + "CO_SIGNED": "Signed by Cosign", + "NOTARY_SIGNED": "Signed by Notary", "ACCESSORY": "Accessory", "ACCESSORIES": "Accessories", "SUBJECT_ARTIFACT": "Subject Artifact", - "CO_SIGN": "Co-sign", + "CO_SIGN": "Cosign", "NOTARY": "Notary", "PLACEHOLDER": "We couldn't find any accessories!" } diff --git a/src/portal/src/i18n/lang/en-us-lang.json b/src/portal/src/i18n/lang/en-us-lang.json index 9ccfcb488..beba71ec8 100644 --- a/src/portal/src/i18n/lang/en-us-lang.json +++ b/src/portal/src/i18n/lang/en-us-lang.json @@ -1713,12 +1713,12 @@ "DELETE_ACCESSORY": "Delete Accessory", "DELETED_SUCCESS": "Accessory deleted successfully", "DELETED_FAILED": "Deleting accessory failed", - "CO_SIGNED": "Co-signed", - "NOTARY_SIGNED": "Notary signed", + "CO_SIGNED": "Signed by Cosign", + "NOTARY_SIGNED": "Signed by Notary", "ACCESSORY": "Accessory", "ACCESSORIES": "Accessories", "SUBJECT_ARTIFACT": "Subject Artifact", - "CO_SIGN": "Co-sign", + "CO_SIGN": "Cosign", "NOTARY": "Notary", "PLACEHOLDER": "We couldn't find any accessories!" } diff --git a/src/portal/src/i18n/lang/es-es-lang.json b/src/portal/src/i18n/lang/es-es-lang.json index 028341de6..db864dd31 100644 --- a/src/portal/src/i18n/lang/es-es-lang.json +++ b/src/portal/src/i18n/lang/es-es-lang.json @@ -1712,12 +1712,12 @@ "DELETE_ACCESSORY": "Delete Accessory", "DELETED_SUCCESS": "Accessory deleted successfully", "DELETED_FAILED": "Deleting accessory failed", - "CO_SIGNED": "Co-signed", - "NOTARY_SIGNED": "Notary signed", + "CO_SIGNED": "Signed by Cosign", + "NOTARY_SIGNED": "Signed by Notary", "ACCESSORY": "Accessory", "ACCESSORIES": "Accessories", "SUBJECT_ARTIFACT": "Subject Artifact", - "CO_SIGN": "Co-sign", + "CO_SIGN": "Cosign", "NOTARY": "Notary", "PLACEHOLDER": "We couldn't find any accessories!" } diff --git a/src/portal/src/i18n/lang/fr-fr-lang.json b/src/portal/src/i18n/lang/fr-fr-lang.json index 9969a5398..040e7df3a 100644 --- a/src/portal/src/i18n/lang/fr-fr-lang.json +++ b/src/portal/src/i18n/lang/fr-fr-lang.json @@ -1681,12 +1681,12 @@ "DELETE_ACCESSORY": "Delete Accessory", "DELETED_SUCCESS": "Accessory deleted successfully", "DELETED_FAILED": "Deleting accessory failed", - "CO_SIGNED": "Co-signed", - "NOTARY_SIGNED": "Notary signed", + "CO_SIGNED": "Signed by Cosign", + "NOTARY_SIGNED": "Signed by Notary", "ACCESSORY": "Accessory", "ACCESSORIES": "Accessories", "SUBJECT_ARTIFACT": "Subject Artifact", - "CO_SIGN": "Co-sign", + "CO_SIGN": "Cosign", "NOTARY": "Notary", "PLACEHOLDER": "We couldn't find any accessories!" } diff --git a/src/portal/src/i18n/lang/pt-br-lang.json b/src/portal/src/i18n/lang/pt-br-lang.json index 873f17bd0..3a40c1db1 100644 --- a/src/portal/src/i18n/lang/pt-br-lang.json +++ b/src/portal/src/i18n/lang/pt-br-lang.json @@ -1709,12 +1709,12 @@ "DELETE_ACCESSORY": "Delete Accessory", "DELETED_SUCCESS": "Accessory deleted successfully", "DELETED_FAILED": "Deleting accessory failed", - "CO_SIGNED": "Co-signed", - "NOTARY_SIGNED": "Notary signed", + "CO_SIGNED": "Signed by Cosign", + "NOTARY_SIGNED": "Signed by Notary", "ACCESSORY": "Accessory", "ACCESSORIES": "Accessories", "SUBJECT_ARTIFACT": "Subject Artifact", - "CO_SIGN": "Co-sign", + "CO_SIGN": "Cosign", "NOTARY": "Notary", "PLACEHOLDER": "We couldn't find any accessories!" } diff --git a/src/portal/src/i18n/lang/tr-tr-lang.json b/src/portal/src/i18n/lang/tr-tr-lang.json index 89e3e9d47..60c2defec 100644 --- a/src/portal/src/i18n/lang/tr-tr-lang.json +++ b/src/portal/src/i18n/lang/tr-tr-lang.json @@ -1713,12 +1713,12 @@ "DELETE_ACCESSORY": "Delete Accessory", "DELETED_SUCCESS": "Accessory deleted successfully", "DELETED_FAILED": "Deleting accessory failed", - "CO_SIGNED": "Co-signed", - "NOTARY_SIGNED": "Notary signed", + "CO_SIGNED": "Signed by Cosign", + "NOTARY_SIGNED": "Signed by Notary", "ACCESSORY": "Accessory", "ACCESSORIES": "Accessories", "SUBJECT_ARTIFACT": "Subject Artifact", - "CO_SIGN": "Co-sign", + "CO_SIGN": "Cosign", "NOTARY": "Notary", "PLACEHOLDER": "We couldn't find any accessories!" } diff --git a/src/portal/src/i18n/lang/zh-cn-lang.json b/src/portal/src/i18n/lang/zh-cn-lang.json index e6b6e2495..436e3cf6e 100644 --- a/src/portal/src/i18n/lang/zh-cn-lang.json +++ b/src/portal/src/i18n/lang/zh-cn-lang.json @@ -1711,12 +1711,12 @@ "DELETE_ACCESSORY": "删除附件", "DELETED_SUCCESS": "删除附件成功", "DELETED_FAILED": "删除附件失败", - "CO_SIGNED": "Co-sign 签名", + "CO_SIGNED": "Cosign 签名", "NOTARY_SIGNED": "Notary 签名", "ACCESSORY": "附件", "ACCESSORIES": "附件", "SUBJECT_ARTIFACT": "主体 Artifact", - "CO_SIGN": "Co-sign", + "CO_SIGN": "Cosign", "NOTARY": "Notary", "PLACEHOLDER": "未发现任何附件!" } diff --git a/src/portal/src/i18n/lang/zh-tw-lang.json b/src/portal/src/i18n/lang/zh-tw-lang.json index 387326880..f063f52c9 100644 --- a/src/portal/src/i18n/lang/zh-tw-lang.json +++ b/src/portal/src/i18n/lang/zh-tw-lang.json @@ -1698,12 +1698,12 @@ "DELETE_ACCESSORY": "Delete Accessory", "DELETED_SUCCESS": "Accessory deleted successfully", "DELETED_FAILED": "Deleting accessory failed", - "CO_SIGNED": "Co-signed", - "NOTARY_SIGNED": "Notary signed", + "CO_SIGNED": "Signed by Cosign", + "NOTARY_SIGNED": "Signed by Notary", "ACCESSORY": "Accessory", "ACCESSORIES": "Accessories", "SUBJECT_ARTIFACT": "Subject Artifact", - "CO_SIGN": "Co-sign", + "CO_SIGN": "Cosign", "NOTARY": "Notary", "PLACEHOLDER": "We couldn't find any accessories!" }