-
Notifications
You must be signed in to change notification settings - Fork 40
feat: set up new Preferences page & edit/view drawers (MSQ V2) #5654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jaredcwhite
wants to merge
27
commits into
main
Choose a base branch
from
5597/new-preferences-table
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 18 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
101468e
feat: set up a new page for the Preferences AG table
jaredcwhite 141c318
feat: use separate set of modals for new preferences page
jaredcwhite 25a6472
fix: temp rename to pull main in
jaredcwhite 43fb98c
Merge branch 'main' into 5597/new-preferences-table
jaredcwhite 5eac551
feat: set up proper feature flag detection for preferences table
jaredcwhite 0b81d89
feat: start relocating fields for new MSQ schema
jaredcwhite 1787568
Merge branch 'main' into 5597/new-preferences-table
jaredcwhite 7b2de0a
feat: viewing preferences now working correctly
jaredcwhite c58d1e2
feat: update seed data for newer preference schema
jaredcwhite 375d8e1
feat: tighten up UI in various drawers/modals
jaredcwhite ef30979
feat: keep show/hide on listing as its own option, improve view drawer
jaredcwhite b5a29d3
test: update backend tests for the MSQv2 changes
jaredcwhite dece4d5
test: address linting issues
jaredcwhite 79d8048
fix: use explicit call to save handler
jaredcwhite f10822f
feat: improve view UI
jaredcwhite ae1e700
Merge branch 'main' into 5597/new-preferences-table
jaredcwhite 3489879
feat: use conditional CLI flag for MSQ V2 seed data
jaredcwhite b68ea77
feat: additional improvements to seed data, fixing bugs in adding prefs
jaredcwhite fae326c
test: add new unit tests for the V2 Preferences page
jaredcwhite 772e994
test: cleanup, DRY
jaredcwhite 0050c1e
fix: lint
jaredcwhite 076cbd6
test: add test for viewing a preference
jaredcwhite 47d57f6
fix: address additional feedback QA
jaredcwhite 323d659
fix: cleanup multiple watch statements
jaredcwhite 4f54324
chore: update all useMutate usage to import from shared-helpers
jaredcwhite 951eeae
Merge branch 'main' into 5597/new-preferences-table
jaredcwhite 8943b10
fix: MSG V2 seeding issues
jaredcwhite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,52 @@ | ||
| import { useState } from "react" | ||
|
|
||
| export type UseMutateOptions = { | ||
| onSuccess?: () => void | ||
| onError?: (err: any) => void | ||
| } | ||
|
|
||
| export const useMutate = <UseMutateResponse>() => { | ||
jaredcwhite marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const [data, setData] = useState<UseMutateResponse | undefined>(undefined) | ||
| const [isSuccess, setSuccess] = useState(false) | ||
| const [isLoading, setLoading] = useState(false) | ||
| const [isError, setError] = useState<unknown>(null) | ||
|
|
||
| const mutate = async ( | ||
| mutateFn: (args?: unknown) => Promise<UseMutateResponse>, | ||
| options?: UseMutateOptions | ||
| ) => { | ||
| let response: UseMutateResponse | undefined = undefined | ||
|
|
||
| try { | ||
| setLoading(true) | ||
| response = await mutateFn() | ||
| setData(response) | ||
| setSuccess(true) | ||
| options?.onSuccess?.() | ||
| setLoading(false) | ||
| } catch (err) { | ||
| setSuccess(false) | ||
| setLoading(false) | ||
| setError(err) | ||
| options?.onError?.(err) | ||
| } | ||
|
|
||
| return response | ||
| } | ||
|
|
||
| const reset = () => { | ||
| setData(undefined) | ||
| setSuccess(false) | ||
| setLoading(false) | ||
| setError(null) | ||
| } | ||
|
|
||
| return { | ||
| mutate, | ||
| reset, | ||
| data, | ||
| isSuccess, | ||
| isLoading, | ||
| isError, | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.