[ACA-1552] extensibility support for document lists (#714)

* dynamic column component

* dynamic columns for files

* support conditional rendering

* libraries preset

* shared files preset

* recent files preset

* favorites preset

* trashcan preset

* load presets from the extension config

* code fixes
This commit is contained in:
Denys Vuika
2018-10-14 08:21:58 +01:00
committed by Cilibiu Bogdan
parent 933f426759
commit 9dcdacce40
19 changed files with 785 additions and 239 deletions

View File

@@ -37,45 +37,37 @@
</empty-folder-content>
<data-columns>
<data-column
key="$thumbnail"
type="image"
[sortable]="false"
class="image-table-cell">
</data-column>
<ng-container *ngFor="let column of columns">
<data-column
class="adf-data-table-cell--ellipsis__name"
key="name"
title="APP.DOCUMENT_LIST.COLUMNS.NAME">
<ng-container *ngIf="column.template && !(column.desktopOnly && isSmallScreen)">
<data-column
[key]="column.key"
[title]="column.title"
[type]="column.type"
[format]="column.format"
[class]="column.class"
[sortable]="column.sortable">
<ng-template let-context>
<app-name-column [context]="context"></app-name-column>
<app-dynamic-column
[id]="column.template"
[context]="context">
</app-dynamic-column>
</ng-template>
</data-column>
</data-column>
</ng-container>
<data-column
*ngIf="!isSmallScreen"
key="path.name"
title="APP.DOCUMENT_LIST.COLUMNS.LOCATION">
<ng-template let-context>
<aca-location-link [context]="context"></aca-location-link>
</ng-template>
</data-column>
<ng-container *ngIf="!column.template && !(column.desktopOnly && isSmallScreen)">
<data-column
[key]="column.key"
[title]="column.title"
[type]="column.type"
[format]="column.format"
[class]="column.class"
[sortable]="column.sortable">
</data-column>
</ng-container>
<data-column
*ngIf="!isSmallScreen"
key="content.sizeInBytes"
type="fileSize"
title="APP.DOCUMENT_LIST.COLUMNS.SIZE">
</data-column>
<data-column
*ngIf="!isSmallScreen"
key="modifiedAt"
title="APP.DOCUMENT_LIST.COLUMNS.MODIFIED_ON"
type="date"
format="timeAgo">
</data-column>
</ng-container>
</data-columns>
</adf-document-list>

View File

@@ -38,6 +38,8 @@ import { AppExtensionService } from '../../extensions/extension.service';
export class RecentFilesComponent extends PageComponent implements OnInit {
isSmallScreen = false;
columns: any[] = [];
constructor(
store: Store<AppStore>,
extensions: AppExtensionService,
@@ -61,6 +63,8 @@ export class RecentFilesComponent extends PageComponent implements OnInit {
this.isSmallScreen = result.matches;
})
]);
this.columns = this.extensions.documentListPresets.recent || [];
}
onNodeDoubleClick(node: MinimalNodeEntity) {