Skip to content

Commit

Permalink
Merge pull request #688 from aphp/hot-fix/noRightToAccessMyPatient
Browse files Browse the repository at this point in the history
[2.19.3][Merge] - Merge hot-fix/rights into main
  • Loading branch information
Mehdi-BOUYAHIA authored Jan 10, 2023
2 parents 15a97b8 + 6c9ce9f commit 6509d4f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cohort360_react",
"version": "2.19.2",
"version": "2.19.3",
"private": true,
"dependencies": {
"@apollo/client": "^3.7.0",
Expand Down
8 changes: 4 additions & 4 deletions src/state/exploredCohort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const defaultInitialState = {
importedPatients: [],
includedPatients: [],
excludedPatients: [],
loading: false,
loading: true,
canMakeExport: false,
deidentifiedBoolean: undefined
}
Expand Down Expand Up @@ -324,20 +324,20 @@ const exploredCohortSlice = createSlice({
builder.addCase(logout.fulfilled, () => defaultInitialState)
builder.addCase(fetchExploredCohort.pending, (state) => ({ ...state, loading: true }))
builder.addCase(fetchExploredCohort.fulfilled, (state, { payload }) => ({ ...state, ...payload, loading: false }))
builder.addCase(fetchExploredCohort.rejected, () => ({ ...defaultInitialState }))
builder.addCase(fetchExploredCohort.rejected, () => ({ ...defaultInitialState, loading: false }))
builder.addCase(fetchExploredCohortInBackground.pending, (state) => ({ ...state, loading: true }))
builder.addCase(fetchExploredCohortInBackground.fulfilled, (state, { payload }) => ({
...state,
...payload,
loading: false
}))
builder.addCase(fetchExploredCohortInBackground.rejected, () => ({ ...defaultInitialState }))
builder.addCase(fetchExploredCohortInBackground.rejected, () => ({ ...defaultInitialState, loading: false }))
builder.addCase(favoriteExploredCohort.pending, (state) => ({ ...state }))
builder.addCase(favoriteExploredCohort.fulfilled, (state, { payload }) => ({
...state,
...payload
}))
builder.addCase(favoriteExploredCohort.rejected, () => ({ ...defaultInitialState }))
builder.addCase(favoriteExploredCohort.rejected, () => ({ ...defaultInitialState, loading: false }))
}
})

Expand Down
2 changes: 1 addition & 1 deletion src/views/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const Dashboard: React.FC<{
return <CohortCreation />
}

if (dashboard.loading === false && dashboard.cohort === undefined) {
if (dashboard.loading === false && dashboard.cohort === undefined && dashboard.totalPatients === undefined) {
return <CohortRightOrNotExist />
} else if (dashboard.loading === false && dashboard.totalPatients === 0) {
return <CohortNoPatient />
Expand Down

0 comments on commit 6509d4f

Please sign in to comment.