fix public pages

This commit is contained in:
Efstratios Giannopoulos 2024-06-28 18:26:18 +03:00
parent 9a455ad873
commit b45bff4452
18 changed files with 112 additions and 92 deletions

View File

@ -1,5 +1,6 @@
package org.opencdmp.data;
import jakarta.persistence.*;
import org.opencdmp.commons.enums.DmpAccessType;
import org.opencdmp.commons.enums.DmpStatus;
import org.opencdmp.commons.enums.DmpVersionStatus;
@ -9,7 +10,6 @@ import org.opencdmp.data.converters.enums.DmpStatusConverter;
import org.opencdmp.data.converters.enums.DmpVersionStatusConverter;
import org.opencdmp.data.converters.enums.IsActiveConverter;
import org.opencdmp.data.tenant.TenantScopedBaseEntity;
import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
@ -110,7 +110,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
public static final String _publicAfter = "publicAfter";
public UUID getId() {
return id;
return this.id;
}
public void setId(UUID id) {
@ -118,7 +118,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public String getLabel() {
return label;
return this.label;
}
public void setLabel(String label) {
@ -126,7 +126,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public Short getVersion() {
return version;
return this.version;
}
public void setVersion(Short version) {
@ -134,7 +134,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public DmpStatus getStatus() {
return status;
return this.status;
}
public void setStatus(DmpStatus status) {
@ -142,7 +142,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public String getProperties() {
return properties;
return this.properties;
}
public void setProperties(String properties) {
@ -150,7 +150,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public UUID getGroupId() {
return groupId;
return this.groupId;
}
public void setGroupId(UUID groupId) {
@ -158,7 +158,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public String getDescription() {
return description;
return this.description;
}
public void setDescription(String description) {
@ -166,7 +166,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public Instant getCreatedAt() {
return createdAt;
return this.createdAt;
}
public void setCreatedAt(Instant createdAt) {
@ -174,7 +174,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public Instant getUpdatedAt() {
return updatedAt;
return this.updatedAt;
}
public void setUpdatedAt(Instant updatedAt) {
@ -182,7 +182,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public IsActive getIsActive() {
return isActive;
return this.isActive;
}
public void setIsActive(IsActive isActive) {
@ -190,7 +190,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public Instant getFinalizedAt() {
return finalizedAt;
return this.finalizedAt;
}
public void setFinalizedAt(Instant finalizedAt) {
@ -198,7 +198,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public UUID getCreatorId() {
return creatorId;
return this.creatorId;
}
public void setCreatorId(UUID creatorId) {
@ -206,7 +206,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public DmpAccessType getAccessType() {
return accessType;
return this.accessType;
}
public void setAccessType(DmpAccessType accessType) {
@ -214,7 +214,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public UUID getBlueprintId() {
return blueprintId;
return this.blueprintId;
}
public void setBlueprintId(UUID blueprintId) {
@ -222,7 +222,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public String getLanguage() {
return language;
return this.language;
}
public void setLanguage(String language) {
@ -230,7 +230,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public Instant getPublicAfter() {
return publicAfter;
return this.publicAfter;
}
public void setPublicAfter(Instant publicAfter) {
@ -238,7 +238,7 @@ public class DmpEntity extends TenantScopedBaseEntity {
}
public DmpVersionStatus getVersionStatus() {
return versionStatus;
return this.versionStatus;
}
public void setVersionStatus(DmpVersionStatus versionStatus) {

View File

@ -2,4 +2,5 @@ export enum RecentActivityOrder {
UpdatedAt = 0,
Label = 1,
Status = 2,
PublishedAt = 3,
}

View File

@ -230,6 +230,7 @@ export class EnumUtils {
case RecentActivityOrder.Label: return this.language.instant('TYPES.RECENT-ACTIVITY-ORDER.LABEL');
case RecentActivityOrder.UpdatedAt: return this.language.instant('TYPES.RECENT-ACTIVITY-ORDER.MODIFIED');
case RecentActivityOrder.Status: return this.language.instant('TYPES.RECENT-ACTIVITY-ORDER.STATUS');
case RecentActivityOrder.PublishedAt: return this.language.instant('TYPES.RECENT-ACTIVITY-ORDER.PUBLISHED-AT');
}
}

View File

@ -46,6 +46,7 @@
<mat-form-field class="sort-form w-100">
<mat-select placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" [formControl]="formGroup.get('order')" (selectionChange)="orderByChanged()">
<mat-option *ngIf="!isPublic" [value]="order.UpdatedAt">{{enumUtils.toRecentActivityOrderString(order.UpdatedAt)}}</mat-option>
<mat-option *ngIf="isPublic" [value]="order.PublishedAt">{{enumUtils.toRecentActivityOrderString(order.PublishedAt)}}</mat-option>
<mat-option [value]="order.Label">{{enumUtils.toRecentActivityOrderString(order.Label)}}</mat-option>
<mat-option *ngIf="!isPublic" [value]="order.Status">{{enumUtils.toRecentActivityOrderString(order.Status)}}</mat-option>
</mat-select>

View File

@ -192,7 +192,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
lookup.page = { offset: 0, size: this.ITEMS_PER_PAGE };
lookup.isActive = [IsActive.Active];
let recentActivityOrder = this.isPublic ? this.toAscSortField(nameof<Description>(x => x.label)) : this.toDescSortField(nameof<Description>(x => x.updatedAt));
let recentActivityOrder = this.isPublic ? this.toDescSortField(nameof<Description>(x => x.finalizedAt)) : this.toDescSortField(nameof<Description>(x => x.updatedAt));
lookup.order = { items: [recentActivityOrder] };
this.updateOrderUiFields(lookup.order);
@ -247,7 +247,9 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.status)] };
} else if (this.formGroup.get('order').value == RecentActivityOrder.Label) {
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.label)] };
} else {
} else if (this.formGroup.get('order').value == RecentActivityOrder.PublishedAt) {
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.finalizedAt)] };
}else {
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.updatedAt)] };
}
this.filterChanged(this.lookup);
@ -371,6 +373,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
switch (recentActivityOrderValue) {
case nameof<Description>(x => x.updatedAt): return RecentActivityOrder.UpdatedAt;
case nameof<Description>(x => x.label): return RecentActivityOrder.Label;
case nameof<Description>(x => x.finalizedAt): return RecentActivityOrder.PublishedAt;
case nameof<Description>(x => x.status): return RecentActivityOrder.Status;
}
}

View File

@ -32,7 +32,7 @@
<mat-form-field class="sort-form w-100">
<mat-select placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" [formControl]="formGroup.get('order')" (selectionChange)="orderByChanged()">
<mat-option *ngIf="!isPublic" [value]="order.UpdatedAt">{{enumUtils.toRecentActivityOrderString(order.UpdatedAt)}}</mat-option>
<!-- <mat-option *ngIf="isPublic" [value]="order.PUBLISHED">{{enumUtils.toRecentActivityOrderString(order.PUBLISHED)}}</mat-option> -->
<mat-option *ngIf="isPublic" [value]="order.PublishedAt">{{enumUtils.toRecentActivityOrderString(order.PublishedAt)}}</mat-option>
<mat-option [value]="order.Label">{{enumUtils.toRecentActivityOrderString(order.Label)}}</mat-option>
<mat-option *ngIf="!isPublic" [value]="order.Status">{{enumUtils.toRecentActivityOrderString(order.Status)}}</mat-option>
</mat-select>

View File

@ -206,7 +206,7 @@ export class DmpListingComponent extends BaseListingComponent<BaseDmp, DmpLookup
lookup.page = { offset: 0, size: this.ITEMS_PER_PAGE };
lookup.isActive = [IsActive.Active];
let recentActivityOrder = this.isPublic ? this.toAscSortField(nameof<Description>(x => x.label)) : this.toDescSortField(nameof<Description>(x => x.updatedAt));
let recentActivityOrder = this.isPublic ? this.toDescSortField(nameof<Description>(x => x.finalizedAt)) : this.toDescSortField(nameof<Description>(x => x.updatedAt));
lookup.order = { items: [recentActivityOrder] };
this.updateOrderUiFields(lookup.order);
@ -246,7 +246,9 @@ export class DmpListingComponent extends BaseListingComponent<BaseDmp, DmpLookup
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.status)] };
} else if (this.formGroup.get('order').value == RecentActivityOrder.Label) {
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.label)] };
} else {
} else if (this.formGroup.get('order').value == RecentActivityOrder.PublishedAt){
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.finalizedAt)] };
}else {
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.updatedAt)] };
}
this.filterChanged(this.lookup);
@ -342,6 +344,7 @@ export class DmpListingComponent extends BaseListingComponent<BaseDmp, DmpLookup
switch (recentActivityOrderValue) {
case nameof<Dmp>(x => x.updatedAt): return RecentActivityOrder.UpdatedAt;
case nameof<Dmp>(x => x.label): return RecentActivityOrder.Label;
case nameof<Dmp>(x => x.finalizedAt): return RecentActivityOrder.PublishedAt;
case nameof<Dmp>(x => x.status): return RecentActivityOrder.Status;
}
}

View File

@ -1916,7 +1916,8 @@
"RECENT-ACTIVITY-ORDER": {
"LABEL": "Etiketa",
"MODIFIED": "Aldatuta",
"STATUS": "Egoera"
"STATUS": "Egoera",
"PUBLISHED-AT": "Published"
},
"DESCRIPTION-TEMPLATE-TYPE-STATUS": {
"FINALIZED": "Finalized",

View File

@ -1916,7 +1916,8 @@
"RECENT-ACTIVITY-ORDER": {
"LABEL": "Label",
"MODIFIED": "Modified",
"STATUS": "Status"
"STATUS": "Status",
"PUBLISHED-AT": "Published"
},
"DESCRIPTION-TEMPLATE-TYPE-STATUS": {
"FINALIZED": "Finalized",

View File

@ -1916,7 +1916,8 @@
"RECENT-ACTIVITY-ORDER": {
"LABEL": "Label",
"MODIFIED": "Modified",
"STATUS": "Status"
"STATUS": "Status",
"PUBLISHED-AT": "Published"
},
"DESCRIPTION-TEMPLATE-TYPE-STATUS": {
"FINALIZED": "Finalized",

View File

@ -1916,7 +1916,8 @@
"RECENT-ACTIVITY-ORDER": {
"LABEL": "Etiqueta",
"MODIFIED": "Modificado",
"STATUS": "Estado"
"STATUS": "Estado",
"PUBLISHED-AT": "Published"
},
"DESCRIPTION-TEMPLATE-TYPE-STATUS": {
"FINALIZED": "Finalized",

View File

@ -1916,7 +1916,8 @@
"RECENT-ACTIVITY-ORDER": {
"LABEL": "Ετικέτα",
"MODIFIED": "Τροποποιημένο",
"STATUS": "Κατάσταση"
"STATUS": "Κατάσταση",
"PUBLISHED-AT": "Published"
},
"DESCRIPTION-TEMPLATE-TYPE-STATUS": {
"FINALIZED": "Finalized",

View File

@ -1916,7 +1916,8 @@
"RECENT-ACTIVITY-ORDER": {
"LABEL": "Oznaka",
"MODIFIED": "Izmijenjeno",
"STATUS": "Status"
"STATUS": "Status",
"PUBLISHED-AT": "Published"
},
"DESCRIPTION-TEMPLATE-TYPE-STATUS": {
"FINALIZED": "Finalized",

View File

@ -1916,7 +1916,8 @@
"RECENT-ACTIVITY-ORDER": {
"LABEL": "Etykieta",
"MODIFIED": "Zmodyfikowany",
"STATUS": "Status"
"STATUS": "Status",
"PUBLISHED-AT": "Published"
},
"DESCRIPTION-TEMPLATE-TYPE-STATUS": {
"FINALIZED": "Finalized",

View File

@ -1916,7 +1916,8 @@
"RECENT-ACTIVITY-ORDER": {
"LABEL": "Etiqueta",
"MODIFIED": "Modificado",
"STATUS": "Estado"
"STATUS": "Estado",
"PUBLISHED-AT": "Published"
},
"DESCRIPTION-TEMPLATE-TYPE-STATUS": {
"FINALIZED": "Finalized",

View File

@ -1916,7 +1916,8 @@
"RECENT-ACTIVITY-ORDER": {
"LABEL": "Označenie",
"MODIFIED": "Modifikované",
"STATUS": "Stav"
"STATUS": "Stav",
"PUBLISHED-AT": "Published"
},
"DESCRIPTION-TEMPLATE-TYPE-STATUS": {
"FINALIZED": "Finalized",

View File

@ -1916,7 +1916,8 @@
"RECENT-ACTIVITY-ORDER": {
"LABEL": "Oznaka",
"MODIFIED": "Izmenjeno",
"STATUS": "Status"
"STATUS": "Status",
"PUBLISHED-AT": "Published"
},
"DESCRIPTION-TEMPLATE-TYPE-STATUS": {
"FINALIZED": "Finalized",

View File

@ -1916,7 +1916,8 @@
"RECENT-ACTIVITY-ORDER": {
"LABEL": "Etiket",
"MODIFIED": "Değiştirilmiş",
"STATUS": "Durum"
"STATUS": "Durum",
"PUBLISHED-AT": "Published"
},
"DESCRIPTION-TEMPLATE-TYPE-STATUS": {
"FINALIZED": "Finalized",