-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add disable preview toggle in settings panel (#1977)
* add disable preview toggle Signed-off-by: Sajid Alam <[email protected]> * rename and add api call Signed-off-by: Sajid Alam <[email protected]> * add to localstore Signed-off-by: Sajid Alam <[email protected]> * api backend implementation Signed-off-by: Sajid Alam <[email protected]> * add new api endpoint Signed-off-by: Sajid Alam <[email protected]> * changes based on review Signed-off-by: Sajid Alam <[email protected]> * coverage Signed-off-by: Sajid Alam <[email protected]> * add tests Signed-off-by: Sajid Alam <[email protected]> * lint Signed-off-by: Sajid Alam <[email protected]> * design changes Signed-off-by: Sajid Alam <[email protected]> * changes based on review 2 Signed-off-by: Sajid Alam <[email protected]> * changes based on review 3 Signed-off-by: Sajid Alam <[email protected]> * add reducer test Signed-off-by: Sajid Alam <[email protected]> * elint fix Signed-off-by: Sajid Alam <[email protected]> * changes based on review Signed-off-by: Sajid Alam <[email protected]> * Update test_router.py Signed-off-by: Sajid Alam <[email protected]> * Update router.py Signed-off-by: Sajid Alam <[email protected]> * remove fstring Signed-off-by: Sajid Alam <[email protected]> * Add new endpoint to fetch initial showDatasetsPreviews value Signed-off-by: Sajid Alam <[email protected]> * coverage Signed-off-by: Sajid Alam <[email protected]> * redux thunk for preferences API Signed-off-by: Sajid Alam <[email protected]> * Update preferences.js Signed-off-by: Sajid Alam <[email protected]> * Update settings-modal.js Signed-off-by: Sajid Alam <[email protected]> * revert nested Signed-off-by: Sajid Alam <[email protected]> * changes based on review Signed-off-by: Sajid Alam <[email protected]> * combine preference action Signed-off-by: Sajid Alam <[email protected]> * changes based on reviews Signed-off-by: Sajid Alam <[email protected]> * Update settings-modal.test.js Signed-off-by: Sajid Alam <[email protected]> * Update RELEASE.md Signed-off-by: Sajid Alam <[email protected]> * rename and add nesting Signed-off-by: Sajid Alam <[email protected]> * update tests Signed-off-by: Sajid Alam <[email protected]> * changes based on reviews Signed-off-by: Sajid Alam <[email protected]> --------- Signed-off-by: Sajid Alam <[email protected]>
- Loading branch information
1 parent
73ac8b0
commit f75f16a
Showing
14 changed files
with
261 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { fetchPreferences } from '../utils/preferences-api'; | ||
|
||
// Action Types | ||
export const UPDATE_USER_PREFERENCES = 'UPDATE_USER_PREFERENCES'; | ||
|
||
// Action Creators | ||
export const updateUserPreferences = (preferences) => ({ | ||
type: UPDATE_USER_PREFERENCES, | ||
payload: preferences, | ||
}); | ||
|
||
export const getPreferences = () => async (dispatch) => { | ||
try { | ||
const preferences = await fetchPreferences(); | ||
dispatch(updateUserPreferences(preferences)); | ||
} catch (error) { | ||
console.error('Error fetching preferences:', error); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { UPDATE_USER_PREFERENCES } from '../actions/preferences'; | ||
|
||
const initialState = { | ||
showDatasetPreviews: true, | ||
}; | ||
|
||
const userPreferences = (state = initialState, action) => { | ||
switch (action.type) { | ||
case UPDATE_USER_PREFERENCES: | ||
return { | ||
...state, | ||
showDatasetPreviews: action.payload.showDatasetPreviews, | ||
}; | ||
default: | ||
return state; | ||
} | ||
}; | ||
|
||
export default userPreferences; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.