From 19163934d8b2edfdd41c5466bdb582ed8398f153 Mon Sep 17 00:00:00 2001 From: Tom Caiger Date: Thu, 31 Oct 2024 21:23:58 +1300 Subject: [PATCH 1/4] fix(tupaiaWeb): RN-1512: Fix broken arithmetic visuals (#5980) Update utils.ts --- packages/data-api/src/utils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/data-api/src/utils.ts b/packages/data-api/src/utils.ts index 06b42c251b..f74c84e29c 100644 --- a/packages/data-api/src/utils.ts +++ b/packages/data-api/src/utils.ts @@ -25,6 +25,7 @@ export const sanitizeAnalyticsTableValue = (value: string, type: string) => { switch (type) { case 'Binary': case 'Checkbox': + case 'Arithmetic': case 'Number': { const sanitizedValue = parseFloat(value); return Number.isNaN(sanitizedValue) ? '' : sanitizedValue; From eba85fac2594642a3e5c6456c5347104f3af665f Mon Sep 17 00:00:00 2001 From: Salman <114740396+hrazasalman@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:06:32 +1100 Subject: [PATCH 2/4] db(entityTypes): MAUI-4763: Add new entity types (pacmossi_insecticide_test) for PacMOSSI project (#5986) * pacmossi_insecticide_test entity type * schema and model update --- ...secticideTestEntityType-modifies-schema.js | 29 +++++++++++++++++++ packages/types/src/schemas/schemas.ts | 1 + packages/types/src/types/models.ts | 1 + 3 files changed, 31 insertions(+) create mode 100644 packages/database/src/migrations/20241104002014-addPacmossiInsecticideTestEntityType-modifies-schema.js diff --git a/packages/database/src/migrations/20241104002014-addPacmossiInsecticideTestEntityType-modifies-schema.js b/packages/database/src/migrations/20241104002014-addPacmossiInsecticideTestEntityType-modifies-schema.js new file mode 100644 index 0000000000..960ed4034b --- /dev/null +++ b/packages/database/src/migrations/20241104002014-addPacmossiInsecticideTestEntityType-modifies-schema.js @@ -0,0 +1,29 @@ +'use strict'; + +var dbm; +var type; +var seed; + +/** + * We receive the dbmigrate dependency from dbmigrate initially. + * This enables us to not have to rely on NODE_PATH. + */ +exports.setup = function (options, seedLink) { + dbm = options.dbmigrate; + type = dbm.dataType; + seed = seedLink; +}; + +exports.up = function (db) { + return db.runSql( + `ALTER TYPE public.entity_type ADD VALUE IF NOT EXISTS 'pacmossi_insecticide_test'`, + ); +}; + +exports.down = function (db) { + return null; +}; + +exports._meta = { + version: 1, +}; diff --git a/packages/types/src/schemas/schemas.ts b/packages/types/src/schemas/schemas.ts index 9a82832635..4536718d2d 100644 --- a/packages/types/src/schemas/schemas.ts +++ b/packages/types/src/schemas/schemas.ts @@ -84574,6 +84574,7 @@ export const EntityTypeEnumSchema = { "msupply_store", "nursing_zone", "pacmossi_district", + "pacmossi_insecticide_test", "pacmossi_spraying_site", "pacmossi_village", "postcode", diff --git a/packages/types/src/types/models.ts b/packages/types/src/types/models.ts index 07a1aa0e63..af2026a629 100644 --- a/packages/types/src/types/models.ts +++ b/packages/types/src/types/models.ts @@ -1866,6 +1866,7 @@ export enum EntityTypeEnum { 'pacmossi_district' = 'pacmossi_district', 'pacmossi_village' = 'pacmossi_village', 'pacmossi_spraying_site' = 'pacmossi_spraying_site', + 'pacmossi_insecticide_test' = 'pacmossi_insecticide_test', } export enum DataTableType { 'analytics' = 'analytics', From 10ceb6de4e46cf5bccb17adf0bbe14141839547e Mon Sep 17 00:00:00 2001 From: Tom Caiger Date: Mon, 4 Nov 2024 14:41:36 +1300 Subject: [PATCH 3/4] Update dataTables.js --- packages/admin-panel/src/routes/visualisations/dataTables.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/admin-panel/src/routes/visualisations/dataTables.js b/packages/admin-panel/src/routes/visualisations/dataTables.js index d545d445d1..7e22ffe0f6 100644 --- a/packages/admin-panel/src/routes/visualisations/dataTables.js +++ b/packages/admin-panel/src/routes/visualisations/dataTables.js @@ -67,7 +67,7 @@ const COLUMNS = [ type: 'export', actionConfig: { exportEndpoint: 'dataTable', - fileName: '{code}.xlsx', + fileName: '{code}.json', }, }, { From e294a80fa6d0b02cea573548e1c5ed9225baeb58 Mon Sep 17 00:00:00 2001 From: Tom Caiger Date: Mon, 4 Nov 2024 16:16:13 +1300 Subject: [PATCH 4/4] tweak styles --- .../features/Dashboard/ExportDashboard/ExportConfig.tsx | 8 ++++---- .../features/ExportSettings/ExportDescriptionInput.tsx | 6 +++--- .../src/features/ExportSettings/ExportSettingLabel.tsx | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/tupaia-web/src/features/Dashboard/ExportDashboard/ExportConfig.tsx b/packages/tupaia-web/src/features/Dashboard/ExportDashboard/ExportConfig.tsx index 693fb0f44c..258dc2ea9c 100644 --- a/packages/tupaia-web/src/features/Dashboard/ExportDashboard/ExportConfig.tsx +++ b/packages/tupaia-web/src/features/Dashboard/ExportDashboard/ExportConfig.tsx @@ -22,7 +22,7 @@ import { Preview } from './Preview'; import { ExportDescriptionInput } from '../../ExportSettings/ExportDescriptionInput'; const ButtonGroup = styled.div` - padding-top: 2.5rem; + padding: 1rem 0; width: 100%; display: flex; justify-content: flex-end; @@ -32,7 +32,7 @@ const Wrapper = styled.div` display: flex; flex-direction: column; flex-grow: 1; - width 100%; + width: 100%; align-items: start; section + section { margin-top: 1.5rem; @@ -105,9 +105,9 @@ const ExportSettingsInstructionsContainer = styled.div` `; const ExportSettingsWrapper = styled.div` - padding-block-end: 2rem; + padding-block-end: 0.8rem; & + & { - padding-block-start: 1.5rem; + padding-block-start: 1rem; border-top: 0.1rem solid ${({ theme }) => theme.palette.text.secondary}; } &:last-child { diff --git a/packages/tupaia-web/src/features/ExportSettings/ExportDescriptionInput.tsx b/packages/tupaia-web/src/features/ExportSettings/ExportDescriptionInput.tsx index 3673ac5f59..34734cab9f 100644 --- a/packages/tupaia-web/src/features/ExportSettings/ExportDescriptionInput.tsx +++ b/packages/tupaia-web/src/features/ExportSettings/ExportDescriptionInput.tsx @@ -17,7 +17,7 @@ const Wrapper = styled.div` const ExportDescriptionInputArea = styled((props: OutlinedTextFieldProps) => ( ))` - margin-block-start: 1rem; + margin-block-start: 0.6rem; .MuiInputBase-root { border: 1px solid ${({ theme }) => theme.palette.text.secondary}; @@ -44,7 +44,7 @@ const ExportDescription = styled.div<{ display: flex; align-self: end; justify-content: space-between; - margin-top: 0.313rem; + margin-top: 0.3rem; color: ${({ error, theme }) => (error ? theme.palette.error.main : theme.palette.text.secondary)}; font-size: 0.75rem; `; @@ -61,7 +61,7 @@ export const ExportDescriptionInput = () => { theme.palette.text.primary}; padding-inline-start: 0; - font-size: 1.125rem; + font-size: 1rem; font-weight: ${({ theme }) => theme.typography.fontWeightMedium}; `;