Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
43a1ee470b
|
@ -14,7 +14,7 @@
|
||||||
<div *ngIf="hasLoadedListingItems && (hasListingItems || hasFilters)" class="col-12">
|
<div *ngIf="hasLoadedListingItems && (hasListingItems || hasFilters)" class="col-12">
|
||||||
<app-navigation-breadcrumb />
|
<app-navigation-breadcrumb />
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="hasLoadedListingItems && (hasListingItems || hasFilters) && !isPublic" class="filter-btn" [style.right]="dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="listingItems.length > 2 ? '57px' : '37px'" (click)="openFiltersDialog()">
|
<div *ngIf="!versionsModeEnabled && hasLoadedListingItems && (hasListingItems || hasFilters) && !isPublic" class="filter-btn" [style.right]="dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="listingItems.length > 2 ? '57px' : '37px'" (click)="openFiltersDialog()">
|
||||||
<button mat-raised-button class="p-0" [matBadge]="filtersCount" [matBadgeHidden]="!hasFilters" matBadgePosition="before">
|
<button mat-raised-button class="p-0" [matBadge]="filtersCount" [matBadgeHidden]="!hasFilters" matBadgePosition="before">
|
||||||
<mat-icon class="mr-4 filter-icon">filter_alt</mat-icon>
|
<mat-icon class="mr-4 filter-icon">filter_alt</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -55,7 +55,6 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
|
||||||
@ViewChild(MatPaginator, { static: true }) _paginator: MatPaginator;
|
@ViewChild(MatPaginator, { static: true }) _paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
lookup: PlanLookup;
|
lookup: PlanLookup;
|
||||||
// groupId: string;
|
|
||||||
totalCount: number;
|
totalCount: number;
|
||||||
listingItems: any[] = [];
|
listingItems: any[] = [];
|
||||||
isPublic: boolean = false;
|
isPublic: boolean = false;
|
||||||
|
@ -102,6 +101,9 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
|
||||||
this.lookup.planBlueprintSubQuery != null || this.lookup.planUserSubQuery != null ||
|
this.lookup.planBlueprintSubQuery != null || this.lookup.planUserSubQuery != null ||
|
||||||
this.lookup.tenantSubQuery != null;
|
this.lookup.tenantSubQuery != null;
|
||||||
}
|
}
|
||||||
|
get versionsModeEnabled(): boolean {
|
||||||
|
return this.groupId != null;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected router: Router,
|
protected router: Router,
|
||||||
|
@ -203,7 +205,7 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
|
||||||
if (this.isPublic) {
|
if (this.isPublic) {
|
||||||
return this.planService.publicQuery(this.lookup).pipe(takeUntil(this._destroyed))
|
return this.planService.publicQuery(this.lookup).pipe(takeUntil(this._destroyed))
|
||||||
.pipe(tap(result => {
|
.pipe(tap(result => {
|
||||||
if (this.groupId != null) {
|
if (this.versionsModeEnabled) {
|
||||||
const latestVersionPlan: BasePlan = this._getLatestVersion(result.items);
|
const latestVersionPlan: BasePlan = this._getLatestVersion(result.items);
|
||||||
this.breadcrumbService.addIdResolvedValue(this.groupId.toString(), latestVersionPlan.label);
|
this.breadcrumbService.addIdResolvedValue(this.groupId.toString(), latestVersionPlan.label);
|
||||||
}
|
}
|
||||||
|
@ -217,7 +219,7 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
|
||||||
} else {
|
} else {
|
||||||
return this.planService.query(this.lookup).pipe(takeUntil(this._destroyed))
|
return this.planService.query(this.lookup).pipe(takeUntil(this._destroyed))
|
||||||
.pipe(tap(result => {
|
.pipe(tap(result => {
|
||||||
if (this.groupId != null) {
|
if (this.versionsModeEnabled) {
|
||||||
const latestVersionPlan: BasePlan = this._getLatestVersion(result.items);
|
const latestVersionPlan: BasePlan = this._getLatestVersion(result.items);
|
||||||
this.breadcrumbService.addIdResolvedValue(this.groupId.toString(), latestVersionPlan.label);
|
this.breadcrumbService.addIdResolvedValue(this.groupId.toString(), latestVersionPlan.label);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue