-
Notifications
You must be signed in to change notification settings - Fork 35
feat: [DHIS2-18739] Update feedback and indicator widgets in the Registration page #4385
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
147123a
feat: create container files and use in dataentrywidgetoutput
henrikmv 18aa91c
fix: typo
henrikmv 5a9da90
fix: reuse same empty text
henrikmv ee24498
feat: clean up
henrikmv 856c1b0
feat: temp
henrikmv c86f28d
feat: review
henrikmv c8cab54
feat: temp
henrikmv d4f2f59
feat: review
henrikmv 34ee39e
fix: use component
henrikmv f50ffe7
feat: temp
henrikmv 4d1b237
feat: revert
henrikmv 817f1bd
feat: temp
henrikmv 32dffdf
fix: revert
henrikmv a7c8fb1
feat: check for feedback and indicators before reading redux
henrikmv 848a429
feat: specify prop for empty text
henrikmv 58aef37
fix: improve typing
henrikmv efc43b2
Merge branch 'master' into DHIS2-18739
henrikmv 6f94ed3
fix: clean up
henrikmv 855626b
fix: line break
henrikmv 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
7 changes: 4 additions & 3 deletions
7
...e-core/components/Pages/common/EnrollmentOverviewDomain/enrollmentOverviewDomain.types.ts
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 |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| import type { Message } from '../../../WidgetErrorAndWarning/content/WidgetErrorAndWarningContent.types'; | ||
| import type { WidgetData } from '../../../WidgetFeedback/WidgetFeedback.types'; | ||
| import type { FeedbackWidgetData } from '../../../WidgetFeedback'; | ||
| import type { IndicatorWidgetData } from '../../../WidgetIndicator'; | ||
|
|
||
| export type HideWidgets = { | ||
| feedback: boolean; | ||
| indicator: boolean; | ||
| }; | ||
|
|
||
| export type WidgetEffects = { | ||
| feedbacks?: Array<WidgetData> | null; | ||
| feedbacks?: Array<FeedbackWidgetData> | null; | ||
| warnings?: Array<Message> | null; | ||
| errors?: Array<Message> | null; | ||
| indicators?: Array<WidgetData> | null; | ||
| indicators?: Array<IndicatorWidgetData> | null; | ||
| }; |
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
14 changes: 14 additions & 0 deletions
14
src/core_modules/capture-core/components/WidgetFeedback/WidgetFeedback.container.ts
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,14 @@ | ||
| import { connect } from 'react-redux'; | ||
| import { WidgetFeedbackComponent } from './WidgetFeedback.component'; | ||
| import { FeedbackProps } from './WidgetFeedback.types'; | ||
|
|
||
| const mapStateToProps = (state: any, props: FeedbackProps) => ({ | ||
| feedback: props.feedback || (props.dataEntryKey ? [ | ||
| ...(state.rulesEffectsFeedback[props.dataEntryKey]?.displayTexts || []), | ||
| ...(state.rulesEffectsFeedback[props.dataEntryKey]?.displayKeyValuePairs || []), | ||
| ] : []), | ||
| feedbackEmptyText: props.feedbackEmptyText, | ||
| }); | ||
|
|
||
| export const WidgetFeedback = connect(mapStateToProps, () => ({}))(WidgetFeedbackComponent); | ||
|
|
30 changes: 8 additions & 22 deletions
30
src/core_modules/capture-core/components/WidgetFeedback/WidgetFeedback.types.ts
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 |
|---|---|---|
| @@ -1,39 +1,25 @@ | ||
| export type FilteredText = { | ||
| export type FilteredFeedbackText = { | ||
| id: string; | ||
| message: string; | ||
| color?: string; | ||
| } | ||
|
|
||
| export type FilteredKeyValue = { | ||
| export type FilteredFeedbackKeyValue = { | ||
| id: string; | ||
| key: string; | ||
| value: string; | ||
| color?: string; | ||
| } | ||
|
|
||
| export type WidgetData = string | FilteredText | FilteredKeyValue; | ||
| export type FeedbackWidgetData = string | FilteredFeedbackText | FilteredFeedbackKeyValue; | ||
|
|
||
| export type ContentType = { | ||
| widgetData?: Array<WidgetData>; | ||
| emptyText: string; | ||
| }; | ||
|
|
||
| export type InputFeedbackProps = { | ||
| export type FeedbackInputProps = { | ||
| widgetEffects?: Record<string, unknown>; | ||
| feedbackEmptyText: string; | ||
| } | ||
|
|
||
| export type Props = { | ||
| feedback?: Array<string | FilteredText | FilteredKeyValue>; | ||
| emptyText: string; | ||
| } | ||
|
|
||
| export type IndicatorProps = { | ||
| indicators?: Array<string | FilteredText | FilteredKeyValue>; | ||
| emptyText: string; | ||
| } | ||
|
|
||
| export type InputIndicatorProps = { | ||
| widgetEffects?: Record<string, unknown>; | ||
| indicatorEmptyText: string; | ||
| export type FeedbackProps = { | ||
| feedback?: Array<FeedbackWidgetData>; | ||
| feedbackEmptyText: string; | ||
| dataEntryKey?: string; | ||
| } | ||
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.