@@ -177,11 +199,12 @@
import { nextTick, onBeforeMount, onUpdated, type Ref, ref, watch } from 'vue'
import { useRoute } from 'vue-router'
import { type ToastInterface, useToast } from 'vue-toastification'
+import ModSearchbar from './ModSearchBar.vue'
import { ModerationScreen, useModerationScreenStore } from '~/stores/moderationScreenStore'
import { useHealthcareProfessionalsStore } from '~/stores/healthcareProfessionalsStore'
-import { Locale, Insurance, Degree, Specialty, type LocalizedNameInput } from '~/typedefs/gqlTypes'
+import { Locale, Insurance, Degree, Specialty, type LocalizedNameInput, type Facility } from '~/typedefs/gqlTypes'
import { multiSelectWithoutKeyboard } from '~/utils/multiSelectWithoutKeyboard'
-import { useI18n } from '#imports'
+import { useFacilitiesStore, useI18n } from '#imports'
let toast: ToastInterface
@@ -189,6 +212,11 @@ const route = useRoute()
const { t } = useI18n()
+const selectedFacilities = ref(new Set())
+const facilitiesStore = useFacilitiesStore()
+await facilitiesStore.getFacilities() // Fix a bug where facilities disappear after the user refreshes the page
+const currentFacilities = facilitiesStore.facilityData
+
const moderationScreenStore = useModerationScreenStore()
const healthcareProfessionalsStore = useHealthcareProfessionalsStore()
const isEditSubmissionScreen = moderationScreenStore.activeScreen === ModerationScreen.EditSubmission
@@ -230,6 +258,18 @@ const handleLocalizedName = () => {
}
}
+const handleSearchInputChange = (filteredItems: Ref, inputValue: string) => {
+ filteredItems.value = currentFacilities.filter(({ nameEn, nameJa, id }) => {
+ const isMatch
+ = nameEn.toLowerCase().includes(inputValue)
+ || nameJa.toLowerCase().includes(inputValue)
+ || id.toLowerCase() === inputValue
+ return isMatch
+ })
+}
+
+const fieldsToDisplayCallback = (item: Facility) => [item.nameEn, item.nameJa]
+
onBeforeMount(async () => {
isHealthcareProfessionalInitialized.value = false
diff --git a/components/ModSearchBar.vue b/components/ModSearchBar.vue
new file mode 100644
index 00000000..7e3518b0
--- /dev/null
+++ b/components/ModSearchBar.vue
@@ -0,0 +1,252 @@
+
+
+
+
+
+ {{ searchResultCount }}
+
+
+
+
+
+
{ handleListItemMouseOver(index) }"
+ >
+
+ {{ index + 1 }}
+
+ {{ item.id }}
+
+
+
+ {{ field }}
+
+
+
+
+
+
+
+
+
+
+ {{ noMatchText }}
+
+
+
+
+
+
+
diff --git a/i18n/locales/cn.json b/i18n/locales/cn.json
index 9b910feb..57943a82 100644
--- a/i18n/locales/cn.json
+++ b/i18n/locales/cn.json
@@ -174,6 +174,9 @@
"selectSpecialties": "Specialties",
"selectDegrees": "Degrees",
"selectLocales": "Select Locales Spoken",
+ "facilities": "Facilities",
+ "placeholderTextFacilitySearchBar": "Search by name or Id add a facility",
+ "noFacilitiesWereFound": "No facilities were found",
"errorMessageHealthcareProfessionalId": "Healthcare Professional Id was not found"
},
"modSubmissionForm": {
@@ -364,4 +367,4 @@
"editName": "Edit",
"saveName": "Save"
}
-}
\ No newline at end of file
+}
diff --git a/i18n/locales/de.json b/i18n/locales/de.json
index 79510280..f05588b6 100644
--- a/i18n/locales/de.json
+++ b/i18n/locales/de.json
@@ -174,6 +174,9 @@
"selectSpecialties": "Specialties",
"selectDegrees": "Degrees",
"selectLocales": "Select Locales Spoken",
+ "facilities": "Facilities",
+ "placeholderTextFacilitySearchBar": "Search by name or Id add a facility",
+ "noFacilitiesWereFound": "No facilities were found",
"errorMessageHealthcareProfessionalId": "Healthcare Professional Id was not found"
},
"modSubmissionForm": {
@@ -364,4 +367,4 @@
"editName": "Edit",
"saveName": "Save"
}
-}
\ No newline at end of file
+}
diff --git a/i18n/locales/en.json b/i18n/locales/en.json
index 10578433..d5059936 100644
--- a/i18n/locales/en.json
+++ b/i18n/locales/en.json
@@ -10,7 +10,7 @@
"UNAUTHENTICATED": "You do not have the authentication to do this action",
"BAD_USER_INPUT": "One or more of the inputs entered is invalid, please try again",
"errorCodeMessagingNeeded": "The server error code does not have a message for the user. Please add one.",
- "genericErrorMessage": "There was an error submitting your form, please try again"
+ "genericErrorMessage": "There was an error submitting your form, please try again"
},
"footer": {
"terms": "Terms",
@@ -204,7 +204,10 @@
"selectDegrees": "Degrees",
"selectInsurances": "Accepted Insurances",
"selectLocales": "Select Locales Spoken",
- "selectSpecialties": "Specialties"
+ "selectSpecialties": "Specialties",
+ "facilities": "Facilities",
+ "placeholderTextFacilitySearchBar": "Search by name or Id add a facility",
+ "noFacilitiesWereFound": "No facilities were found"
},
"modFacilitySection": {
"addresses": "Addresses",
diff --git a/i18n/locales/fr.json b/i18n/locales/fr.json
index 31ea8435..8efc84be 100644
--- a/i18n/locales/fr.json
+++ b/i18n/locales/fr.json
@@ -362,10 +362,13 @@
"selectInsurances": "Accepted Insurances",
"selectLocales": "Select Locales Spoken",
"selectSpecialties": "Specialties",
+ "facilities": "Facilities",
+ "placeholderTextFacilitySearchBar": "Search by name or Id add a facility",
+ "noFacilitiesWereFound": "No facilities were found",
"errorMessageHealthcareProfessionalId": "Healthcare Professional Id was not found"
},
"modHealthcareProfessionalCard": {
"editName": "Edit",
"saveName": "Save"
}
-}
\ No newline at end of file
+}
diff --git a/i18n/locales/ja.json b/i18n/locales/ja.json
index 9a394d65..b42e674b 100644
--- a/i18n/locales/ja.json
+++ b/i18n/locales/ja.json
@@ -175,6 +175,9 @@
"selectLocales": "Select Locales Spoken",
"selectSpecialties": "Specialties",
"healthcareProfessionalId": "Healthcare Professional IDs",
+ "facilities": "Facilities",
+ "placeholderTextFacilitySearchBar": "Search by name or Id add a facility",
+ "noFacilitiesWereFound": "No facilities were found",
"errorMessageHealthcareProfessionalId": "Healthcare Professional Id was not found"
},
"modSubmissionForm": {
@@ -365,4 +368,4 @@
"editName": "Edit",
"saveName": "Save"
}
-}
\ No newline at end of file
+}
diff --git a/i18n/locales/pt.json b/i18n/locales/pt.json
index bdc91765..ad3f020e 100644
--- a/i18n/locales/pt.json
+++ b/i18n/locales/pt.json
@@ -160,6 +160,9 @@
"selectSpecialties": "Specialties",
"selectDegrees": "Degrees",
"selectLocales": "Select Locales Spoken",
+ "facilities": "Facilities",
+ "placeholderTextFacilitySearchBar": "Search by name or Id add a facility",
+ "noFacilitiesWereFound": "No facilities were found",
"errorMessageHealthcareProfessionalId": "Healthcare Professional Id was not found"
},
"modSubmissionForm": {
@@ -364,4 +367,4 @@
"editName": "Edit",
"saveName": "Save"
}
-}
\ No newline at end of file
+}
diff --git a/i18n/locales/ru.json b/i18n/locales/ru.json
index bd07ed2c..a2e601c5 100644
--- a/i18n/locales/ru.json
+++ b/i18n/locales/ru.json
@@ -160,6 +160,9 @@
"selectSpecialties": "Specialties",
"selectDegrees": "Degrees",
"selectLocales": "Select Locales Spoken",
+ "facilities": "Facilities",
+ "placeholderTextFacilitySearchBar": "Search by name or Id add a facility",
+ "noFacilitiesWereFound": "No facilities were found",
"errorMessageHealthcareProfessionalId": "Healthcare Professional Id was not found"
},
"modSubmissionForm": {
@@ -364,4 +367,4 @@
"editName": "Edit",
"saveName": "Save"
}
-}
\ No newline at end of file
+}
diff --git a/i18n/locales/tl.json b/i18n/locales/tl.json
index ed8c0107..0a9ccd64 100644
--- a/i18n/locales/tl.json
+++ b/i18n/locales/tl.json
@@ -349,10 +349,13 @@
"selectInsurances": "Accepted Insurances",
"selectLocales": "Select Locales Spoken",
"selectSpecialties": "Specialties",
+ "facilities": "Facilities",
+ "placeholderTextFacilitySearchBar": "Search by name or Id add a facility",
+ "noFacilitiesWereFound": "No facilities were found",
"errorMessageHealthcareProfessionalId": "Healthcare Professional Id was not found"
},
"modHealthcareProfessionalCard": {
"editName": "Edit",
"saveName": "Save"
}
-}
\ No newline at end of file
+}
diff --git a/i18n/locales/vi.json b/i18n/locales/vi.json
index 4ee9920e..5a74592e 100644
--- a/i18n/locales/vi.json
+++ b/i18n/locales/vi.json
@@ -194,7 +194,10 @@
"selectInsurances": "Các bảo hiểm được chấp nhận",
"selectLocales": "Chọn các ngôn ngữ địa phương được sử dụng",
"selectSpecialties": "Chuyên ngành.",
- "errorMessageHealthcareProfessionalId": "Healthcare Professional Id was not found"
+ "errorMessageHealthcareProfessionalId": "Healthcare Professional Id was not found",
+ "facilities": "Facilities",
+ "placeholderTextFacilitySearchBar": "Search by name or Id add a facility",
+ "noFacilitiesWereFound": "No facilities were found"
},
"modFacilitySection": {
"addresses": "Địa chỉ.",