mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 00:57:44 +01:00
Fix bugs infinity copy of reponame and auth
1. everytime click deploy or add additional info will add a prefix before reponame 2. add constrait on button on cardview
This commit is contained in:
parent
fa8bbe821a
commit
18c8686d57
@ -69,9 +69,9 @@ export const CREATE_EDIT_RULE_TEMPLATE: string = `
|
||||
</div>
|
||||
</div>
|
||||
<label *ngIf="noEndpointInfo.length != 0" class="colorRed alertLabel">{{noEndpointInfo | translate}}</label>
|
||||
<span class="alertLabel goLink" *ngIf="noEndpointInfo.length != 0" (click)="goRegistry()">{{'SIDE_NAV.SYSTEM_MGMT.REGISTRY' | translate}}</span>
|
||||
<span class="alertLabel goLink" *ngIf="noEndpointInfo.length != 0" (click)="goRegistry()">{{'REPLICATION.ENDPOINTS' | translate}}</span>
|
||||
</div>
|
||||
|
||||
|
||||
<!--Trigger-->
|
||||
<div class="form-group form-group-override">
|
||||
<label class="form-group-label-override">{{'REPLICATION.TRIGGER_MODE' | translate}}</label>
|
||||
|
@ -73,16 +73,16 @@ export const REPOSITORY_GRIDVIEW_TEMPLATE = `
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<clr-dropdown [clrCloseMenuOnItemClick]="false">
|
||||
<button *ngIf="withAdmiral" type="button" class="btn btn-link" (click)="provisionItemEvent($event, item)">{{'REPOSITORY.DEPLOY' | translate}}</button>
|
||||
<button type="button" class="btn btn-link" (click)="$event.stopPropagation()" clrDropdownTrigger>
|
||||
<button *ngIf="withAdmiral" type="button" class="btn btn-link" (click)="provisionItemEvent($event, item)" [disabled]="!hasProjectAdminRole">{{'REPOSITORY.DEPLOY' | translate}}</button>
|
||||
<button type="button" class="btn btn-link" (click)="$event.stopPropagation()" [disabled]="!hasProjectAdminRole" clrDropdownTrigger>
|
||||
{{'REPOSITORY.ACTION' | translate}}
|
||||
<clr-icon shape="caret down"></clr-icon>
|
||||
</button>
|
||||
<clr-dropdown-menu clrPosition="top-left" *clrIfOpen>
|
||||
<button *ngIf="withAdmiral" type="button" class="btn btn-link" clrDropdownItem (click)="itemAddInfoEvent($event, item)">
|
||||
<button *ngIf="withAdmiral" type="button" class="btn btn-link" clrDropdownItem (click)="itemAddInfoEvent($event, item)" [disabled]="!hasProjectAdminRole">
|
||||
{{'REPOSITORY.ADDITIONAL_INFO' | translate}}
|
||||
</button>
|
||||
<button type="button" class="btn btn-link" clrDropdownItem (click)="deleteItemEvent($event, item)">
|
||||
<button type="button" class="btn btn-link" clrDropdownItem (click)="deleteItemEvent($event, item)" [disabled]="!hasProjectAdminRole">
|
||||
{{'REPOSITORY.DELETE' | translate}}
|
||||
</button>
|
||||
</clr-dropdown-menu>
|
||||
|
@ -9,7 +9,7 @@ import { REPOSITORY_GRIDVIEW_TEMPLATE } from './repository-gridview.component.ht
|
||||
import { REPOSITORY_GRIDVIEW_STYLE } from './repository-gridview.component.css';
|
||||
import { Repository, SystemInfo, SystemInfoService, RepositoryService, RequestQueryParams, RepositoryItem, TagService } from '../service/index';
|
||||
import { ErrorHandler } from '../error-handler/error-handler';
|
||||
import { toPromise, CustomComparator , DEFAULT_PAGE_SIZE, calculatePage, doFiltering, doSorting} from '../utils';
|
||||
import { toPromise, CustomComparator , DEFAULT_PAGE_SIZE, calculatePage, doFiltering, doSorting, clone} from '../utils';
|
||||
import { ConfirmationState, ConfirmationTargets, ConfirmationButtons } from '../shared/shared.const';
|
||||
import { ConfirmationDialogComponent } from '../confirmation-dialog/confirmation-dialog.component';
|
||||
import { ConfirmationMessage } from '../confirmation-dialog/confirmation-message';
|
||||
@ -266,12 +266,16 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit {
|
||||
|
||||
provisionItemEvent(evt: any, repo: RepositoryItem): void {
|
||||
evt.stopPropagation();
|
||||
this.repoProvisionEvent.emit(repo);
|
||||
let repoCopy = clone(repo)
|
||||
repoCopy.name = this.registryUrl + ':443/' + repoCopy.name;
|
||||
this.repoProvisionEvent.emit(repoCopy);
|
||||
}
|
||||
|
||||
itemAddInfoEvent(evt: any, repo: RepositoryItem): void {
|
||||
evt.stopPropagation();
|
||||
this.addInfoEvent.emit(repo);
|
||||
let repoCopy = clone(repo)
|
||||
repoCopy.name = this.registryUrl + ':443/' + repoCopy.name;
|
||||
this.addInfoEvent.emit(repoCopy);
|
||||
}
|
||||
|
||||
deleteItemEvent(evt: any, item: RepositoryItem): void {
|
||||
|
@ -285,6 +285,6 @@ export function isEmptyObject(obj: any): boolean {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function clone(srcObj: any): any {
|
||||
if (!srcObj) return null;
|
||||
if (!srcObj) { return null };
|
||||
return JSON.parse(JSON.stringify(srcObj));
|
||||
}
|
Loading…
Reference in New Issue
Block a user