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', }, }, { 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; 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/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}; `; 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',