Skip to content

Commit baab74f

Browse files
committed
Change urgancy levels, remove useEffect arrays in App.js and ParticipantsList.js
1 parent 5dbce15 commit baab74f

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

core/models/visit.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77

88
class UrgencyLevel(Enum):
9-
ONE = 1
10-
TWO = 2
11-
THREE = 3
12-
FOUR = 4
13-
FIVE = 5
9+
_1 = 1
10+
_2 = 2
11+
_3 = 3
12+
_4 = 4
13+
_5 = 5
1414

1515

1616
class Visit(models.Model):
@@ -21,4 +21,4 @@ class Visit(models.Model):
2121
ProgramServiceMap, null=True, on_delete=models.CASCADE
2222
)
2323
notes = models.TextField("Visit Notes", null=True, blank=True)
24-
urgency = models.CharField(choices=URGENCY_LEVEL, max_length=20, default=UrgencyLevel.ONE)
24+
urgency = models.CharField(choices=URGENCY_LEVEL, max_length=20, default=UrgencyLevel._1)

frontend/src/App.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ const App = observer(() => {
2828
}
2929
}
3030
stillAuthenticated()
31-
//Add in dependency to eliminate eslint error
31+
//Suppress eslint error for []
32+
//eslint-disable-next-line react-hooks/exhaustive-deps
3233
}, []) // Hooks equivalent to "componentDidMount"
3334

3435
if (rootStore.authStore.isAuthenticated === null) {

frontend/src/components/ParticipantsList.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ const ParticipantsList = observer(() => {
1818
const [isLoading, setIsLoading] = useState(false)
1919

2020
// useEffect is a hook that gets called after every render/re-render. Empty array second argument prevents it from running again.
21-
// Empty array throws eslint warning--treated as an error in TravisCI. Including dependency to resolve it.
2221
useEffect(() => {
2322
setIsLoading(true)
2423
participantsStore.getParticipants()
2524
setIsLoading(false)
25+
//Suppress eslint error for []
26+
//eslint-disable-next-line react-hooks/exhaustive-deps
2627
}, [])
2728

2829
return (

frontend/src/components/QueueTable.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ const QueueTable = observer(queueData => {
4949
]
5050

5151
const urgencyOptions = [
52-
{ value: "ONE", name: 1 },
53-
{ value: "TWO", name: 2 },
54-
{ value: "THREE", name: 3 },
55-
{ value: "FOUR", name: 4 },
56-
{ value: "FIVE", name: 5 },
52+
{ value: "_1", name: 1 },
53+
{ value: "_2", name: 2 },
54+
{ value: "_3", name: 3 },
55+
{ value: "_4", name: 4 },
56+
{ value: "_5", name: 5 },
5757
]
5858

5959
const NotesButton = visitId => {

0 commit comments

Comments
 (0)