From e5a757d78dd8e47779f01924f002efa948487ae5 Mon Sep 17 00:00:00 2001 From: pfh Date: Mon, 2 Apr 2018 14:45:52 +0800 Subject: [PATCH] Modify label filter issue and add stick label to image case --- .../create-edit-label.component.ts | 3 +- .../create-edit-rule.component.ts | 6 +- .../src/label-piece/label-piece.component.ts | 1 + .../src/label-piece/label-piece.template.ts | 11 ++- src/ui_ng/lib/src/tag/tag.component.html.ts | 16 ++-- src/ui_ng/lib/src/tag/tag.component.ts | 23 ++--- src/ui_ng/package.json | 2 +- src/ui_ng/src/i18n/lang/en-us-lang.json | 2 +- src/ui_ng/src/i18n/lang/es-es-lang.json | 2 +- src/ui_ng/src/i18n/lang/fr-fr-lang.json | 4 + src/ui_ng/src/styles.css | 17 ++++ tests/resources/Harbor-Pages/Project.robot | 10 ++- .../robot-cases/Group11-Nightly/Nightly.robot | 86 ++++++++++++++----- 13 files changed, 133 insertions(+), 50 deletions(-) diff --git a/src/ui_ng/lib/src/create-edit-label/create-edit-label.component.ts b/src/ui_ng/lib/src/create-edit-label/create-edit-label.component.ts index 1c35656a4..a326f216b 100644 --- a/src/ui_ng/lib/src/create-edit-label/create-edit-label.component.ts +++ b/src/ui_ng/lib/src/create-edit-label/create-edit-label.component.ts @@ -68,7 +68,8 @@ export class CreateEditLabelComponent implements OnInit, OnDestroy { ngOnInit(): void { this.nameChecker.debounceTime(500).subscribe((name: string) => { this.checkOnGoing = true; - toPromise(this.labelService.getLabels(this.scope, this.projectId, name)) + let labelName = this.currentForm.controls['name'].value; + toPromise(this.labelService.getLabels(this.scope, this.projectId, labelName)) .then(targets => { if (targets && targets.length) { this.isLabelNameExist = true; diff --git a/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.ts b/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.ts index f15a8a810..827bf5a4b 100644 --- a/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.ts +++ b/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.ts @@ -157,7 +157,7 @@ export class CreateEditRuleComponent implements OnInit, OnDestroy { // if input value exit in project list let pro = res.find((data: any) => data.name === name); if (!pro) { - this.noProjectInfo = 'REPLICATION.PROJECT_NOT_EXIST_INFO'; + this.noProjectInfo = 'REPLICATION.NO_PROJECT_INFO'; this.noSelectedProject = true; } else { this.noProjectInfo = ''; @@ -165,12 +165,12 @@ export class CreateEditRuleComponent implements OnInit, OnDestroy { this.setProject([pro]) } } else { - this.noProjectInfo = 'REPLICATION.PROJECT_NOT_EXIST_INFO'; + this.noProjectInfo = 'REPLICATION.NO_PROJECT_INFO'; this.noSelectedProject = true; } }).catch((error: any) => { this.errorHandler.error(error); - this.noProjectInfo = 'REPLICATION.PROJECT_NOT_EXIST_INFO'; + this.noProjectInfo = 'REPLICATION.NO_PROJECT_INFO'; this.noSelectedProject = true; }); }); diff --git a/src/ui_ng/lib/src/label-piece/label-piece.component.ts b/src/ui_ng/lib/src/label-piece/label-piece.component.ts index 222c035f2..4c82b00cc 100644 --- a/src/ui_ng/lib/src/label-piece/label-piece.component.ts +++ b/src/ui_ng/lib/src/label-piece/label-piece.component.ts @@ -30,6 +30,7 @@ import {Label} from "../service/interface"; export class LabelPieceComponent implements OnInit { @Input() label: Label; + @Input() labelWidth: number; ngOnInit(): void { } diff --git a/src/ui_ng/lib/src/label-piece/label-piece.template.ts b/src/ui_ng/lib/src/label-piece/label-piece.template.ts index 9fd26a292..573625e83 100644 --- a/src/ui_ng/lib/src/label-piece/label-piece.template.ts +++ b/src/ui_ng/lib/src/label-piece/label-piece.template.ts @@ -3,7 +3,7 @@ */ export const LABEL_PIEICE_TEMPLATE: string = ` -