From 8cbb15bd90ad758726a2e7bf41d2c40e5a0eb3c1 Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Wed, 3 Apr 2024 00:07:49 -0700
Subject: [PATCH] Proper data type enum
---
.../global-search.component.html | 26 +++++-----
.../global-search.component.spec.ts | 37 ++++++++------
.../global-search/global-search.component.ts | 49 +++++++++++--------
src-ui/src/app/data/datatype.ts | 13 +++++
src-ui/src/app/data/filter-rule-type.ts | 26 +++++-----
5 files changed, 91 insertions(+), 60 deletions(-)
create mode 100644 src-ui/src/app/data/datatype.ts
diff --git a/src-ui/src/app/components/app-frame/global-search/global-search.component.html b/src-ui/src/app/components/app-frame/global-search/global-search.component.html
index a434eaf23..5c71dd8c5 100644
--- a/src-ui/src/app/components/app-frame/global-search/global-search.component.html
+++ b/src-ui/src/app/components/app-frame/global-search/global-search.component.html
@@ -30,10 +30,10 @@
(click)="primaryAction(type, item); $event.stopPropagation()"
[disabled]="disablePrimaryButton(type, item)"
(mouseenter)="onButtonHover($event)">
- @if (type === 'document') {
+ @if (type === DataType.Document) {
Open
- } @else if (type === 'workflow' || type === 'customField' || type === 'group' || type === 'user') {
+ } @else if (type === DataType.Workflow || type === DataType.CustomField || type === DataType.Group || type === DataType.User) {
Edit
} @else {
@@ -41,12 +41,12 @@
Filter documents
}
- @if (type !== 'workflow' && type !== 'customField' && type !== 'group' && type !== 'user') {
+ @if (type !== DataType.Workflow && type !== DataType.CustomField && type !== DataType.Group && type !== DataType.User) {