Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions openmrs/apps/command-palette/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"id": "bahmni.commandPalette",
"extensionPoints": [
{
"id": "org.bahmni.commandpalette.navItem",
"description": "Command Palette Navigation Items"
},
{
"id": "org.bahmni.commandpalette.patientAction",
"description": "Command Palette Patient Actions — rendered as action buttons after patient search"
}
],
"commandPalette": {
"trigger": {
"type": "combination",
"keys": ["cmd+k", "ctrl+k"]
},
"searchAnnotations": [
{
"prefix": "@phone",
"label": "Phone",
"searchType": "patientAttribute",
"fieldType": "person",
"fieldsToSearch": ["phoneNumber"]
},
{
"prefix": "@email",
"label": "Email",
"searchType": "patientAttribute",
"fieldType": "person",
"fieldsToSearch": ["email"]
}
],
"patientFields": {
"primaryFields": ["name", "identifier"],
"additionalFields": ["age", "gender"]
}
}
}
94 changes: 94 additions & 0 deletions openmrs/apps/command-palette/v2/extension.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"cmdPaletteNavRegistration": {
"id": "org.bahmni.commandpalette.nav.registration",
"extensionPointId": "org.bahmni.commandpalette.navItem",
"type": "link",
"translationKey": "COMMAND_PALETTE_NAV_REGISTRATION",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: URLs use /bahmni-new/ prefix, but the established convention in this repo for React/new-frontend routes is /bahmni-v2/ (e.g., home/extension.json uses /bahmni-v2/registration/search, clinical/extension.json uses /bahmni-v2/clinical/{{patientUuid}}).

Same applies to lines 22, 73, and 80. If /bahmni-new/ is intentionally replacing /bahmni-v2/, could you note that in the PR description?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

resolved

"url": "/bahmni-v2/registration/search",
"icon": "fa-registered",
"newTab": true,
"order": 1,
"requiredPrivilege": "app:registration"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: All 7 nav extensions are missing the "type": "link" field. In home/v2/extension.json (the only other v2 extension file in the repo), every entry includes "type": "link". Could you add it to each nav item for consistency?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

resolved

},
"cmdPaletteNavAppointments": {
"id": "org.bahmni.commandpalette.nav.appointments",
"extensionPointId": "org.bahmni.commandpalette.navItem",
"type": "link",
"translationKey": "COMMAND_PALETTE_NAV_APPOINTMENTS",
"url": "/appointments/",
"icon": "fa-calendar-alt",
"order": 2,
"requiredPrivilege": "app:appointments"
},
"cmdPaletteNavCreatePatient": {
"id": "org.bahmni.commandpalette.nav.createpatient",
"extensionPointId": "org.bahmni.commandpalette.navItem",
"type": "link",
"translationKey": "COMMAND_PALETTE_NAV_CREATE_PATIENT",
"url": "/bahmni-v2/registration/patient/new",
"icon": "fa-user-plus",
"order": 3,
"requiredPrivilege": "app:registration"
},
"cmdPaletteNavBedManagement": {
"id": "org.bahmni.commandpalette.nav.bedmanagement",
"extensionPointId": "org.bahmni.commandpalette.navItem",
"type": "link",
"translationKey": "COMMAND_PALETTE_NAV_BED_MANAGEMENT",
"url": "/bahmni/bedmanagement/",
"icon": "fa-bed",
"order": 4,
"requiredPrivilege": "app:adt"
},
"cmdPaletteNavOT": {
"id": "org.bahmni.commandpalette.nav.ot",
"extensionPointId": "org.bahmni.commandpalette.navItem",
"type": "link",
"translationKey": "COMMAND_PALETTE_NAV_OT",
"url": "/bahmni/ot/",
"icon": "fa-hospital-o",
"order": 5,
"requiredPrivilege": "app:ot"
},
"cmdPaletteNavOpenMRS": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: cmdPaletteNavOpenMRS and cmdPaletteNavBahmniWiki (line 58) use "label" as the sole display field with no translationKey. The other 7 extensions all use translationKey. In existing v2 extensions, label is only used as a supplemental fallback alongside translationKey, never as the sole display string.

This means these two items won't be translatable and have no corresponding entries in the locale files. Consider adding translationKey values and locale entries for both.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

resolved

"id": "org.bahmni.commandpalette.nav.openmrs",
"extensionPointId": "org.bahmni.commandpalette.navItem",
"type": "link",
"translationKey": "COMMAND_PALETTE_NAV_OPENMRS",
"label": "OpenMRS",
"url": "/openmrs",
"icon": "fa-external-link",
"newTab": true,
"order": 6,
"requiredPrivilege": "app:admin"
},
"cmdPaletteNavBahmniWiki": {
"id": "org.bahmni.commandpalette.nav.bahmniwiki",
"extensionPointId": "org.bahmni.commandpalette.navItem",
"type": "link",
"translationKey": "COMMAND_PALETTE_NAV_BAHMNI_WIKI",
"label": "Bahmni Wiki",
"url": "https://bahmni.atlassian.net/wiki/spaces/BAH/overview",
"icon": "fa-book",
"newTab": true,
"order": 7
},
"cmdPaletteActionRegistration": {
"id": "org.bahmni.commandpalette.action.registration",
"extensionPointId": "org.bahmni.commandpalette.patientAction",
"translationKey": "COMMAND_PALETTE_ACTION_REGISTRATION",
"icon": "fa-clipboard-list",
"pathTemplate": "/bahmni-v2/registration/patient/{{patientUuid}}",
"order": 1,
"requiredPrivilege": "app:registration"
},
"cmdPaletteActionClinical": {
"id": "org.bahmni.commandpalette.action.clinical",
"extensionPointId": "org.bahmni.commandpalette.patientAction",
"translationKey": "COMMAND_PALETTE_ACTION_CLINICAL",
"icon": "fa-stethoscope",
"pathTemplate": "/bahmni-v2/clinical/{{patientUuid}}",
"order": 2,
"requiredPrivilege": "app:clinical"
}
}
11 changes: 11 additions & 0 deletions openmrs/i18n/command-palette/locale_en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"COMMAND_PALETTE_NAV_REGISTRATION": "Go to Registration",
"COMMAND_PALETTE_NAV_CREATE_PATIENT": "Create New Patient",
"COMMAND_PALETTE_NAV_APPOINTMENTS": "Go to Appointments",
"COMMAND_PALETTE_NAV_BED_MANAGEMENT": "Bed Management",
"COMMAND_PALETTE_NAV_OT": "Operating Theatre",
"COMMAND_PALETTE_NAV_OPENMRS": "OpenMRS",
"COMMAND_PALETTE_NAV_BAHMNI_WIKI": "Bahmni Wiki",
"COMMAND_PALETTE_ACTION_REGISTRATION": "Registration",
"COMMAND_PALETTE_ACTION_CLINICAL": "Clinical"
}
11 changes: 11 additions & 0 deletions openmrs/i18n/command-palette/locale_es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"COMMAND_PALETTE_NAV_REGISTRATION": "Ir a Registro",
"COMMAND_PALETTE_NAV_CREATE_PATIENT": "Crear Nuevo Paciente",
"COMMAND_PALETTE_NAV_APPOINTMENTS": "Ir a Citas",
"COMMAND_PALETTE_NAV_BED_MANAGEMENT": "Gestión de Camas",
"COMMAND_PALETTE_NAV_OT": "Quirófano",
"COMMAND_PALETTE_NAV_OPENMRS": "OpenMRS",
"COMMAND_PALETTE_NAV_BAHMNI_WIKI": "Bahmni Wiki",
"COMMAND_PALETTE_ACTION_REGISTRATION": "Registro",
"COMMAND_PALETTE_ACTION_CLINICAL": "Clínico"
}
Loading