mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-18 22:57:38 +01:00
Fix repo list sorting and filtering bug
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
93f316ccfe
commit
e5e39c03c5
@ -21,7 +21,13 @@ import {
|
|||||||
UserPermissionService, USERSTATICPERMISSION
|
UserPermissionService, USERSTATICPERMISSION
|
||||||
} from "../../../../../lib/services";
|
} from "../../../../../lib/services";
|
||||||
import { ClrDatagridStateInterface } from '@clr/angular';
|
import { ClrDatagridStateInterface } from '@clr/angular';
|
||||||
import { DEFAULT_PAGE_SIZE, calculatePage, dbEncodeURIComponent } from '../../../../../lib/utils/utils';
|
import {
|
||||||
|
DEFAULT_PAGE_SIZE,
|
||||||
|
calculatePage,
|
||||||
|
dbEncodeURIComponent,
|
||||||
|
doFiltering,
|
||||||
|
doSorting
|
||||||
|
} from '../../../../../lib/utils/utils';
|
||||||
import { AppConfigService } from "../../../../services/app-config.service";
|
import { AppConfigService } from "../../../../services/app-config.service";
|
||||||
|
|
||||||
class InitTag {
|
class InitTag {
|
||||||
@ -130,6 +136,9 @@ export class ArtifactTagComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.currentTags = res.body;
|
this.currentTags = res.body;
|
||||||
|
// Do customising filtering and sorting
|
||||||
|
this.currentTags = doFiltering<Tag>(this.currentTags, state);
|
||||||
|
this.currentTags = doSorting<Tag>(this.currentTags, state);
|
||||||
}, error => {
|
}, error => {
|
||||||
this.errorHandlerService.error(error);
|
this.errorHandlerService.error(error);
|
||||||
});
|
});
|
||||||
|
@ -25,11 +25,9 @@
|
|||||||
<div *ngIf="!isCardView" class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
<div *ngIf="!isCardView" class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||||
<clr-datagrid (clrDgRefresh)="clrLoad($event)" [clrDgLoading]="loading" [(clrDgSelected)]="selectedRow">
|
<clr-datagrid (clrDgRefresh)="clrLoad($event)" [clrDgLoading]="loading" [(clrDgSelected)]="selectedRow">
|
||||||
<clr-dg-action-bar>
|
<clr-dg-action-bar>
|
||||||
<!-- <button *ngIf="withAdmiral" type="button" class="btn btn-secondary" (click)="provisionItemEvent($event, selectedRow[0])" [disabled]="!(selectedRow.length===1 && hasProjectAdminRole)"><clr-icon shape="times" size="16"></clr-icon> {{'REPOSITORY.DEPLOY' | translate}}</button>
|
|
||||||
<button *ngIf="withAdmiral" type="button" class="btn btn-secondary" (click)="itemAddInfoEvent($event, selectedRow[0])" [disabled]="!(selectedRow.length===1 && hasProjectAdminRole)"><clr-icon shape="times" size="16"></clr-icon> {{'REPOSITORY.ADDITIONAL_INFO' | translate}}</button> -->
|
|
||||||
<button type="button" class="btn btn-secondary" (click)="deleteRepos(selectedRow)" [disabled]="!(selectedRow.length)|| !hasDeleteRepositoryPermission"><clr-icon shape="times" size="16"></clr-icon> {{'REPOSITORY.DELETE' | translate}}</button>
|
<button type="button" class="btn btn-secondary" (click)="deleteRepos(selectedRow)" [disabled]="!(selectedRow.length)|| !hasDeleteRepositoryPermission"><clr-icon shape="times" size="16"></clr-icon> {{'REPOSITORY.DELETE' | translate}}</button>
|
||||||
</clr-dg-action-bar>
|
</clr-dg-action-bar>
|
||||||
<clr-dg-column [clrDgField]="'q'" [clrDgSortBy]="'name'">{{'REPOSITORY.NAME' | translate}}</clr-dg-column>
|
<clr-dg-column [clrDgField]="'name'">{{'REPOSITORY.NAME' | translate}}</clr-dg-column>
|
||||||
<clr-dg-column>{{'REPOSITORY.ARTIFACTS_COUNT' | translate}}</clr-dg-column>
|
<clr-dg-column>{{'REPOSITORY.ARTIFACTS_COUNT' | translate}}</clr-dg-column>
|
||||||
<clr-dg-column [clrDgSortBy]="'pull_count'">{{'REPOSITORY.PULL_COUNT' | translate}}</clr-dg-column>
|
<clr-dg-column [clrDgSortBy]="'pull_count'">{{'REPOSITORY.PULL_COUNT' | translate}}</clr-dg-column>
|
||||||
<clr-dg-placeholder>{{'REPOSITORY.PLACEHOLDER' | translate }}</clr-dg-placeholder>
|
<clr-dg-placeholder>{{'REPOSITORY.PLACEHOLDER' | translate }}</clr-dg-placeholder>
|
||||||
|
@ -24,7 +24,14 @@ import {
|
|||||||
UserPermissionService, USERSTATICPERMISSION
|
UserPermissionService, USERSTATICPERMISSION
|
||||||
} from "../../../lib/services";
|
} from "../../../lib/services";
|
||||||
import { FilterComponent } from "../../../lib/components/filter/filter.component";
|
import { FilterComponent } from "../../../lib/components/filter/filter.component";
|
||||||
import { calculatePage, clone, DEFAULT_PAGE_SIZE, dbEncodeURIComponent } from "../../../lib/utils/utils";
|
import {
|
||||||
|
calculatePage,
|
||||||
|
clone,
|
||||||
|
DEFAULT_PAGE_SIZE,
|
||||||
|
dbEncodeURIComponent,
|
||||||
|
doFiltering,
|
||||||
|
doSorting
|
||||||
|
} from "../../../lib/utils/utils";
|
||||||
import { IServiceConfig, SERVICE_CONFIG } from "../../../lib/entities/service.config";
|
import { IServiceConfig, SERVICE_CONFIG } from "../../../lib/entities/service.config";
|
||||||
import { ErrorHandler } from "../../../lib/utils/error-handler";
|
import { ErrorHandler } from "../../../lib/utils/error-handler";
|
||||||
import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../../lib/entities/shared.const";
|
import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../../lib/entities/shared.const";
|
||||||
@ -372,7 +379,9 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
|
|
||||||
this.totalCount = +repo.headers.get('x-total-count');
|
this.totalCount = +repo.headers.get('x-total-count');
|
||||||
this.repositories = repo.body;
|
this.repositories = repo.body;
|
||||||
|
// Do customising filtering and sorting
|
||||||
|
this.repositories = doFiltering<NewRepository>(this.repositories, state);
|
||||||
|
this.repositories = doSorting<NewRepository>(this.repositories, state);
|
||||||
this.signedCon = {};
|
this.signedCon = {};
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}, error => {
|
}, error => {
|
||||||
|
Loading…
Reference in New Issue
Block a user