From a64a2a5b093d40b54826d985c8e79eab6a6f069e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Thu, 8 Apr 2021 20:23:59 +0300 Subject: [PATCH] Remove selected --- .../file-attributes-csv-import-dialog.component.html | 10 ++++++++++ .../file-attributes-csv-import-dialog.component.scss | 4 ++++ .../file-attributes-csv-import-dialog.component.ts | 5 +++++ apps/red-ui/src/assets/i18n/en.json | 5 ++++- 4 files changed, 23 insertions(+), 1 deletion(-) 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/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html index 7cbe8c928..f6168e147 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/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html @@ -121,6 +121,16 @@ {{ 'file-attributes-csv-import.table-header.title' | translate: { length: activeFields.length } }} + + + + +
diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss b/apps/red-ui/src/app/modules/admin/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss index 4018fe05b..b420b6ef3 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.scss @@ -169,6 +169,10 @@ padding: 0 24px 0 10px; box-shadow: none; border-top: 1px solid $separator; + + .all-caps-label { + margin-right: 10px; + } } cdk-virtual-scroll-viewport { 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/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts index 34939fa72..0502a37a2 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/screens/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts @@ -165,6 +165,11 @@ export class FileAttributesCsvImportDialogComponent implements OnInit { return this.selectedFields.indexOf(field) !== -1; } + public deactivateSelection() { + this.activeFields = [...this.activeFields.filter((field) => !this.isFieldSelected(field.csvColumn))]; + this.selectedFields = []; + } + public async save() { const promises: Promise[] = [ this._fileAttributesControllerService.addOrUpdateFileAttributesBaseConfig(this.baseConfigForm.getRawValue(), this.ruleSetId).toPromise() diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index c62f71eb1..92ff0c8e5 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1122,7 +1122,10 @@ "csv-column": "CSV Column", "no-hovered-column": "Preview CSV column by hovering the entry.", "table-header": { - "title": "{{length}} file attributes" + "title": "{{length}} file attributes", + "actions": { + "remove-selected": "Remove Selected" + } }, "file": "File:", "table-col-names": {