mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
[ADF-2766] download button for custom sources (#3258)
* download button for custom sources * fix enum usage
This commit is contained in:
parent
76005cd215
commit
9b78fcb445
@ -8,6 +8,13 @@
|
|||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</adf-toolbar-title>
|
</adf-toolbar-title>
|
||||||
|
<adf-toolbar-divider fxFlex="0 0 auto"></adf-toolbar-divider>
|
||||||
|
<button mat-icon-button
|
||||||
|
[disabled]="!hasSelection(customSourcesDocumentList.selection)"
|
||||||
|
title="{{ 'DOCUMENT_LIST.TOOLBAR.DOWNLOAD' | translate }}"
|
||||||
|
[adfNodeDownload]="customSourcesDocumentList.selection">
|
||||||
|
<mat-icon>get_app</mat-icon>
|
||||||
|
</button>
|
||||||
</adf-toolbar>
|
</adf-toolbar>
|
||||||
<adf-document-list
|
<adf-document-list
|
||||||
#customSourcesDocumentList
|
#customSourcesDocumentList
|
||||||
|
@ -41,4 +41,8 @@ export class CustomSourcesComponent {
|
|||||||
{ title: 'My', value: '-my-' },
|
{ title: 'My', value: '-my-' },
|
||||||
{ title: 'Shared', value: '-shared-' }
|
{ title: 'Shared', value: '-shared-' }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
hasSelection(selection: any[]): boolean {
|
||||||
|
return selection && selection.length > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,8 @@ import {
|
|||||||
NodePaging,
|
NodePaging,
|
||||||
PersonEntry,
|
PersonEntry,
|
||||||
SitePaging,
|
SitePaging,
|
||||||
DeletedNodesPaging
|
DeletedNodesPaging,
|
||||||
|
SortDefinitionType
|
||||||
} from 'alfresco-js-api';
|
} from 'alfresco-js-api';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
@ -56,7 +57,7 @@ export class CustomResourcesService {
|
|||||||
],
|
],
|
||||||
include: ['path', 'properties', 'allowableOperations'],
|
include: ['path', 'properties', 'allowableOperations'],
|
||||||
sort: [{
|
sort: [{
|
||||||
type: 'FIELD',
|
type: SortDefinitionType.FIELD,
|
||||||
field: 'cm:modified',
|
field: 'cm:modified',
|
||||||
ascending: false
|
ascending: false
|
||||||
}],
|
}],
|
||||||
@ -66,8 +67,8 @@ export class CustomResourcesService {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return this.apiService.searchApi.search(query)
|
return this.apiService.searchApi.search(query)
|
||||||
.then((serachResult) => {
|
.then((searchResult) => {
|
||||||
observer.next(serachResult);
|
observer.next(searchResult);
|
||||||
observer.complete();
|
observer.complete();
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user