diff --git a/src/core_modules/capture-core/components/WorkingLists/TeiWorkingLists/epics/teiViewEpics/teiTemplates.epics.js b/src/core_modules/capture-core/components/WorkingLists/TeiWorkingLists/epics/teiViewEpics/teiTemplates.epics.js index 0c275b3b09..fd490829cd 100644 --- a/src/core_modules/capture-core/components/WorkingLists/TeiWorkingLists/epics/teiViewEpics/teiTemplates.epics.js +++ b/src/core_modules/capture-core/components/WorkingLists/TeiWorkingLists/epics/teiViewEpics/teiTemplates.epics.js @@ -6,14 +6,14 @@ import { errorCreator } from 'capture-core-utils'; import { ofType } from 'redux-observable'; import { concatMap, filter, takeUntil } from 'rxjs/operators'; import { - workingListsCommonActionTypes, - addTemplateSuccess, addTemplateError, - deleteTemplateSuccess, + addTemplateSuccess, deleteTemplateError, - updateTemplateSuccess, - updateTemplateError, + deleteTemplateSuccess, updateDefaultTemplate, + updateTemplateError, + updateTemplateSuccess, + workingListsCommonActionTypes, workingListsCommonActionTypesBatchActionTypes, } from '../../../WorkingListsCommon'; import { TEI_WORKING_LISTS_TYPE } from '../../constants'; @@ -55,7 +55,7 @@ export const addTEITemplateEpic = (action$: InputObservable, store: ReduxStore, ...(assignedUserMode && { assignedUserMode }), ...(assignedUsers?.length > 0 && { assignedUsers }), ...(programStatus && { enrollmentStatus: programStatus }), - ...(!!followUp && { followUp }), + ...(followUp !== undefined && { followUp: JSON.stringify(followUp) }), ...(enrolledAt && { enrollmentCreatedDate: enrolledAt }), ...(occurredAt && { enrollmentIncidentDate: occurredAt }), ...(attributeValueFilters?.length > 0 && { attributeValueFilters }), diff --git a/src/core_modules/capture-core/components/WorkingLists/TeiWorkingLists/helpers/TEIFilters/clientConfigToApiTEIFilterQueryConverter/convertors.js b/src/core_modules/capture-core/components/WorkingLists/TeiWorkingLists/helpers/TEIFilters/clientConfigToApiTEIFilterQueryConverter/convertors.js index 7236ae345b..ae66d8b171 100644 --- a/src/core_modules/capture-core/components/WorkingLists/TeiWorkingLists/helpers/TEIFilters/clientConfigToApiTEIFilterQueryConverter/convertors.js +++ b/src/core_modules/capture-core/components/WorkingLists/TeiWorkingLists/helpers/TEIFilters/clientConfigToApiTEIFilterQueryConverter/convertors.js @@ -1,12 +1,12 @@ // @flow import moment from 'moment'; import { - filterTypesObject, - dateFilterTypes, type BooleanFilterData, - type TextFilterData, - type NumericFilterData, type DateFilterData, + dateFilterTypes, + filterTypesObject, + type NumericFilterData, + type TextFilterData, } from '../../../../WorkingListsBase'; import type { ApiDataFilterBoolean, ApiDataFilterDateContents } from '../../../types'; import { ADDITIONAL_FILTERS } from '../../../helpers'; @@ -108,7 +108,7 @@ export const convertMainFilters = ({ } const mainValue = mainFiltersTable[key](filter); - if (mainValue) { + if (mainValue !== undefined) { if (key === MAIN_FILTERS.ASSIGNEE) { return { ...acc, ...mainValue }; } diff --git a/src/core_modules/capture-core/components/WorkingLists/WorkingListsBase/TemplateMaintenance/DeleteConfirmationDialog.component.js b/src/core_modules/capture-core/components/WorkingLists/WorkingListsBase/TemplateMaintenance/DeleteConfirmationDialog.component.js index 635bac6d3e..72c965d3da 100644 --- a/src/core_modules/capture-core/components/WorkingLists/WorkingListsBase/TemplateMaintenance/DeleteConfirmationDialog.component.js +++ b/src/core_modules/capture-core/components/WorkingLists/WorkingListsBase/TemplateMaintenance/DeleteConfirmationDialog.component.js @@ -1,31 +1,21 @@ // @flow import * as React from 'react'; -import { withStyles } from '@material-ui/core/styles'; import i18n from '@dhis2/d2-i18n'; -import { Button, Modal, ModalTitle, ModalContent, ModalActions } from '@dhis2/ui'; - -const getStyles = () => ({ - buttonContainer: { - display: 'flex', - justifyContent: 'space-between', - }, -}); +import { Button, ButtonStrip, Modal, ModalActions, ModalContent, ModalTitle } from '@dhis2/ui'; type Props = { open: boolean, onClose: () => void, onDeleteTemplate: () => void, templateName: string, - classes: Object, }; -const DeleteConfirmationDialogPlain = (props: Props) => { +export const DeleteConfirmationDialog = (props: Props) => { const { open, onClose, onDeleteTemplate, templateName, - classes, } = props; if (!open) { @@ -41,18 +31,17 @@ const DeleteConfirmationDialogPlain = (props: Props) => { {i18n.t('Do you really want to delete the \'{{templateName}}\' view?', { templateName })} - - - + + + + + ); }; -export const DeleteConfirmationDialog = withStyles(getStyles)(DeleteConfirmationDialogPlain); diff --git a/src/core_modules/capture-core/components/WorkingLists/WorkingListsBase/TemplateMaintenance/ExistingTemplateContents.component.js b/src/core_modules/capture-core/components/WorkingLists/WorkingListsBase/TemplateMaintenance/ExistingTemplateContents.component.js index 0efef529f0..993b30eb2d 100644 --- a/src/core_modules/capture-core/components/WorkingLists/WorkingListsBase/TemplateMaintenance/ExistingTemplateContents.component.js +++ b/src/core_modules/capture-core/components/WorkingLists/WorkingListsBase/TemplateMaintenance/ExistingTemplateContents.component.js @@ -1,40 +1,30 @@ // @flow import * as React from 'react'; -import { withStyles } from '@material-ui/core/styles'; import i18n from '@dhis2/d2-i18n'; -import { Button, ModalTitle, ModalContent, ModalActions } from '@dhis2/ui'; - -const getStyles = () => ({ - buttonContainer: { - display: 'flex', - justifyContent: 'space-between', - }, -}); +import { Button, ButtonStrip, ModalActions, ModalContent, ModalTitle } from '@dhis2/ui'; type Props = { onSaveTemplate: () => void, onClose: () => void, - classes: Object, }; -const ExistingTemplateContentsPlain = (props: Props) => { - const { onSaveTemplate, onClose, classes } = props; +export const ExistingTemplateContents = (props: Props) => { + const { onSaveTemplate, onClose } = props; return ( {i18n.t('Save')} - - - + + + + + ); }; -export const ExistingTemplateContents = withStyles(getStyles)(ExistingTemplateContentsPlain); diff --git a/src/core_modules/capture-core/components/WorkingLists/WorkingListsBase/TemplateMaintenance/NewTemplateContents.component.js b/src/core_modules/capture-core/components/WorkingLists/WorkingListsBase/TemplateMaintenance/NewTemplateContents.component.js index c064f74893..ca1a446e8f 100644 --- a/src/core_modules/capture-core/components/WorkingLists/WorkingListsBase/TemplateMaintenance/NewTemplateContents.component.js +++ b/src/core_modules/capture-core/components/WorkingLists/WorkingListsBase/TemplateMaintenance/NewTemplateContents.component.js @@ -1,6 +1,6 @@ // @flow import * as React from 'react'; -import { colors, Button, ModalTitle, ModalContent, ModalActions } from '@dhis2/ui'; +import { Button, ButtonStrip, colors, ModalActions, ModalContent, ModalTitle } from '@dhis2/ui'; import { withStyles } from '@material-ui/core/styles'; import i18n from '@dhis2/d2-i18n'; import { NewTemplateTextField } from './NewTemplateTextField.component'; @@ -64,15 +64,15 @@ const NewTemplateContentsPlain = (props: Props) => { {error} - - - + + + + + );