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

fixes edit profile - questionItems disable via readOnlyLinkIds #3218

Merged
merged 3 commits into from
May 6, 2024

Conversation

AbdulWahabMemon
Copy link
Contributor

Revert fhircore PR#3069

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes [link to issue]

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

ageryck
ageryck previously approved these changes May 2, 2024
Comment on lines 43 to 49
Observer<T>
// override fun onChanged(o: T?) {
// data[0] = o
// latch.countDown()
// liveData.removeObserver(this)
// }
{ TODO("Not yet implemented") }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of commenting these lines, make the function parameter o NON-NULLABLE by removing the question mark.

override fun onChanged(o: T) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

@ellykits
Copy link
Collaborator

ellykits commented May 3, 2024

@ageryck @AbdulWahabMemon How is this PR different from this one by @DebbieArita #3070

@ageryck
Copy link
Contributor

ageryck commented May 6, 2024

@ageryck @AbdulWahabMemon How is this PR different from this one by @DebbieArita #3070

@ellykits the other PR was evaluating to true when in edit mode irrespective of linkid's supplied hence rending full form in readonly mode
@AbdulWahabMemon share more here

@@ -130,13 +131,16 @@ constructor(
readOnlyLinkIds: List<String>? = emptyList()
): Questionnaire? =
defaultRepository.loadResource<Questionnaire>(questionnaireConfig.id)?.apply {
if (questionnaireConfig.type.isReadOnly() || questionnaireConfig.type.isEditMode()) {
if (questionnaireConfig.type.isReadOnly()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ellykits , here its the main change I found to fix the underline issue,
the required/expected behavior is handle with line 141 below.

@AbdulWahabMemon
Copy link
Contributor Author

@ageryck @AbdulWahabMemon How is this PR different from this one by @DebbieArita #3070

@ellykits the other PR was evaluating to true when in edit mode irrespective of linkid's supplied hence rending full form in readonly mode @AbdulWahabMemon share more here

https://github.com/opensrp/fhircore/pull/3218/files#r1590661089

@dubdabasoduba dubdabasoduba merged commit 4d2d504 into opensrp-0.2.5 May 6, 2024
@dubdabasoduba dubdabasoduba deleted the edit-profile-fixes branch May 6, 2024 08:42
LZRS added a commit that referenced this pull request May 9, 2024
ellykits pushed a commit that referenced this pull request May 14, 2024
* Remove unanswered linkId from questionnaireResponse

so that default initial values for the linkId get picked from Questionnaire

* Apply patch changes from #3218
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.

None yet

4 participants