From a4a5dd3a3342b6b848b00062f2dcf417f4bc47f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Mon, 12 Apr 2021 12:50:43 +0300 Subject: [PATCH 1/6] Remove title (default tooltip) from icons --- ...e-attributes-listing-screen.component.html | 19 ++++++------------- ...e-attributes-listing-screen.component.scss | 5 +++++ .../circle-button.component.html | 2 -- .../circle-button.component.scss | 4 ---- .../circle-button/circle-button.component.ts | 1 - .../src/assets/icons/general/analyse.svg | 1 - .../src/assets/icons/general/approved.svg | 1 - .../src/assets/icons/general/arrow-down.svg | 1 - .../src/assets/icons/general/arrow-right.svg | 1 - .../src/assets/icons/general/assign-me.svg | 1 - .../src/assets/icons/general/assign.svg | 1 - .../src/assets/icons/general/attribute.svg | 1 - .../src/assets/icons/general/calendar.svg | 1 - .../assets/icons/general/case-sensitive.svg | 1 - .../red-ui/src/assets/icons/general/close.svg | 1 - .../src/assets/icons/general/collapse.svg | 1 - .../src/assets/icons/general/comment-fill.svg | 1 - .../src/assets/icons/general/comment.svg | 1 - .../src/assets/icons/general/dictionary.svg | 1 - .../src/assets/icons/general/document.svg | 1 - .../src/assets/icons/general/download.svg | 1 - apps/red-ui/src/assets/icons/general/edit.svg | 1 - .../src/assets/icons/general/entries.svg | 1 - .../assets/icons/general/exit-fullscreen.svg | 1 - .../src/assets/icons/general/expand.svg | 1 - .../src/assets/icons/general/folder.svg | 1 - .../src/assets/icons/general/fullscreen.svg | 1 - apps/red-ui/src/assets/icons/general/info.svg | 1 - .../src/assets/icons/general/lightning.svg | 1 - .../src/assets/icons/general/nav-first.svg | 1 - .../src/assets/icons/general/nav-last.svg | 1 - .../src/assets/icons/general/needs-work.svg | 1 - .../src/assets/icons/general/notification.svg | 1 - apps/red-ui/src/assets/icons/general/ocr.svg | 3 +-- apps/red-ui/src/assets/icons/general/page.svg | 1 - .../red-ui/src/assets/icons/general/pages.svg | 1 - .../icons/general/pdftron-action-add-dict.svg | 1 - .../general/pdftron-action-add-redaction.svg | 1 - .../icons/general/pdftron-action-search.svg | 1 - apps/red-ui/src/assets/icons/general/plus.svg | 1 - .../icons/general/radio-indeterminate.svg | 1 - .../assets/icons/general/radio-selected.svg | 1 - .../src/assets/icons/general/read-only.svg | 1 - .../icons/general/ready-for-approval.svg | 1 - .../src/assets/icons/general/rectangle.svg | 2 +- .../src/assets/icons/general/refresh.svg | 1 - .../src/assets/icons/general/report.svg | 1 - .../red-ui/src/assets/icons/general/right.svg | 3 +-- .../src/assets/icons/general/search.svg | 1 - .../src/assets/icons/general/sort-asc.svg | 1 - .../src/assets/icons/general/sort-desc.svg | 1 - .../assets/icons/general/status-collapse.svg | 1 - .../assets/icons/general/status-expand.svg | 1 - .../src/assets/icons/general/status-info.svg | 1 - .../src/assets/icons/general/status.svg | 1 - .../src/assets/icons/general/template.svg | 1 - .../src/assets/icons/general/thumb_down.svg | 1 - .../src/assets/icons/general/thumb_up.svg | 1 - .../red-ui/src/assets/icons/general/trash.svg | 1 - apps/red-ui/src/assets/icons/general/undo.svg | 1 - .../src/assets/icons/general/upload.svg | 1 - apps/red-ui/src/assets/icons/general/user.svg | 1 - 62 files changed, 14 insertions(+), 79 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html index b03f0ab33..9bfee854f 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html @@ -69,8 +69,6 @@ column="name" > - -
@@ -91,18 +89,13 @@
{{ attribute.label }}
- - - - -
- + + [matTooltip]="'file-attributes-listing.read-only' | translate" + matTooltipPosition="above" + >
diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss index 54a860447..5760c007d 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss @@ -41,6 +41,11 @@ redaction-table-col-name::ng-deep { &.center { align-items: center; } + + &.read-only mat-icon { + width: 14px; + height: 34px; + } } } } diff --git a/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html index 9ae2ab412..22c547128 100644 --- a/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html +++ b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html @@ -7,9 +7,7 @@ [disabled]="disabled" [class.small]="small" [class.overlay]="showDot" - [class.dummy]="dummy" mat-icon-button - [disableRipple]="dummy" > diff --git a/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.scss b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.scss index d240cb264..f2b7a4924 100644 --- a/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.scss @@ -37,8 +37,4 @@ button { background-color: $yellow-2; } } - - &.dummy { - cursor: default; - } } diff --git a/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.ts b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.ts index 6f6437899..b0f115a46 100644 --- a/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.ts @@ -15,7 +15,6 @@ export class CircleButtonComponent implements OnInit { @Input() disabled = false; @Input() small = false; @Input() type: 'default' | 'primary' | 'warn' | 'dark-bg' = 'default'; - @Input() dummy = false; @Input() removeTooltip = false; @Output() action = new EventEmitter(); diff --git a/apps/red-ui/src/assets/icons/general/analyse.svg b/apps/red-ui/src/assets/icons/general/analyse.svg index 79756d324..8fc6c5dd5 100644 --- a/apps/red-ui/src/assets/icons/general/analyse.svg +++ b/apps/red-ui/src/assets/icons/general/analyse.svg @@ -1,6 +1,5 @@ - analyse diff --git a/apps/red-ui/src/assets/icons/general/approved.svg b/apps/red-ui/src/assets/icons/general/approved.svg index 0240a82e8..69e85476f 100644 --- a/apps/red-ui/src/assets/icons/general/approved.svg +++ b/apps/red-ui/src/assets/icons/general/approved.svg @@ -1,6 +1,5 @@ - 163F9A92-B60D-42FF-80C8-1135F4B95ECC diff --git a/apps/red-ui/src/assets/icons/general/arrow-down.svg b/apps/red-ui/src/assets/icons/general/arrow-down.svg index c18754710..c03ea2571 100644 --- a/apps/red-ui/src/assets/icons/general/arrow-down.svg +++ b/apps/red-ui/src/assets/icons/general/arrow-down.svg @@ -1,6 +1,5 @@ - arrow-down diff --git a/apps/red-ui/src/assets/icons/general/arrow-right.svg b/apps/red-ui/src/assets/icons/general/arrow-right.svg index 507e88575..1b555ad3f 100644 --- a/apps/red-ui/src/assets/icons/general/arrow-right.svg +++ b/apps/red-ui/src/assets/icons/general/arrow-right.svg @@ -1,6 +1,5 @@ - right_expandable diff --git a/apps/red-ui/src/assets/icons/general/assign-me.svg b/apps/red-ui/src/assets/icons/general/assign-me.svg index 3d2623ff2..9c1dad028 100644 --- a/apps/red-ui/src/assets/icons/general/assign-me.svg +++ b/apps/red-ui/src/assets/icons/general/assign-me.svg @@ -1,6 +1,5 @@ - A52380C8-F72C-425E-8B18-75F0A16E2FA9 diff --git a/apps/red-ui/src/assets/icons/general/assign.svg b/apps/red-ui/src/assets/icons/general/assign.svg index 3ec399f7d..680a9e4b4 100644 --- a/apps/red-ui/src/assets/icons/general/assign.svg +++ b/apps/red-ui/src/assets/icons/general/assign.svg @@ -1,6 +1,5 @@ - assign diff --git a/apps/red-ui/src/assets/icons/general/attribute.svg b/apps/red-ui/src/assets/icons/general/attribute.svg index a37866ac1..d98542404 100644 --- a/apps/red-ui/src/assets/icons/general/attribute.svg +++ b/apps/red-ui/src/assets/icons/general/attribute.svg @@ -1,6 +1,5 @@ - status diff --git a/apps/red-ui/src/assets/icons/general/calendar.svg b/apps/red-ui/src/assets/icons/general/calendar.svg index ff0aa88ad..f6e549692 100644 --- a/apps/red-ui/src/assets/icons/general/calendar.svg +++ b/apps/red-ui/src/assets/icons/general/calendar.svg @@ -1,6 +1,5 @@ - calendar diff --git a/apps/red-ui/src/assets/icons/general/case-sensitive.svg b/apps/red-ui/src/assets/icons/general/case-sensitive.svg index 077e3b18c..b35bbda56 100644 --- a/apps/red-ui/src/assets/icons/general/case-sensitive.svg +++ b/apps/red-ui/src/assets/icons/general/case-sensitive.svg @@ -1,6 +1,5 @@ - 5331E3A6-DD6D-43B9-9CA0-C8B876D10B59 diff --git a/apps/red-ui/src/assets/icons/general/close.svg b/apps/red-ui/src/assets/icons/general/close.svg index a6017e535..3120b9e37 100644 --- a/apps/red-ui/src/assets/icons/general/close.svg +++ b/apps/red-ui/src/assets/icons/general/close.svg @@ -1,6 +1,5 @@ - close - 5B0A44C3-61D4-4E26-9E1A-B63DF5709D7D diff --git a/apps/red-ui/src/assets/icons/general/comment-fill.svg b/apps/red-ui/src/assets/icons/general/comment-fill.svg index 1079f62e8..02062e305 100644 --- a/apps/red-ui/src/assets/icons/general/comment-fill.svg +++ b/apps/red-ui/src/assets/icons/general/comment-fill.svg @@ -1,6 +1,5 @@ - A3E6003E-4D04-4848-8D81-41796CEA5098 diff --git a/apps/red-ui/src/assets/icons/general/comment.svg b/apps/red-ui/src/assets/icons/general/comment.svg index 06c578ba2..1c1bbc7dd 100644 --- a/apps/red-ui/src/assets/icons/general/comment.svg +++ b/apps/red-ui/src/assets/icons/general/comment.svg @@ -1,6 +1,5 @@ - comments diff --git a/apps/red-ui/src/assets/icons/general/dictionary.svg b/apps/red-ui/src/assets/icons/general/dictionary.svg index 4f583601c..86baddd35 100644 --- a/apps/red-ui/src/assets/icons/general/dictionary.svg +++ b/apps/red-ui/src/assets/icons/general/dictionary.svg @@ -1,6 +1,5 @@ - 6C0B3F0C-53AF-4E50-8C71-BCE07198E584 diff --git a/apps/red-ui/src/assets/icons/general/document.svg b/apps/red-ui/src/assets/icons/general/document.svg index 09cf6cdd9..1cac84c13 100644 --- a/apps/red-ui/src/assets/icons/general/document.svg +++ b/apps/red-ui/src/assets/icons/general/document.svg @@ -1,6 +1,5 @@ - document diff --git a/apps/red-ui/src/assets/icons/general/download.svg b/apps/red-ui/src/assets/icons/general/download.svg index f31108133..f279e4840 100644 --- a/apps/red-ui/src/assets/icons/general/download.svg +++ b/apps/red-ui/src/assets/icons/general/download.svg @@ -1,6 +1,5 @@ - download diff --git a/apps/red-ui/src/assets/icons/general/edit.svg b/apps/red-ui/src/assets/icons/general/edit.svg index b818d2e48..0c7146875 100644 --- a/apps/red-ui/src/assets/icons/general/edit.svg +++ b/apps/red-ui/src/assets/icons/general/edit.svg @@ -1,6 +1,5 @@ - edit diff --git a/apps/red-ui/src/assets/icons/general/entries.svg b/apps/red-ui/src/assets/icons/general/entries.svg index 008efd07d..55aafb527 100644 --- a/apps/red-ui/src/assets/icons/general/entries.svg +++ b/apps/red-ui/src/assets/icons/general/entries.svg @@ -1,6 +1,5 @@ - D2E1BFB9-9086-46E0-98F5-F3E2898811B0 diff --git a/apps/red-ui/src/assets/icons/general/exit-fullscreen.svg b/apps/red-ui/src/assets/icons/general/exit-fullscreen.svg index 461eee82f..875e0de9d 100644 --- a/apps/red-ui/src/assets/icons/general/exit-fullscreen.svg +++ b/apps/red-ui/src/assets/icons/general/exit-fullscreen.svg @@ -1,6 +1,5 @@ - minimize diff --git a/apps/red-ui/src/assets/icons/general/expand.svg b/apps/red-ui/src/assets/icons/general/expand.svg index eb38ed7ab..99d7d23c8 100644 --- a/apps/red-ui/src/assets/icons/general/expand.svg +++ b/apps/red-ui/src/assets/icons/general/expand.svg @@ -1,6 +1,5 @@ - AED16F82-54B2-4F74-8F6F-39C215879618 diff --git a/apps/red-ui/src/assets/icons/general/folder.svg b/apps/red-ui/src/assets/icons/general/folder.svg index cfeb75a93..f6dfe8512 100644 --- a/apps/red-ui/src/assets/icons/general/folder.svg +++ b/apps/red-ui/src/assets/icons/general/folder.svg @@ -1,6 +1,5 @@ - folder diff --git a/apps/red-ui/src/assets/icons/general/fullscreen.svg b/apps/red-ui/src/assets/icons/general/fullscreen.svg index 2043418fc..f2e060e3f 100644 --- a/apps/red-ui/src/assets/icons/general/fullscreen.svg +++ b/apps/red-ui/src/assets/icons/general/fullscreen.svg @@ -1,6 +1,5 @@ - full screen diff --git a/apps/red-ui/src/assets/icons/general/info.svg b/apps/red-ui/src/assets/icons/general/info.svg index 4ad21e134..fbdc1d059 100644 --- a/apps/red-ui/src/assets/icons/general/info.svg +++ b/apps/red-ui/src/assets/icons/general/info.svg @@ -1,6 +1,5 @@ - info diff --git a/apps/red-ui/src/assets/icons/general/lightning.svg b/apps/red-ui/src/assets/icons/general/lightning.svg index fe4601796..123ab15d9 100644 --- a/apps/red-ui/src/assets/icons/general/lightning.svg +++ b/apps/red-ui/src/assets/icons/general/lightning.svg @@ -1,6 +1,5 @@ - due diff --git a/apps/red-ui/src/assets/icons/general/nav-first.svg b/apps/red-ui/src/assets/icons/general/nav-first.svg index 685ffebac..afa1b76f6 100644 --- a/apps/red-ui/src/assets/icons/general/nav-first.svg +++ b/apps/red-ui/src/assets/icons/general/nav-first.svg @@ -1,6 +1,5 @@ - ED22EA6D-C390-4471-B1E4-6B17BA55D5F9 diff --git a/apps/red-ui/src/assets/icons/general/nav-last.svg b/apps/red-ui/src/assets/icons/general/nav-last.svg index 1c0697770..7ee89b357 100644 --- a/apps/red-ui/src/assets/icons/general/nav-last.svg +++ b/apps/red-ui/src/assets/icons/general/nav-last.svg @@ -1,6 +1,5 @@ - F189455C-659F-4467-9C15-B17B152A29C5 diff --git a/apps/red-ui/src/assets/icons/general/needs-work.svg b/apps/red-ui/src/assets/icons/general/needs-work.svg index 9f85f65ce..0f5c35ba0 100644 --- a/apps/red-ui/src/assets/icons/general/needs-work.svg +++ b/apps/red-ui/src/assets/icons/general/needs-work.svg @@ -1,6 +1,5 @@ - Needs work diff --git a/apps/red-ui/src/assets/icons/general/notification.svg b/apps/red-ui/src/assets/icons/general/notification.svg index 9f72c057b..09498e5f4 100644 --- a/apps/red-ui/src/assets/icons/general/notification.svg +++ b/apps/red-ui/src/assets/icons/general/notification.svg @@ -1,6 +1,5 @@ - AAFF7BC7-3583-4A2B-A91D-8A2F1A75D50E diff --git a/apps/red-ui/src/assets/icons/general/ocr.svg b/apps/red-ui/src/assets/icons/general/ocr.svg index 58eac0923..66c3956bf 100644 --- a/apps/red-ui/src/assets/icons/general/ocr.svg +++ b/apps/red-ui/src/assets/icons/general/ocr.svg @@ -1,9 +1,8 @@ - OCR - \ No newline at end of file + diff --git a/apps/red-ui/src/assets/icons/general/page.svg b/apps/red-ui/src/assets/icons/general/page.svg index 8c053a5a7..c7f34a0fa 100644 --- a/apps/red-ui/src/assets/icons/general/page.svg +++ b/apps/red-ui/src/assets/icons/general/page.svg @@ -1,6 +1,5 @@ - Page diff --git a/apps/red-ui/src/assets/icons/general/pages.svg b/apps/red-ui/src/assets/icons/general/pages.svg index 6c1cb6e48..7070c7d55 100644 --- a/apps/red-ui/src/assets/icons/general/pages.svg +++ b/apps/red-ui/src/assets/icons/general/pages.svg @@ -1,6 +1,5 @@ - pages diff --git a/apps/red-ui/src/assets/icons/general/pdftron-action-add-dict.svg b/apps/red-ui/src/assets/icons/general/pdftron-action-add-dict.svg index cede1bcf0..d3ca5af42 100644 --- a/apps/red-ui/src/assets/icons/general/pdftron-action-add-dict.svg +++ b/apps/red-ui/src/assets/icons/general/pdftron-action-add-dict.svg @@ -1,6 +1,5 @@ - dictionary diff --git a/apps/red-ui/src/assets/icons/general/pdftron-action-add-redaction.svg b/apps/red-ui/src/assets/icons/general/pdftron-action-add-redaction.svg index ae8e85c4a..b7e836dba 100644 --- a/apps/red-ui/src/assets/icons/general/pdftron-action-add-redaction.svg +++ b/apps/red-ui/src/assets/icons/general/pdftron-action-add-redaction.svg @@ -1,6 +1,5 @@ - Redacted diff --git a/apps/red-ui/src/assets/icons/general/pdftron-action-search.svg b/apps/red-ui/src/assets/icons/general/pdftron-action-search.svg index 11ab8fdbc..7acd26a7f 100644 --- a/apps/red-ui/src/assets/icons/general/pdftron-action-search.svg +++ b/apps/red-ui/src/assets/icons/general/pdftron-action-search.svg @@ -1,6 +1,5 @@ - search diff --git a/apps/red-ui/src/assets/icons/general/plus.svg b/apps/red-ui/src/assets/icons/general/plus.svg index 0c64c1cac..a965c8f72 100644 --- a/apps/red-ui/src/assets/icons/general/plus.svg +++ b/apps/red-ui/src/assets/icons/general/plus.svg @@ -1,6 +1,5 @@ - plus_white diff --git a/apps/red-ui/src/assets/icons/general/radio-indeterminate.svg b/apps/red-ui/src/assets/icons/general/radio-indeterminate.svg index 044e09768..2ca9f4776 100644 --- a/apps/red-ui/src/assets/icons/general/radio-indeterminate.svg +++ b/apps/red-ui/src/assets/icons/general/radio-indeterminate.svg @@ -1,6 +1,5 @@ - BACD0033-A5B4-40C6-9A6E-99CC587814E4 diff --git a/apps/red-ui/src/assets/icons/general/radio-selected.svg b/apps/red-ui/src/assets/icons/general/radio-selected.svg index 8652d564e..8405c7953 100644 --- a/apps/red-ui/src/assets/icons/general/radio-selected.svg +++ b/apps/red-ui/src/assets/icons/general/radio-selected.svg @@ -1,6 +1,5 @@ - 53931886-242F-46D3-AD2D-DBADB674ACDB diff --git a/apps/red-ui/src/assets/icons/general/read-only.svg b/apps/red-ui/src/assets/icons/general/read-only.svg index ff827078c..cd887b9fb 100644 --- a/apps/red-ui/src/assets/icons/general/read-only.svg +++ b/apps/red-ui/src/assets/icons/general/read-only.svg @@ -1,6 +1,5 @@ - 9C81EE87-2992-4087-907E-26A83F796466 diff --git a/apps/red-ui/src/assets/icons/general/ready-for-approval.svg b/apps/red-ui/src/assets/icons/general/ready-for-approval.svg index 24be62ca8..324d9a54b 100644 --- a/apps/red-ui/src/assets/icons/general/ready-for-approval.svg +++ b/apps/red-ui/src/assets/icons/general/ready-for-approval.svg @@ -1,6 +1,5 @@ - ready_for_approval diff --git a/apps/red-ui/src/assets/icons/general/rectangle.svg b/apps/red-ui/src/assets/icons/general/rectangle.svg index d07571e19..a1302324e 100644 --- a/apps/red-ui/src/assets/icons/general/rectangle.svg +++ b/apps/red-ui/src/assets/icons/general/rectangle.svg @@ -1,4 +1,4 @@ -icon / operation / multi select + diff --git a/apps/red-ui/src/assets/icons/general/refresh.svg b/apps/red-ui/src/assets/icons/general/refresh.svg index 018632553..936701c81 100644 --- a/apps/red-ui/src/assets/icons/general/refresh.svg +++ b/apps/red-ui/src/assets/icons/general/refresh.svg @@ -1,6 +1,5 @@ - reanalyse diff --git a/apps/red-ui/src/assets/icons/general/report.svg b/apps/red-ui/src/assets/icons/general/report.svg index 09dc897e9..c36cf9fea 100644 --- a/apps/red-ui/src/assets/icons/general/report.svg +++ b/apps/red-ui/src/assets/icons/general/report.svg @@ -1,6 +1,5 @@ - report diff --git a/apps/red-ui/src/assets/icons/general/right.svg b/apps/red-ui/src/assets/icons/general/right.svg index 0390cde02..20157bd55 100644 --- a/apps/red-ui/src/assets/icons/general/right.svg +++ b/apps/red-ui/src/assets/icons/general/right.svg @@ -1,9 +1,8 @@ - right - \ No newline at end of file + diff --git a/apps/red-ui/src/assets/icons/general/search.svg b/apps/red-ui/src/assets/icons/general/search.svg index f0fc5c809..25b907266 100644 --- a/apps/red-ui/src/assets/icons/general/search.svg +++ b/apps/red-ui/src/assets/icons/general/search.svg @@ -1,6 +1,5 @@ - search diff --git a/apps/red-ui/src/assets/icons/general/sort-asc.svg b/apps/red-ui/src/assets/icons/general/sort-asc.svg index e4f16d061..c6b32e018 100644 --- a/apps/red-ui/src/assets/icons/general/sort-asc.svg +++ b/apps/red-ui/src/assets/icons/general/sort-asc.svg @@ -1,6 +1,5 @@ - sort-asc diff --git a/apps/red-ui/src/assets/icons/general/sort-desc.svg b/apps/red-ui/src/assets/icons/general/sort-desc.svg index 979017696..21e2eb61e 100644 --- a/apps/red-ui/src/assets/icons/general/sort-desc.svg +++ b/apps/red-ui/src/assets/icons/general/sort-desc.svg @@ -1,6 +1,5 @@ - sort-desc diff --git a/apps/red-ui/src/assets/icons/general/status-collapse.svg b/apps/red-ui/src/assets/icons/general/status-collapse.svg index b05ef0e3f..7ead8f40a 100644 --- a/apps/red-ui/src/assets/icons/general/status-collapse.svg +++ b/apps/red-ui/src/assets/icons/general/status-collapse.svg @@ -1,7 +1,6 @@ - B14B1060-4D9C-4EEC-845D-CFA8258D2E16 - 98CDF1EA-D4BC-4B4A-A707-D85244677FBB diff --git a/apps/red-ui/src/assets/icons/general/status-info.svg b/apps/red-ui/src/assets/icons/general/status-info.svg index 7f75f904d..5da44f713 100644 --- a/apps/red-ui/src/assets/icons/general/status-info.svg +++ b/apps/red-ui/src/assets/icons/general/status-info.svg @@ -1,6 +1,5 @@ - F8E3057D-BE44-469F-9E28-9A04A0B36DF0 diff --git a/apps/red-ui/src/assets/icons/general/status.svg b/apps/red-ui/src/assets/icons/general/status.svg index e480511f5..096e8dd60 100644 --- a/apps/red-ui/src/assets/icons/general/status.svg +++ b/apps/red-ui/src/assets/icons/general/status.svg @@ -1,6 +1,5 @@ - status diff --git a/apps/red-ui/src/assets/icons/general/template.svg b/apps/red-ui/src/assets/icons/general/template.svg index 1f6183219..bbe5850ae 100644 --- a/apps/red-ui/src/assets/icons/general/template.svg +++ b/apps/red-ui/src/assets/icons/general/template.svg @@ -1,6 +1,5 @@ - rule_sets diff --git a/apps/red-ui/src/assets/icons/general/thumb_down.svg b/apps/red-ui/src/assets/icons/general/thumb_down.svg index 2db75f0fd..6b1aff656 100644 --- a/apps/red-ui/src/assets/icons/general/thumb_down.svg +++ b/apps/red-ui/src/assets/icons/general/thumb_down.svg @@ -1,6 +1,5 @@ - false_positive - false_negative - trash diff --git a/apps/red-ui/src/assets/icons/general/undo.svg b/apps/red-ui/src/assets/icons/general/undo.svg index 13567f137..64b348ae4 100644 --- a/apps/red-ui/src/assets/icons/general/undo.svg +++ b/apps/red-ui/src/assets/icons/general/undo.svg @@ -1,6 +1,5 @@ - B3EA3E95-AC5D-4F73-ACEB-7F071103E161 diff --git a/apps/red-ui/src/assets/icons/general/upload.svg b/apps/red-ui/src/assets/icons/general/upload.svg index bd680c4fc..3216cbd34 100644 --- a/apps/red-ui/src/assets/icons/general/upload.svg +++ b/apps/red-ui/src/assets/icons/general/upload.svg @@ -1,6 +1,5 @@ - upload diff --git a/apps/red-ui/src/assets/icons/general/user.svg b/apps/red-ui/src/assets/icons/general/user.svg index e6477340c..29c5bc677 100644 --- a/apps/red-ui/src/assets/icons/general/user.svg +++ b/apps/red-ui/src/assets/icons/general/user.svg @@ -1,6 +1,5 @@ - user From 74005530249eb76b05ba683cda1f439c64d41c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Tue, 13 Apr 2021 16:58:08 +0300 Subject: [PATCH 2/6] Update api --- .../api/fileAttributesController.service.ts | 449 ++++++++---------- 1 file changed, 209 insertions(+), 240 deletions(-) diff --git a/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts b/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts index 598d80aeb..70d096d15 100644 --- a/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts +++ b/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts @@ -11,8 +11,7 @@ */ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; +import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; import { Observable } from 'rxjs'; @@ -20,7 +19,6 @@ import { FileAttributeConfig } from '../model/fileAttributeConfig'; import { FileAttributes } from '../model/fileAttributes'; import { FileAttributesBaseConfigRequest } from '../model/fileAttributesBaseConfigRequest'; import { FileAttributesConfig } from '../model/fileAttributesConfig'; -import { ImportCsvResponse } from '../model/importCsvResponse'; import { BASE_PATH } from '../variables'; import { Configuration } from '../configuration'; @@ -130,178 +128,6 @@ export class FileAttributesControllerService { ); } - /** - * Get the file attributes that can be used at importing csv. - * None - * @param ruleSetId ruleSetId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getFileAttributesConfiguration(ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable; - public getFileAttributesConfiguration(ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public getFileAttributesConfiguration(ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public getFileAttributesConfiguration(ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (ruleSetId === null || ruleSetId === undefined) { - throw new Error('Required parameter ruleSetId was null or undefined when calling getFileAttributesConfiguration.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = []; - - return this.httpClient.request('get', `${this.basePath}/fileAttributes/config/${encodeURIComponent(String(ruleSetId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); - } - - /** - * Import a csv file to set file attributes - * None - * @param file - * @param projectId projectId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public importCsvForm(file: Blob, projectId: string, observe?: 'body', reportProgress?: boolean): Observable; - public importCsvForm(file: Blob, projectId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public importCsvForm(file: Blob, projectId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public importCsvForm(file: Blob, projectId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (file === null || file === undefined) { - throw new Error('Required parameter file was null or undefined when calling importCsv.'); - } - - if (projectId === null || projectId === undefined) { - throw new Error('Required parameter projectId was null or undefined when calling importCsv.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['multipart/form-data']; - - const canConsumeForm = this.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): void }; - let useForm = false; - const convertFormParamsToString = false; - // use FormData to transmit files using content-type "multipart/form-data" - // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data - useForm = canConsumeForm; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - } - - if (file !== undefined) { - formParams = (formParams.append('file', file) as any) || formParams; - } - - return this.httpClient.request('post', `${this.basePath}/fileAttributes/csvImport/${encodeURIComponent(String(projectId))}`, { - body: convertFormParamsToString ? formParams.toString() : formParams, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); - } - - /** - * Set file attributes to a existing file - * None - * @param body fileAttributes - * @param projectId projectId - * @param fileId fileId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public setFileAttributes(body: FileAttributes, projectId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; - public setFileAttributes( - body: FileAttributes, - projectId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - public setFileAttributes(body: FileAttributes, projectId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public setFileAttributes(body: FileAttributes, projectId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setFileAttributes.'); - } - - if (projectId === null || projectId === undefined) { - throw new Error('Required parameter projectId was null or undefined when calling setFileAttributes.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling setFileAttributes.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/fileAttributes/set/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - /** * Adds or updates file attributes base configuration and a list of file attributes, * None @@ -377,6 +203,214 @@ export class FileAttributesControllerService { ); } + /** + * Delete a specific file attribute. + * None + * @param ruleSetId ruleSetId + * @param fileAttributeId fileAttributeId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteFileAttribute(ruleSetId: string, fileAttributeId: string, observe?: 'body', reportProgress?: boolean): Observable; + public deleteFileAttribute(ruleSetId: string, fileAttributeId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteFileAttribute(ruleSetId: string, fileAttributeId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteFileAttribute(ruleSetId: string, fileAttributeId: string, observe: any = 'body', reportProgress: boolean = false): Observable { + if (ruleSetId === null || ruleSetId === undefined) { + throw new Error('Required parameter ruleSetId was null or undefined when calling deleteFileAttribute.'); + } + + if (fileAttributeId === null || fileAttributeId === undefined) { + throw new Error('Required parameter fileAttributeId was null or undefined when calling deleteFileAttribute.'); + } + + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = []; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = []; + + return this.httpClient.request( + 'delete', + `${this.basePath}/fileAttributes/config/fileAttribute/${encodeURIComponent(String(ruleSetId))}/${encodeURIComponent(String(fileAttributeId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Bulk delete file attributes. + * None + * @param body fileAttributeIds + * @param ruleSetId ruleSetId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteFileAttributes(body: Array, ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable; + public deleteFileAttributes(body: Array, ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteFileAttributes(body: Array, ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteFileAttributes(body: Array, ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling deleteFileAttributes.'); + } + + if (ruleSetId === null || ruleSetId === undefined) { + throw new Error('Required parameter ruleSetId was null or undefined when calling deleteFileAttributes.'); + } + + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = []; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.request('post', `${this.basePath}/fileAttributes/config/fileAttribute/${encodeURIComponent(String(ruleSetId))}/delete`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); + } + + /** + * Get the file attributes that can be used at importing csv. + * None + * @param ruleSetId ruleSetId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getFileAttributesConfiguration(ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable; + public getFileAttributesConfiguration(ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public getFileAttributesConfiguration(ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public getFileAttributesConfiguration(ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable { + if (ruleSetId === null || ruleSetId === undefined) { + throw new Error('Required parameter ruleSetId was null or undefined when calling getFileAttributesConfiguration.'); + } + + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = ['application/json']; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = []; + + return this.httpClient.request('get', `${this.basePath}/fileAttributes/config/${encodeURIComponent(String(ruleSetId))}`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); + } + + /** + * Set file attributes to a existing file + * None + * @param body fileAttributes + * @param projectId projectId + * @param fileId fileId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public setFileAttributes(body: FileAttributes, projectId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; + public setFileAttributes( + body: FileAttributes, + projectId: string, + fileId: string, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public setFileAttributes(body: FileAttributes, projectId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public setFileAttributes(body: FileAttributes, projectId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling setFileAttributes.'); + } + + if (projectId === null || projectId === undefined) { + throw new Error('Required parameter projectId was null or undefined when calling setFileAttributes.'); + } + + if (fileId === null || fileId === undefined) { + throw new Error('Required parameter fileId was null or undefined when calling setFileAttributes.'); + } + + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = []; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.request( + 'post', + `${this.basePath}/fileAttributes/set/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + /** * Add or update a file attribute that can be used at importing csv. * None @@ -451,69 +485,4 @@ export class FileAttributesControllerService { } ); } - - /** - * Delete a specific file attribute. - * None - * @param ruleSetId ruleSetId - * @param fileAttributeId fileAttributeId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteFileAttributesConfiguration(ruleSetId: string, fileAttributeId: string, observe?: 'body', reportProgress?: boolean): Observable; - public deleteFileAttributesConfiguration( - ruleSetId: string, - fileAttributeId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - public deleteFileAttributesConfiguration( - ruleSetId: string, - fileAttributeId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - public deleteFileAttributesConfiguration( - ruleSetId: string, - fileAttributeId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { - if (ruleSetId === null || ruleSetId === undefined) { - throw new Error('Required parameter ruleSetId was null or undefined when calling setFileAttributesConfiguration1.'); - } - - if (fileAttributeId === null || fileAttributeId === undefined) { - throw new Error('Required parameter ruleSetId was null or undefined when calling setFileAttributesConfiguration1.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = []; - - return this.httpClient.request( - 'delete', - `${this.basePath}/fileAttributes/config/fileAttribute/${encodeURIComponent(String(ruleSetId))}/${encodeURIComponent(String(fileAttributeId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } } From f78671d3042f2df7929285dc066b4874d3fab1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Tue, 13 Apr 2021 17:04:02 +0300 Subject: [PATCH 3/6] Bulk delete file attrs --- .../downloads-list-screen.component.html | 4 +-- ...dd-edit-file-attribute-dialog.component.ts | 4 +-- ...elete-file-attribute-dialog.component.html | 8 ++--- ...-delete-file-attribute-dialog.component.ts | 21 ++++++------ ...e-attributes-listing-screen.component.html | 20 ++++++++++-- ...e-attributes-listing-screen.component.scss | 10 ++++-- ...ile-attributes-listing-screen.component.ts | 16 ++++++++-- .../services/admin-dialog-service.service.ts | 2 +- apps/red-ui/src/assets/i18n/en.json | 32 ++++++++++++++----- 9 files changed, 83 insertions(+), 34 deletions(-) diff --git a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html index 2c7929dc1..1872fac50 100644 --- a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html +++ b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html @@ -66,9 +66,7 @@ > - - - +
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts index efc1fb506..2e4580cfb 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts @@ -1,7 +1,7 @@ import { Component, Inject } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppStateService } from '../../../../state/app-state.service'; -import { FileAttributeConfig, FileAttributesControllerService } from '@redaction/red-ui-http'; +import { FileAttributeConfig } from '@redaction/red-ui-http'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @Component({ @@ -17,7 +17,6 @@ export class AddEditFileAttributeDialogComponent { constructor( private readonly _appStateService: AppStateService, private readonly _formBuilder: FormBuilder, - private readonly _fileAttributesService: FileAttributesControllerService, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: { fileAttribute: FileAttributeConfig; ruleSetId: string } ) { @@ -54,7 +53,6 @@ export class AddEditFileAttributeDialogComponent { editable: !this.fileAttributeForm.get('readonly').value, ...this.fileAttributeForm.getRawValue() }; - await this._fileAttributesService.setFileAttributesConfiguration(fileAttribute, this.ruleSetId).toPromise(); this.dialogRef.close(fileAttribute); } } diff --git a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html index 2af43a9c1..4c3b0ac62 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html @@ -1,6 +1,6 @@
- {{ 'confirm-delete-file-attribute.title' | translate: { name: fileAttribute.label } }} + {{ 'confirm-delete-file-attribute.title.' + type | translate: { name: fileAttribute?.label } }}
@@ -19,15 +19,15 @@ color="primary" [class.error]="!checkbox.value && showToast" > - {{ 'confirm-delete-file-attribute.checkbox-' + (idx + 1) | translate }} + {{ 'confirm-delete-file-attribute.' + checkbox.label | translate }}
-
+
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts index 8e86022bc..ddcf589ce 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts @@ -1,6 +1,6 @@ import { Component, Inject } from '@angular/core'; import { AppStateService } from '../../../../state/app-state.service'; -import { FileAttributeConfig, FileAttributesControllerService } from '@redaction/red-ui-http'; +import { FileAttributeConfig } from '@redaction/red-ui-http'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @Component({ @@ -10,33 +10,36 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; }) export class ConfirmDeleteFileAttributeDialogComponent { public fileAttribute: FileAttributeConfig; - public ruleSetId: string; - public checkboxes = [{ value: false }, { value: false }]; + public checkboxes = [ + { value: false, label: 'impacted-documents.' + this.type }, + { value: false, label: 'lost-details' } + ]; public showToast = false; constructor( private readonly _appStateService: AppStateService, - private readonly _fileAttributesService: FileAttributesControllerService, public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: { fileAttribute: FileAttributeConfig; ruleSetId: string } + @Inject(MAT_DIALOG_DATA) public data: FileAttributeConfig ) { - this.fileAttribute = data.fileAttribute; - this.ruleSetId = data.ruleSetId; + this.fileAttribute = data; } public get valid() { return this.checkboxes[0].value && this.checkboxes[1].value; } - async deleteFileAttribute() { + public deleteFileAttribute() { if (this.valid) { - await this._fileAttributesService.deleteFileAttributesConfiguration(this.ruleSetId, this.fileAttribute.id).toPromise(); this.dialogRef.close(true); } else { this.showToast = true; } } + public get type(): 'bulk' | 'single' { + return !this.fileAttribute ? 'bulk' : 'single'; + } + public cancel() { this.dialogRef.close(); } diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html index 9bfee854f..1e0b16e56 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html @@ -37,6 +37,17 @@ {{ 'file-attributes-listing.table-header.title' | translate: { length: displayedAttributes.length } }} + + + + +
@@ -71,6 +82,8 @@ + +
@@ -86,8 +99,8 @@
-
- {{ attribute.label }} +
+ {{ attribute.label }}
+
+ {{ attribute.csvColumnHeader }} +
div:not(.scrollbar-placeholder) { @@ -42,6 +44,10 @@ redaction-table-col-name::ng-deep { align-items: center; } + &.label span { + @include line-clamp(1); + } + &.read-only mat-icon { width: 14px; height: 34px; @@ -52,7 +58,7 @@ redaction-table-col-name::ng-deep { &.has-scrollbar:hover { ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 1fr 1fr 3fr; + grid-template-columns: auto 2fr 1fr 2fr 3fr; } } } diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts index e94ea6dc5..eb5368be3 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts @@ -19,6 +19,7 @@ export class FileAttributesListingScreenComponent implements OnInit { public displayedAttributes: FileAttributeConfig[] = []; public selectedFileAttributeIds: string[] = []; public viewReady = false; + public loading = false; @ViewChild('fileInput') private _fileInput: ElementRef; @@ -45,14 +46,17 @@ export class FileAttributesListingScreenComponent implements OnInit { } private async _loadData() { - this.viewReady = false; try { const response = await this._fileAttributesService.getFileAttributesConfiguration(this._appStateService.activeRuleSetId).toPromise(); this.attributes = response?.fileAttributeConfigs || []; } catch (e) { } finally { + // Remove potentially deleted items + this.selectedFileAttributeIds = this.selectedFileAttributeIds.filter((id) => !!this.attributes.find((attr) => attr.id === id)); + this._executeSearch(); this.viewReady = true; + this.loading = false; } } @@ -74,7 +78,9 @@ export class FileAttributesListingScreenComponent implements OnInit { public openAddEditAttributeDialog($event: MouseEvent, fileAttribute?: FileAttributeConfig) { $event.stopPropagation(); - this._dialogService.openAddEditFileAttributeDialog(fileAttribute, this._appStateService.activeRuleSetId, async () => { + this._dialogService.openAddEditFileAttributeDialog(fileAttribute, this._appStateService.activeRuleSetId, async (newValue: FileAttributeConfig) => { + this.loading = true; + await this._fileAttributesService.setFileAttributesConfiguration(newValue, this._appStateService.activeRuleSetId).toPromise(); await this._loadData(); }); } @@ -82,6 +88,12 @@ export class FileAttributesListingScreenComponent implements OnInit { public openConfirmDeleteAttributeDialog($event: MouseEvent, fileAttribute?: FileAttributeConfig) { $event.stopPropagation(); this._dialogService.openConfirmDeleteFileAttributeDialog(fileAttribute, this._appStateService.activeRuleSetId, async () => { + this.loading = true; + if (!!fileAttribute) { + await this._fileAttributesService.deleteFileAttribute(this._appStateService.activeRuleSetId, fileAttribute.id).toPromise(); + } else { + await this._fileAttributesService.deleteFileAttributes(this.selectedFileAttributeIds, this._appStateService.activeRuleSetId).toPromise(); + } await this._loadData(); }); } diff --git a/apps/red-ui/src/app/modules/admin/services/admin-dialog-service.service.ts b/apps/red-ui/src/app/modules/admin/services/admin-dialog-service.service.ts index db245ee60..9d10aead4 100644 --- a/apps/red-ui/src/app/modules/admin/services/admin-dialog-service.service.ts +++ b/apps/red-ui/src/app/modules/admin/services/admin-dialog-service.service.ts @@ -166,7 +166,7 @@ export class AdminDialogService { ): MatDialogRef { const ref = this._dialog.open(ConfirmDeleteFileAttributeDialogComponent, { ...dialogConfig, - data: { fileAttribute, ruleSetId }, + data: fileAttribute, autoFocus: true }); diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 9af7236e2..15c1308a7 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -763,28 +763,44 @@ "table-header": { "title": "{{length}} file attributes" }, + "bulk-actions": { + "delete": "Delete Selected Attributes" + }, "table-col-names": { "name": "Name", "created-by": "Created by", - "read-only": "Read-Only" + "read-only": "Read-Only", + "csv-column": "CSV Column" }, "no-data": { "title": "There are no file attributes yet." }, "read-only": "Read-only", "action": { - "edit": "Edit attribute", - "delete": "Delete attribute" + "edit": "Edit Attribute", + "delete": "Delete Attribute" }, "upload-csv": "Upload File Attributes Configuration" }, "confirm-delete-file-attribute": { - "title": "Delete {{name}}", + "title": { + "single": "Delete {{name}}", + "bulk": "Delete File Attributes" + }, "warning": "Warning: this cannot be undone!", - "delete": "Delete Attribute", - "cancel": "Keep Attribute", - "checkbox-1": "All documents it is used on will be impacted", - "checkbox-2": "All inputted details on the documents will be lost", + "delete": { + "single": "Delete Attribute", + "bulk": "Delete Attributes" + }, + "cancel": { + "single": "Keep Attribute", + "bulk": "Keep Attributes" + }, + "impacted-documents": { + "single": "All documents it is used on will be impacted", + "bulk": "All documents they are used on will be impacted" + }, + "lost-details": "All inputted details on the documents will be lost", "toast-error": "Please confirm that you understand the ramifications of your action!" }, "confirm-delete-users": { From 05bde93f49ff925151318d3d6f904da67e6cdabb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Tue, 13 Apr 2021 17:52:29 +0300 Subject: [PATCH 4/6] CSV import search by column name --- .../src/app/modules/admin/admin.module.ts | 4 +-- .../rule-set-actions.component.ts | 2 +- ...ttributes-csv-import-dialog.component.html | 36 ++++++++++++++----- ...ttributes-csv-import-dialog.component.scss | 28 ++++++++++++--- ...-attributes-csv-import-dialog.component.ts | 19 +++++++--- .../default-colors-screen.component.ts | 2 +- .../dictionary-listing-screen.component.ts | 2 +- .../dictionary-overview-screen.component.ts | 2 +- ...ile-attributes-listing-screen.component.ts | 2 +- .../rule-sets-listing-screen.component.ts | 2 +- .../smtp-config-screen.component.ts | 2 +- .../user-listing-screen.component.ts | 2 +- ...ice.service.ts => admin-dialog.service.ts} | 2 +- .../search-input/search-input.component.html | 2 +- .../search-input/search-input.component.ts | 6 +++- apps/red-ui/src/assets/i18n/en.json | 3 ++ 16 files changed, 86 insertions(+), 30 deletions(-) rename apps/red-ui/src/app/modules/admin/{screens => dialogs}/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html (91%) rename apps/red-ui/src/app/modules/admin/{screens => dialogs}/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss (90%) rename apps/red-ui/src/app/modules/admin/{screens => dialogs}/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts (91%) rename apps/red-ui/src/app/modules/admin/services/{admin-dialog-service.service.ts => admin-dialog.service.ts} (98%) diff --git a/apps/red-ui/src/app/modules/admin/admin.module.ts b/apps/red-ui/src/app/modules/admin/admin.module.ts index 2215a086f..2c12acb71 100644 --- a/apps/red-ui/src/app/modules/admin/admin.module.ts +++ b/apps/red-ui/src/app/modules/admin/admin.module.ts @@ -25,13 +25,13 @@ import { ConfirmDeleteFileAttributeDialogComponent } from './dialogs/confirm-del import { EditColorDialogComponent } from './dialogs/edit-color-dialog/edit-color-dialog.component'; import { ComboChartComponent, ComboSeriesVerticalComponent } from './components/combo-chart'; import { NgxChartsModule } from '@swimlane/ngx-charts'; -import { AdminDialogService } from './services/admin-dialog-service.service'; +import { AdminDialogService } from './services/admin-dialog.service'; import { SmtpConfigScreenComponent } from './screens/smtp-config/smtp-config-screen.component'; import { SmtpAuthDialogComponent } from './dialogs/smtp-auth-dialog/smtp-auth-dialog.component'; import { AddEditUserDialogComponent } from './dialogs/add-edit-user-dialog/add-edit-user-dialog.component'; import { UsersStatsComponent } from './components/users-stats/users-stats.component'; import { ConfirmDeleteUsersDialogComponent } from './dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component'; -import { FileAttributesCsvImportDialogComponent } from './screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component'; +import { FileAttributesCsvImportDialogComponent } from './dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component'; const dialogs = [ AddEditRuleSetDialogComponent, diff --git a/apps/red-ui/src/app/modules/admin/components/rule-set-actions/rule-set-actions.component.ts b/apps/red-ui/src/app/modules/admin/components/rule-set-actions/rule-set-actions.component.ts index 9591cf183..8a4dd362d 100644 --- a/apps/red-ui/src/app/modules/admin/components/rule-set-actions/rule-set-actions.component.ts +++ b/apps/red-ui/src/app/modules/admin/components/rule-set-actions/rule-set-actions.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { PermissionsService } from '../../../../services/permissions.service'; import { AppStateService } from '../../../../state/app-state.service'; import { Router } from '@angular/router'; -import { AdminDialogService } from '../../services/admin-dialog-service.service'; +import { AdminDialogService } from '../../services/admin-dialog.service'; @Component({ selector: 'redaction-rule-set-actions', diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html similarity index 91% rename from apps/red-ui/src/app/modules/admin/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html rename to apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html index 2fc9d6f53..be61e0504 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html @@ -53,19 +53,37 @@ }} {{ 'file-attributes-csv-import.selected' | translate: { value: activeFields.length } }}
-
- - +
+ +
+ + +
-
+
+ +
+
:not(.quick-activation) > *:not(:last-child)::after { + > div:first-child > *:not(:last-child)::after { content: '-'; margin: 0 4px; } - .quick-activation > :not(:last-child) { - margin-right: 10px; + .actions { + display: flex; + align-items: center; + + .quick-activation { + margin-left: 12px; + + > :not(:last-child) { + margin-right: 10px; + } + } } } + .search-input-container { + background-color: $white; + border-bottom: 1px solid $separator; + padding: 8px 16px; + } + .csv-part-content { overflow: auto; @include no-scroll-bar; @@ -110,6 +126,10 @@ height: calc(100% - 58px); @include no-scroll-bar; + &.search-open { + height: calc(100% - 58px - 51px); + } + .csv-header-pill { min-height: 32px; margin: 6px auto; diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts similarity index 91% rename from apps/red-ui/src/app/modules/admin/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts rename to apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts index e0daa4fb5..c7b5b6ac4 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts @@ -5,6 +5,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import * as Papa from 'papaparse'; import { FileAttributesControllerService } from '@redaction/red-ui-http'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; +import { debounce } from '../../../../utils/debounce'; enum FieldType { Text = 'Text', @@ -35,6 +36,9 @@ export class FileAttributesCsvImportDialogComponent implements OnInit { public activeFields: Field[] = []; public selectedFields: string[] = []; public baseConfigForm: FormGroup; + public isSearchOpen = false; + public searchForm: FormGroup; + public filteredFields: Field[]; @ViewChild(CdkVirtualScrollViewport, { static: false }) cdkVirtualScrollViewport: CdkVirtualScrollViewport; @@ -48,6 +52,10 @@ export class FileAttributesCsvImportDialogComponent implements OnInit { this.csvFile = data.csv; this.ruleSetId = data.ruleSetId; + this.searchForm = this._formBuilder.group({ + query: [''] + }); + this.baseConfigForm = this._formBuilder.group({ filenameMappingColumnHeaderName: [undefined, Validators.required], delimiter: [undefined, Validators.required], @@ -55,10 +63,8 @@ export class FileAttributesCsvImportDialogComponent implements OnInit { }); this._readFile(); - } - get relevantFields() { - return this.parseResult?.fields.filter((f) => this.getEntries(f.csvColumn) > 0); + this.searchForm.valueChanges.subscribe((value) => this._executeSearch(value)); } ngOnInit(): void { @@ -70,6 +76,11 @@ export class FileAttributesCsvImportDialogComponent implements OnInit { }, 500); } + @debounce(200) + private _executeSearch(value: { query: string }) { + this.filteredFields = this.parseResult.fields.filter((f) => f.csvColumn.toLowerCase().includes(value.query.toLowerCase())); + } + private _readFile() { const reader = new FileReader(); reader.addEventListener('load', async (event) => { @@ -82,7 +93,7 @@ export class FileAttributesCsvImportDialogComponent implements OnInit { this.baseConfigForm.patchValue({ delimiter: this.parseResult.meta.delimiter }); } this.parseResult.fields = this.parseResult.meta.fields.map((field) => this._buildAttribute(field)); - console.log(this.parseResult); + this.filteredFields = [...this.parseResult.fields]; }); reader.readAsText(this.csvFile, this.baseConfigForm.get('encoding').value); } diff --git a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts index a81ccba03..e4f1f461e 100644 --- a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts @@ -4,7 +4,7 @@ import { Colors, DictionaryControllerService } from '@redaction/red-ui-http'; import { ActivatedRoute } from '@angular/router'; import { SortingOption, SortingService } from '../../../../services/sorting.service'; import { PermissionsService } from '../../../../services/permissions.service'; -import { AdminDialogService } from '../../services/admin-dialog-service.service'; +import { AdminDialogService } from '../../services/admin-dialog.service'; @Component({ selector: 'redaction-default-colors-screen', diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts index 267e4a401..cf54c6347 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts @@ -9,7 +9,7 @@ import { PermissionsService } from '../../../../services/permissions.service'; import { FormBuilder, FormGroup } from '@angular/forms'; import { debounce } from '../../../../utils/debounce'; import { ActivatedRoute } from '@angular/router'; -import { AdminDialogService } from '../../services/admin-dialog-service.service'; +import { AdminDialogService } from '../../services/admin-dialog.service'; @Component({ selector: 'redaction-dictionary-listing-screen', diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts index a44aba3be..ddf5e4ff9 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts @@ -11,7 +11,7 @@ import { Observable } from 'rxjs'; import { saveAs } from 'file-saver'; import { ComponentHasChanges } from '../../../../guards/can-deactivate.guard'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { AdminDialogService } from '../../services/admin-dialog-service.service'; +import { AdminDialogService } from '../../services/admin-dialog.service'; declare var ace; diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts index eb5368be3..7c5ffafeb 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts @@ -6,7 +6,7 @@ import { AppStateService } from '../../../../state/app-state.service'; import { ActivatedRoute } from '@angular/router'; import { debounce } from '../../../../utils/debounce'; import { SortingOption, SortingService } from '../../../../services/sorting.service'; -import { AdminDialogService } from '../../services/admin-dialog-service.service'; +import { AdminDialogService } from '../../services/admin-dialog.service'; @Component({ selector: 'redaction-file-attributes-listing-screen', diff --git a/apps/red-ui/src/app/modules/admin/screens/rule-sets-listing/rule-sets-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/rule-sets-listing/rule-sets-listing-screen.component.ts index 2bdb4f091..105a1afd6 100644 --- a/apps/red-ui/src/app/modules/admin/screens/rule-sets-listing/rule-sets-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/rule-sets-listing/rule-sets-listing-screen.component.ts @@ -6,7 +6,7 @@ import { FormBuilder, FormGroup } from '@angular/forms'; import { debounce } from '../../../../utils/debounce'; import { RuleSetModel } from '@redaction/red-ui-http'; import { UserPreferenceService } from '../../../../services/user-preference.service'; -import { AdminDialogService } from '../../services/admin-dialog-service.service'; +import { AdminDialogService } from '../../services/admin-dialog.service'; @Component({ selector: 'redaction-rule-sets-listing-screen', diff --git a/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.ts index e0405f044..9b0d0b027 100644 --- a/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { PermissionsService } from '../../../../services/permissions.service'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { AdminDialogService } from '../../services/admin-dialog-service.service'; +import { AdminDialogService } from '../../services/admin-dialog.service'; import { SmtpConfigurationControllerService, SMTPConfigurationModel } from '@redaction/red-ui-http'; import { NotificationService, NotificationType } from '../../../../services/notification.service'; import { TranslateService } from '@ngx-translate/core'; diff --git a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts index 819d007a5..fa559f668 100644 --- a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts @@ -4,7 +4,7 @@ import { UserService } from '../../../../services/user.service'; import { RuleSetModel, User, UserControllerService } from '@redaction/red-ui-http'; import { FormBuilder, FormGroup } from '@angular/forms'; import { debounce } from '../../../../utils/debounce'; -import { AdminDialogService } from '../../services/admin-dialog-service.service'; +import { AdminDialogService } from '../../services/admin-dialog.service'; import { TranslateService } from '@ngx-translate/core'; import { DoughnutChartConfig } from '../../../shared/components/simple-doughnut-chart/simple-doughnut-chart.component'; import { TranslateChartService } from '../../../../services/translate-chart.service'; diff --git a/apps/red-ui/src/app/modules/admin/services/admin-dialog-service.service.ts b/apps/red-ui/src/app/modules/admin/services/admin-dialog.service.ts similarity index 98% rename from apps/red-ui/src/app/modules/admin/services/admin-dialog-service.service.ts rename to apps/red-ui/src/app/modules/admin/services/admin-dialog.service.ts index 9d10aead4..ff8e2888d 100644 --- a/apps/red-ui/src/app/modules/admin/services/admin-dialog-service.service.ts +++ b/apps/red-ui/src/app/modules/admin/services/admin-dialog.service.ts @@ -24,7 +24,7 @@ import { TranslateService } from '@ngx-translate/core'; import { SmtpAuthDialogComponent } from '../dialogs/smtp-auth-dialog/smtp-auth-dialog.component'; import { AddEditUserDialogComponent } from '../dialogs/add-edit-user-dialog/add-edit-user-dialog.component'; import { ConfirmDeleteUsersDialogComponent } from '../dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component'; -import { FileAttributesCsvImportDialogComponent } from '../screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component'; +import { FileAttributesCsvImportDialogComponent } from '../dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component'; const largeDialogConfig = { width: '90vw', diff --git a/apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.html b/apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.html index aff28b9a6..4ba25388d 100644 --- a/apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.html +++ b/apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.html @@ -1,5 +1,5 @@
-
+
diff --git a/apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.ts b/apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.ts index 4b79e8da3..ac1a00683 100644 --- a/apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.ts @@ -9,7 +9,7 @@ import { FormGroup } from '@angular/forms'; export class SearchInputComponent implements OnInit { @Input() form: FormGroup; @Input() placeholder: string; - @Input() width = 250; + @Input() width: number | 'full' = 250; constructor() {} @@ -22,4 +22,8 @@ export class SearchInputComponent implements OnInit { public clearContent() { this.form.patchValue({ query: '' }); } + + public get computedWidth() { + return this.width === 'full' ? '100%' : `${this.width}px`; + } } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 15c1308a7..ad62b56a7 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1160,6 +1160,9 @@ "selected": "{{value}} selected", "csv-column": "CSV Column", "no-hovered-column": "Preview CSV column by hovering the entry.", + "search": { + "placeholder": "Search by column name..." + }, "table-header": { "title": "{{length}} file attributes", "actions": { From fcdea16497f0584c5be3b7dc78e85645327709df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Tue, 13 Apr 2021 18:22:47 +0300 Subject: [PATCH 5/6] Collapse column preview --- ...ttributes-csv-import-dialog.component.html | 10 +++++-- ...ttributes-csv-import-dialog.component.scss | 30 +++++++++++++++++-- ...-attributes-csv-import-dialog.component.ts | 1 + apps/red-ui/src/assets/i18n/en.json | 1 + 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html index be61e0504..e8951ad45 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html @@ -99,13 +99,17 @@
-
+
- {{ 'file-attributes-csv-import.csv-column' | translate }} + {{ 'file-attributes-csv-import.csv-column' + (previewExpanded ? '' : '-preview') | translate }}
+
-
+
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss index d2f4aebf5..8b3df0e3a 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss @@ -170,10 +170,34 @@ min-width: 150px; background: $grey-2; border-right: 1px solid $separator; + + &:not(.collapsed) redaction-circle-button { + margin-right: -8px; + } + + &.collapsed { + width: 50px; + min-width: 50px; + + > .csv-part-header { + height: 100%; + border-bottom: none; + align-items: center; + flex-direction: column-reverse; + justify-content: flex-end; + padding-top: 8px; + + > .all-caps-label { + transform: rotate(90deg) translateX(50%); + white-space: nowrap; + margin-top: 10px; + } + } + } } > .content-container { - width: calc(100% - 527px); + width: 100%; redaction-table-col-name::ng-deep { > div { @@ -211,7 +235,7 @@ height: calc(100% - 80px); ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 2fr 150px auto auto auto 11px; + grid-template-columns: 30px minmax(0, 20vw) 150px auto auto auto 11px; .table-item { > div { @@ -253,7 +277,7 @@ &.has-scrollbar:hover { ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 2fr 150px auto auto auto; + grid-template-columns: 30px minmax(0, 20vw) 150px auto auto auto; } } } diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts index c7b5b6ac4..ae71e6f5e 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts @@ -39,6 +39,7 @@ export class FileAttributesCsvImportDialogComponent implements OnInit { public isSearchOpen = false; public searchForm: FormGroup; public filteredFields: Field[]; + public previewExpanded = true; @ViewChild(CdkVirtualScrollViewport, { static: false }) cdkVirtualScrollViewport: CdkVirtualScrollViewport; diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index ad62b56a7..b38d12861 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1159,6 +1159,7 @@ "available": "{{value}} available", "selected": "{{value}} selected", "csv-column": "CSV Column", + "csv-column-preview": "CSV Column Preview", "no-hovered-column": "Preview CSV column by hovering the entry.", "search": { "placeholder": "Search by column name..." From 44d4779ae07d9811d890b06c189150a4b3dbc037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Tue, 13 Apr 2021 19:52:14 +0300 Subject: [PATCH 6/6] Key column autocomplete --- ...ttributes-csv-import-dialog.component.html | 13 +++++-- ...ttributes-csv-import-dialog.component.scss | 4 +-- ...-attributes-csv-import-dialog.component.ts | 34 ++++++++++++------- .../modules/mat-config/mat-config.module.ts | 4 ++- apps/red-ui/src/assets/i18n/en.json | 2 +- .../src/assets/styles/red-autocomplete.scss | 10 ++++++ apps/red-ui/src/assets/styles/red-theme.scss | 1 + 7 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 apps/red-ui/src/assets/styles/red-autocomplete.scss diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html index e8951ad45..6aae70c94 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html @@ -14,11 +14,18 @@
{{ 'file-attributes-csv-import.key-column' | translate }} - - + + + {{ field }} - +
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss index 8b3df0e3a..447df33f7 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss @@ -235,7 +235,7 @@ height: calc(100% - 80px); ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: 30px minmax(0, 20vw) 150px auto auto auto 11px; + grid-template-columns: 30px minmax(0, 25vw) 150px auto auto auto 11px; .table-item { > div { @@ -277,7 +277,7 @@ &.has-scrollbar:hover { ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: 30px minmax(0, 20vw) 150px auto auto auto; + grid-template-columns: 30px minmax(0, 25vw) 150px auto auto auto; } } } diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts index ae71e6f5e..60f282035 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts @@ -1,11 +1,13 @@ -import { Component, Inject, OnInit, ViewChild } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { Component, Inject, ViewChild } from '@angular/core'; +import { AbstractControl, FormBuilder, FormGroup, ValidatorFn, Validators } from '@angular/forms'; import { AppStateService } from '../../../../state/app-state.service'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import * as Papa from 'papaparse'; import { FileAttributesControllerService } from '@redaction/red-ui-http'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; import { debounce } from '../../../../utils/debounce'; +import { Observable } from 'rxjs'; +import { map, startWith } from 'rxjs/operators'; enum FieldType { Text = 'Text', @@ -28,7 +30,7 @@ interface Field { templateUrl: './file-attributes-csv-import-dialog.component.html', styleUrls: ['./file-attributes-csv-import-dialog.component.scss'] }) -export class FileAttributesCsvImportDialogComponent implements OnInit { +export class FileAttributesCsvImportDialogComponent { public csvFile: File; public ruleSetId: string; public parseResult: { data: any[]; errors: any[]; meta: any; fields: Field[] }; @@ -40,6 +42,7 @@ export class FileAttributesCsvImportDialogComponent implements OnInit { public searchForm: FormGroup; public filteredFields: Field[]; public previewExpanded = true; + public filteredKeyOptions: Observable; @ViewChild(CdkVirtualScrollViewport, { static: false }) cdkVirtualScrollViewport: CdkVirtualScrollViewport; @@ -58,7 +61,7 @@ export class FileAttributesCsvImportDialogComponent implements OnInit { }); this.baseConfigForm = this._formBuilder.group({ - filenameMappingColumnHeaderName: [undefined, Validators.required], + filenameMappingColumnHeaderName: ['', [Validators.required, this._autocompleteStringValidator()]], delimiter: [undefined, Validators.required], encoding: ['UTF-8', Validators.required] }); @@ -68,20 +71,20 @@ export class FileAttributesCsvImportDialogComponent implements OnInit { this.searchForm.valueChanges.subscribe((value) => this._executeSearch(value)); } - ngOnInit(): void { - setTimeout(() => { - // Calculate viewport size after dialog is completely expanded - if (this.cdkVirtualScrollViewport) { - this.cdkVirtualScrollViewport.checkViewportSize(); - } - }, 500); - } - @debounce(200) private _executeSearch(value: { query: string }) { this.filteredFields = this.parseResult.fields.filter((f) => f.csvColumn.toLowerCase().includes(value.query.toLowerCase())); } + private _autocompleteStringValidator(): ValidatorFn { + return (control: AbstractControl): { [key: string]: any } | null => { + if ((this.parseResult?.meta?.fields || []).indexOf(control.value) !== -1) { + return null; /* valid option selected */ + } + return { invalidAutocompleteString: { value: control.value } }; + }; + } + private _readFile() { const reader = new FileReader(); reader.addEventListener('load', async (event) => { @@ -95,6 +98,11 @@ export class FileAttributesCsvImportDialogComponent implements OnInit { } this.parseResult.fields = this.parseResult.meta.fields.map((field) => this._buildAttribute(field)); this.filteredFields = [...this.parseResult.fields]; + + this.filteredKeyOptions = this.baseConfigForm.get('filenameMappingColumnHeaderName').valueChanges.pipe( + startWith(''), + map((value: string) => this.parseResult.meta.fields.filter((field) => field.toLowerCase().indexOf(value.toLowerCase()) !== -1)) + ); }); reader.readAsText(this.csvFile, this.baseConfigForm.get('encoding').value); } diff --git a/apps/red-ui/src/app/modules/mat-config/mat-config.module.ts b/apps/red-ui/src/app/modules/mat-config/mat-config.module.ts index 79e2e3042..1ef613d30 100644 --- a/apps/red-ui/src/app/modules/mat-config/mat-config.module.ts +++ b/apps/red-ui/src/app/modules/mat-config/mat-config.module.ts @@ -15,6 +15,7 @@ import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; import { MatProgressBarModule } from '@angular/material/progress-bar'; +import { MatAutocompleteModule } from '@angular/material/autocomplete'; const matImports = [ MatDialogModule, @@ -32,7 +33,8 @@ const matImports = [ MatDatepickerModule, MatInputModule, MatSelectModule, - MatProgressBarModule + MatProgressBarModule, + MatAutocompleteModule ]; @NgModule({ diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index b38d12861..36e4b62af 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1154,7 +1154,7 @@ "encoding": "Encoding", "encoding-placeholder": "UTF-8", "key-column": "Key Column", - "key-column-placeholder": "Select Column ...", + "key-column-placeholder": "Select column...", "total-rows": "{{rows}} rows in total", "available": "{{value}} available", "selected": "{{value}} selected", diff --git a/apps/red-ui/src/assets/styles/red-autocomplete.scss b/apps/red-ui/src/assets/styles/red-autocomplete.scss new file mode 100644 index 000000000..cd517e71b --- /dev/null +++ b/apps/red-ui/src/assets/styles/red-autocomplete.scss @@ -0,0 +1,10 @@ +@import 'red-variables'; +@import 'red-mixins'; + +.mat-autocomplete-panel { + @include scroll-bar; + + .mat-option { + font-size: inherit; + } +} diff --git a/apps/red-ui/src/assets/styles/red-theme.scss b/apps/red-ui/src/assets/styles/red-theme.scss index 46008285d..8802af2d4 100644 --- a/apps/red-ui/src/assets/styles/red-theme.scss +++ b/apps/red-ui/src/assets/styles/red-theme.scss @@ -8,6 +8,7 @@ @import 'red-input'; @import 'red-button'; @import 'red-select'; +@import 'red-autocomplete'; @import 'red-list'; @import 'red-checkbox'; @import 'red-toggle';