-
Notifications
You must be signed in to change notification settings - Fork 71
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
(feat) O3-3712: add a concept answer to a concept in the form builder #351
Open
Willie-theBeastMutua
wants to merge
14
commits into
openmrs:main
Choose a base branch
from
Willie-theBeastMutua:addConceptAnswer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
99c0a50
Add concept answer added in edit
Willie-theBeastMutua d761d9b
All Changes done
Willie-theBeastMutua bcfd74b
Edit Modal changed
Willie-theBeastMutua 0b098c5
Check for duplicates & delete added
Willie-theBeastMutua 75d1cfa
Add Concept Answers
Willie-theBeastMutua bfec7d3
Upstream Merge
Willie-theBeastMutua e417ff7
check for duplicate added answer
Willie-theBeastMutua e5de0d0
Update src/components/interactive-builder/add-question.modal.tsx
Willie-theBeastMutua 462277e
Merge remote-tracking branch 'upstream/main' into addConceptAnswer
Willie-theBeastMutua 1b94b7b
removed callback
Willie-theBeastMutua 93e4773
Add Concept Answer
Willie-theBeastMutua f1aa909
Merge remote-tracking branch 'upstream/main' into addConceptAnswer
Willie-theBeastMutua 96a39f9
Add answer edit empty concept
Willie-theBeastMutua cf438a4
Add more concept answers
Willie-theBeastMutua 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 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,13 @@ | ||
import useSWR from 'swr'; | ||
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework'; | ||
import type { Concept } from '../types'; | ||
|
||
export function useConceptInfo(conceptId: string) { | ||
const url = `${restBaseUrl}/concept/${conceptId}`; | ||
|
||
const { data } = useSWR<{ data: Concept }, Error>(conceptId ? url : null, openmrsFetch); | ||
|
||
return { | ||
concept: data?.data ?? null, | ||
}; | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have a hard-coded UUID?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Willie-theBeastMutua please check my comment, just removing the conditional logic is sufficient, and we'll merge this in. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UUID id for the coded datatype that is the check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remove the logic, the more answers will display even when the concept is not of a coded datatype so I added a hook that collects data on the concept and I check for the UUID for the coded datatype. I can use the word "Coded" to check but my fear was what would happen if the language changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore my suggestion about simply removing the condition, I see why the hook is needed.
@ibacher if we do a datatype.display === "Coded", would that be language sensitive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Willie-theBeastMutua for now lets assume it wont change with the language
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NethmiRodrigo Yes, but if you used
datatype.name
is shouldn't be, except in some edge-cases.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general
display
is the (possibly) localized metadata, butname
is the "raw" value.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NethmiRodrigo this is done