-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1411 from IFRCGo/project/operational-learning
Project: Operational Learning
- Loading branch information
Showing
48 changed files
with
2,060 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ifrc-go/ui": patch | ||
--- | ||
|
||
Add DismissableListOutput, DismissableMultListOutput and DismissableTextOutput components |
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,5 @@ | ||
--- | ||
"go-web-app": patch | ||
--- | ||
|
||
Create Operational Learning Page and integrate LLM summary generation |
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,5 @@ | ||
--- | ||
"go-web-app": patch | ||
--- | ||
|
||
Integrate multi-select functionality in operational learning filters to allow selection of multiple filter items. |
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,5 @@ | ||
--- | ||
"@ifrc-go/ui": minor | ||
--- | ||
|
||
Add Chip component |
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
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
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,56 @@ | ||
import { | ||
useContext, | ||
useEffect, | ||
useMemo, | ||
} from 'react'; | ||
import { isDefined } from '@togglecorp/fujs'; | ||
|
||
import DomainContext, { PerComponents } from '#contexts/domain'; | ||
|
||
export type PerComponent = NonNullable<PerComponents['results']>[number]; | ||
|
||
type ListProps = { | ||
id?: never; | ||
} | ||
|
||
type PropsForId = { | ||
id: number; | ||
} | ||
|
||
function usePerComponent(props?: ListProps): Array<PerComponent> | undefined | ||
function usePerComponent(props: PropsForId): PerComponent | undefined | ||
function usePerComponent( | ||
props?: ListProps | PropsForId, | ||
): PerComponent | undefined | Array<PerComponent> | undefined { | ||
const { | ||
register, | ||
perComponents, | ||
} = useContext(DomainContext); | ||
|
||
useEffect( | ||
() => { | ||
register('per-components'); | ||
}, | ||
[register], | ||
); | ||
|
||
const returnValue = useMemo( | ||
() => { | ||
const id = props?.id; | ||
if (isDefined(id)) { | ||
return perComponents | ||
?.results?.find((perComponent) => perComponent.id === id); | ||
} | ||
|
||
// NOTE: we need to filter out parent components | ||
return perComponents?.results?.filter( | ||
(perComponent) => !perComponent.is_parent, | ||
); | ||
}, | ||
[perComponents, props?.id], | ||
); | ||
|
||
return returnValue; | ||
} | ||
|
||
export default usePerComponent; |
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,52 @@ | ||
import { | ||
useContext, | ||
useEffect, | ||
useMemo, | ||
} from 'react'; | ||
import { isDefined } from '@togglecorp/fujs'; | ||
|
||
import DomainContext, { type SecondarySectors } from '#contexts/domain'; | ||
|
||
export type SecondarySector = NonNullable<SecondarySectors>[number]; | ||
|
||
type ListProps = { | ||
id?: never; | ||
} | ||
|
||
type PropsForId = { | ||
id: number; | ||
} | ||
|
||
function useSecondarySector(props?: ListProps): Array<SecondarySector> | undefined | ||
function useSecondarySector(props: PropsForId): SecondarySector | undefined | ||
function useSecondarySector( | ||
props?: ListProps | PropsForId, | ||
): SecondarySector | undefined | Array<SecondarySector> | undefined { | ||
const { | ||
register, | ||
secondarySectors, | ||
} = useContext(DomainContext); | ||
|
||
useEffect( | ||
() => { | ||
register('secondary-sector'); | ||
}, | ||
[register], | ||
); | ||
|
||
const returnValue = useMemo( | ||
() => { | ||
const id = props?.id; | ||
if (isDefined(id)) { | ||
return secondarySectors?.find((secondaryTag) => secondaryTag.key === id); | ||
} | ||
|
||
return secondarySectors; | ||
}, | ||
[secondarySectors, props?.id], | ||
); | ||
|
||
return returnValue; | ||
} | ||
|
||
export default useSecondarySector; |
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.