Conversation
b9e478d to
4e5676e
Compare
a63342f to
889c76c
Compare
|
Missing some commits from 2609 (by Andrew), local branch with those commits exists. |
Move the clinician portal code in its own module
Visit page - added link to patient survey
Rename clinician-portal -> clinician-dashboard
Implement new clinician views
Finish new clinician views
Fix merge and linting errors
889c76c to
907d787
Compare
- Remove ClinicianForms as it got renamed and then readded due to a merge issue - Add expand button back to clinician dashboard subjects and forms table
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/SurveyLinkButton.jsx
Outdated
Show resolved
Hide resolved
modules/data-entry/src/main/frontend/src/questionnaire/Form.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/SurveyLinkButton.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Form.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/FormView.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Forms.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Patient.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Patient.jsx
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/SurveyLinkButton.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/SurveyLinkButton.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/SurveyLinkButton.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Visit.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Visit.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Visit.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Visit.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Form.jsx
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Patient.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Patient.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Patient.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/SubjectView.jsx
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/SurveyLinkButton.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/SurveyLinkButton.jsx
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Visit.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Visit.jsx
Outdated
Show resolved
Hide resolved
| ids.push(q); | ||
| } | ||
| }); | ||
| !questionnaireIds && setQuestionnaireIds(ids); |
There was a problem hiding this comment.
Why do we need a separate state var for questionnaireIds if they are just Object.keys(surveyData)?
There was a problem hiding this comment.
Morevover, we only reset questionnaireIds when there were none. When questionnaireSetId changes and we reload data, ids become stale forever.
There was a problem hiding this comment.
This looks like code adapted from QuestionnaireSet.jsx. There, we may have introduced questionnaireIds to be used as an effect dependency in an attempt to reduce the frequency of that effect in a different version of the code.
There was a problem hiding this comment.
I don't really mind this state var, definitely not a top refactoring priority.
There was a problem hiding this comment.
On that note, in a future iteration we should explore actually reusing, rather than adapting, code between clinician-dashboard/Visit.jsx and QuestionnaireSet.jsx, for example via a QuestionnaireSetUtils.
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Visit.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Visit.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Visit.jsx
Outdated
Show resolved
Hide resolved
modules/clinician-dashboard/src/main/frontend/src/clinician-dashboard/Visit.jsx
Outdated
Show resolved
Hide resolved
|
Most of the comments should be addressed by the latest commit, haven't had time to double check or thoroughly test yet though |
| const fetchToken = () => { | ||
| setFetchingLink(true); | ||
| fetchWithReLogin(globalLoginDisplay, `${visitURL}.token.html`) | ||
| .then((response) => response.ok ? response.text() : Promise.reject(response)) | ||
| .then((text) => { | ||
| let link = window.location.origin + "/Survey.html?auth_token=" + text.trim(); | ||
| setSurveyLink(link); | ||
| copy(link); | ||
| }) | ||
| .catch(() => setError("Could not generate survey link")) | ||
| .finally(() => setFetchingLink(false)); | ||
| }; |
There was a problem hiding this comment.
I would like to build in the ability to specify the validity of the token, or at least use a better default. For example, there could be an admin config that allows to specify how many days a token created this way would be valid from the moment of it's creation. This way, the functionality could be used to provide a new link to expired surveys in just one step. It doesn't have to be done in this PR unless it's trivial. Thoughts? @acrowthe @sdumitriu
modules/data-entry/src/main/frontend/src/dataHomepage/Forms.jsx
Outdated
Show resolved
Hide resolved
| let isActionEnabled = (action) => (!!!actionSwitches || !!(actionSwitches[action]?.(data))); | ||
|
|
||
| let isDropdnEnabled = () => ( | ||
| (isEdit && isActionEnabled("subject")) | ||
| || (!isEdit && isActionEnabled("text")) | ||
| || isActionEnabled("delete") | ||
| ); | ||
|
|
There was a problem hiding this comment.
This would have been a really good time for implementing https://phenotips.atlassian.net/browse/CARDS-1084 . Maybe in the next iteration?
| { | ||
| key: "", | ||
| label: "Subject", | ||
| format: (row) => (row.subject ? getHierarchy(row.subject, undefined, undefined, props.extensionURL) : ''), |
There was a problem hiding this comment.
Code style: why not extract extensionURL form props? This what we do in the majority of other components, and helps know which props are actually relevant.
…ctions - Address code review comments: Clean up and handle edge cases - Clean up extensionUrl definition
efc02d4 to
bdb7c76
Compare
To test:
./start_cards.sh -P prems --dev -f 'mvn:io.uhndata.cards/cards-clinician-portal/${CARDS_VERSION}/slingosgifeature' -f 'mvn:io.uhndata.cards/cards-locking/${CARDS_VERSION}/slingosgifeature'