aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/reportManager/reportManagerUtils.ts
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2023-07-10 19:10:34 -0400
committerSophie Zhang <sophie_zhang@brown.edu>2023-07-10 19:10:34 -0400
commitb1f189ffc7dfe558d5895c8f0cb103ab3e5c17d7 (patch)
tree3b40e13257ca09c11f5dadf0b9ef5811b757e74d /src/client/util/reportManager/reportManagerUtils.ts
parentfb939a1d2d59a776d9e3336dfc4a1e028ebc3113 (diff)
filters and better ui
Diffstat (limited to 'src/client/util/reportManager/reportManagerUtils.ts')
-rw-r--r--src/client/util/reportManager/reportManagerUtils.ts54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/client/util/reportManager/reportManagerUtils.ts b/src/client/util/reportManager/reportManagerUtils.ts
new file mode 100644
index 000000000..3c919856a
--- /dev/null
+++ b/src/client/util/reportManager/reportManagerUtils.ts
@@ -0,0 +1,54 @@
+// Final file url reference: "https://browndash.com/files/images/upload_cb31bc0fda59c96ca14193ec494f80cf_o.jpg" />
+
+export enum ViewState {
+ VIEW,
+ CREATE,
+}
+
+export enum Priority {
+ HIGH = 'priority-high',
+ MEDIUM = 'priority-medium',
+ LOW = 'priority-low',
+}
+
+export enum BugType {
+ BUG = 'bug',
+ COSMETIC = 'cosmetic',
+ DOCUMENTATION = 'documentation',
+ ENHANCEMENT = 'enhancement',
+}
+
+// [bgColor, color]
+export const priorityColors: { [key: string]: string[] } = {
+ 'priority-low': ['#d4e0ff', '#000000'],
+ 'priority-medium': ['#6a91f6', '#ffffff'],
+ 'priority-high': ['#4476f7', '#ffffff'],
+};
+
+// [bgColor, color]
+export const bugColors: { [key: string]: string[] } = {
+ bug: ['#fe6d6d', '#ffffff'],
+ cosmetic: ['#c650f4', '#ffffff'],
+ documentation: ['#36acf0', '#ffffff'],
+ enhancement: ['#36d4f0', '#ffffff'],
+};
+
+export const prioritySet = new Set(Object.values(Priority));
+export const bugSet = new Set(Object.values(BugType));
+
+export const getLabelColors = (label: string): string[] => {
+ if (prioritySet.has(label as Priority)) {
+ return priorityColors[label];
+ } else if (bugSet.has(label as BugType)) {
+ return bugColors[label];
+ }
+ return ['#347bff', '#ffffff'];
+};
+
+export interface FileData {
+ _id: string;
+ file: File;
+}
+
+export const inactiveBorderColor = '#cbd5e1';
+export const inactiveColor = '#64748b';