Skip to content

Commit

Permalink
Update the name checking for the robot account (goharbor#19645)
Browse files Browse the repository at this point in the history
1. Fixes goharbor#19612

Signed-off-by: AllForNothing <shijun.sun@broadcom.com>
Signed-off-by: Altynbaev Dinislam <altynbayevdr@sberautotech.ru>
  • Loading branch information
AllForNothing authored and Altynbaev Dinislam committed Jan 29, 2024
1 parent 124fae1 commit 73c70e7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ <h3 *ngIf="isEditMode" class="modal-title">
<ng-template clrPageTitle>{{
'ROBOT_ACCOUNT.SELECT_PROJECT_PERMISSIONS' | translate
}}</ng-template>
<inline-alert class="modal-title"></inline-alert>
<inline-alert></inline-alert>
<form class="clr-form clr-form-horizontal pb-0 pt-0">
<section class="form-block">
<div class="clr-form-control mt-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
distinctUntilChanged,
filter,
finalize,
map,
switchMap,
} from 'rxjs/operators';
import {
Expand Down Expand Up @@ -119,7 +120,6 @@ export class NewRobotComponent implements OnInit, OnDestroy {
if (!this._nameSubscription) {
this._nameSubscription = this._nameSubject
.pipe(
debounceTime(500),
distinctUntilChanged(),
filter(name => {
if (
Expand All @@ -131,6 +131,11 @@ export class NewRobotComponent implements OnInit, OnDestroy {
}
return name?.length > 0;
}),
map(name => {
this.checkNameOnGoing = !!name;
return name;
}),
debounceTime(500),
switchMap(name => {
this.isNameExisting = false;
this.checkNameOnGoing = true;
Expand Down Expand Up @@ -490,6 +495,7 @@ export class NewRobotComponent implements OnInit, OnDestroy {
}

clrWizardPageOnLoad() {
this.inlineAlertComponent.close();
this.showPage3 = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,14 @@ <h3 *ngIf="isEditMode" class="modal-title">
</clr-wizard-page>

<clr-wizard-page
(clrWizardPageOnLoad)="clrWizardPageOnLoad()"
(clrWizardPageOnCommit)="save()"
[clrWizardPagePreventDefaultNext]="true"
[clrWizardPageNextDisabled]="disabled()">
<ng-template clrPageTitle>{{
'ROBOT_ACCOUNT.SELECT_PERMISSIONS' | translate
}}</ng-template>
<inline-alert class="modal-title"></inline-alert>
<inline-alert></inline-alert>
<form class="clr-form clr-form-horizontal mt-1">
<section class="form-block">
<robot-permissions-panel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
distinctUntilChanged,
filter,
finalize,
map,
switchMap,
} from 'rxjs/operators';
import { MessageHandlerService } from '../../../../shared/services/message-handler.service';
Expand Down Expand Up @@ -87,7 +88,6 @@ export class AddRobotComponent implements OnInit, OnDestroy {
if (!this._nameSubscription) {
this._nameSubscription = this._nameSubject
.pipe(
debounceTime(500),
distinctUntilChanged(),
filter(name => {
if (
Expand All @@ -99,6 +99,11 @@ export class AddRobotComponent implements OnInit, OnDestroy {
}
return name?.length > 0;
}),
map(name => {
this.checkNameOnGoing = !!name;
return name;
}),
debounceTime(500),
switchMap(name => {
this.isNameExisting = false;
this.checkNameOnGoing = true;
Expand Down Expand Up @@ -295,5 +300,9 @@ export class AddRobotComponent implements OnInit, OnDestroy {
return new Date() >= this.calculateExpiresAt();
}

clrWizardPageOnLoad() {
this.inlineAlertComponent.close();
}

protected readonly PermissionSelectPanelModes = PermissionSelectPanelModes;
}

0 comments on commit 73c70e7

Please sign in to comment.