Modify repository filter's position and inline alert text position

Modify issues about pagination and signed display

Modify test case about member
This commit is contained in:
pfh 2018-01-08 17:02:48 +08:00
parent 93c524f5df
commit 49160e6b13
28 changed files with 58 additions and 32 deletions

View File

@ -25,7 +25,7 @@ export const ENDPOINT_TEMPLATE: string = `
<clr-dg-column [clrDgField]="'insecure'">{{'CONFIG.VERIFY_REMOTE_CERT' | translate }}</clr-dg-column>
<clr-dg-column [clrDgSortBy]="creationTimeComparator">{{'DESTINATION.CREATION_TIME' | translate}}</clr-dg-column>
<clr-dg-placeholder>{{'DESTINATION.PLACEHOLDER' | translate }}</clr-dg-placeholder>
<clr-dg-row *clrDgItems="let t of targets" [clrDgItem]='t'>
<clr-dg-row *ngFor="let t of targets" [clrDgItem]='t'>
<clr-dg-cell>{{t.name}}</clr-dg-cell>
<clr-dg-cell>{{t.endpoint}}</clr-dg-cell>
<clr-dg-cell>

View File

@ -102,6 +102,7 @@ export class EndpointComponent implements OnInit, OnDestroy {
retrieve(): void {
this.loading = true;
this.selectedRow = [];
toPromise<Endpoint[]>(this.endpointService
.getEndpoints(this.targetName))
.then(

View File

@ -7,4 +7,11 @@ export const INLINE_ALERT_STYLE: string = `
padding: 0px !important;
min-width: 30px !important;
}
.alert-item {
display: inline-block;
text-align: center;
}
:host >>> .alert-icon-wrapper{
display: inline;
}
`;

View File

@ -1,7 +1,7 @@
export const LIST_REPLICATION_RULE_TEMPLATE: string = `
<div>
<div style="padding-bottom: 15px;">
<clr-datagrid [clrDgLoading]="loading" [(clrDgSingleSelected)]="selectedRow" (clrDgSingleSelectedChange)="selectedChange()">
<clr-dg-action-bar>
<clr-dg-action-bar style="height:24px;">
<div class="btn-group" *ngIf="opereateAvailable">
<button type="button" class="btn btn-sm btn-secondary" (click)="openModal()">{{'REPLICATION.NEW_REPLICATION_RULE' | translate}}</button>
<button type="button" class="btn btn-sm btn-secondary" [disabled]="!selectedRow" (click)="editRule(selectedRow)">{{'REPLICATION.EDIT_POLICY' | translate}}</button>

View File

@ -13,7 +13,6 @@ export const REPLICATION_TEMPLATE: string = `
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<hbr-list-replication-rule #listReplicationRule [readonly]="readonly" [projectId]="projectId" (replicateManual)=replicateManualRule($event) (selectOne)="selectOneRule($event)" (openNewRule)="openModal()" (editOne)="openEditRule($event)" (reload)="reloadRules($event)" [loading]="loading" [withReplicationJob]="withReplicationJob" (redirect)="customRedirect($event)"></hbr-list-replication-rule>
</div>
<br> <br>
<div *ngIf="withReplicationJob" class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="row flex-items-xs-between" style="height:60px;">
<h5 class="flex-items-xs-bottom option-left-down" style="margin-left: 14px;">{{'REPLICATION.REPLICATION_JOBS' | translate}}</h5>

View File

@ -21,7 +21,7 @@ export const REPOSITORY_LISTVIEW_TEMPLATE = `
<clr-dg-column [clrDgSortBy]="tagsCountComparator">{{'REPOSITORY.TAGS_COUNT' | translate}}</clr-dg-column>
<clr-dg-column [clrDgSortBy]="pullCountComparator">{{'REPOSITORY.PULL_COUNT' | translate}}</clr-dg-column>
<clr-dg-placeholder>{{'REPOSITORY.PLACEHOLDER' | translate }}</clr-dg-placeholder>
<clr-dg-row *clrDgItems="let r of repositories" [clrDgItem]="r">
<clr-dg-row *ngFor="let r of repositories" [clrDgItem]="r">
<clr-dg-cell><a href="javascript:void(0)" (click)="gotoLink(projectId || r.project_id, r.name || r.repository_name)">{{r.name}}</a></clr-dg-cell>
<clr-dg-cell>{{r.tags_count}}</clr-dg-cell>
<clr-dg-cell>{{r.pull_count}}</clr-dg-cell>

View File

@ -283,6 +283,7 @@ export class RepositoryListviewComponent implements OnChanges, OnInit {
}
clrLoad(state: State): void {
this.selectedRow = [];
//Keep it for future filtering and sorting
this.currentState = state;

View File

@ -51,13 +51,12 @@ export class RepositoryComponent implements OnInit {
@Input() repoName: string;
@Input() hasSignedIn: boolean;
@Input() hasProjectAdminRole: boolean;
@Input() withNotary: boolean;
@Input() withClair: boolean;
@Output() tagClickEvent = new EventEmitter<TagClickEvent>();
@Output() backEvt: EventEmitter<any> = new EventEmitter<any>();
onGoing = false;
withNotary = false;
withClair = true;
editing = false;
inProgress = true;
currentTabID = 'repo-image';

View File

@ -25,10 +25,6 @@ export const TAG_STYLE = `
display: block; height: 0;
}
:host >>> .datagrid {
margin: 0;
}
:host >>> .datagrid-placeholder {
display: none;
}

View File

@ -23,24 +23,24 @@ export const TAG_TEMPLATE = `
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<clr-datagrid [clrDgLoading]="loading" [class.embeded-datagrid]="isEmbedded" [(clrDgSelected)]="selectedRow" (clrDgSelectedChange)="selectedChange()">
<clr-dg-action-bar style="margin-bottom: 0;">
<clr-dg-action-bar>
<div class="btn-group">
<button type="button" class="btn btn-sm btn-secondary" *ngIf="canScanNow(selectedRow)" [disabled]="!(selectedRow.length==1)" (click)="scanNow(selectedRow)">{{'VULNERABILITY.SCAN_NOW' | translate}}</button>
<button type="button" class="btn btn-sm btn-secondary" [disabled]="!canScanNow(selectedRow)" [disabled]="!(selectedRow.length==1)" (click)="scanNow(selectedRow)">{{'VULNERABILITY.SCAN_NOW' | translate}}</button>
<button type="button" class="btn btn-sm btn-secondary" [disabled]="!(selectedRow.length==1)" (click)="showDigestId(selectedRow)" >{{'REPOSITORY.COPY_DIGEST_ID' | translate}}</button>
<button type="button" class="btn btn-sm btn-secondary" *ngIf="hasProjectAdminRole" (click)="deleteTags(selectedRow)" [disabled]="!selectedRow.length">{{'REPOSITORY.DELETE' | translate}}</button>
</div>
</clr-dg-action-bar>
<clr-dg-column style="min-width: 160px;" [clrDgField]="'name'">{{'REPOSITORY.TAG' | translate}}</clr-dg-column>
<clr-dg-column style="width: 160px;" [clrDgField]="'name'">{{'REPOSITORY.TAG' | translate}}</clr-dg-column>
<clr-dg-column style="width: 90px;" [clrDgField]="'size'">{{'REPOSITORY.SIZE' | translate}}</clr-dg-column>
<clr-dg-column style="min-width: 120px; max-width:220px;">{{'REPOSITORY.PULL_COMMAND' | translate}}</clr-dg-column>
<clr-dg-column style="width: 140px;" *ngIf="withClair">{{'REPOSITORY.VULNERABILITY' | translate}}</clr-dg-column>
<clr-dg-column style="width: 80px;" *ngIf="withNotary">{{'REPOSITORY.SIGNED' | translate}}</clr-dg-column>
<clr-dg-column style="width: 130px;">{{'REPOSITORY.AUTHOR' | translate}}</clr-dg-column>
<clr-dg-column style="min-width: 130px;">{{'REPOSITORY.AUTHOR' | translate}}</clr-dg-column>
<clr-dg-column style="width: 160px;"[clrDgSortBy]="createdComparator">{{'REPOSITORY.CREATED' | translate}}</clr-dg-column>
<clr-dg-column style="width: 80px;" [clrDgField]="'docker_version'" *ngIf="!withClair">{{'REPOSITORY.DOCKER_VERSION' | translate}}</clr-dg-column>
<clr-dg-placeholder>{{'TGA.PLACEHOLDER' | translate }}</clr-dg-placeholder>
<clr-dg-row *clrDgItems="let t of tags" [clrDgItem]='t'>
<clr-dg-cell class="truncated" style="min-width: 160px;" [ngSwitch]="withClair">
<clr-dg-row *ngFor="let t of tags" [clrDgItem]='t'>
<clr-dg-cell class="truncated" style="width: 160px;" [ngSwitch]="withClair">
<a *ngSwitchCase="true" href="javascript:void(0)" (click)="onTagClick(t)" title="{{t.name}}">{{t.name}}</a>
<span *ngSwitchDefault>{{t.name}}</span>
</clr-dg-cell>
@ -59,7 +59,7 @@ export const TAG_TEMPLATE = `
<span class="tooltip-content">{{'REPOSITORY.NOTARY_IS_UNDETERMINED' | translate}}</span>
</a>
</clr-dg-cell>
<clr-dg-cell class="truncated" style="width: 130px;" title="{{t.author}}">{{t.author}}</clr-dg-cell>
<clr-dg-cell class="truncated" style="min-width: 130px;" title="{{t.author}}">{{t.author}}</clr-dg-cell>
<clr-dg-cell style="width: 160px;">{{t.created | date: 'short'}}</clr-dg-cell>
<clr-dg-cell style="width: 80px;" *ngIf="!withClair">{{t.docker_version}}</clr-dg-cell>
</clr-dg-row>

View File

@ -152,6 +152,7 @@ export class TagComponent implements OnInit {
}
clrLoad(state: State): void {
this.selectedRow = [];
// Keep it for future filtering and sorting
this.currentState = state;

View File

@ -31,7 +31,7 @@
"clarity-icons": "^0.10.17",
"clarity-ui": "^0.10.17",
"core-js": "^2.4.1",
"harbor-ui": "0.6.9",
"harbor-ui": "0.6.13",
"intl": "^1.2.5",
"mutationobserver-shim": "^0.3.2",
"ngx-cookie": "^1.0.0",

View File

@ -4,4 +4,11 @@
left: 0px;
width: 100%;
z-index: 999;
}
.alert-item {
display: inline-block;
text-align: center;
}
:host >>> .alert-icon-wrapper{
display: inline;
}

View File

@ -10,7 +10,7 @@
<clr-dg-column *ngIf="showRoleInfo" [clrDgSortBy]="roleComparator">{{'PROJECT.ROLE' | translate}}</clr-dg-column>
<clr-dg-column [clrDgSortBy]="repoCountComparator">{{'PROJECT.REPO_COUNT'| translate}}</clr-dg-column>
<clr-dg-column [clrDgSortBy]="timeComparator">{{'PROJECT.CREATION_TIME' | translate}}</clr-dg-column>
<clr-dg-row *clrDgItems="let p of projects" [clrDgItem]="p">
<clr-dg-row *ngFor="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.metadata.public === 'true' ? 'PROJECT.PUBLIC' : 'PROJECT.PRIVATE') | translate}}</clr-dg-cell>
<clr-dg-cell *ngIf="showRoleInfo">{{roleInfo[p.current_user_role_id] | translate}}</clr-dg-cell>

View File

@ -141,6 +141,8 @@ export class ListProjectComponent implements OnDestroy {
}
clrLoad(state: State) {
this.selectedRow = [];
//Keep state for future filtering and sorting
this.currentState = state;

View File

@ -26,7 +26,7 @@
</clr-dg-action-bar>
<clr-dg-column>{{'MEMBER.NAME' | translate}}</clr-dg-column>
<clr-dg-column>{{'MEMBER.ROLE' | translate}}</clr-dg-column>
<clr-dg-row *clrDgItems="let m of members" [clrDgItem]="m">
<clr-dg-row *ngFor="let m of members" [clrDgItem]="m">
<clr-dg-cell>{{m.username}}</clr-dg-cell>
<clr-dg-cell>{{roleInfo[m.role_id] | translate}}</clr-dg-cell>
</clr-dg-row>

View File

@ -93,6 +93,7 @@ export class MemberComponent implements OnInit, OnDestroy {
}
retrieve(projectId: number, username: string) {
this.selectedRow = [];
this.memberService
.listMembers(projectId, username)
.subscribe(
@ -165,7 +166,7 @@ export class MemberComponent implements OnInit, OnDestroy {
if (members && members.length) {
let promiseList: any[] = [];
members.forEach(member => {
if (member.user_id === this.currentUser.user_id || member.role_id >= this.roleNum) {
if (member.user_id === this.currentUser.user_id) {
let findedList = this.batchDelectionInfos.find(data => data.name === member.username);
this.translate.get('BATCH.SWITCH_FAILURE').subscribe(res => {
findedList = BathInfoChanges(findedList, res, false, true);

View File

@ -17,7 +17,7 @@
</div>
<clr-datagrid (clrDgRefresh)="clrLoad($event)" [clrDgLoading]="loading" [(clrDgSingleSelected)]="selectedProject">
<clr-dg-row *clrDgItems="let project of projects; let i = index" [clrDgItem]="project">
<clr-dg-row *ngFor="let project of projects; let i = index" [clrDgItem]="project">
<clr-dg-cell>{{project.name}}</clr-dg-cell>
</clr-dg-row>
<clr-dg-footer>

View File

@ -87,6 +87,7 @@ export class ListProjectModelComponent {
clrLoad(state: State) {
this.selectedProject = null;
//Keep state for future filtering and sorting
this.currentState = state;

View File

@ -1,3 +1,3 @@
<div>
<hbr-repository (tagClickEvent)="watchTagClickEvt($event)" (backEvt)="goBack($event)" [repoName]="repoName" [hasSignedIn]="hasSignedIn" [hasProjectAdminRole]="hasProjectAdminRole" [projectId]="projectId"></hbr-repository>
<hbr-repository (tagClickEvent)="watchTagClickEvt($event)" (backEvt)="goBack($event)" [repoName]="repoName" [withClair]="withClair" [withNotary]="withNotary" [hasSignedIn]="hasSignedIn" [hasProjectAdminRole]="hasProjectAdminRole" [projectId]="projectId"></hbr-repository>
</div>

View File

@ -29,7 +29,7 @@
</ng-template>
<ng-template [ngSwitchCase]="2">
<button type="button" class="btn btn-outline" (click)="cancel()" [hidden]="isDelete">{{'BUTTON.CANCEL' | translate}}</button>
<button type="button" class="btn btn-danger" (click)="delete()" [hidden]="isDelete">{{'BUTTON.DELETE' | translate}}</button>
<button type="button" class="btn btn-danger" (click)="delete()" [hidden]="isDelete">{{isSwitch? 'BUTTON.SWITCH':'BUTTON.DELETE' | translate}}</button>
<button type="button" class="btn btn-primary" (click)="cancel()" [disabled]="!batchOverStatus" [hidden]="!isDelete">{{'BUTTON.CLOSE' | translate}}</button>
</ng-template>
<ng-template [ngSwitchCase]="3">

View File

@ -45,6 +45,13 @@ export class ConfirmationDialogComponent implements OnDestroy {
return false;
}
get isSwitch(): boolean {
if (this.dialogTitle && (this.dialogTitle.includes('SWITCH') || this.dialogTitle.includes('switch'))) {
return true;
}
return false;
}
colorChange(list: BatchInfo) {
if (!list.loading && !list.errorState) {
return 'green';

View File

@ -21,7 +21,7 @@
<clr-dg-column>{{'USER.COLUMN_ADMIN' | translate}}</clr-dg-column>
<clr-dg-column>{{'USER.COLUMN_EMAIL' | translate}}</clr-dg-column>
<clr-dg-column>{{'USER.COLUMN_REG_NAME' | translate}}</clr-dg-column>
<clr-dg-row *clrDgItems="let user of users" [clrDgItem]="user">
<clr-dg-row *ngFor="let user of users" [clrDgItem]="user">
<clr-dg-cell>{{user.username}}</clr-dg-cell>
<clr-dg-cell>{{isSystemAdmin(user)}}</clr-dg-cell>
<clr-dg-cell>{{user.email}}</clr-dg-cell>

View File

@ -317,6 +317,7 @@ export class UserComponent implements OnInit, OnDestroy {
//Data loading
load(state: any): void {
this.selectedRow = [];
if (state && state.page) {
if (this.originalUsers) {
this.originalUsers.then(users => {

View File

@ -33,7 +33,8 @@
"NO": "NO",
"NEGATIVE": "NEGATIVE",
"COPY": "COPY",
"EDIT": "EDIT"
"EDIT": "EDIT",
"SWITCH": "SWITCH"
},
"BATCH": {
"DELETED_SUCCESS": "Deleted successfully",

View File

@ -33,7 +33,8 @@
"NO": "NO",
"NEGATIVE": "NEGATIVO",
"COPY": "COPY",
"EDIT": "EDITAR"
"EDIT": "EDITAR",
"SWITCH": "SWITCH"
},
"BATCH": {
"DELETED_SUCCESS": "Deleted successfully",

View File

@ -33,7 +33,8 @@
"NO": "否",
"NEGATIVE": "否",
"COPY": "拷贝",
"EDIT": "编辑"
"EDIT": "编辑",
"SWITCH": "切换"
},
"BATCH": {
"DELETED_SUCCESS": "删除成功",

View File

@ -70,9 +70,9 @@ Change Project Member Role
Click Element //button[@class='btn dropdown-toggle']
Click Element //button[contains(.,'${role}')]
sleep 1
Click Element xpath=//clr-modal//button[contains(.,'SWITCH')];
Click Element xpath=//clr-modal//button[contains(.,'SWITCH')]
sleep 1
Click Element xpath=//clr-modal//button[contains(.,'CLOSE')];
Click Element xpath=//clr-modal//button[contains(.,'CLOSE')]
Sleep 2
Wait Until Page Contains ${role}