[AAE-3321] Select uploaded local files by default (#6079)

* [AAE-3111] Select uploaded files by default

* [AAE-3321] Select uploaded local files by default

* * After rebase

* *  Renamed method/property names

* * Fixed comments
* Added a private method to bubble up preselected nodes

* * Added unit tests

* * Fixed typo* added doc* Preselect based on the selection mode

* * Added way to test in demo shell
This commit is contained in:
siva kumar
2020-09-14 13:37:41 +05:30
committed by GitHub
parent a64e13bec5
commit 6fa02548ae
11 changed files with 429 additions and 34 deletions

View File

@@ -13,6 +13,7 @@
[currentFolderId]="'-recent-'"
locationFormat="/files"
[display]="'gallery'"
[preselectNodes]="selectedNodes"
[showHeader]="false"
[maxItems]="5"
(preview)="showFile($event)"
@@ -221,6 +222,7 @@
[contentActions]="true"
[allowDropFiles]="allowDropFiles"
[selectionMode]="selectionMode"
[preselectNodes]="selectedNodes"
[multiselect]="multiselect"
[display]="displayMode"
[node]="nodeResult"
@@ -550,7 +552,7 @@
</section>
<section>
<mat-slide-toggle id="adf-multiple-upload-switch" [color]="'primary'" [(ngModel)]="multipleFileUpload">
<mat-slide-toggle id="adf-multiple-upload-switch" [color]="'primary'" (change)="onMultipleFilesUpload()" [(ngModel)]="multipleFileUpload" >
{{'DOCUMENT_LIST.MULTIPLE_FILE_UPLOAD' | translate}}
</mat-slide-toggle>
</section>
@@ -643,6 +645,21 @@
</mat-slide-toggle>
</section>
<section>
<mat-slide-toggle
color="primary" [(ngModel)]="preselectNodes" id="preselectNodes">
Preselect Nodes
</mat-slide-toggle>
</section>
<form class="example-form">
<mat-form-field *ngIf="preselectNodes" class="adf-preselect-nodes-input">
<input matInput
(input)="setPreselectNodes($event.target?.value)"
placeholder="NodeEntry[] => [{ entry: { isFile: true, id: 'node-id' }}, { entry: { isFile: true, id: 'node-id' }} ]">
</mat-form-field>
</form>
<h5>Upload</h5>
<section *ngIf="acceptedFilesTypeShow">
<mat-form-field floatPlaceholder="float">