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

[Fix] risk and iap fixes #39

Merged
merged 14 commits into from
Nov 27, 2024
Merged

Conversation

deeonwuli
Copy link
Contributor

@deeonwuli deeonwuli commented Nov 12, 2024

📌 References

📝 Implementation

  • Remove dashboard section text
  • Make only incident manager user group users edit verification field
  • Bugfix: Show correct options for incident response action select fields
  • Bugfix: Fix IAP cancel button
  • Change event tracker form summary layout
  • Add button to add new risk grading
  • Edit a singular response action

📹 Screenshots/Screen capture

Screen.Recording.2024-11-13.at.19.44.30.mov
Screen.Recording.2024-11-26.at.11.00.39.mov

🔥 Notes to the tester

#8696j3edq

@deeonwuli deeonwuli changed the title [Fix]: risk and iap fixes [Fix] risk and iap fixes Nov 12, 2024
Copy link
Contributor

@9sneha-n 9sneha-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, minor changes required @deeonwuli

sections[0]?.fields[3]?.type === "select" ? sections[0].fields[3].options : [],
statusOptions:
sections[0]?.fields[6]?.type === "select" ? sections[0].fields[6].options : [],
searchAssignROField?.type === "select" ? searchAssignROField.options : [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deeonwuli now we have configurations in useAppContext which will give you the options for each form type. Please use that instead : configurations.selectableOptions.incidentActionPlanConfigurations

useEffect(() => {
compositionRoot.userGroup.getByCode.execute(RTSL_ZEBRA_INCIDENTMANAGER).run(
userGroup => {
const isIncidentManager = currentUser.belongToUserGroup(userGroup.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if my understanding is correct, this userGroup will be same throughout the app (wont be different for different evnt trackers) So can you move this code to GetConfigurationsUseCase so that it is called only once on app load? You can add isIncidentManager to AppContextState.currentUser and save the value there and it will be available throughout the code.

@@ -0,0 +1,3 @@
import { Ref } from "./Ref";

export type UserGroup = Ref;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@@ -38,7 +39,7 @@ function App(props: AppProps) {
const orgUnits = await compositionRoot.orgUnits.getAll.execute().toPromise();

const configurations = await compositionRoot.diseaseOutbreakEvent.getConfigurations
.execute()
.execute({ incidentManagerUserGroupCode: RTSL_ZEBRA_INCIDENTMANAGER })
Copy link
Contributor

@9sneha-n 9sneha-n Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to pass incidentManagerUserGroupCode from here ? It is defined in the repository, so it can be used directly in the getUserGroupByCode. We do not need to send it from presentation to domain to data layer again. It belongs in the data layer and can imported/exported directly between the 2 repos.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay understood 👍

@deeonwuli deeonwuli requested a review from 9sneha-n November 14, 2024 07:51
Copy link
Contributor

@9sneha-n 9sneha-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good @deeonwuli

@deeonwuli deeonwuli requested a review from 9sneha-n November 26, 2024 09:46
Copy link
Contributor

@9sneha-n 9sneha-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two good to have minor comments, can be fixed in next release - not major enough to block the merge.

switch (formType) {
case "incident-action-plan":
return RTSL_ZEBRA_INCIDENT_ACTION_PLAN_PROGRAM_STAGE_ID;
case "incident-response-actions":
case "incident-response-action":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is quite confusing, change "incident-response-action" to "single-incident-response-action" .

Make the change in the next PR for v2, so that we are not blocking release for this code review comment.

eventTrackerDetails: eventTrackerDetails,
entity:
eventTrackerDetails.incidentActionPlan?.responseActions.find(
responseAction => responseAction.id === responseActionId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not throw an error if the response action if not found. return "undefined" and in the presentation layer, if the formtype is SingleResponseActionConfigurableForm and entity is undefined, then show error in snackbar.

@bhavananarayanan bhavananarayanan merged commit 3d62ad0 into development Nov 27, 2024
1 check passed
@bhavananarayanan bhavananarayanan deleted the fix/risk-and-iap-fixes branch November 27, 2024 08:24
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