From 3fcddc4e1ac9dc4bc06a29a0597b4b288526fee1 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 2 Oct 2024 22:23:43 -0700 Subject: [PATCH] Improve new storage path display on list / edit --- src-ui/messages.xlf | 38 +++++++++---------- .../storage-path-edit-dialog.component.html | 2 +- .../input/textarea/textarea.component.html | 12 +++++- .../input/textarea/textarea.component.ts | 3 ++ .../management-list.component.html | 4 +- .../management-list.component.ts | 2 + .../storage-path-list.component.spec.ts | 12 ++++++ .../storage-path-list.component.ts | 3 +- 8 files changed, 52 insertions(+), 24 deletions(-) diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 47c3b8c0f..8383acfc1 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -1561,7 +1561,7 @@ src/app/components/manage/management-list/management-list.component.ts - 208 + 210 src/app/components/manage/workflows/workflows.component.html @@ -2185,11 +2185,11 @@ src/app/components/manage/management-list/management-list.component.ts - 204 + 206 src/app/components/manage/management-list/management-list.component.ts - 321 + 323 @@ -2231,7 +2231,7 @@ src/app/components/manage/management-list/management-list.component.ts - 323 + 325 src/app/components/manage/workflows/workflows.component.ts @@ -2582,7 +2582,7 @@ src/app/components/manage/management-list/management-list.component.ts - 325 + 327 src/app/components/manage/workflows/workflows.component.ts @@ -7681,7 +7681,7 @@ src/app/components/manage/management-list/management-list.component.ts - 308 + 310 @@ -7783,7 +7783,7 @@ Automatic src/app/components/manage/management-list/management-list.component.ts - 115 + 117 src/app/data/matching-model.ts @@ -7794,7 +7794,7 @@ None src/app/components/manage/management-list/management-list.component.ts - 117 + 119 src/app/data/matching-model.ts @@ -7805,70 +7805,70 @@ Successfully created . src/app/components/manage/management-list/management-list.component.ts - 161 + 163 Error occurred while creating . src/app/components/manage/management-list/management-list.component.ts - 166 + 168 Successfully updated . src/app/components/manage/management-list/management-list.component.ts - 181 + 183 Error occurred while saving . src/app/components/manage/management-list/management-list.component.ts - 186 + 188 Associated documents will not be deleted. src/app/components/manage/management-list/management-list.component.ts - 206 + 208 Error while deleting element src/app/components/manage/management-list/management-list.component.ts - 222 + 224 Permissions updated successfully src/app/components/manage/management-list/management-list.component.ts - 301 + 303 This operation will permanently delete all objects. src/app/components/manage/management-list/management-list.component.ts - 322 + 324 Objects deleted successfully src/app/components/manage/management-list/management-list.component.ts - 336 + 338 Error deleting objects src/app/components/manage/management-list/management-list.component.ts - 342 + 344 @@ -7889,7 +7889,7 @@ Do you really want to delete the storage path ""? src/app/components/manage/storage-path-list/storage-path-list.component.ts - 53 + 54 diff --git a/src-ui/src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html b/src-ui/src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html index 32d663db8..f8232f957 100644 --- a/src-ui/src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html +++ b/src-ui/src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html @@ -10,7 +10,7 @@
- + @if (hint) { } diff --git a/src-ui/src/app/components/common/input/textarea/textarea.component.ts b/src-ui/src/app/components/common/input/textarea/textarea.component.ts index 39b6c13fe..46c2a52ad 100644 --- a/src-ui/src/app/components/common/input/textarea/textarea.component.ts +++ b/src-ui/src/app/components/common/input/textarea/textarea.component.ts @@ -18,6 +18,9 @@ export class TextAreaComponent extends AbstractInputComponent { @Input() placeholder: string = '' + @Input() + monospace: boolean = false + constructor() { super() } diff --git a/src-ui/src/app/components/manage/management-list/management-list.component.html b/src-ui/src/app/components/manage/management-list/management-list.component.html index a180f4941..10522b8f1 100644 --- a/src-ui/src/app/components/manage/management-list/management-list.component.html +++ b/src-ui/src/app/components/manage/management-list/management-list.component.html @@ -38,7 +38,7 @@ Matching Document count @for (column of extraColumns; track column) { - {{column.name}} + {{column.name}} } Actions @@ -64,7 +64,7 @@ {{ getMatching(object) }} {{ object.document_count }} @for (column of extraColumns; track column) { - + @if (column.rendersHtml) {
} @else { diff --git a/src-ui/src/app/components/manage/management-list/management-list.component.ts b/src-ui/src/app/components/manage/management-list/management-list.component.ts index 84cee9ddc..27165a8fb 100644 --- a/src-ui/src/app/components/manage/management-list/management-list.component.ts +++ b/src-ui/src/app/components/manage/management-list/management-list.component.ts @@ -44,6 +44,8 @@ export interface ManagementListColumn { valueFn: any rendersHtml?: boolean + + hideOnMobile?: boolean } @Directive() diff --git a/src-ui/src/app/components/manage/storage-path-list/storage-path-list.component.spec.ts b/src-ui/src/app/components/manage/storage-path-list/storage-path-list.component.spec.ts index 36da7cc84..00cb2b037 100644 --- a/src-ui/src/app/components/manage/storage-path-list/storage-path-list.component.spec.ts +++ b/src-ui/src/app/components/manage/storage-path-list/storage-path-list.component.spec.ts @@ -12,6 +12,7 @@ import { StoragePathListComponent } from './storage-path-list.component' import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe' +import { StoragePath } from 'src/app/data/storage-path' describe('StoragePathListComponent', () => { let component: StoragePathListComponent @@ -73,4 +74,15 @@ describe('StoragePathListComponent', () => { 'Do you really want to delete the storage path "StoragePath1"?' ) }) + + it('should truncate path if necessary', () => { + const path: StoragePath = { + id: 1, + name: 'StoragePath1', + path: 'a'.repeat(100), + } + expect(component.extraColumns[0].valueFn(path)).toEqual( + `${'a'.repeat(49)}...` + ) + }) }) diff --git a/src-ui/src/app/components/manage/storage-path-list/storage-path-list.component.ts b/src-ui/src/app/components/manage/storage-path-list/storage-path-list.component.ts index 5177a0a21..66819284d 100644 --- a/src-ui/src/app/components/manage/storage-path-list/storage-path-list.component.ts +++ b/src-ui/src/app/components/manage/storage-path-list/storage-path-list.component.ts @@ -41,8 +41,9 @@ export class StoragePathListComponent extends ManagementListComponent { - return `${c.path}` + return `${c.path?.slice(0, 49)}${c.path?.length > 50 ? '...' : ''}` }, }, ]