[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:
Denys Vuika
2017-08-14 11:09:55 +01:00
committed by Mario Romano
parent f3515ad02b
commit 8b4261acb3
6 changed files with 37 additions and 26 deletions

View File

@@ -43,9 +43,6 @@ import { CustomEditorsModule } from './components/activiti/custom-editor/custom-
import { MaterialModule } from './material.module';
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 {
@@ -121,8 +118,6 @@ if (process.env.ENV === 'production') {
AboutComponent,
FilesComponent,
FormNodeViewerComponent,
CreateFolderDialogComponent,
DownloadZipDialogComponent,
SettingsComponent,
FormDemoComponent,
FormListDemoComponent
@@ -138,10 +133,6 @@ if (process.env.ENV === 'production') {
}
}
],
bootstrap: [ AppComponent ],
entryComponents: [
CreateFolderDialogComponent,
DownloadZipDialogComponent
]
bootstrap: [ AppComponent ]
})
export class AppModule { }

View File

@@ -20,14 +20,12 @@ import { MdDialog } from '@angular/material';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { MinimalNodeEntity } from 'alfresco-js-api';
import {
AlfrescoApiService, AlfrescoContentService, AlfrescoTranslationService, FileUploadCompleteEvent,
FolderCreatedEvent, NotificationService, SiteModel, UploadService
AlfrescoApiService, AlfrescoContentService, AlfrescoTranslationService, CreateFolderDialogComponent,
DownloadZipDialogComponent, FileUploadCompleteEvent, FolderCreatedEvent, NotificationService,
SiteModel, UploadService
} from 'ng2-alfresco-core';
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';
@Component({

View File

@@ -30,6 +30,9 @@ import { CardViewModule } from './src/components/view/card-view.module';
import { MaterialModule } from './src/material.module';
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 { AlfrescoContentService } from './src/services/alfresco-content.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';
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 { StorageService } from './src/services/storage.service';
export { CookieService } from './src/services/cookie.service';
@@ -230,7 +236,9 @@ export function createTranslateLoader(http: Http, logService: LogService) {
DataColumnListComponent,
FileSizePipe,
HighlightPipe,
TimeAgoPipe
TimeAgoPipe,
CreateFolderDialogComponent,
DownloadZipDialogComponent
],
providers: [
...providers(),
@@ -266,7 +274,13 @@ export function createTranslateLoader(http: Http, logService: LogService) {
DataColumnListComponent,
FileSizePipe,
HighlightPipe,
TimeAgoPipe
TimeAgoPipe,
CreateFolderDialogComponent,
DownloadZipDialogComponent
],
entryComponents: [
CreateFolderDialogComponent,
DownloadZipDialogComponent
]
})
export class CoreModule {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component } from '@angular/core';
import { Component, ViewEncapsulation } from '@angular/core';
@Component({
selector: 'adf-create-folder-dialog',
@@ -37,7 +37,8 @@ import { Component } from '@angular/core';
width: 100%;
}
`
]
],
encapsulation: ViewEncapsulation.None
})
export class CreateFolderDialogComponent {
value: string = '';

View File

@@ -19,7 +19,7 @@ import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material';
import { DownloadEntry, MinimalNodeEntity } from 'alfresco-js-api';
import { AlfrescoApiService } from 'ng2-alfresco-core';
import { AlfrescoApiService } from './../services/alfresco-api.service';
@Component({
selector: 'adf-download-zip-dialog',
@@ -83,8 +83,6 @@ export class DownloadZipDialogComponent implements OnInit {
this.dialogRef.close(false);
}
// Download as ZIP prototype
// js-api@alpha 1.8.0-c422a3b69b1b96f72abc61ab370eff53590f8ee4
downloadZip(nodeIds: string[]) {
if (nodeIds && nodeIds.length > 0) {
@@ -102,7 +100,6 @@ export class DownloadZipDialogComponent implements OnInit {
this.nodesApi.getNode(data.entry.id).then((downloadNode: MinimalNodeEntity) => {
console.log(downloadNode);
const fileName = downloadNode.entry.name;
// this.download(url, fileName);
this.waitAndDownload(data.entry.id, url, fileName);
});
}

View File

@@ -16,13 +16,23 @@
*/
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() {
return [
MdButtonModule,
MdDialogModule,
MdInputModule,
MdProgressBarModule,
MdSnackBarModule,
MdToolbarModule,
MdButtonModule
MdToolbarModule
];
}