Skip to content

Commit

Permalink
Merge branch 'main' into fix/O3-3983
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen authored Nov 5, 2024
2 parents c6ed293 + 7122212 commit 9ac0687
Show file tree
Hide file tree
Showing 354 changed files with 13,727 additions and 1,005 deletions.
3 changes: 1 addition & 2 deletions __mocks__/react-i18next.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ useMock.i18n = { language: 'en_US' };

module.exports = {
// this mock makes sure any components using the translate HoC receive the t function as a prop
Trans: ({ children }) => renderNodes(children),
Trans: ({ children }) => (Array.isArray(children) ? renderNodes(children) : renderNodes([children])),
Translation: ({ children }) => children((k) => k, { i18n: {} }),
useTranslation: () => useMock,

// mock if needed
I18nextProvider: reactI18next.I18nextProvider,
initReactI18next: reactI18next.initReactI18next,
Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/attachments.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test('Add and remove an attachment', async ({ page }) => {
});

await test.step('Then I should see the file I uploaded displayed in the attachments table', async () => {
await expect(page.getByRole('button', { name: /brainScan.jpeg/i })).toBeVisible();
await expect(page.getByRole('button', { name: /brainScan/i })).toBeVisible();
});

await test.step('When I click on the `Table view` tab', async () => {
Expand All @@ -78,7 +78,7 @@ test('Add and remove an attachment', async ({ page }) => {
});

await test.step('And I should not see the deleted attachment in the list', async () => {
await expect(page.getByRole('button', { name: /brainScan.jpeg/i })).not.toBeVisible();
await expect(page.getByRole('button', { name: /brainScan/i })).not.toBeVisible();
});

await test.step('And the attachments table should be empty', async () => {
Expand Down
18 changes: 12 additions & 6 deletions e2e/specs/edit-existing-visit.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@playwright/test';
import { type Visit } from '@openmrs/esm-framework';
import { type Patient, generateRandomPatient, deletePatient, startVisit } from '../commands';
import { deletePatient, generateRandomPatient, type Patient, startVisit } from '../commands';
import { test } from '../core';
import { ChartPage, VisitsPage } from '../pages';

Expand All @@ -27,18 +27,24 @@ test('Edit an existing visit', async ({ page }) => {

await test.step('Then I should see the `Edit Visit` form launch in the workspace', async () => {
await expect(chartPage.page.getByText(/visit start date and time/i)).toBeVisible();
const datePickerInput = chartPage.page.getByPlaceholder(/dd\/mm\/yyyy/i);
await expect(datePickerInput).toBeVisible();
const dateValue = await datePickerInput.inputValue();

const startDateInput = chartPage.page.locator('input#visitStartDateInput');
const startTimeInput = chartPage.page.locator('input#visitStartTime');

await expect(startDateInput).toBeVisible();
const dateValue = await startDateInput.inputValue();
expect(dateValue).not.toBe('');
expect(dateValue).toMatch(/^\d{2}\/\d{2}\/\d{4}$/);

await expect(chartPage.page.getByPlaceholder(/hh\:mm/i)).toBeVisible();
await expect(startTimeInput).toBeVisible();
const timeValue = await startTimeInput.inputValue();
expect(timeValue).toMatch(/^(1[0-2]|0?[1-9]):([0-5][0-9])$/);

await expect(chartPage.page.getByRole('combobox', { name: /select a location/i })).toBeVisible();
await expect(chartPage.page.getByRole('combobox', { name: /select a location/i })).toHaveValue('Outpatient Clinic');
await expect(chartPage.page.getByText(/visit type/i)).toBeVisible();
await expect(chartPage.page.getByLabel(/facility visit/i)).toBeChecked();
await expect(chartPage.page.getByRole('search', { name: /search for a visit type/i })).toBeVisible();
await expect(chartPage.page.getByRole('search', { name: /visit type/i })).toBeVisible();
await expect(chartPage.page.getByLabel(/facility visit/i)).toBeVisible();
await expect(chartPage.page.getByLabel(/home visit/i)).toBeVisible();
await expect(chartPage.page.getByLabel(/opd visit/i)).toBeVisible();
Expand Down
2 changes: 1 addition & 1 deletion e2e/support/bamboo/playwright.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The image version should match the Playwright version specified in the package.json file
FROM mcr.microsoft.com/playwright:v1.45.3-jammy
FROM mcr.microsoft.com/playwright:v1.48.2-jammy

ARG USER_ID
ARG GROUP_ID
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"devDependencies": {
"@openmrs/esm-framework": "next",
"@playwright/test": "1.45.3",
"@playwright/test": "1.48.2",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.89",
"@swc/jest": "^0.2.29",
Expand Down Expand Up @@ -71,7 +71,7 @@
"sass": "^1.54.3",
"swc-loader": "^0.2.3",
"swr": "^2.2.4",
"turbo": "^2.0.12",
"turbo": "^2.2.3",
"typescript": "^4.0.3",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1"
Expand Down
15 changes: 15 additions & 0 deletions packages/esm-form-engine-app/translations/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cancel": "Cancel",
"closeThisPanel": "Close this panel",
"collapseAll": "Collapse all",
"deleteQuestion": "Delete question",
"deleteQuestionConfirmation": "Are you sure you want to delete this question?",
"deleteQuestionExplainerText": "This action cannot be undone.",
"errorTitle": "There was an error with this form",
"expandAll": "Expand all",
"loading": "Loading",
"or": "or",
"thisList": "this list",
"toggleCollapseOrExpand": "Toggle collapse or expand",
"tryAgainMessage": "Try opening another form from"
}
15 changes: 15 additions & 0 deletions packages/esm-form-engine-app/translations/hi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cancel": "Cancel",
"closeThisPanel": "Close this panel",
"collapseAll": "Collapse all",
"deleteQuestion": "Delete question",
"deleteQuestionConfirmation": "Are you sure you want to delete this question?",
"deleteQuestionExplainerText": "This action cannot be undone.",
"errorTitle": "There was an error with this form",
"expandAll": "Expand all",
"loading": "Loading",
"or": "or",
"thisList": "this list",
"toggleCollapseOrExpand": "Toggle collapse or expand",
"tryAgainMessage": "Try opening another form from"
}
15 changes: 15 additions & 0 deletions packages/esm-form-engine-app/translations/id.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cancel": "Cancel",
"closeThisPanel": "Close this panel",
"collapseAll": "Collapse all",
"deleteQuestion": "Delete question",
"deleteQuestionConfirmation": "Are you sure you want to delete this question?",
"deleteQuestionExplainerText": "This action cannot be undone.",
"errorTitle": "There was an error with this form",
"expandAll": "Expand all",
"loading": "Loading",
"or": "or",
"thisList": "this list",
"toggleCollapseOrExpand": "Toggle collapse or expand",
"tryAgainMessage": "Try opening another form from"
}
15 changes: 15 additions & 0 deletions packages/esm-form-engine-app/translations/it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cancel": "Cancel",
"closeThisPanel": "Close this panel",
"collapseAll": "Collapse all",
"deleteQuestion": "Delete question",
"deleteQuestionConfirmation": "Are you sure you want to delete this question?",
"deleteQuestionExplainerText": "This action cannot be undone.",
"errorTitle": "There was an error with this form",
"expandAll": "Expand all",
"loading": "Loading",
"or": "or",
"thisList": "this list",
"toggleCollapseOrExpand": "Toggle collapse or expand",
"tryAgainMessage": "Try opening another form from"
}
15 changes: 15 additions & 0 deletions packages/esm-form-engine-app/translations/pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cancel": "Cancel",
"closeThisPanel": "Close this panel",
"collapseAll": "Collapse all",
"deleteQuestion": "Delete question",
"deleteQuestionConfirmation": "Are you sure you want to delete this question?",
"deleteQuestionExplainerText": "This action cannot be undone.",
"errorTitle": "There was an error with this form",
"expandAll": "Expand all",
"loading": "Loading",
"or": "or",
"thisList": "this list",
"toggleCollapseOrExpand": "Toggle collapse or expand",
"tryAgainMessage": "Try opening another form from"
}
15 changes: 15 additions & 0 deletions packages/esm-form-engine-app/translations/si.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cancel": "Cancel",
"closeThisPanel": "Close this panel",
"collapseAll": "Collapse all",
"deleteQuestion": "Delete question",
"deleteQuestionConfirmation": "Are you sure you want to delete this question?",
"deleteQuestionExplainerText": "This action cannot be undone.",
"errorTitle": "There was an error with this form",
"expandAll": "Expand all",
"loading": "Loading",
"or": "or",
"thisList": "this list",
"toggleCollapseOrExpand": "Toggle collapse or expand",
"tryAgainMessage": "Try opening another form from"
}
15 changes: 15 additions & 0 deletions packages/esm-form-engine-app/translations/sw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cancel": "Cancel",
"closeThisPanel": "Close this panel",
"collapseAll": "Collapse all",
"deleteQuestion": "Delete question",
"deleteQuestionConfirmation": "Are you sure you want to delete this question?",
"deleteQuestionExplainerText": "This action cannot be undone.",
"errorTitle": "There was an error with this form",
"expandAll": "Expand all",
"loading": "Loading",
"or": "or",
"thisList": "this list",
"toggleCollapseOrExpand": "Toggle collapse or expand",
"tryAgainMessage": "Try opening another form from"
}
15 changes: 15 additions & 0 deletions packages/esm-form-engine-app/translations/sw_KE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cancel": "Cancel",
"closeThisPanel": "Close this panel",
"collapseAll": "Collapse all",
"deleteQuestion": "Delete question",
"deleteQuestionConfirmation": "Are you sure you want to delete this question?",
"deleteQuestionExplainerText": "This action cannot be undone.",
"errorTitle": "There was an error with this form",
"expandAll": "Expand all",
"loading": "Loading",
"or": "or",
"thisList": "this list",
"toggleCollapseOrExpand": "Toggle collapse or expand",
"tryAgainMessage": "Try opening another form from"
}
15 changes: 15 additions & 0 deletions packages/esm-form-engine-app/translations/tr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cancel": "Cancel",
"closeThisPanel": "Close this panel",
"collapseAll": "Collapse all",
"deleteQuestion": "Delete question",
"deleteQuestionConfirmation": "Are you sure you want to delete this question?",
"deleteQuestionExplainerText": "This action cannot be undone.",
"errorTitle": "There was an error with this form",
"expandAll": "Expand all",
"loading": "Loading",
"or": "or",
"thisList": "this list",
"toggleCollapseOrExpand": "Toggle collapse or expand",
"tryAgainMessage": "Try opening another form from"
}
15 changes: 15 additions & 0 deletions packages/esm-form-engine-app/translations/tr_TR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cancel": "Cancel",
"closeThisPanel": "Close this panel",
"collapseAll": "Collapse all",
"deleteQuestion": "Delete question",
"deleteQuestionConfirmation": "Are you sure you want to delete this question?",
"deleteQuestionExplainerText": "This action cannot be undone.",
"errorTitle": "There was an error with this form",
"expandAll": "Expand all",
"loading": "Loading",
"or": "or",
"thisList": "this list",
"toggleCollapseOrExpand": "Toggle collapse or expand",
"tryAgainMessage": "Try opening another form from"
}
15 changes: 15 additions & 0 deletions packages/esm-form-engine-app/translations/uk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cancel": "Cancel",
"closeThisPanel": "Close this panel",
"collapseAll": "Collapse all",
"deleteQuestion": "Delete question",
"deleteQuestionConfirmation": "Are you sure you want to delete this question?",
"deleteQuestionExplainerText": "This action cannot be undone.",
"errorTitle": "There was an error with this form",
"expandAll": "Expand all",
"loading": "Loading",
"or": "or",
"thisList": "this list",
"toggleCollapseOrExpand": "Toggle collapse or expand",
"tryAgainMessage": "Try opening another form from"
}
15 changes: 15 additions & 0 deletions packages/esm-form-engine-app/translations/vi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cancel": "Hủy",
"closeThisPanel": "Close this panel",
"collapseAll": "Collapse all",
"deleteQuestion": "Delete question",
"deleteQuestionConfirmation": "Are you sure you want to delete this question?",
"deleteQuestionExplainerText": "This action cannot be undone.",
"errorTitle": "There was an error with this form",
"expandAll": "Expand all",
"loading": "Đang tải",
"or": "hoặc",
"thisList": "this list",
"toggleCollapseOrExpand": "Toggle collapse or expand",
"tryAgainMessage": "Try opening another form from"
}
10 changes: 5 additions & 5 deletions packages/esm-form-entry-app/translations/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"daysAgo": " أيام مضت",
"deleteEntry": "هل أنت متأكد أنك تريد حذف هذا العنصر؟",
"discardButton": "تجاهل",
"disallowDecimals": "Decimals are not allowed",
"disallowDecimals": "غير مسموح بالأرقام العشرية",
"enterMoreCharacters": "الرجاء إدخال 2 أحرف أو أكثر",
"errorFetchingFormData": "حدث خطأ أثناء جلب بيانات النموذج. التفاصيل: {detail}",
"errorLoadingForm": "خطأ في تحميل النموذج",
"errorWithForm": "هناك خطأ في هذا النموذج",
"fix": "إصلاح",
"formSubmissionFailed": "An error occurred while processing your form submission. Kindly notify the system administrator and reference the following error : {error}",
"formSubmissionFailed": "حدث خطأ عند معالجة النموذج. الرجاء اعلام مدير النظام بالخطأ التالي : {error}",
"formSubmittedSuccessfully": "تم إرسال النموذج بنجاح.",
"from": "من",
"futureDateRestriction": "لا يُسمح بتاريخ في المستقبل!",
Expand All @@ -44,14 +44,14 @@
"minusSecond": "اطرح ثانية",
"minutesAgo": " دقائق مضت",
"monthsAgo": " أشهر مضت",
"next": "Next",
"next": "التالي",
"next21Years": "الـ 21 سنة القادمة",
"nextMonth": "الشهر القادم",
"nextYear": "السنة القادمة",
"patientIdentifierDuplication": "تكرار معرف المريض",
"patientIdentifierDuplicationDescription": "المعرف المقدم مرتبط بالفعل بمريض موجود. يرجى التحقق من المعرف والمحاولة مرة أخرى.",
"orderNumber": "Order number",
"previous": "Previous",
"orderNumber": "رقم الأمر",
"previous": "السابق",
"previous21Years": "الـ 21 سنة السابقة",
"previousMonth": "الشهر السابق",
"previousValue": "القيمة السابقة",
Expand Down
70 changes: 70 additions & 0 deletions packages/esm-form-entry-app/translations/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"aDayAgo": "a day ago",
"aFewSecondsAgo": "a few seconds ago",
"aMinuteAgo": "a minute ago",
"aMonthAgo": "a month ago",
"aYearAgo": "a year ago",
"add": "Add",
"addHour": "Add a hour",
"addMinute": "Add a minute",
"addSecond": "Add a second",
"anHourAgo": "an hour ago",
"cancel": "Cancel",
"changeToMonthView": "Change to month view",
"chooseMonthAndYear": "Choose month and year",
"clearEntry": "Are you sure you want to clear this entry?",
"closeThisPanel": "Close this panel",
"componentLoadingFailed": "Component Loading failed...",
"daysAgo": " days ago",
"deleteEntry": "Are you sure you want to delete this item?",
"discardButton": "Discard",
"disallowDecimals": "Decimals are not allowed",
"enterMoreCharacters": "Please enter 2 or more characters",
"errorFetchingFormData": "There was an error fetching form data. Details: {detail}",
"errorLoadingForm": "Error loading form",
"errorWithForm": "There was an error with this form",
"fix": "Fix",
"formSubmissionFailed": "An error occurred while processing your form submission. Kindly notify the system administrator and reference the following error : {error}",
"formSubmittedSuccessfully": "The form has been submitted successfully.",
"from": "From",
"futureDateRestriction": "Future date is not allowed!",
"hoursAgo": " hours ago",
"invalidDate": "Provided date is invalid!",
"loading": "Loading...",
"loadingComponent": "Loading Component...",
"max": "Max value should be {max}",
"maxDate": "Max Date should be {maxDate}",
"maxEntries": "Cannot have more than {max} entries",
"maxLength": "Max Length should be {maxLength}",
"min": "Min value should be {min}",
"minDate": "Min Date should be {minDate}",
"minLength": "Min Length should be {minLength}",
"minusHour": "Minus a hour",
"minusMinute": "Minus a minute",
"minusSecond": "Minus a second",
"minutesAgo": " minutes ago",
"monthsAgo": " months ago",
"next": "Next",
"next21Years": "Next 21 years",
"nextMonth": "Next month",
"nextYear": "Next year",
"patientIdentifierDuplication": "Patient identifier duplication",
"patientIdentifierDuplicationDescription": "The identifier provided is already associated with an existing patient. Please check the identifier and try again.",
"orderNumber": "Order number",
"previous": "Previous",
"previous21Years": "Previous 21 years",
"previousMonth": "Previous month",
"previousValue": "Previous Value",
"previousYear": "Previous year",
"remove": "Remove",
"requiredField": "This field is required!",
"saveAndCloseButton": "Save and close",
"selectWeeks": "Select Weeks",
"set": "Set",
"submitting": "Submitting",
"to": "To",
"tryOpeningAnotherForm": "Try opening another form",
"useValue": "Use Value",
"weeks": "Weeks",
"yearsAgo": " years ago"
}
Loading

0 comments on commit 9ac0687

Please sign in to comment.