mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2065] Refactored Content node selector component (#2778)
* [ADF-2065] created dialog component for content node selector * [ADF-2065] removing SiteModel from site dropdown to use SitePaging model of js-api * [ADF-2065] - removed site model and updated documentation * [ADF-2065] fixed test for site component * [ADF-2065] refactored content node selector and created content node selector dialog * [ADF-2065] fixed test on site-api service * [ADF-2065] added a new content node dialog service to centralise the logic for content node dialog * [ADF-2065] start adding test for node-actions service| * [ADF-2065] added test for node-actions service * [ADF-2065] added test for node action service * [ADF-2065] renamed components to keep backward compatibility * [ADF-2065] added input just for backward compatibility * [ADF-2065] added some changes for backward compatibility and updated documentation * [ADF-2065] updated documentation for content node selector
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { SiteModel, SitesService } from '@alfresco/adf-core';
|
||||
import { SitesService } from '@alfresco/adf-core';
|
||||
import { SitePaging, SiteEntry } from 'alfresco-js-api';
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
@@ -29,13 +30,13 @@ export class DropdownSitesComponent implements OnInit {
|
||||
hideMyFiles: boolean = false;
|
||||
|
||||
@Input()
|
||||
siteList: any[] = null;
|
||||
siteList: SitePaging = null;
|
||||
|
||||
@Input()
|
||||
placeholder: string = 'DROPDOWN.PLACEHOLDER_LABEL';
|
||||
|
||||
@Output()
|
||||
change: EventEmitter<SiteModel> = new EventEmitter();
|
||||
change: EventEmitter<SiteEntry> = new EventEmitter();
|
||||
|
||||
public MY_FILES_VALUE = 'default';
|
||||
|
||||
@@ -52,15 +53,14 @@ export class DropdownSitesComponent implements OnInit {
|
||||
selectedSite() {
|
||||
let siteFound;
|
||||
if (this.siteSelected === this.MY_FILES_VALUE) {
|
||||
siteFound = new SiteModel();
|
||||
siteFound = { entry: {}};
|
||||
}else {
|
||||
siteFound = this.siteList.find( site => site.guid === this.siteSelected);
|
||||
siteFound = this.siteList.list.entries.find( site => site.entry.guid === this.siteSelected);
|
||||
}
|
||||
this.change.emit(siteFound);
|
||||
}
|
||||
|
||||
setDefaultSiteList() {
|
||||
this.siteList = [];
|
||||
this.sitesService.getSites().subscribe((result) => {
|
||||
this.siteList = result;
|
||||
},
|
||||
|
Reference in New Issue
Block a user