Skip to content

Commit

Permalink
UI modification for creating robot account
Browse files Browse the repository at this point in the history
Signed-off-by: sshijun <sshijun@vmware.com>
  • Loading branch information
wy65701436 authored and sshijun committed Jun 26, 2019
1 parent b1d02d5 commit d38ca3b
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h3 class="modal-title">{{'ROBOT_ACCOUNT.CREAT_ROBOT_ACCOUNT' | translate}}</h3>
<div class="modal-body">
<form #robotForm="ngForm">
<section class="form-block">
<div class="form-group">
<div class="form-group padding-left-120">
<label class="col-md-3
form-group-label-override required" for="robot_name">
{{'ROBOT_ACCOUNT.NAME' | translate}}
Expand All @@ -31,58 +31,57 @@ <h3 class="modal-title">{{'ROBOT_ACCOUNT.CREAT_ROBOT_ACCOUNT' | translate}}</h3>
</label>
<span class="spinner spinner-inline" [hidden]="!checkOnGoing"></span>
</div>
<div class="form-group">
<label class="form-group-label-override">{{'REPLICATION.DESCRIPTION' |
translate}}</label>
<input type="text" size="255" class="input-width"
[(ngModel)]="robot.description"
name="robot_desc" id="robot_desc">
</div>
<div class="form-group">
<label class="col-md-3">
{{'ROBOT_ACCOUNT.PERMISSIONS' | translate}}
</label>
<label class="clr-col-md-8 no-margin padding-left-0">
<clr-checkbox-wrapper>
<input type="checkbox" clrCheckbox [checked]="true"
[(ngModel)]="robot.access.isPullImage" name="isPullImage"
id="permission-pull" class="clr-checkbox">
<label for="permission-pull" class="clr-control-label">
{{'ROBOT_ACCOUNT.PULL_PERMISSION' | translate}}
</label>
</clr-checkbox-wrapper>
</label>
<label class="clr-col-md-8 no-margin padding-left-0">
<clr-checkbox-wrapper>
<input type="checkbox" clrCheckbox [checked]="true"
[(ngModel)]="robot.access.isPushOrPullImage" name="isPushOrPullImage"
id="permission-push" class="clr-checkbox">
<label for="permission-push" class="clr-control-label">
{{'ROBOT_ACCOUNT.PULL_PUSH_PERMISSION' | translate}}
</label>
</clr-checkbox-wrapper>
</label>
<label class="clr-col-md-8 no-margin padding-left-0">
<clr-checkbox-wrapper>
<input type="checkbox" clrCheckbox [checked]="true"
[(ngModel)]="robot.access.isPushChart" name="isPushChart"
id="permission-push-chart" class="clr-checkbox">
<label for="permission-push-chart" class="clr-control-label">
{{'ROBOT_ACCOUNT.PUSH_CHART_PERMISSION' | translate}}
</label>
</clr-checkbox-wrapper>
</label>
<label class="clr-col-md-8 no-margin padding-left-0">
<clr-checkbox-wrapper>
<input type="checkbox" clrCheckbox [checked]="true"
[(ngModel)]="robot.access.isPullChart" name="isPullChart"
id="permission-pull-chart" class="clr-checkbox">
<label for="permission-pull-chart" class="clr-control-label">
{{'ROBOT_ACCOUNT.PULL_CHART_PERMISSION' | translate}}
</label>
</clr-checkbox-wrapper>
</label>
</div>
<div class="form-group padding-left-120">
<label class="form-group-label-override">{{'REPLICATION.DESCRIPTION' |
translate}}</label>
<input type="text" size="255" class="input-width"
[(ngModel)]="robot.description"
name="robot_desc" id="robot_desc">
</div>
<div class="clr-row">
<div class="clr-col-3 permission">
<label class="col-md-3">
{{'ROBOT_ACCOUNT.PERMISSIONS' | translate}}
</label>
</div>
<div class="clr-col">
<div class="form-group padding-left-120">
<label>{{'ROBOT_ACCOUNT.PERMISSIONS_IMAGE' | translate}}</label>
<div class="radio-inline">
<input type="radio" name="image-permission"
id="image-permission-pull"
value="pull"
[(ngModel)]="imagePermission">
<label for="image-permission-pull">{{'ROBOT_ACCOUNT.PULL' | translate}}</label>
</div>
<div class="radio-inline">
<input type="radio" name="image-permission"
id="image-permission-push-and-pull"
value="push-and-pull"
[(ngModel)]="imagePermission">
<label for="image-permission-push-and-pull">{{'ROBOT_ACCOUNT.PUSH' | translate}}
& {{'ROBOT_ACCOUNT.PULL' | translate}}</label>
</div>
</div>
<div class="form-group padding-left-120">
<label>{{'ROBOT_ACCOUNT.PERMISSIONS_HELMCHART' | translate}}</label>
<div class="checkbox-inline">
<input type="checkbox" id="helm-permission-push"
[checked]="robot.access.isPushChart"
[(ngModel)]="robot.access.isPushChart"
name="helm-permission">
<label for="helm-permission-push">{{'ROBOT_ACCOUNT.PUSH' | translate}}</label>
</div>
<div class="checkbox-inline">
<input type="checkbox" id="helm-permission-pull"
[checked]="robot.access.isPullChart"
[(ngModel)]="robot.access.isPullChart"
name="helm-permission">
<label for="helm-permission-pull">{{'ROBOT_ACCOUNT.PULL' | translate}}</label>
</div>
</div>
</div>
</div>
</section>
</form>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export class AddRobotComponent implements OnInit, OnDestroy {
robotNameChecker: Subject<string> = new Subject<string>();
nameTooltipText = "ROBOT_ACCOUNT.ROBOT_NAME";
robotForm: NgForm;
imagePermission: string = "push-and-pull";
@Input() projectId: number;
@Input() projectName: string;
@Output() create = new EventEmitter<boolean>();
Expand Down Expand Up @@ -116,6 +117,14 @@ export class AddRobotComponent implements OnInit, OnDestroy {
if (this.isSubmitOnGoing) {
return;
}
// set value to robot.access.isPullImage and robot.access.isPushOrPullImage when submit
if ( this.imagePermission === 'pull' ) {
this.robot.access.isPullImage = true;
this.robot.access.isPushOrPullImage = false;
} else {
this.robot.access.isPullImage = false;
this.robot.access.isPushOrPullImage = true;
}
this.isSubmitOnGoing = true;
this.robotService
.addRobotAccount(
Expand Down
4 changes: 2 additions & 2 deletions tests/resources/Harbor-Util.robot
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Down Harbor
Should Be Equal As Integers ${rc} 0

Package Harbor Offline
[Arguments] ${golang_image}=golang:${GOLANG_VERSION} ${with_notary}=true ${with_clair}=true ${with_migrator}=false ${with_chartmuseum}=true
[Arguments] ${with_notary}=true ${with_clair}=true ${with_migrator}=false ${with_chartmuseum}=true
Log To Console \nStart Docker Daemon
Start Docker Daemon Locally
Log To Console \n\nmake package_offline VERSIONTAG=%{Harbor_Assets_Version} PKGVERSIONTAG=%{Harbor_Package_Version} UIVERSIONTAG=%{Harbor_UI_Version} COMPILETAG=compile_golangimage NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} MIGRATORFLAG=${with_migrator} CHARTFLAG=${with_chartmuseum} HTTPPROXY=
Expand All @@ -64,7 +64,7 @@ Package Harbor Offline
Should Be Equal As Integers ${rc} 0

Package Harbor Online
[Arguments] ${golang_image}=golang:${GOLANG_VERSION} ${with_notary}=true ${with_clair}=true ${with_migrator}=false ${with_chartmuseum}=true
[Arguments] ${with_notary}=true ${with_clair}=true ${with_migrator}=false ${with_chartmuseum}=true
Log To Console \nStart Docker Daemon
Start Docker Daemon Locally
Log To Console \nmake package_online VERSIONTAG=%{Harbor_Assets_Version} PKGVERSIONTAG=%{Harbor_Package_Version} UIVERSIONTAG=%{Harbor_UI_Version} COMPILETAG=compile_golangimage NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} MIGRATORFLAG=${with_migrator} CHARTFLAG=${with_chartmuseum} HTTPPROXY=
Expand Down

0 comments on commit d38ca3b

Please sign in to comment.