mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1374] Move download and create folder dialogs to ADF (#2205)
* move create folder and download zip dialogs to core * code cleanup
This commit is contained in:
committed by
Mario Romano
parent
f3515ad02b
commit
8b4261acb3
@@ -43,9 +43,6 @@ import { CustomEditorsModule } from './components/activiti/custom-editor/custom-
|
|||||||
import { MaterialModule } from './material.module';
|
import { MaterialModule } from './material.module';
|
||||||
import { DebugAppConfigService } from './services/debug-app-config.service';
|
import { DebugAppConfigService } from './services/debug-app-config.service';
|
||||||
|
|
||||||
import { CreateFolderDialogComponent } from './dialogs/create-folder.dialog';
|
|
||||||
import { DownloadZipDialogComponent } from './dialogs/download-zip.dialog';
|
|
||||||
|
|
||||||
import { FormListDemoComponent } from './components/form/form-list-demo.component';
|
import { FormListDemoComponent } from './components/form/form-list-demo.component';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -121,8 +118,6 @@ if (process.env.ENV === 'production') {
|
|||||||
AboutComponent,
|
AboutComponent,
|
||||||
FilesComponent,
|
FilesComponent,
|
||||||
FormNodeViewerComponent,
|
FormNodeViewerComponent,
|
||||||
CreateFolderDialogComponent,
|
|
||||||
DownloadZipDialogComponent,
|
|
||||||
SettingsComponent,
|
SettingsComponent,
|
||||||
FormDemoComponent,
|
FormDemoComponent,
|
||||||
FormListDemoComponent
|
FormListDemoComponent
|
||||||
@@ -138,10 +133,6 @@ if (process.env.ENV === 'production') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
bootstrap: [ AppComponent ],
|
bootstrap: [ AppComponent ]
|
||||||
entryComponents: [
|
|
||||||
CreateFolderDialogComponent,
|
|
||||||
DownloadZipDialogComponent
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule { }
|
||||||
|
@@ -20,14 +20,12 @@ import { MdDialog } from '@angular/material';
|
|||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||||
import { MinimalNodeEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntity } from 'alfresco-js-api';
|
||||||
import {
|
import {
|
||||||
AlfrescoApiService, AlfrescoContentService, AlfrescoTranslationService, FileUploadCompleteEvent,
|
AlfrescoApiService, AlfrescoContentService, AlfrescoTranslationService, CreateFolderDialogComponent,
|
||||||
FolderCreatedEvent, NotificationService, SiteModel, UploadService
|
DownloadZipDialogComponent, FileUploadCompleteEvent, FolderCreatedEvent, NotificationService,
|
||||||
|
SiteModel, UploadService
|
||||||
} from 'ng2-alfresco-core';
|
} from 'ng2-alfresco-core';
|
||||||
import { DocumentListComponent, PermissionStyleModel } from 'ng2-alfresco-documentlist';
|
import { DocumentListComponent, PermissionStyleModel } from 'ng2-alfresco-documentlist';
|
||||||
|
|
||||||
import { CreateFolderDialogComponent } from '../../dialogs/create-folder.dialog';
|
|
||||||
import { DownloadZipDialogComponent } from './../../dialogs/download-zip.dialog';
|
|
||||||
|
|
||||||
import { ViewerService } from 'ng2-alfresco-viewer';
|
import { ViewerService } from 'ng2-alfresco-viewer';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@@ -30,6 +30,9 @@ import { CardViewModule } from './src/components/view/card-view.module';
|
|||||||
import { MaterialModule } from './src/material.module';
|
import { MaterialModule } from './src/material.module';
|
||||||
import { AppConfigModule } from './src/services/app-config.service';
|
import { AppConfigModule } from './src/services/app-config.service';
|
||||||
|
|
||||||
|
import { CreateFolderDialogComponent } from './src/dialogs/create-folder.dialog';
|
||||||
|
import { DownloadZipDialogComponent } from './src/dialogs/download-zip.dialog';
|
||||||
|
|
||||||
import { AlfrescoApiService } from './src/services/alfresco-api.service';
|
import { AlfrescoApiService } from './src/services/alfresco-api.service';
|
||||||
import { AlfrescoContentService } from './src/services/alfresco-content.service';
|
import { AlfrescoContentService } from './src/services/alfresco-content.service';
|
||||||
import { AlfrescoSettingsService } from './src/services/alfresco-settings.service';
|
import { AlfrescoSettingsService } from './src/services/alfresco-settings.service';
|
||||||
@@ -67,6 +70,9 @@ import { SitesApiService } from './src/services/sites-api.service';
|
|||||||
export { MomentDateAdapter, MOMENT_DATE_FORMATS } from './src/utils/momentDateAdapter';
|
export { MomentDateAdapter, MOMENT_DATE_FORMATS } from './src/utils/momentDateAdapter';
|
||||||
import { MomentDateAdapter } from './src/utils/momentDateAdapter';
|
import { MomentDateAdapter } from './src/utils/momentDateAdapter';
|
||||||
|
|
||||||
|
export { CreateFolderDialogComponent } from './src/dialogs/create-folder.dialog';
|
||||||
|
export { DownloadZipDialogComponent } from './src/dialogs/download-zip.dialog';
|
||||||
|
|
||||||
export { ContentService } from './src/services/content.service';
|
export { ContentService } from './src/services/content.service';
|
||||||
export { StorageService } from './src/services/storage.service';
|
export { StorageService } from './src/services/storage.service';
|
||||||
export { CookieService } from './src/services/cookie.service';
|
export { CookieService } from './src/services/cookie.service';
|
||||||
@@ -230,7 +236,9 @@ export function createTranslateLoader(http: Http, logService: LogService) {
|
|||||||
DataColumnListComponent,
|
DataColumnListComponent,
|
||||||
FileSizePipe,
|
FileSizePipe,
|
||||||
HighlightPipe,
|
HighlightPipe,
|
||||||
TimeAgoPipe
|
TimeAgoPipe,
|
||||||
|
CreateFolderDialogComponent,
|
||||||
|
DownloadZipDialogComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
...providers(),
|
...providers(),
|
||||||
@@ -266,7 +274,13 @@ export function createTranslateLoader(http: Http, logService: LogService) {
|
|||||||
DataColumnListComponent,
|
DataColumnListComponent,
|
||||||
FileSizePipe,
|
FileSizePipe,
|
||||||
HighlightPipe,
|
HighlightPipe,
|
||||||
TimeAgoPipe
|
TimeAgoPipe,
|
||||||
|
CreateFolderDialogComponent,
|
||||||
|
DownloadZipDialogComponent
|
||||||
|
],
|
||||||
|
entryComponents: [
|
||||||
|
CreateFolderDialogComponent,
|
||||||
|
DownloadZipDialogComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class CoreModule {
|
export class CoreModule {
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component } from '@angular/core';
|
import { Component, ViewEncapsulation } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-create-folder-dialog',
|
selector: 'adf-create-folder-dialog',
|
||||||
@@ -37,7 +37,8 @@ import { Component } from '@angular/core';
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
]
|
],
|
||||||
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class CreateFolderDialogComponent {
|
export class CreateFolderDialogComponent {
|
||||||
value: string = '';
|
value: string = '';
|
@@ -19,7 +19,7 @@ import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
|
|||||||
import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material';
|
import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material';
|
||||||
|
|
||||||
import { DownloadEntry, MinimalNodeEntity } from 'alfresco-js-api';
|
import { DownloadEntry, MinimalNodeEntity } from 'alfresco-js-api';
|
||||||
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
import { AlfrescoApiService } from './../services/alfresco-api.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-download-zip-dialog',
|
selector: 'adf-download-zip-dialog',
|
||||||
@@ -83,8 +83,6 @@ export class DownloadZipDialogComponent implements OnInit {
|
|||||||
this.dialogRef.close(false);
|
this.dialogRef.close(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Download as ZIP prototype
|
|
||||||
// js-api@alpha 1.8.0-c422a3b69b1b96f72abc61ab370eff53590f8ee4
|
|
||||||
downloadZip(nodeIds: string[]) {
|
downloadZip(nodeIds: string[]) {
|
||||||
if (nodeIds && nodeIds.length > 0) {
|
if (nodeIds && nodeIds.length > 0) {
|
||||||
|
|
||||||
@@ -102,7 +100,6 @@ export class DownloadZipDialogComponent implements OnInit {
|
|||||||
this.nodesApi.getNode(data.entry.id).then((downloadNode: MinimalNodeEntity) => {
|
this.nodesApi.getNode(data.entry.id).then((downloadNode: MinimalNodeEntity) => {
|
||||||
console.log(downloadNode);
|
console.log(downloadNode);
|
||||||
const fileName = downloadNode.entry.name;
|
const fileName = downloadNode.entry.name;
|
||||||
// this.download(url, fileName);
|
|
||||||
this.waitAndDownload(data.entry.id, url, fileName);
|
this.waitAndDownload(data.entry.id, url, fileName);
|
||||||
});
|
});
|
||||||
}
|
}
|
@@ -16,13 +16,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { MdButtonModule, MdSnackBarModule, MdToolbarModule } from '@angular/material';
|
import {
|
||||||
|
MdButtonModule,
|
||||||
|
MdDialogModule,
|
||||||
|
MdInputModule,
|
||||||
|
MdProgressBarModule,
|
||||||
|
MdSnackBarModule,
|
||||||
|
MdToolbarModule
|
||||||
|
} from '@angular/material';
|
||||||
|
|
||||||
export function modules() {
|
export function modules() {
|
||||||
return [
|
return [
|
||||||
|
MdButtonModule,
|
||||||
|
MdDialogModule,
|
||||||
|
MdInputModule,
|
||||||
|
MdProgressBarModule,
|
||||||
MdSnackBarModule,
|
MdSnackBarModule,
|
||||||
MdToolbarModule,
|
MdToolbarModule
|
||||||
MdButtonModule
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user