From c79126d94430f6253de8c517962392ec93877935 Mon Sep 17 00:00:00 2001 From: Elena Grednikova Date: Thu, 19 Dec 2024 21:22:31 +0100 Subject: [PATCH] Update batch action for mobile --- .../BaseLayout/PageContainer/styles.ts | 3 +- src/components/SearchBar/styles.ts | 3 +- src/components/Table/styles.ts | 3 +- src/locale/en/messages.po | 59 +++++++++------- src/locale/es/messages.po | 59 +++++++++------- src/locale/ru/messages.po | 59 +++++++++------- src/theme/utils.ts | 1 + .../ResourceListPage/BatchActions.tsx | 70 ++++++++++++++----- src/uberComponents/ResourceListPage/index.tsx | 1 + src/uberComponents/ResourceListPage/styles.ts | 53 ++++++++++++++ 10 files changed, 209 insertions(+), 102 deletions(-) create mode 100644 src/theme/utils.ts diff --git a/src/components/BaseLayout/PageContainer/styles.ts b/src/components/BaseLayout/PageContainer/styles.ts index 4b21e52a..b942f4cb 100644 --- a/src/components/BaseLayout/PageContainer/styles.ts +++ b/src/components/BaseLayout/PageContainer/styles.ts @@ -2,8 +2,7 @@ import styled, { css } from 'styled-components'; import { BasePageContent, BasePageHeader } from '..'; import { Title } from 'src/components/Typography'; - -const mobileWidth = 768; +import { mobileWidth } from 'src/theme/utils'; export const S = { HeaderContainer: styled(BasePageHeader)<{ $variant?: 'default' | 'with-table' | 'with-tabs' }>` diff --git a/src/components/SearchBar/styles.ts b/src/components/SearchBar/styles.ts index c1526dae..ec486fad 100644 --- a/src/components/SearchBar/styles.ts +++ b/src/components/SearchBar/styles.ts @@ -1,7 +1,6 @@ +import { mobileWidth } from 'src/theme/utils'; import styled, { css } from 'styled-components'; -const mobileWidth = 768; - export const S = { SearchBar: styled.div<{ $showInDrawerOnMobile?: boolean }>` position: relative; diff --git a/src/components/Table/styles.ts b/src/components/Table/styles.ts index 44fb9a13..68a4cd28 100644 --- a/src/components/Table/styles.ts +++ b/src/components/Table/styles.ts @@ -1,7 +1,6 @@ +import { mobileWidth } from 'src/theme/utils'; import styled, { css } from 'styled-components'; -const mobileWidth = 768; - export const S = { Table: styled.div<{ $showCardsOnMobile?: boolean }>` overflow: auto; diff --git a/src/locale/en/messages.po b/src/locale/en/messages.po index 6cf61454..79d3fd6e 100644 --- a/src/locale/en/messages.po +++ b/src/locale/en/messages.po @@ -13,7 +13,7 @@ msgstr "" "Language-Team: \n" "Plural-Forms: \n" -#: src/uberComponents/ResourceListPage/index.tsx:176 +#: src/uberComponents/ResourceListPage/BatchActions.tsx:57 msgid "{0, plural, one {Selected # item} other {Selected # items}}" msgstr "" @@ -31,7 +31,7 @@ msgstr "" #: src/containers/PatientList/index.tsx:103 #: src/containers/PractitionerList/index.tsx:121 #: src/containers/Prescriptions/index.tsx:148 -#: src/uberComponents/ResourceListPage/index.tsx:237 +#: src/uberComponents/ResourceListPage/index.tsx:273 msgid "Actions" msgstr "" @@ -110,7 +110,7 @@ msgstr "" #: src/components/ModalNewPatient/index.tsx:16 #: src/components/ModalNewPatient/index.tsx:20 -#: src/containers/PatientResourceListExample/index.tsx:76 +#: src/containers/PatientResourceListExample/index.tsx:78 msgid "Add patient" msgstr "" @@ -207,7 +207,7 @@ msgstr "" #: src/containers/PatientDetails/PatientOverviewDynamic/containers/GeneralIInformationDashboardContainer/hooks.ts:31 #: src/containers/PatientList/index.tsx:87 -#: src/containers/PatientResourceListExample/index.tsx:47 +#: src/containers/PatientResourceListExample/index.tsx:48 msgid "Birth date" msgstr "" @@ -258,7 +258,7 @@ msgstr "" msgid "Characteristics" msgstr "" -#: src/components/SearchBar/index.tsx:30 +#: src/components/SearchBar/index.tsx:36 #: src/components/SearchBar/SearchBarMobile/index.tsx:51 msgid "Clear filters" msgstr "" @@ -383,7 +383,7 @@ msgstr "" #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:95 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:142 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:216 -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:283 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:271 #: src/containers/PatientDetails/PatientResources/utils.tsx:96 #: src/containers/PatientDetails/PatientResources/utils.tsx:135 #: src/containers/PatientDetails/PatientResources/utils.tsx:174 @@ -430,7 +430,7 @@ msgstr "" msgid "Delete" msgstr "" -#: src/containers/PatientResourceListExample/index.tsx:78 +#: src/containers/PatientResourceListExample/index.tsx:80 msgid "Delete patients" msgstr "" @@ -620,7 +620,7 @@ msgid "Filters" msgstr "" #: src/containers/PatientList/searchBarUtils.ts:10 -#: src/containers/PatientResourceListExample/index.tsx:67 +#: src/containers/PatientResourceListExample/index.tsx:68 msgid "Find patient" msgstr "" @@ -711,7 +711,7 @@ msgstr "" msgid "Inline options?" msgstr "" -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:317 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:313 msgid "Intent" msgstr "" @@ -826,7 +826,7 @@ msgstr "" #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:123 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:204 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:240 -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:312 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:308 #: src/containers/PatientDetails/PatientResources/utils.tsx:50 #: src/containers/PatientDetails/PatientResources/utils.tsx:85 #: src/containers/PatientDetails/PatientResources/utils.tsx:124 @@ -864,7 +864,7 @@ msgstr "" #: src/containers/PractitionerList/index.tsx:101 #: src/containers/QuestionnaireBuilder/QuestionnaireItemSettings/controls.tsx:500 #: src/containers/QuestionnaireList/index.tsx:102 -#: src/uberComponents/ResourceListPage/index.tsx:200 +#: src/uberComponents/ResourceListPage/index.tsx:214 msgid "No data" msgstr "" @@ -888,6 +888,10 @@ msgstr "" msgid "Number (default)" msgstr "" +#: src/containers/PatientResourceListExample/index.tsx:83 +msgid "Number of Patients" +msgstr "" + #: src/containers/PatientDetails/PatientResources/utils.tsx:230 msgid "Observations" msgstr "" @@ -936,7 +940,7 @@ msgid "Order added" msgstr "" #: src/containers/PatientDetails/PatientDetailsTabs/index.tsx:22 -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:304 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:300 msgid "Orders" msgstr "" @@ -1008,7 +1012,6 @@ msgstr "" #: src/containers/InvoiceList/components/InvoiceListSearchBar/index.tsx:32 #: src/containers/InvoiceList/tableUtils.tsx:114 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:152 -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:275 #: src/containers/PatientDetails/PatientResources/utils.tsx:221 msgid "Practitioner" msgstr "" @@ -1094,7 +1097,7 @@ msgstr "" #~ msgid "Reset password" #~ msgstr "" -#: src/uberComponents/ResourceListPage/index.tsx:169 +#: src/uberComponents/ResourceListPage/BatchActions.tsx:48 msgid "Reset selection" msgstr "" @@ -1187,6 +1190,10 @@ msgstr "" msgid "Select (default)" msgstr "" +#: src/uberComponents/ResourceListPage/BatchActions.tsx:69 +msgid "Select all" +msgstr "" + #: src/components/BaseQuestionnaireResponseForm/widgets/choice/index.tsx:30 #: src/components/BaseQuestionnaireResponseForm/widgets/choice/index.tsx:55 msgid "Select..." @@ -1197,8 +1204,8 @@ msgid "Serum creatinin" msgstr "" #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:279 -msgid "Service" -msgstr "" +#~ msgid "Service" +#~ msgstr "" #: src/containers/PatientDetails/PatientResources/utils.tsx:306 msgid "Service Requests" @@ -1242,7 +1249,7 @@ msgid "Specialty" msgstr "" #: src/containers/PatientList/index.tsx:94 -#: src/containers/PatientResourceListExample/index.tsx:54 +#: src/containers/PatientResourceListExample/index.tsx:55 msgid "SSN" msgstr "" @@ -1312,9 +1319,9 @@ msgid "Subject Type" msgstr "" #: src/containers/QuestionnaireBuilder/PromptForm.tsx:104 -#: src/uberComponents/ResourceListPage/actions.tsx:96 -#: src/uberComponents/ResourceListPage/actions.tsx:130 -#: src/uberComponents/ResourceListPage/actions.tsx:176 +#: src/uberComponents/ResourceListPage/actions.tsx:97 +#: src/uberComponents/ResourceListPage/actions.tsx:131 +#: src/uberComponents/ResourceListPage/actions.tsx:177 msgid "Submit" msgstr "" @@ -1324,9 +1331,9 @@ msgstr "" #~ msgid "Successfully saved" #~ msgstr "" -#: src/uberComponents/ResourceListPage/actions.tsx:90 -#: src/uberComponents/ResourceListPage/actions.tsx:125 -#: src/uberComponents/ResourceListPage/actions.tsx:172 +#: src/uberComponents/ResourceListPage/actions.tsx:91 +#: src/uberComponents/ResourceListPage/actions.tsx:126 +#: src/uberComponents/ResourceListPage/actions.tsx:173 msgid "Successfully submitted" msgstr "" @@ -1359,11 +1366,11 @@ msgstr "" msgid "Text with macro" msgstr "" -#: src/containers/App/index.tsx:129 +#: src/containers/App/index.tsx:130 msgid "Thank you for filling out the questionnaire. Now you can close this page." msgstr "" -#: src/containers/App/index.tsx:128 +#: src/containers/App/index.tsx:129 msgid "Thank you!" msgstr "" @@ -1400,7 +1407,7 @@ msgstr "" msgid "Thursday" msgstr "" -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:287 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:275 #: src/containers/Scheduling/Availability/index.tsx:129 msgid "Time" msgstr "" diff --git a/src/locale/es/messages.po b/src/locale/es/messages.po index 10cee3c4..b7ea52e9 100644 --- a/src/locale/es/messages.po +++ b/src/locale/es/messages.po @@ -13,7 +13,7 @@ msgstr "" "Language-Team: \n" "Plural-Forms: \n" -#: src/uberComponents/ResourceListPage/index.tsx:176 +#: src/uberComponents/ResourceListPage/BatchActions.tsx:57 msgid "{0, plural, one {Selected # item} other {Selected # items}}" msgstr "" @@ -31,7 +31,7 @@ msgstr "Acción" #: src/containers/PatientList/index.tsx:103 #: src/containers/PractitionerList/index.tsx:121 #: src/containers/Prescriptions/index.tsx:148 -#: src/uberComponents/ResourceListPage/index.tsx:237 +#: src/uberComponents/ResourceListPage/index.tsx:273 msgid "Actions" msgstr "Acciones" @@ -110,7 +110,7 @@ msgstr "Añadir Orden" #: src/components/ModalNewPatient/index.tsx:16 #: src/components/ModalNewPatient/index.tsx:20 -#: src/containers/PatientResourceListExample/index.tsx:76 +#: src/containers/PatientResourceListExample/index.tsx:78 msgid "Add patient" msgstr "Añadir paciente" @@ -207,7 +207,7 @@ msgstr "Número de lote" #: src/containers/PatientDetails/PatientOverviewDynamic/containers/GeneralIInformationDashboardContainer/hooks.ts:31 #: src/containers/PatientList/index.tsx:87 -#: src/containers/PatientResourceListExample/index.tsx:47 +#: src/containers/PatientResourceListExample/index.tsx:48 msgid "Birth date" msgstr "Fecha de nacimiento" @@ -258,7 +258,7 @@ msgstr "Ejecución en curso" msgid "Characteristics" msgstr "Características" -#: src/components/SearchBar/index.tsx:30 +#: src/components/SearchBar/index.tsx:36 #: src/components/SearchBar/SearchBarMobile/index.tsx:51 msgid "Clear filters" msgstr "" @@ -383,7 +383,7 @@ msgstr "" #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:95 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:142 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:216 -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:283 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:271 #: src/containers/PatientDetails/PatientResources/utils.tsx:96 #: src/containers/PatientDetails/PatientResources/utils.tsx:135 #: src/containers/PatientDetails/PatientResources/utils.tsx:174 @@ -430,7 +430,7 @@ msgstr "Predeterminado" msgid "Delete" msgstr "Eliminar" -#: src/containers/PatientResourceListExample/index.tsx:78 +#: src/containers/PatientResourceListExample/index.tsx:80 msgid "Delete patients" msgstr "" @@ -616,7 +616,7 @@ msgid "Filters" msgstr "" #: src/containers/PatientList/searchBarUtils.ts:10 -#: src/containers/PatientResourceListExample/index.tsx:67 +#: src/containers/PatientResourceListExample/index.tsx:68 msgid "Find patient" msgstr "Buscar paciente" @@ -707,7 +707,7 @@ msgstr "Elección en línea" msgid "Inline options?" msgstr "¿Opciones en línea?" -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:317 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:313 msgid "Intent" msgstr "Intención" @@ -818,7 +818,7 @@ msgstr "Lunes" #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:123 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:204 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:240 -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:312 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:308 #: src/containers/PatientDetails/PatientResources/utils.tsx:50 #: src/containers/PatientDetails/PatientResources/utils.tsx:85 #: src/containers/PatientDetails/PatientResources/utils.tsx:124 @@ -856,7 +856,7 @@ msgstr "No" #: src/containers/PractitionerList/index.tsx:101 #: src/containers/QuestionnaireBuilder/QuestionnaireItemSettings/controls.tsx:500 #: src/containers/QuestionnaireList/index.tsx:102 -#: src/uberComponents/ResourceListPage/index.tsx:200 +#: src/uberComponents/ResourceListPage/index.tsx:214 msgid "No data" msgstr "Sin datos" @@ -880,6 +880,10 @@ msgstr "Notas" msgid "Number (default)" msgstr "Número (predeterminado)" +#: src/containers/PatientResourceListExample/index.tsx:83 +msgid "Number of Patients" +msgstr "" + #: src/containers/PatientDetails/PatientResources/utils.tsx:230 msgid "Observations" msgstr "Resultados" @@ -924,7 +928,7 @@ msgid "Order added" msgstr "Orden añadida" #: src/containers/PatientDetails/PatientDetailsTabs/index.tsx:22 -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:304 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:300 msgid "Orders" msgstr "Resultados" @@ -996,7 +1000,6 @@ msgstr "Widget de teléfono" #: src/containers/InvoiceList/components/InvoiceListSearchBar/index.tsx:32 #: src/containers/InvoiceList/tableUtils.tsx:114 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:152 -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:275 #: src/containers/PatientDetails/PatientResources/utils.tsx:221 msgid "Practitioner" msgstr "Profesional" @@ -1078,7 +1081,7 @@ msgstr "Requerido" msgid "Reset" msgstr "Restablecer" -#: src/uberComponents/ResourceListPage/index.tsx:169 +#: src/uberComponents/ResourceListPage/BatchActions.tsx:48 msgid "Reset selection" msgstr "" @@ -1167,6 +1170,10 @@ msgstr "Ver detalles de ValueSet" msgid "Select (default)" msgstr "Seleccionar (predeterminado)" +#: src/uberComponents/ResourceListPage/BatchActions.tsx:69 +msgid "Select all" +msgstr "" + #: src/components/BaseQuestionnaireResponseForm/widgets/choice/index.tsx:30 #: src/components/BaseQuestionnaireResponseForm/widgets/choice/index.tsx:55 msgid "Select..." @@ -1177,8 +1184,8 @@ msgid "Serum creatinin" msgstr "Creatinina sérica" #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:279 -msgid "Service" -msgstr "Servicio" +#~ msgid "Service" +#~ msgstr "Servicio" #: src/containers/PatientDetails/PatientResources/utils.tsx:306 msgid "Service Requests" @@ -1222,7 +1229,7 @@ msgid "Specialty" msgstr "Especialidad" #: src/containers/PatientList/index.tsx:94 -#: src/containers/PatientResourceListExample/index.tsx:54 +#: src/containers/PatientResourceListExample/index.tsx:55 msgid "SSN" msgstr "NSS" @@ -1292,9 +1299,9 @@ msgid "Subject Type" msgstr "Tipo de sujeto" #: src/containers/QuestionnaireBuilder/PromptForm.tsx:104 -#: src/uberComponents/ResourceListPage/actions.tsx:96 -#: src/uberComponents/ResourceListPage/actions.tsx:130 -#: src/uberComponents/ResourceListPage/actions.tsx:176 +#: src/uberComponents/ResourceListPage/actions.tsx:97 +#: src/uberComponents/ResourceListPage/actions.tsx:131 +#: src/uberComponents/ResourceListPage/actions.tsx:177 msgid "Submit" msgstr "Enviar" @@ -1304,9 +1311,9 @@ msgstr "Enviar" #~ msgid "Successfully saved" #~ msgstr "" -#: src/uberComponents/ResourceListPage/actions.tsx:90 -#: src/uberComponents/ResourceListPage/actions.tsx:125 -#: src/uberComponents/ResourceListPage/actions.tsx:172 +#: src/uberComponents/ResourceListPage/actions.tsx:91 +#: src/uberComponents/ResourceListPage/actions.tsx:126 +#: src/uberComponents/ResourceListPage/actions.tsx:173 msgid "Successfully submitted" msgstr "" @@ -1339,11 +1346,11 @@ msgstr "Texto (por defecto)" msgid "Text with macro" msgstr "Texto con macro" -#: src/containers/App/index.tsx:129 +#: src/containers/App/index.tsx:130 msgid "Thank you for filling out the questionnaire. Now you can close this page." msgstr "Gracias por completar el cuestionario. Ahora puedes cerrar esta página." -#: src/containers/App/index.tsx:128 +#: src/containers/App/index.tsx:129 msgid "Thank you!" msgstr "¡Gracias!" @@ -1380,7 +1387,7 @@ msgstr "" msgid "Thursday" msgstr "Jueves" -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:287 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:275 #: src/containers/Scheduling/Availability/index.tsx:129 msgid "Time" msgstr "Hora" diff --git a/src/locale/ru/messages.po b/src/locale/ru/messages.po index cf3c3d0e..cbbc5d0f 100644 --- a/src/locale/ru/messages.po +++ b/src/locale/ru/messages.po @@ -13,7 +13,7 @@ msgstr "" "Language-Team: \n" "Plural-Forms: \n" -#: src/uberComponents/ResourceListPage/index.tsx:176 +#: src/uberComponents/ResourceListPage/BatchActions.tsx:57 msgid "{0, plural, one {Selected # item} other {Selected # items}}" msgstr "" @@ -31,7 +31,7 @@ msgstr "" #: src/containers/PatientList/index.tsx:103 #: src/containers/PractitionerList/index.tsx:121 #: src/containers/Prescriptions/index.tsx:148 -#: src/uberComponents/ResourceListPage/index.tsx:237 +#: src/uberComponents/ResourceListPage/index.tsx:273 msgid "Actions" msgstr "Действия" @@ -110,7 +110,7 @@ msgstr "" #: src/components/ModalNewPatient/index.tsx:16 #: src/components/ModalNewPatient/index.tsx:20 -#: src/containers/PatientResourceListExample/index.tsx:76 +#: src/containers/PatientResourceListExample/index.tsx:78 msgid "Add patient" msgstr "Добавить пациенда" @@ -207,7 +207,7 @@ msgstr "" #: src/containers/PatientDetails/PatientOverviewDynamic/containers/GeneralIInformationDashboardContainer/hooks.ts:31 #: src/containers/PatientList/index.tsx:87 -#: src/containers/PatientResourceListExample/index.tsx:47 +#: src/containers/PatientResourceListExample/index.tsx:48 msgid "Birth date" msgstr "Дата рождения" @@ -258,7 +258,7 @@ msgstr "" msgid "Characteristics" msgstr "" -#: src/components/SearchBar/index.tsx:30 +#: src/components/SearchBar/index.tsx:36 #: src/components/SearchBar/SearchBarMobile/index.tsx:51 msgid "Clear filters" msgstr "" @@ -383,7 +383,7 @@ msgstr "" #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:95 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:142 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:216 -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:283 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:271 #: src/containers/PatientDetails/PatientResources/utils.tsx:96 #: src/containers/PatientDetails/PatientResources/utils.tsx:135 #: src/containers/PatientDetails/PatientResources/utils.tsx:174 @@ -430,7 +430,7 @@ msgstr "" msgid "Delete" msgstr "" -#: src/containers/PatientResourceListExample/index.tsx:78 +#: src/containers/PatientResourceListExample/index.tsx:80 msgid "Delete patients" msgstr "" @@ -620,7 +620,7 @@ msgid "Filters" msgstr "" #: src/containers/PatientList/searchBarUtils.ts:10 -#: src/containers/PatientResourceListExample/index.tsx:67 +#: src/containers/PatientResourceListExample/index.tsx:68 msgid "Find patient" msgstr "Найти пациента" @@ -711,7 +711,7 @@ msgstr "" msgid "Inline options?" msgstr "" -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:317 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:313 msgid "Intent" msgstr "" @@ -826,7 +826,7 @@ msgstr "" #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:123 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:204 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:240 -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:312 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:308 #: src/containers/PatientDetails/PatientResources/utils.tsx:50 #: src/containers/PatientDetails/PatientResources/utils.tsx:85 #: src/containers/PatientDetails/PatientResources/utils.tsx:124 @@ -864,7 +864,7 @@ msgstr "" #: src/containers/PractitionerList/index.tsx:101 #: src/containers/QuestionnaireBuilder/QuestionnaireItemSettings/controls.tsx:500 #: src/containers/QuestionnaireList/index.tsx:102 -#: src/uberComponents/ResourceListPage/index.tsx:200 +#: src/uberComponents/ResourceListPage/index.tsx:214 msgid "No data" msgstr "Нет данных" @@ -888,6 +888,10 @@ msgstr "" msgid "Number (default)" msgstr "" +#: src/containers/PatientResourceListExample/index.tsx:83 +msgid "Number of Patients" +msgstr "" + #: src/containers/PatientDetails/PatientResources/utils.tsx:230 msgid "Observations" msgstr "" @@ -936,7 +940,7 @@ msgid "Order added" msgstr "" #: src/containers/PatientDetails/PatientDetailsTabs/index.tsx:22 -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:304 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:300 msgid "Orders" msgstr "" @@ -1008,7 +1012,6 @@ msgstr "" #: src/containers/InvoiceList/components/InvoiceListSearchBar/index.tsx:32 #: src/containers/InvoiceList/tableUtils.tsx:114 #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:152 -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:275 #: src/containers/PatientDetails/PatientResources/utils.tsx:221 msgid "Practitioner" msgstr "Врач" @@ -1094,7 +1097,7 @@ msgstr "Сбросить" #~ msgid "Reset password" #~ msgstr "Сбросить пароль" -#: src/uberComponents/ResourceListPage/index.tsx:169 +#: src/uberComponents/ResourceListPage/BatchActions.tsx:48 msgid "Reset selection" msgstr "" @@ -1187,6 +1190,10 @@ msgstr "" msgid "Select (default)" msgstr "" +#: src/uberComponents/ResourceListPage/BatchActions.tsx:69 +msgid "Select all" +msgstr "" + #: src/components/BaseQuestionnaireResponseForm/widgets/choice/index.tsx:30 #: src/components/BaseQuestionnaireResponseForm/widgets/choice/index.tsx:55 msgid "Select..." @@ -1197,8 +1204,8 @@ msgid "Serum creatinin" msgstr "" #: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:279 -msgid "Service" -msgstr "" +#~ msgid "Service" +#~ msgstr "" #: src/containers/PatientDetails/PatientResources/utils.tsx:306 msgid "Service Requests" @@ -1242,7 +1249,7 @@ msgid "Specialty" msgstr "" #: src/containers/PatientList/index.tsx:94 -#: src/containers/PatientResourceListExample/index.tsx:54 +#: src/containers/PatientResourceListExample/index.tsx:55 msgid "SSN" msgstr "СНИЛС" @@ -1312,9 +1319,9 @@ msgid "Subject Type" msgstr "" #: src/containers/QuestionnaireBuilder/PromptForm.tsx:104 -#: src/uberComponents/ResourceListPage/actions.tsx:96 -#: src/uberComponents/ResourceListPage/actions.tsx:130 -#: src/uberComponents/ResourceListPage/actions.tsx:176 +#: src/uberComponents/ResourceListPage/actions.tsx:97 +#: src/uberComponents/ResourceListPage/actions.tsx:131 +#: src/uberComponents/ResourceListPage/actions.tsx:177 msgid "Submit" msgstr "" @@ -1324,9 +1331,9 @@ msgstr "" #~ msgid "Successfully saved" #~ msgstr "" -#: src/uberComponents/ResourceListPage/actions.tsx:90 -#: src/uberComponents/ResourceListPage/actions.tsx:125 -#: src/uberComponents/ResourceListPage/actions.tsx:172 +#: src/uberComponents/ResourceListPage/actions.tsx:91 +#: src/uberComponents/ResourceListPage/actions.tsx:126 +#: src/uberComponents/ResourceListPage/actions.tsx:173 msgid "Successfully submitted" msgstr "" @@ -1359,11 +1366,11 @@ msgstr "" msgid "Text with macro" msgstr "" -#: src/containers/App/index.tsx:129 +#: src/containers/App/index.tsx:130 msgid "Thank you for filling out the questionnaire. Now you can close this page." msgstr "" -#: src/containers/App/index.tsx:128 +#: src/containers/App/index.tsx:129 msgid "Thank you!" msgstr "" @@ -1400,7 +1407,7 @@ msgstr "" msgid "Thursday" msgstr "" -#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:287 +#: src/containers/PatientDetails/PatientOverviewDynamic/components/StandardCard/prepare.tsx:275 #: src/containers/Scheduling/Availability/index.tsx:129 msgid "Time" msgstr "" diff --git a/src/theme/utils.ts b/src/theme/utils.ts new file mode 100644 index 00000000..a4d775ca --- /dev/null +++ b/src/theme/utils.ts @@ -0,0 +1 @@ +export const mobileWidth = 768; diff --git a/src/uberComponents/ResourceListPage/BatchActions.tsx b/src/uberComponents/ResourceListPage/BatchActions.tsx index bd6d1b79..f4dc4359 100644 --- a/src/uberComponents/ResourceListPage/BatchActions.tsx +++ b/src/uberComponents/ResourceListPage/BatchActions.tsx @@ -1,5 +1,5 @@ import { plural, Trans } from '@lingui/macro'; -import { Button } from 'antd'; +import { Button, Checkbox } from 'antd'; import { Bundle, ParametersParameter, Resource } from 'fhir/r4b'; import { Text } from 'src/components/Typography'; @@ -11,6 +11,7 @@ export { navigationAction, customAction, questionnaireAction } from './actions'; interface BatchActionsProps { batchActions: QuestionnaireActionType[]; selectedRowKeys: React.Key[]; + allKeys: React.Key[]; setSelectedRowKeys: (keys: React.Key[]) => void; reload: () => void; selectedResourcesBundle: Bundle; @@ -18,8 +19,15 @@ interface BatchActionsProps { } export function BatchActions(props: BatchActionsProps) { - const { batchActions, selectedRowKeys, setSelectedRowKeys, reload, selectedResourcesBundle, defaultLaunchContext } = - props; + const { + batchActions, + selectedRowKeys, + setSelectedRowKeys, + reload, + selectedResourcesBundle, + defaultLaunchContext, + allKeys, + } = props; return ( @@ -34,22 +42,48 @@ export function BatchActions(props: BatchActionsProps) { defaultLaunchContext={defaultLaunchContext ?? []} /> ))} + {selectedRowKeys.length ? ( + + + + ) : null} - {selectedRowKeys.length ? ( - - ) : null} - {selectedRowKeys.length ? ( - - {selectedRowKeys.length - ? plural(selectedRowKeys.length, { - one: 'Selected # item', - other: 'Selected # items', - }) - : null} - - ) : null} + + {selectedRowKeys.length ? ( + + {selectedRowKeys.length + ? plural(selectedRowKeys.length, { + one: 'Selected # item', + other: 'Selected # items', + }) + : null} + + ) : ( +
+ )} + + + + Select all + + 0 && selectedRowKeys.length === allKeys.length} + indeterminate={selectedRowKeys.length > 0 && selectedRowKeys.length !== allKeys.length} + onChange={(e) => { + const checked = e.target.checked; + + if (checked) { + setSelectedRowKeys(allKeys); + } else { + setSelectedRowKeys([]); + } + }} + > + + + ); } diff --git a/src/uberComponents/ResourceListPage/index.tsx b/src/uberComponents/ResourceListPage/index.tsx index 5840067f..faabfd13 100644 --- a/src/uberComponents/ResourceListPage/index.tsx +++ b/src/uberComponents/ResourceListPage/index.tsx @@ -189,6 +189,7 @@ export function ResourceListPage({ d.resource.id!) : []} setSelectedRowKeys={setSelectedRowKeys} reload={reload} selectedResourcesBundle={selectedResourcesBundle} diff --git a/src/uberComponents/ResourceListPage/styles.ts b/src/uberComponents/ResourceListPage/styles.ts index 85afbce5..95d76394 100644 --- a/src/uberComponents/ResourceListPage/styles.ts +++ b/src/uberComponents/ResourceListPage/styles.ts @@ -1,24 +1,77 @@ import styled from 'styled-components'; import { Button } from 'antd'; +import { mobileWidth } from 'src/theme/utils'; export const S = { Actions: styled.div` display: flex; gap: 8px 16px; + + @media screen and (max-width: ${() => `${mobileWidth - 1}px`}) { + gap: 2px 16px; + flex-wrap: wrap; + } `, LinkButton: styled(Button)` padding: 0; `, BatchActionsContainer: styled.div` display: flex; + flex-direction: row; gap: 10px 16px; align-items: center; flex-wrap: wrap; + + @media screen and (max-width: ${() => `${mobileWidth - 1}px`}) { + flex-direction: column; + align-items: stretch; + } `, BatchActions: styled.div` display: flex; gap: 10px 8px; flex-wrap: wrap; + + @media screen and (max-width: ${() => `${mobileWidth - 1}px`}) { + gap: 10px 16px; + + & > * { + width: calc(50% - 8px); + } + } + `, + ResetSelection: styled.div` + margin-left: 8px; + + @media screen and (max-width: ${() => `${mobileWidth - 1}px`}) { + margin-left: 0; + + & > * { + width: 100%; + } + } + `, + SelectAll: styled.div` + @media screen and (max-width: ${() => `${mobileWidth - 1}px`}) { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + height: 32px; + padding: 0 16px; + } + `, + CheckboxAll: styled.div` + display: none; + + @media screen and (max-width: ${() => `${mobileWidth - 1}px`}) { + display: block; + } + `, + Label: styled.div` + display: flex; + gap: 0 8px; + align-items: center; `, };