[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
This commit is contained in:
siva kumar
2020-09-17 18:41:51 +05:30
committed by GitHub
parent 864e080e19
commit 9c427b3142
2 changed files with 10 additions and 11 deletions

View File

@@ -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(() => {

View File

@@ -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[]) {