Commit c9a5e3a7 authored by Florent POITTEVIN's avatar Florent POITTEVIN
Browse files

feat: migrate some data table

parent 792117d7
......@@ -14937,9 +14937,9 @@
}
},
"solidify-frontend": {
"version": "0.6.8",
"resolved": "https://nexus.unige.ch/repository/npm-all/solidify-frontend/-/solidify-frontend-0.6.8.tgz",
"integrity": "sha512-OKEtH+XcIoXs59GT5nf99bPIjSUlbk1IiazIeTnqepdd6c0EC2B85JdecAVSJVlP+e4NwAHgUdGIt8sOh433Pg==",
"version": "1.0.4",
"resolved": "https://nexus.unige.ch/repository/npm-all/solidify-frontend/-/solidify-frontend-1.0.4.tgz",
"integrity": "sha512-cCaUJ/7K7lcYLrxf0BvnMdT519B2ewHCrLurV9UkLmCNQ+2lJoJnbVoi3D4wBTv5tlbkFDHYhShaF+0BeZwPow==",
"requires": {
"tslib": "^2.0.0"
}
......
......@@ -47,8 +47,9 @@
"build:sourcemaps": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --sourceMap --base-href /",
"build:sourcemaps-prod": "npm run build:sourcemaps -- --prod",
"build:sourcemaps-prod-local": "npm run build:sourcemaps -- -c production-local",
"build-solidify": "cd ../Solidify-Frontend/ && npm run build && cp -fr dist/solidify-frontend ../DLCM-Portal/node_modules",
"serve:prod": "cd dist/DLCM-Frontend && ws --spa index.html --rewrite \"/api/rss -> https://www.unige.ch/feed/rss\" -p 4200",
"simulate-prod-local": "rm -fr dist && cd ../Solidify-Frontend/ && npm run build-dlcm:nowatch && cd ../DLCM-Portal/ && npm run build:sourcemaps-prod-local && npm run serve:prod",
"simulate-prod-local": "rm -fr dist && npm run build-solidify && npm run build:sourcemaps-prod-local && npm run serve:prod",
"refresh-ngsw-config": "ngsw-config dist/DLCM-Frontend ngsw-config.json"
},
"dependencies": {
......@@ -100,7 +101,7 @@
"normalize.css": "8.0.1",
"patch-package": "6.2.2",
"rxjs": "6.6.0",
"solidify-frontend": "0.6.8",
"solidify-frontend": "1.0.4",
"streamsaver": "2.0.4",
"sync-pom-version-to-package": "1.5.0",
"ts-key-enum": "2.0.3",
......
......@@ -168,7 +168,7 @@ export class DepositCollectionContainer extends SharedAbstractDetailEditRoutable
isSortable: false,
isFilterable: false,
translate: true,
component: DataTableComponentEnum.conformityLevelStar,
component: DataTableComponentEnum.complianceLevel,
filterEnum: Enums.DataFile.ComplianceLevelEnumTranslate,
},
];
......
......@@ -90,29 +90,29 @@
<div class="file-list-wrapper"
[dlcmSpinner]="isLoadingDataFileObs | async"
>
<dlcm-shared-data-table #dataTablePresentational
*ngIf="columns"
[dlcmDataTest]="dataTestEnum.depositFileDataTable"
[columns]="columns"
[isLoading]="isLoadingDataFileObs | async"
[datas]="listDataFileObs | async"
[queryParameters]="queryParametersObs | async"
(queryParametersChange)="onQueryParametersEvent($event)"
(queryParametersWithoutRefreshChange)="onQueryParametersEvent($event, false)"
(selectChange)="showDetail($event)"
[columnsSkippedToClear]="columnsToSkippedFilter"
[skipInitialQuery]="true"
[actions]="actions"
[isMultiSelectable]="this.canEditObs | async | isTrue"
[bulkActions]="bulkActions"
[isDraggable]="currentFileViewMode === fileViewModeEnum.FolderView"
[listCdkDropListId]="foldersWithIntermediateFoldersObs | async"
[stickyTopPosition]="40"
[draggablePreviewColumn]="'fileName'"
[draggablePreviewMatIcon]="'insert_drive_file'"
[preloadRowsForPage]="true"
<solidify-data-table #dataTablePresentational
*ngIf="columns"
[dlcmDataTest]="dataTestEnum.depositFileDataTable"
[columns]="columns"
[isLoading]="isLoadingDataFileObs | async"
[datas]="listDataFileObs | async"
[queryParameters]="queryParametersObs | async"
(queryParametersChange)="onQueryParametersEvent($event)"
(queryParametersWithoutRefreshChange)="onQueryParametersEvent($event, false)"
(selectChange)="showDetail($event)"
[columnsSkippedToClear]="columnsToSkippedFilter"
[skipInitialQuery]="true"
[actions]="actions"
[isMultiSelectable]="this.canEditObs | async | isTrue"
[bulkActions]="bulkActions"
[isDraggable]="currentFileViewMode === fileViewModeEnum.FolderView"
[listCdkDropListId]="foldersWithIntermediateFoldersObs | async"
[stickyTopPosition]="40"
[draggablePreviewColumn]="'fileName'"
[draggablePreviewMatIcon]="'insert_drive_file'"
[preloadRowsForPage]="true"
>
</dlcm-shared-data-table>
</solidify-data-table>
</div>
<ng-template #noFile>
......
......@@ -52,7 +52,6 @@ import {SharedPreviewDialog} from "@shared/components/dialogs/shared-preview/sha
import {SharedDataTablePresentational} from "@shared/components/presentationals/shared-data-table/shared-data-table.presentational";
import {SharedAbstractDetailEditRoutable} from "@shared/components/routables/shared-abstract-detail-edit/shared-abstract-detail-edit.routable";
import {DataTableComponentEnum} from "@shared/enums/data-table-component.enum";
import {FieldTypeEnum} from "@shared/enums/field-type.enum";
import {FileViewModeEnum} from "@shared/enums/file-view-mode.enum";
import {IconNameEnum} from "@shared/enums/icon-name.enum";
import {LabelTranslateEnum} from "@shared/enums/label-translate.enum";
......@@ -66,9 +65,9 @@ import {
AbstractFileVisualizer,
FILE_VISUALIZERS,
} from "@shared/filevisualizer/services/abstract-file-visualizer.service";
import {DataTableComponentHelper} from "@shared/helpers/data-table-component.helper";
import {DataTableActions} from "@shared/models/data-table-actions.model";
import {DataTableBulkActions} from "@shared/models/data-table-bulk-actions.model";
import {DataTableColumns} from "@shared/models/data-table-columns.model";
import {SecurityService} from "@shared/services/security.service";
import {Observable} from "rxjs";
import {
......@@ -79,6 +78,8 @@ import {
tap,
} from "rxjs/operators";
import {
DataTableColumns,
DataTableFieldTypeEnum,
isNonEmptyArray,
isNullOrUndefined,
isTrue,
......@@ -211,7 +212,7 @@ export class DepositFileContainer extends SharedAbstractDetailEditRoutable<Depos
{
field: "fileName",
header: LabelTranslateEnum.fileName,
type: FieldTypeEnum.string,
type: DataTableFieldTypeEnum.string,
order: OrderEnum.ascending,
filterableField: "dataFile.finalData" as any,
sortableField: "dataFile.finalData" as any,
......@@ -221,7 +222,7 @@ export class DepositFileContainer extends SharedAbstractDetailEditRoutable<Depos
{
field: "creation.when" as any,
header: LabelTranslateEnum.created,
type: FieldTypeEnum.datetime,
type: DataTableFieldTypeEnum.datetime,
order: OrderEnum.none,
isFilterable: false,
isSortable: true,
......@@ -229,21 +230,21 @@ export class DepositFileContainer extends SharedAbstractDetailEditRoutable<Depos
{
field: "status",
header: StringUtil.stringEmpty,
type: FieldTypeEnum.singleSelect,
type: DataTableFieldTypeEnum.singleSelect,
order: OrderEnum.none,
sortableField: "dataFile.status" as any,
filterableField: "dataFile.status" as any,
isSortable: false,
isFilterable: false,
translate: false,
component: DataTableComponentEnum.dataFileQuickStatus,
component: DataTableComponentHelper.get(DataTableComponentEnum.dataFileQuickStatus),
width: "35px",
// filterEnum: ComplianceLevelEnumHelper.getListKeyValue(),
},
{
field: "status",
header: LabelTranslateEnum.status,
type: FieldTypeEnum.singleSelect,
type: DataTableFieldTypeEnum.singleSelect,
order: OrderEnum.none,
sortableField: "dataFile.status" as any,
isSortable: true,
......@@ -251,12 +252,12 @@ export class DepositFileContainer extends SharedAbstractDetailEditRoutable<Depos
translate: true,
tooltip: (value) => Enums.DataFile.getExplanation(value as Enums.DataFile.StatusEnum),
filterEnum: Enums.DataFile.StatusEnumTranslate,
component: DataTableComponentEnum.status,
component: DataTableComponentHelper.get(DataTableComponentEnum.status),
},
{
field: "complianceLevel",
header: LabelTranslateEnum.complianceLevel,
type: FieldTypeEnum.singleSelect,
type: DataTableFieldTypeEnum.singleSelect,
order: OrderEnum.none,
sortableField: "dataFile.complianceLevel" as any,
filterableField: "dataFile.complianceLevel" as any,
......@@ -264,13 +265,13 @@ export class DepositFileContainer extends SharedAbstractDetailEditRoutable<Depos
isFilterable: false,
translate: true,
width: "185px",
component: DataTableComponentEnum.conformityLevelStar,
component: DataTableComponentHelper.get(DataTableComponentEnum.complianceLevel),
filterEnum: Enums.DataFile.ComplianceLevelEnumTranslate,
},
{
field: "smartSize",
header: LabelTranslateEnum.size,
type: FieldTypeEnum.string,
type: DataTableFieldTypeEnum.string,
order: OrderEnum.none,
sortableField: "dataFile.fileSize" as any,
filterableField: "dataFile.fileSize" as any,
......
......@@ -157,7 +157,7 @@ export class HomeArchiveFileListRoutable extends SharedAbstractRoutable implemen
isFilterable: false,
translate: true,
width: "185px",
component: DataTableComponentEnum.conformityLevelStar,
component: DataTableComponentEnum.complianceLevel,
filterEnum: Enums.DataFile.ComplianceLevelEnumTranslate,
},
{
......
......@@ -31,12 +31,12 @@
<div class="wrapper"
[dlcmSpinner]="isLoadingObs | async"
>
<dlcm-shared-data-table [columns]="columns"
[isLoading]="isLoadingObs | async"
[datas]="listObs | async"
[isClickable]="false"
[queryParameters]="queryParametersObs | async"
(queryParametersChange)="onQueryParametersEvent($event)"
></dlcm-shared-data-table>
<solidify-data-table [columns]="columns"
[isLoading]="isLoadingObs | async"
[datas]="listObs | async"
[isClickable]="false"
[queryParameters]="queryParametersObs | async"
(queryParametersChange)="onQueryParametersEvent($event)"
></solidify-data-table>
</div>
</div>
......@@ -10,13 +10,14 @@ import {Store} from "@ngxs/store";
import {PreservationAipStatusAction} from "@preservation-planning/aip-status/stores/preservation-planning-aip-status.action";
import {PreservationPlanningAipStatusState} from "@preservation-planning/aip-status/stores/preservation-planning-aip-status.state";
import {DataTableComponentEnum} from "@shared/enums/data-table-component.enum";
import {FieldTypeEnum} from "@shared/enums/field-type.enum";
import {LabelTranslateEnum} from "@shared/enums/label-translate.enum";
import {RoutesEnum} from "@shared/enums/routes.enum";
import {DataTableComponentHelper} from "@shared/helpers/data-table-component.helper";
import {AipCopyList} from "@shared/models/business/aip-copy-list.model";
import {DataTableColumns} from "@shared/models/data-table-columns.model";
import {Observable} from "rxjs";
import {
DataTableColumns,
DataTableFieldTypeEnum,
MemoizedUtil,
OrderEnum,
QueryParameters,
......@@ -48,7 +49,7 @@ export class PreservationPlanningAipStatusHomeRoutable extends SharedAbstractPre
{
field: "resId",
header: LabelTranslateEnum.identifier,
type: FieldTypeEnum.string,
type: DataTableFieldTypeEnum.string,
order: OrderEnum.none,
isFilterable: false,
isSortable: false,
......@@ -56,37 +57,37 @@ export class PreservationPlanningAipStatusHomeRoutable extends SharedAbstractPre
{
field: "copies",
header: LabelTranslateEnum.nameLabel,
type: FieldTypeEnum.string,
type: DataTableFieldTypeEnum.string,
order: OrderEnum.none,
isFilterable: false,
isSortable: false,
component: DataTableComponentEnum.aipStatusNamePresentational,
component: DataTableComponentHelper.get(DataTableComponentEnum.aipStatusNamePresentational),
},
{
field: "copies",
header: LabelTranslateEnum.organizationalUnit,
type: FieldTypeEnum.string,
type: DataTableFieldTypeEnum.string,
order: OrderEnum.none,
component: DataTableComponentEnum.aipStatusOrgUnitPresentational,
component: DataTableComponentHelper.get(DataTableComponentEnum.aipStatusOrgUnitPresentational),
isFilterable: false,
isSortable: false,
},
{
field: "status",
header: LabelTranslateEnum.status,
type: FieldTypeEnum.singleSelect,
type: DataTableFieldTypeEnum.singleSelect,
order: OrderEnum.none,
isFilterable: true,
isSortable: false,
filterableField: "searchType",
filterEnum: Enums.Aip.AipCopySearchTypeEnumTranslate,
translate: true,
component: DataTableComponentEnum.aipStatusSummaryPresentational,
component: DataTableComponentHelper.get(DataTableComponentEnum.aipStatusSummaryPresentational),
},
{
field: "creationDate",
header: LabelTranslateEnum.created,
type: FieldTypeEnum.datetime,
type: DataTableFieldTypeEnum.datetime,
order: OrderEnum.none,
isFilterable: true,
isSortable: true,
......
......@@ -122,7 +122,7 @@ export class PreservationPlanningDipFileRoutable extends SharedAbstractDetailEdi
isSortable: false,
isFilterable: false,
translate: true,
component: DataTableComponentEnum.conformityLevelStar,
component: DataTableComponentEnum.complianceLevel,
filterEnum: Enums.DataFile.ComplianceLevelEnumTranslate,
},
];
......
......@@ -19,16 +19,15 @@ import {PreservationPlanningJobExecutionState} from "@preservation-planning/job/
import {PreservationPlanningJobAction} from "@preservation-planning/job/stores/preservation-planning-job.action";
import {PreservationPlanningJobState} from "@preservation-planning/job/stores/preservation-planning-job.state";
import {DataTableComponentEnum} from "@shared/enums/data-table-component.enum";
import {FieldTypeEnum} from "@shared/enums/field-type.enum";
import {LabelTranslateEnum} from "@shared/enums/label-translate.enum";
import {
AppRoutesEnum,
PreservationPlanningRoutesEnum,
RoutesEnum,
} from "@shared/enums/routes.enum";
import {DataTableComponentHelper} from "@shared/helpers/data-table-component.helper";
import {PollingHelper} from "@shared/helpers/polling.helper";
import {JobExecution} from "@shared/models/business/job-execution.model";
import {DataTableColumns} from "@shared/models/data-table-columns.model";
import {Observable} from "rxjs";
import {
distinctUntilChanged,
......@@ -37,6 +36,8 @@ import {
tap,
} from "rxjs/operators";
import {
DataTableColumns,
DataTableFieldTypeEnum,
isNullOrUndefined,
isTrue,
MemoizedUtil,
......@@ -114,7 +115,7 @@ export class PreservationPlanningJobExecutionListContainer extends SharedAbstrac
{
field: "runNumber",
header: LabelTranslateEnum.runNumber,
type: FieldTypeEnum.string,
type: DataTableFieldTypeEnum.string,
order: OrderEnum.descending,
isFilterable: false,
isSortable: true,
......@@ -123,28 +124,28 @@ export class PreservationPlanningJobExecutionListContainer extends SharedAbstrac
{
field: "status",
header: LabelTranslateEnum.status,
type: FieldTypeEnum.singleSelect,
type: DataTableFieldTypeEnum.singleSelect,
order: OrderEnum.none,
isFilterable: false,
isSortable: true,
translate: true,
filterEnum: Enums.PreservationJob.ExecutionStatusEnumTranslate,
component: DataTableComponentEnum.status,
component: DataTableComponentHelper.get(DataTableComponentEnum.status),
width: "160px",
},
{
field: "completionStatus",
header: LabelTranslateEnum.completionStatus,
type: FieldTypeEnum.string,
type: DataTableFieldTypeEnum.string,
order: OrderEnum.none,
isFilterable: false,
isSortable: true,
component: DataTableComponentEnum.jobExecutionProgression,
component: DataTableComponentHelper.get(DataTableComponentEnum.jobExecutionProgression), // TODO FIX WITH SOLIDFIY TABLE
},
{
field: "startDate",
header: LabelTranslateEnum.startDate,
type: FieldTypeEnum.datetime,
type: DataTableFieldTypeEnum.datetime,
order: OrderEnum.none,
isFilterable: false,
isSortable: true,
......@@ -152,7 +153,7 @@ export class PreservationPlanningJobExecutionListContainer extends SharedAbstrac
{
field: "endDate",
header: LabelTranslateEnum.endDate,
type: FieldTypeEnum.datetime,
type: DataTableFieldTypeEnum.datetime,
order: OrderEnum.none,
isFilterable: false,
isSortable: true,
......
<lib-empty-container (keydown.escape)="isEdit ? backToList() : backToDetail()">
<solidify-empty-container (keydown.escape)="isEdit ? backToList() : backToDetail()">
<router-outlet></router-outlet>
<ng-template [ngIf]="this.preservationJob">
......@@ -32,4 +32,4 @@
>
</dlcm-preservation-planning-job-execution-container>
</ng-template>
</lib-empty-container>
</solidify-empty-container>
......@@ -131,7 +131,7 @@ export class PreservationPlanningSipCollectionRoutable extends SharedAbstractDet
isSortable: false,
isFilterable: false,
translate: true,
component: DataTableComponentEnum.conformityLevelStar,
component: DataTableComponentEnum.complianceLevel,
filterEnum: Enums.DataFile.ComplianceLevelEnumTranslate,
},
];
......
......@@ -137,7 +137,7 @@ export class PreservationPlanningSipFileRoutable extends SharedAbstractDetailEdi
isSortable: false,
isFilterable: false,
translate: true,
component: DataTableComponentEnum.conformityLevelStar,
component: DataTableComponentEnum.complianceLevel,
filterEnum: Enums.DataFile.ComplianceLevelEnumTranslate,
},
];
......
......@@ -89,8 +89,8 @@
>
{{col.header | translate}}
<solidify-icon *ngIf="col.isSortable"
[iconName]="getSortIcon(col)"
class="sm sortable-icon"
[iconName]="getSortIcon(col)"
class="sm sortable-icon"
></solidify-icon>
</th>
......@@ -182,7 +182,7 @@
(click)="cleanFilter(select, col)"
>
<solidify-icon [iconName]="iconNameEnum.close"
matSuffix
matSuffix
></solidify-icon>
</button>
</div>
......@@ -207,7 +207,7 @@
(click)="cleanFilter(filter, col)"
>
<solidify-icon [iconName]="iconNameEnum.close"
matSuffix
matSuffix
></solidify-icon>
</button>
</div>
......@@ -232,7 +232,7 @@
(click)="cleanFilter(filter, col)"
>
<solidify-icon [iconName]="iconNameEnum.close"
matSuffix
matSuffix
></solidify-icon>
</button>
</div>
......@@ -241,12 +241,12 @@
class="filter-boolean"
>
<solidify-icon *ngIf="select?.value === false"
class="icon-boolean"
[iconName]="iconNameEnum.falseValue"
class="icon-boolean"
[iconName]="iconNameEnum.falseValue"
></solidify-icon>
<solidify-icon *ngIf="select?.value === true"
class="icon-boolean"
[iconName]="iconNameEnum.trueValue"
class="icon-boolean"
[iconName]="iconNameEnum.trueValue"
></solidify-icon>
<mat-select #select
[class.no-value]="(select.value | isEmptyString) || (select.value | isNullOrUndefined)"
......@@ -275,7 +275,7 @@
(click)="cleanFilter(select, col)"
>
<solidify-icon [iconName]="iconNameEnum.close"
matSuffix
matSuffix
></solidify-icon>
</button>
</div>
......@@ -318,8 +318,8 @@
<!-- pSelectableRow="row"-->
<div *cdkDragPreview>
<solidify-icon *ngIf="!(draggablePreviewMatIcon | isNullOrUndefined)"
class="icon"
[iconName]="draggablePreviewMatIcon"
class="icon"
[iconName]="draggablePreviewMatIcon"
></solidify-icon>
<span *ngIf="!(draggablePreviewColumn | isNullOrUndefined)"
class="label"
......@@ -525,7 +525,7 @@
[organizationalUnit]="rowData"
></dlcm-shared-organizational-unit-member-container>
<dlcm-shared-compliance-level-rating *ngSwitchCase="dataTableComponentEnum.conformityLevelStar"
<dlcm-shared-compliance-level-rating *ngSwitchCase="dataTableComponentEnum.complianceLevel"
[withLabel]="false"
[center]="true"
[value]="getData(rowData, col)"
......@@ -535,7 +535,7 @@
<dlcm-shared-datafile-quick-status *ngSwitchCase="dataTableComponentEnum.dataFileQuickStatus"
#quickStatus
[value]="getData(rowData, col)"
[matTooltip]="quickStatus.toolipToTranslate | translate"
[matTooltip]="quickStatus.tooltipToTranslate | translate"
>
</dlcm-shared-datafile-quick-status>
......
......@@ -677,7 +677,7 @@ export class SharedDataTablePresentational<TResource extends BaseResource> exten
if (isString(column.width)) {
return column.width;
}
if (column.component === DataTableComponentEnum.conformityLevelStar) {
if (column.component === DataTableComponentEnum.complianceLevel) {
return "100px";
}
if (column.type === FieldTypeEnum.datetime) {
......
......@@ -35,7 +35,7 @@ export class SharedDatafileQuickStatusPresentational extends SharedAbstractPrese
set value(value: Enums.DataFile.StatusEnum) {
this._value = value;
this.classes = this.getColor();
this.toolipToTranslate = Enums.DataFile.getExplanation(value);
this.tooltipToTranslate = Enums.DataFile.getExplanation(value);
}
get value(): Enums.DataFile.StatusEnum {
......@@ -46,7 +46,7 @@ export class SharedDatafileQuickStatusPresentational extends SharedAbstractPrese
super();
}
toolipToTranslate: string | undefined;
tooltipToTranslate: string | undefined;
@HostBinding("class")
classes: string;
......
export enum DataTableComponentEnum {
aipStatusSummaryPresentational = 1,
aipStatusNamePresentational,
aipStatusOrgUnitPresentational,
conformityLevelStar,
dataFileQuickStatus,
jobExecutionProgression,
organizationalUnitName,
archive,
adminResearchDomainLabel,
accessLevel,
status,
logo,
organizationalUnitMember,
sensitivity,
archivePublicationDate,
import {
DataTableComponentPartialEnum,