From 99570c730e9f59f84b8e9ca02a941fb82bc8b0a7 Mon Sep 17 00:00:00 2001
From: Carina Antunes <carina.oliveira.antunes@cern.ch>
Date: Fri, 2 Oct 2020 14:39:09 +0000
Subject: [PATCH] [#5] Change preference levels

---
 .../AddPreferenceComponent.js                  | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/preferences/components/AddPreferenceComponent/AddPreferenceComponent.js b/src/preferences/components/AddPreferenceComponent/AddPreferenceComponent.js
index 17615741..80dbcda1 100644
--- a/src/preferences/components/AddPreferenceComponent/AddPreferenceComponent.js
+++ b/src/preferences/components/AddPreferenceComponent/AddPreferenceComponent.js
@@ -13,6 +13,12 @@ import { useParams } from "react-router-dom";
 import * as showSnackBarActionCreators from "../../../common/actions/Snackbar";
 import * as updatePreferencesActionCreators from "../../actions/UpdatePreferences";
 
+const NotificationPriorityTypes = Object.freeze({
+  IMPORTANT: "IMPORTANT",
+  NORMAL: "NORMAL",
+  LOW: "LOW",
+});
+
 const AddPreferenceComponent = ({ updatePreferences, showSnackbar }) => {
   const hours = [...Array(24)].map((e, i) => ({
     key: i,
@@ -77,8 +83,8 @@ const AddPreferenceComponent = ({ updatePreferences, showSnackbar }) => {
               <label>Notification priority</label>
               <Checkbox
                 label="Important"
-                name="notificatioPrioritylGroup"
-                value="IMPORTANT"
+                name="notificatioPriorityGroup"
+                value={NotificationPriorityTypes.IMPORTANT}
                 checked={notificationPriority.important}
                 onClick={() => {
                   setNotificationPriority({
@@ -89,8 +95,8 @@ const AddPreferenceComponent = ({ updatePreferences, showSnackbar }) => {
               />
               <Checkbox
                 label="Normal"
-                name="notificationPrioritylGroup"
-                value="NORMAL"
+                name="notificationPriorityGroup"
+                value={NotificationPriorityTypes.NORMAL}
                 checked={notificationPriority.normal}
                 onClick={() => {
                   setNotificationPriority({
@@ -101,8 +107,8 @@ const AddPreferenceComponent = ({ updatePreferences, showSnackbar }) => {
               />
               <Checkbox
                 label="Low"
-                name="notificationPrioritylGroup"
-                value="LOW"
+                name="notificationPriorityGroup"
+                value={NotificationPriorityTypes.LOW}
                 checked={notificationPriority.low}
                 onClick={() => {
                   setNotificationPriority({
-- 
GitLab