From 9c427b314248b0b63695d928c392dc339d23e73d Mon Sep 17 00:00:00 2001 From: siva kumar Date: Thu, 17 Sep 2020 18:41:51 +0530 Subject: [PATCH] [AAE-3507] ADF - Change default destination folder alias -root- to -my- (#6126) * [AAE-3507] ADF - Change default destination folder alias -root- to -my- * * After rebase --- .../attach-file-cloud-widget.component.spec.ts | 12 ++++++------ .../attach-file-cloud-widget.component.ts | 9 ++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.spec.ts b/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.spec.ts index c6c85ea4c1..27e4dd6917 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.spec.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.spec.ts @@ -368,8 +368,8 @@ describe('AttachFileCloudWidgetComponent', () => { await fixture.whenStable(); fixture.detectChanges(); - expect(widget.rootNodeId).toEqual('-root-'); - expect(openUploadFileDialogSpy).toHaveBeenCalledWith('-root-', 'multiple', true); + expect(widget.rootNodeId).toEqual('-my-'); + expect(openUploadFileDialogSpy).toHaveBeenCalledWith('-my-', 'multiple', true); }); it('Should be able to set default alias as rootNodeId if destinationFolderPath does not have alias', async () => { @@ -390,8 +390,8 @@ describe('AttachFileCloudWidgetComponent', () => { await fixture.whenStable(); fixture.detectChanges(); - expect(widget.rootNodeId).toEqual('-root-'); - expect(openUploadFileDialogSpy).toHaveBeenCalledWith('-root-', 'multiple', true); + expect(widget.rootNodeId).toEqual('-my-'); + expect(openUploadFileDialogSpy).toHaveBeenCalledWith('-my-', 'multiple', true); }); it('should return the application name in case -appname- placeholder is present', async() => { @@ -450,8 +450,8 @@ describe('AttachFileCloudWidgetComponent', () => { await fixture.whenStable(); fixture.detectChanges(); - expect(widget.rootNodeId).toEqual('-root-'); - expect(openUploadFileDialogSpy).toHaveBeenCalledWith('-root-', 'single', true); + expect(widget.rootNodeId).toEqual('-my-'); + expect(openUploadFileDialogSpy).toHaveBeenCalledWith('-my-', 'single', true); }); it('should display tooltip when tooltip is set', async(() => { diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.ts b/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.ts index 61d0cf368e..e14caa69e0 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.ts @@ -52,13 +52,12 @@ import { DestinationFolderPathModel } from '../../../models/form-cloud-represent }) export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent implements OnInit { - static MY_FILES_FOLDER_ID = '-my-'; - static ROOT_FOLDER_ID = '-root-'; + static ALIAS_USER_FOLDER = '-my-'; static APP_NAME = '-appname-'; - static VALID_ALIAS = [AttachFileCloudWidgetComponent.ROOT_FOLDER_ID, AttachFileCloudWidgetComponent.MY_FILES_FOLDER_ID, '-shared-']; + static VALID_ALIAS = ['-root-', AttachFileCloudWidgetComponent.ALIAS_USER_FOLDER, '-shared-']; typeId = 'AttachFileCloudWidgetComponent'; - rootNodeId = AttachFileCloudWidgetComponent.MY_FILES_FOLDER_ID; + rootNodeId = AttachFileCloudWidgetComponent.ALIAS_USER_FOLDER; constructor( formService: FormService, @@ -133,7 +132,7 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent i } } - return this.isValidAlias(alias) ? { alias, path } : { alias: AttachFileCloudWidgetComponent.ROOT_FOLDER_ID, path: undefined }; + return this.isValidAlias(alias) ? { alias, path } : { alias: AttachFileCloudWidgetComponent.ALIAS_USER_FOLDER, path: undefined }; } removeExistingSelection(selections: Node[]) {