-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fetch and show operational learning summaries #1307
base: project/operational-learning
Are you sure you want to change the base?
Fetch and show operational learning summaries #1307
Conversation
🦋 Changeset detectedLatest commit: 9f26a26 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
c0f456a
to
2583eac
Compare
2583eac
to
5a43feb
Compare
5a43feb
to
8742bd2
Compare
048ffd3
to
9a4fb10
Compare
202b18d
to
b34d2e8
Compare
3006453
to
e5257de
Compare
function useSecondarySector(props?: ListProps): [Array<SecondarySector> | undefined, boolean] | ||
function useSecondarySector(props: PropsForId): [SecondarySector | undefined, boolean] | ||
function useSecondarySector( | ||
props?: ListProps | PropsForId, | ||
): [SecondarySector | undefined | Array<SecondarySector> | undefined, boolean] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this is the correct implementation for fetching enums/options cc: @frozenhelium @samshara
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tnagorra should we add these to the DomainContext
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using hooks, users usually expect that this will only make a single request. But, that won't be the case.
We should add this to the DomainContext and make sure the response is cached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fetched and stored secondary sectors in DomainContext
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this is the correct implementation for fetching enums/options cc: @frozenhelium @samshara
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using hooks, users usually expect that this will only make a single request. But, that won't be the case.
We should add this to the DomainContext and make sure the response is cached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fetched and stored per components in DomainContext
.
const handleStartDateSelect = useCallback(( | ||
newValue: string | undefined, | ||
key: 'appealStartDateAfter', | ||
) => { | ||
onChange( | ||
newValue, | ||
key, | ||
newValue, | ||
); | ||
}, [onChange]); | ||
|
||
const handleEndDateSelect = useCallback(( | ||
newValue: string | undefined, | ||
key: 'appealStartDateBefore', | ||
) => { | ||
onChange( | ||
newValue, | ||
key, | ||
newValue, | ||
); | ||
}, [onChange]); | ||
|
||
const handleSearch = useCallback(( | ||
newValue: string | undefined, | ||
key: 'appealSearchText', | ||
) => { | ||
onChange( | ||
newValue, | ||
key, | ||
); | ||
}, [onChange]); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not directly use onChange
on the components?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tnagorra we need to show the labels of the selection as pills component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function signature for handleSearch
and onChange
are the same so we should be able to just use onChange
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tnagorra here a typing issue arises.
Addresses:
Changes
This PR doesn't introduce:
console.log
meant for debugging