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

feat: autofill the healthcare professional info in mod #953

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

ShizuokaTerrier
Copy link
Contributor

@ShizuokaTerrier ShizuokaTerrier commented Dec 27, 2024

Resolves #864

🔧 What changed

The selected healthcare professional's information is now autofilled.

If the professional has name info in another locale that also autofills when the locale is selected.

📸 Screenshots

  • Before

image
  • After

mod_edit_healthcare_professional_section_autofill.mp4

ShizuokaTerrier and others added 6 commits December 27, 2024 21:23
…nForm

Add healthcareprofessionalsection to locales.
Create healthcareprofessionalsection cypress test.
Add sectionfields to healthcareProfessionalsStore.

Co-authored-by: Chris Bowman <[email protected]>
Co-authored-by: Karl Komeya <[email protected]>
Co-authored-by: NabbeunNabi <[email protected]>

Co-authored-by: NabbeunNabi <[email protected]>
Co-authored-by: Matt Keighley <[email protected]>
Co-authored-by: Karl Komeya <[email protected]>
Co-authored-by: William Brammer <[email protected]>
@ShizuokaTerrier ShizuokaTerrier self-assigned this Dec 27, 2024
Copy link

netlify bot commented Dec 27, 2024

Deploy Preview for findadoc ready!

Name Link
🔨 Latest commit 9173fe9
🔍 Latest deploy log https://app.netlify.com/sites/findadoc/deploys/677c80ff0dd83d00085923ee
😎 Deploy Preview https://deploy-preview-953--findadoc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ShizuokaTerrier ShizuokaTerrier changed the title Feat: autofill the healthcare professional info in mod feat: autofill the healthcare professional info in mod Dec 27, 2024
@NabbeunNabi NabbeunNabi force-pushed the feat/healthcare-component-autofill branch from 3a12dd7 to 77ff6ee Compare December 28, 2024 18:45
@NabbeunNabi NabbeunNabi marked this pull request as ready for review December 28, 2024 18:49
Copy link
Contributor

@ermish ermish left a comment

Choose a reason for hiding this comment

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

nice work @ShizuokaTerrier !

@@ -15,6 +20,61 @@ export const useHealthcareProfessionalsStore = defineStore(
const healthcareProfessionalsData: Ref<HealthcareProfessional[]>
= ref([])
const selectedHealthcareProfessionalId: Ref<string> = ref('')
const selectedHealthcareProfessionalData: Ref<HealthcareProfessional | undefined> = ref()
const healthcareProfessionalSectionFields = reactive({
Copy link
Contributor

Choose a reason for hiding this comment

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

sectionFields to me is a bit confusing. Section of what?
It's important to remember that stores are meant to be abstracted from the specific components using them.

Is this selectedHealthcareProfessional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In combination with the initialize function it is. In that case, would a name like selectedHealthcareProfessionalEditableFields be better? It's clear, but a bit of a mouthful.

Copy link
Contributor

Choose a reason for hiding this comment

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

that's fine by me if that's accurate. I'm not sure why this one is editable and the selectedHealthcareProfessionalData is not. (I think it should be) Can we combine these two and just make the selected one reactive? I don't see why we need to offer two different ones.

function initializeHealthcareProfessionalValues(selectedHealthcareProfessionalData: HealthcareProfessional | undefined) {
if (!selectedHealthcareProfessionalData) return

healthcareProfessionalSectionFields.healthcareProfessionalNameArray = selectedHealthcareProfessionalData.names
Copy link
Contributor

Choose a reason for hiding this comment

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

This function seems more like a function for mapping from api data to component format rather than an initializer function. Perhaps this just needs a rename?

Also, it looks like where this is being used, we could just call this from the setSelectedHealthcareProfessional method internally instead of from the component. Is there a use case outside of the set method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm presuming the setSelectedHealthcareProfessional is potentially going to be used elsewhere without needing to initialize values. Is that right @NabbeunNabi ?

Copy link
Contributor

Choose a reason for hiding this comment

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

At the moment it is only being used here to initialize the fields from the selected healthcare professional. This could be possibly used in the future. We definitely could call it when we set the selected healthcare professional. It does make sense now as @ermish is saying to call it internally

stores/healthcareProfessionalsStore.ts Show resolved Hide resolved
utils/multiSelectWithoutKeyboard.ts Show resolved Hide resolved
components/ModEditHealthcareProfessionalSection.vue Outdated Show resolved Hide resolved
components/ModEditHealthcareProfessionalSection.vue Outdated Show resolved Hide resolved
components/ModEditHealthcareProfessionalSection.vue Outdated Show resolved Hide resolved
name="Name Locales"
class="mb-5 px-3 py-3.5 w-96 h-12 bg-secondary-bg rounded-lg border border-primary-text-muted
text-primary-text text-sm font-normal font-sans placeholder-primary-text-muted"
<div v-if="isHealthcareProfessionalInitialized">
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a great future issue would be to show a loader placeholder while this is being initialized! This can reduce the screen jumping all over while things are loading.
Do you want to take a shot at writing one up for us @ShizuokaTerrier ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds fun @ermish!

Copy link
Contributor

Choose a reason for hiding this comment

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

@ShizuokaTerrier Did you write the ticket for this? Just curious as to whether I can resolve the conversation or not or plan on doing it this week?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto fill the Healthcare Professional Section of the form in the moderation panel
5 participants