Skip to content
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

Open
wants to merge 15 commits into
base: project/operational-learning
Choose a base branch
from

Conversation

roshni73
Copy link
Collaborator

@roshni73 roshni73 commented Aug 8, 2024

Addresses:

Changes

  • Fetch summaries and key insights from API

This PR doesn't introduce:

  • typos
  • conflict markers
  • unwanted comments
  • temporary files, auto-generated files or secret keys
  • console.log meant for debugging
  • codegen errors

Copy link

changeset-bot bot commented Aug 8, 2024

🦋 Changeset detected

Latest commit: 9f26a26

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@ifrc-go/ui Minor

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

Comment on lines 17 to 21
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] {
Copy link
Member

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

Copy link
Member

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 ?

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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

Copy link
Member

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.

Copy link
Member

@samshara samshara Sep 12, 2024

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.

Comment on lines 109 to 140
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]);

Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

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

Copy link
Member

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.

app/src/views/OperationalLearning/KeyInsights/index.tsx Outdated Show resolved Hide resolved
app/src/views/OperationalLearning/Sources/index.tsx Outdated Show resolved Hide resolved
app/src/views/OperationalLearning/index.tsx Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants