Skip to content

Commit

Permalink
Modify global search project and adjust selected label position
Browse files Browse the repository at this point in the history
  • Loading branch information
pengpengshui committed May 4, 2018
1 parent e6a52f4 commit 5006693
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const CREATE_EDIT_LABEL_STYLE: string = `
width: 26px;
height:22px;
min-width: 26px;}
.dropdown-item{margin: 5px 4px; width:30px;height:24px; text-align: center;line-height: 24px;font-size:12px;}
.colorPanel span{margin: 5px 4px; width:30px;height:24px; text-align: center;line-height: 24px;font-size:12px; border:1px solid #A1A1A1;}
.closePanel{ display: block;
left: 138px;
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const CREATE_EDIT_LABEL_TEMPLATE: string = `
</button>
<div class="colorPanel" [hidden]="panelHidden">
<a class="closePanel" (click)="closeColorPanel()">&times;</a>
<label type="button" class="dropdown-item" (click)="labelModel.color=i.color" *ngFor="let i of labelColor" [ngStyle]="{'background-color': i.color, 'color': i.textColor }">Aa</label>
<span type="button" (click)="labelModel.color=i.color" *ngFor="let i of labelColor" [ngStyle]="{'background-color': i.color, 'color': i.textColor }">Aa</span>
</div>
<input type="text" id="color" size="8" name="color" disabled [(ngModel)]="labelModel.color" #color="ngModel">
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/ui_ng/lib/src/label-piece/label-piece.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

export const LABEL_PIEICE_TEMPLATE: string = `
<label class="label" [ngStyle]="{'background-color': labelColor?.color, 'color': labelColor?.textColor, 'border': labelColor?.color == '#FFFFFF'? '1px solid #666': 'none'}" [style.max-width.px]="labelWidth">
<label class="label" [ngStyle]="{'background-color': labelColor?.color, 'color': labelColor?.textColor, 'border': labelColor?.color == '#FFFFFF'? '1px solid #A1A1A1': 'none'}" [style.max-width.px]="labelWidth">
<clr-icon *ngIf="label.scope=='p'" shape="organization"></clr-icon>
<clr-icon *ngIf="label.scope=='g'" shape="administrator"></clr-icon>
{{label.name}}
Expand Down
7 changes: 6 additions & 1 deletion src/ui_ng/lib/src/tag/tag.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,12 @@ export class TagComponent implements OnInit, AfterViewInit {

// set the selected label in front
this.imageStickLabels.splice(this.imageStickLabels.indexOf(labelInfo), 1);
this.imageStickLabels.unshift(labelInfo);
this.imageStickLabels.some((data, i) => {
if (!data.iconsShow) {
this.imageStickLabels.splice(i, 0, labelInfo);
return true;
}
});

labelInfo.iconsShow = true;
this.inprogress = false;
Expand Down
2 changes: 1 addition & 1 deletion src/ui_ng/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"clarity-icons": "^0.10.27",
"clarity-ui": "^0.10.27",
"core-js": "^2.4.1",
"harbor-ui": "0.7.13",
"harbor-ui": "0.7.15",
"intl": "^1.2.5",
"mutationobserver-shim": "^0.3.2",
"ngx-cookie": "^1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<clr-dg-column>{{'PROJECT.CREATION_TIME' | translate}}</clr-dg-column>
<clr-dg-row *clrDgItems="let p of projects" [clrDgItem]="p">
<clr-dg-cell><a href="javascript:void(0)" (click)="goToLink(p.project_id)">{{p.name}}</a></clr-dg-cell>
<clr-dg-cell>{{ (p.public === 1 ? 'PROJECT.PUBLIC' : 'PROJECT.PRIVATE') | translate}}</clr-dg-cell>
<clr-dg-cell>{{ (p.metadata.public === 'true' ? 'PROJECT.PUBLIC' : 'PROJECT.PRIVATE') | translate}}</clr-dg-cell>
<clr-dg-cell>{{p.repo_count}}</clr-dg-cell>
<clr-dg-cell>{{p.creation_time | date: 'short'}}</clr-dg-cell>
</clr-dg-row>
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/Harbor-Pages/Configuration.robot
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Create New Labels
Sleep 1
Click Element xpath=//hbr-create-edit-label//div[@class='colorDrop']//clr-icon
Sleep 1
Click Element xpath=//hbr-create-edit-label//div[@class='colorDrop']//div[@class='colorPanel']//label[1]
Click Element xpath=//hbr-create-edit-label//div[@class='colorDrop']//div[@class='colorPanel']//span[1]
Sleep 1
Click Element //hbr-create-edit-label//div[@class='colorDrop']//div[@class='colorPanel']/a[@class='closePanel']
Sleep 1
Expand Down

0 comments on commit 5006693

Please sign in to comment.