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

OHRI-1857 : Users should only be able to edit the latest MNCH visit/e… #1721

Closed
wants to merge 50 commits into from

Conversation

Herobiam
Copy link
Contributor

@Herobiam Herobiam commented Dec 13, 2023

…ncounter

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes the ticket number in the format OHRI-123 My PR title.
  • My work includes tests or is validated by existing tests.

Summary

OHRI-1857

This feature should not allow users to go back and edit fields from a previous encounters. E.g if a pregnancy has a first ANC entered and a follow-up ANC encounter/visit added then user should not be able to edit the 1st ANC but editing for the latest follow up encounter/visit should still be possible.

Screenshots

Screen.Recording.2023-12-13.at.4.15.15.PM.mov

Related Issue

Other

@Herobiam Herobiam marked this pull request as ready for review December 18, 2023 05:47
@ODORA0
Copy link
Contributor

ODORA0 commented Dec 18, 2023

@Herobiam The requirement of the issue says this has to be default to MNCH but am pretty sure this will affect all encounter lists since these changes are in the encounter list component in the shared commons lib

@Herobiam
Copy link
Contributor Author

@ODORA0 i have made changes as per your comment above

ODORA0
ODORA0 previously approved these changes Dec 18, 2023
Copy link
Contributor

@ODORA0 ODORA0 left a comment

Choose a reason for hiding this comment

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

LGTM

@ODORA0 ODORA0 requested a review from pirupius December 18, 2023 07:52
@@ -198,6 +200,7 @@ export const EncounterList: React.FC<EncounterListProps> = ({
workspaceWindowSize,
);
}}
disabled={actionItem.label == 'Edit form' && disableEdit == true && findEncounterLatestDateIndex(encounters) != encounterIndex}
Copy link
Contributor

Choose a reason for hiding this comment

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

This logic looks very specific and doesn't look like something that can be reused because

  1. The condition to disable the action seems to be based off the words Edit form which would break the moment the text changes
  2. This doesn't play well with scenarios where actions are from multiple forms

My suggestion would be moving this logic away from here and adding it to the actions with the individual programs.

CynthiaKamau and others added 28 commits January 10, 2024 20:10
* (chore) Add encounter tile related mock data

* (chore) Add obs base table related mock data

---------

Co-authored-by: Cynthia Kamau <[email protected]>
* OHRI-2051 update metadata to use config in covid esm

* Remove constants, refactor api and minor changes to config

* Remove identifiers obj in configSchema

* Add config schema file to startupApp function in index

* Configure formNames

* Add cohorts node to interface
Deleted covid outcomes tag.
…IGHS#1750)

* OHRI-2043 Yarn v4 and migrates monorepo to use yarn workspaces

* updates ci publish to yarn
…CSF-IGHS#1736)

* OHRI-2053: config refactor

* cleanup

* OHRI-2053 Cacx form names added to config

* removed constants file

* updated interface
…nd extensions (UCSF-IGHS#1752)

* HIV - Update package index.ts to syncronously load pages and extensions

* removing the unused 'getAsyncLifecycle'
…UCSF-IGHS#1739)

* PMTCT - update metadata to use config instead of constants

* Update config-schema.ts

* Update art-linkage-action.ts

* Update current-ptracker-action.ts

* Update infant-postnatal-care.component.tsx

* Update antenatal-care.component.tsx

* Update labour-delivery.component.tsx

* Update postnatal-care.component.tsx

* Update current-pregnancy.component.tsx

* Update hiv-exposed-infant.component.tsx

* Update api.ts

* Update config-schema.ts

* Update art-linkage-action.ts

* Update current-ptracker-action.ts

* Update infant-postnatal-care.component.tsx

* Update antenatal-care.component.tsx

* Update labour-delivery.component.tsx

* Update postnatal-care.component.tsx

* Update current-pregnancy.component.tsx

* Update hiv-exposed-infant.component.tsx

* removing un-used encTypes

* Update current-pregnancy.component.tsx
* (chore) testing pre-release ci

* fixes jest-dom import

* adds version to root package.json

* yarn version tweaks

* specifies action branches

* adds git fetch step

* adds more git branch commands

* checkout dev

* env check

* fixes to version check

* adds changesetBaseRefs to .yarnrc.yml

* deletes test commands

* tweaks to publish scripts

* npmAuthToken

* fixes import

* failing tests

* makes test threshold zero

* removes duplicate publish script

* clean up
…ma) (UCSF-IGHS#1741)

* ohri-2025 making hiv-app configurable (moved constants to config-schema)

* OHRI-2025 Corrections to config-schema

* Destructuring the configs for shorter names

* ohri-2052 removing duplicated concepts references
* OHRI-2106 fixed failing tests

* cleanup

* more cleanup
* OHRI-2050 replace momentjs with dayjs

* updates openmrs dependencies

* updates yarn.lock
@pirupius
Copy link
Contributor

PR moved to #1772

@pirupius pirupius closed this Jan 19, 2024
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.

10 participants