Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.
TypeScript cloud-alternativecollaborationcollaborative-editingdropboxfile-serverfile-sharingfile-storagefile-syncfull-text-searchhomelabnextcloudon-premiseopen-sourceprivacy-firstprivate-cloudrealtimesecureself-hostedstorage-serverwebdav
feat(frontend:files): add a compact file type selector on mobile
johavenc6c8c225ba8f
diff --git a/frontend/src/app/applications/files/components/dialogs/files-new-dialog.component.html b/frontend/src/app/applications/files/components/dialogs/files-new-dialog.component.htmlindex 595bc548..9aad7084 100755--- a/frontend/src/app/applications/files/components/dialogs/files-new-dialog.component.html+++ b/frontend/src/app/applications/files/components/dialogs/files-new-dialog.component.html@@ -17,7 +17,20 @@</div><div class="modal-body">@if (inputType !== 'download') {- <div class="mb-3" role="group" [attr.aria-label]="'New' | translate: locale.language">+ <label class="form-label d-sm-none" for="new-file-type" l10nTranslate>Type</label>+ <select+ id="new-file-type"+ class="form-select d-sm-none mb-3"+ [ngModel]="inputType === 'directory' ? 'directory' : currentDocType()"+ (ngModelChange)="onSelectMobileType($event)">+ <option value="directory">{{ 'New folder' | translate: locale.language }}</option>+ <optgroup [label]="'Document' | translate: locale.language">+ @for (item of docTypes | keyvalue: originalOrderKeyValue; track item.key) {+ <option [value]="item.key">{{ item.key | translate: locale.language }}{{ item.value ? ' (.' + item.value + ')' : '' }}</option>+ }+ </optgroup>+ </select>+ <div class="mb-3 d-none d-sm-block" role="group" [attr.aria-label]="'New' | translate: locale.language"><div class="row g-2"><div class="col-12 col-sm-6"><buttondiff --git a/frontend/src/app/applications/files/components/dialogs/files-new-dialog.component.ts b/frontend/src/app/applications/files/components/dialogs/files-new-dialog.component.tsindex 4c61cc97..ddddbbff 100644--- a/frontend/src/app/applications/files/components/dialogs/files-new-dialog.component.ts+++ b/frontend/src/app/applications/files/components/dialogs/files-new-dialog.component.ts@@ -89,6 +89,14 @@ export class FilesNewDialogComponent implements OnInit, AfterViewInit {this.updateFileSelection()}+ onSelectMobileType(type: string) {+ if (type === 'directory') {+ this.onSelectDirectory()+ } else {+ this.onSelectDocType(type)+ }+ }+onSelectDirectory() {if (this.inputType === 'file') {const extensionPosition = this.fileNamePosition()@@ -177,7 +185,7 @@ export class FilesNewDialogComponent implements OnInit, AfterViewInit {return this.fileProp.name.lastIndexOf('.')}- private currentDocType(): string {+ protected currentDocType(): string {const extensionPosition = this.fileNamePosition()const extension = extensionPosition >= 0 ? this.fileProp.name.slice(extensionPosition + 1).toLowerCase() : ''return Object.keys(this.docTypes).find((docType) => this.docTypes[docType] && this.docTypes[docType].toLowerCase() === extension) || 'Other'