Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2025-05-02T13:23:06.732Z\n"
"PO-Revision-Date: 2025-05-02T13:23:06.732Z\n"
"POT-Creation-Date: 2025-05-22T12:31:36.902Z\n"
"PO-Revision-Date: 2025-05-22T12:31:36.902Z\n"

msgid "Choose one or more dates..."
msgstr "Choose one or more dates..."
Expand Down Expand Up @@ -1729,24 +1729,6 @@ msgstr "Delete events"
msgid "This cannot be undone. Are you sure you want to delete the selected events?"
msgstr "This cannot be undone. Are you sure you want to delete the selected events?"

msgid "Owner organisation unit"
msgstr "Owner organisation unit"

msgid "Registration Date"
msgstr "Registration Date"

msgid "Inactive"
msgstr "Inactive"

msgid "Enrollment status"
msgstr "Enrollment status"

msgid "Follow up"
msgstr "Follow up"

msgid "Choose a program stage to filter by {{label}}"
msgstr "Choose a program stage to filter by {{label}}"

msgid ""
"Some enrollments were completed successfully, but there was an error while "
"completing the rest. Please see the details below."
Expand Down Expand Up @@ -1871,6 +1853,24 @@ msgstr ""
msgid "An error occurred while deleting the records"
msgstr "An error occurred while deleting the records"

msgid "Owner organisation unit"
msgstr "Owner organisation unit"

msgid "Registration Date"
msgstr "Registration Date"

msgid "Inactive"
msgstr "Inactive"

msgid "Enrollment status"
msgstr "Enrollment status"

msgid "Follow up"
msgstr "Follow up"

msgid "Choose a program stage to filter by {{label}}"
msgstr "Choose a program stage to filter by {{label}}"

msgid "Working list could not be updated"
msgstr "Working list could not be updated"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import {
ModalContent,
ModalTitle,
} from '@dhis2/ui';
import { ConditionalTooltip } from '../../../../../Tooltips/ConditionalTooltip';
import { ConditionalTooltip } from '../../../../../../Tooltips/ConditionalTooltip';
import { useCompleteBulkEnrollments } from './hooks/useCompleteBulkEnrollments';
import { Widget } from '../../../../../Widget';
import type { ProgramStage } from '../../../../../../metaData';
import { Widget } from '../../../../../../Widget';
import type { ProgramStage } from '../../../../../../../metaData';

type Props = {
selectedRows: { [id: string]: any },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { useAlert, useDataEngine } from '@dhis2/app-runtime';
import { useMutation, useQueryClient } from 'react-query';
import i18n from '@dhis2/d2-i18n';
import log from 'loglevel';
import { ReactQueryAppNamespace, useApiDataQuery } from '../../../../../../../utils/reactQueryHelpers';
import { handleAPIResponse, REQUESTED_ENTITIES } from '../../../../../../../utils/api';
import { errorCreator, FEATURES, featureAvailable } from '../../../../../../../../capture-core-utils';
import type { ProgramStage } from '../../../../../../../metaData';
import { errorCreator, FEATURES, featureAvailable } from 'capture-core-utils';
import { ReactQueryAppNamespace, useApiDataQuery } from '../../../../../../../../utils/reactQueryHelpers';
import { handleAPIResponse, REQUESTED_ENTITIES } from '../../../../../../../../utils/api';
import type { ProgramStage } from '../../../../../../../../metaData';

type Props = {
selectedRows: { [id: string]: any },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import React, { useState } from 'react';
import i18n from '@dhis2/d2-i18n';
import { Button } from '@dhis2/ui';
import { useAuthority } from '../../../../../../utils/userInfo/useAuthority';
import { useAuthority } from '../../../../../../../utils/userInfo/useAuthority';
import { EnrollmentDeleteModal } from './EnrollmentDeleteModal';
import { ConditionalTooltip } from '../../../../../Tooltips/ConditionalTooltip';
import { ConditionalTooltip } from '../../../../../../Tooltips/ConditionalTooltip';

type Props = {
selectedRows: { [id: string]: boolean },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import log from 'loglevel';
import i18n from '@dhis2/d2-i18n';
import { useMutation, useQueryClient } from 'react-query';
import { useAlert, useDataEngine } from '@dhis2/app-runtime';
import { handleAPIResponse, REQUESTED_ENTITIES } from '../../../../../../../utils/api';
import { ReactQueryAppNamespace, useApiDataQuery } from '../../../../../../../utils/reactQueryHelpers';
import { errorCreator, FEATURES, featureAvailable } from '../../../../../../../../capture-core-utils';
import { errorCreator, FEATURES, featureAvailable } from 'capture-core-utils';
import { handleAPIResponse, REQUESTED_ENTITIES } from '../../../../../../../../utils/api';
import { ReactQueryAppNamespace, useApiDataQuery } from '../../../../../../../../utils/reactQueryHelpers';

type Props = {
selectedRows: { [id: string]: boolean },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React, { useState } from 'react';
import i18n from '@dhis2/d2-i18n';
import { Button, ButtonStrip, Modal, ModalActions, ModalContent, ModalTitle } from '@dhis2/ui';
import { useAuthority } from '../../../../../../utils/userInfo/useAuthority';
import { useAuthority } from '../../../../../../../utils/userInfo/useAuthority';
import { useCascadeDeleteTei } from './hooks/useCascadeDeleteTei';

type Props = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import log from 'loglevel';
import i18n from '@dhis2/d2-i18n';
import { useAlert, useDataEngine } from '@dhis2/app-runtime';
import { useMutation } from 'react-query';
import { errorCreator } from '../../../../../../../../capture-core-utils';
import { errorCreator } from 'capture-core-utils';

type Props = {
selectedRows: { [id: string]: boolean },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
import React from 'react';
import { BulkActionBar } from '../../WorkingListsBase/BulkActionBar';
import { BulkActionBar } from '../../../WorkingListsBase/BulkActionBar';
import { CompleteAction } from './Actions';
import type { Props } from './TrackedEntityBulkActions.types';
import { DeleteEnrollmentsAction } from './Actions/DeleteEnrollmentsAction';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// @flow
import React from 'react';
import log from 'loglevel';
import { EventBulkActions } from '../../EventWorkingListsCommon/EventBulkActions';
import { errorCreator } from 'capture-core-utils';
import { EventBulkActions } from '../../../EventWorkingListsCommon/EventBulkActions';
import { TrackedEntityBulkActionsComponent } from './TrackedEntityBulkActions.component';
import type { ContainerProps } from './TrackedEntityBulkActions.types';
import { errorCreator } from '../../../../../capture-core-utils';

export const TrackedEntityBulkActions = ({
programStageId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import type { ProgramStage } from '../../../../metaData';
import type { ProgramStage } from '../../../../../metaData';

export type Props = {|
selectedRows: { [key: string]: boolean },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// @flow
import React, { useMemo, useState, useCallback } from 'react';
import { v4 as uuid } from 'uuid';
import { TrackedEntityBulkActions } from './BulkActions';
import { useSelectedRowsController } from '../../WorkingListsBase/BulkActionBar';
import { TeiWorkingListsSetup } from '../Setup';
import type { Props } from './trackerWorkingListsBulkActionsController.types';

export const TrackerWorkingListsBulkActionsController = ({
program,
programStageId,
recordsOrder,
...passOnProps
}: Props) => {
const [customUpdateTrigger, setCustomUpdateTrigger] = useState();
const {
selectedRows,
clearSelection,
selectAllRows,
selectionInProgress,
toggleRowSelected,
allRowsAreSelected,
removeRowsFromSelection,
} = useSelectedRowsController({ recordIds: recordsOrder });

const handleCustomUpdateTrigger = useCallback((disableClearSelection?: boolean) => {
const id = uuid();
setCustomUpdateTrigger(id);
!disableClearSelection && clearSelection();
}, [clearSelection]);

const trackedEntityBulkActionsElement = useMemo(() => (
<TrackedEntityBulkActions
programId={program.id}
programDataWriteAccess={program.access.data.write}
programStageId={programStageId}
stages={program.stages}
selectedRows={selectedRows}
onClearSelection={clearSelection}
onUpdateList={handleCustomUpdateTrigger}
removeRowsFromSelection={removeRowsFromSelection}
/>
), [program, programStageId, selectedRows, clearSelection, handleCustomUpdateTrigger, removeRowsFromSelection]);


return (
<TeiWorkingListsSetup
{...passOnProps}
customUpdateTrigger={customUpdateTrigger}
program={program}
programStageId={programStageId}
recordsOrder={recordsOrder}
bulkActionBarComponent={trackedEntityBulkActionsElement}
selectedRows={selectedRows}
allRowsAreSelected={allRowsAreSelected}
selectionInProgress={selectionInProgress}
onSelectAll={selectAllRows}
onRowSelect={toggleRowSelected}
/>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @flow

export { TrackerWorkingListsBulkActionsController } from './TrackerWorkingListsBulkActionsController.component';
export type { TrackerWorkingListsBulkActionsSetupOutputProps } from './trackerWorkingListsBulkActionsController.types';
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// @flow
import type { TrackerWorkingListsViewMenuSetupOutputProps } from '../ViewMenuSetup';

type ExtractedProps = $ReadOnly<{|
|}>;

type RestProps = $Rest<TrackerWorkingListsViewMenuSetupOutputProps, ExtractedProps>;

export type Props = {|
...ExtractedProps,
...RestProps,
|};

export type TrackerWorkingListsBulkActionsSetupOutputProps = {|
...RestProps,
customUpdateTrigger: ?string,
allRowsAreSelected: ?boolean,
selectedRows: { [key: string]: boolean },
onRowSelect: (id: string) => void,
onSelectAll: (rows: Array<string>) => void,
selectionInProgress: ?boolean,
bulkActionBarComponent: React$Element<any>,
|};
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const TeiWorkingListsReduxProvider = ({
programStage,
currentTemplateId,
viewPreloaded,
onClearFilters,
...commonStateManagementProps
} = useWorkingListsCommonStateManagement(storeId, TEI_WORKING_LISTS_TYPE, program);
const dispatch = useDispatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import type {
ChangePage,
ChangeRowsPerPage,
ClearFilter,
ClearFilters,
RemoveFilter,
CustomMenuContents,
CustomRowMenuContents,
FiltersData,
LoadedContext,
LoadTemplates,
LoadView,
SelectRestMenuItem,
SelectRow,
SelectTemplate,
Expand All @@ -25,12 +23,18 @@ import type {
StickyFilters,
UnloadingContext,
UpdateFilter,
WorkingListTemplates,
SetTemplateSharingSettings,
} from '../../WorkingListsBase';
import type {
CustomColumnOrder,
RecordsOrder,
UpdateList,
InitialViewConfig,
AddTemplate,
DeleteTemplate,
UpdateTemplate,
LoadView,
} from '../../WorkingListsCommon';
import type { TeiWorkingListsTemplates, TeiRecords, ApiTrackerQueryCriteria } from '../types';

Expand Down Expand Up @@ -63,7 +67,6 @@ export type TeiWorkingListsReduxOutputProps = {|
onChangeRowsPerPage: ChangeRowsPerPage,
onClearFilter: ClearFilter,
onRemoveFilter: RemoveFilter,
onClearFilters: ClearFilters,
onLoadView: LoadView,
onLoadTemplates: LoadTemplates,
onClickListRow: SelectRow,
Expand All @@ -89,5 +92,13 @@ export type TeiWorkingListsReduxOutputProps = {|
updating: boolean,
updatingWithDialog: boolean,
viewPreloaded?: boolean,
onPreserveCurrentViewState: (templateId: string, critera: ApiTrackerQueryCriteria) => void
onPreserveCurrentViewState: (templateId: string, critera: ApiTrackerQueryCriteria) => void,
apiTemplates: WorkingListTemplates,
forceUpdateOnMount: boolean,
onAddTemplate: AddTemplate,
onDeleteTemplate: DeleteTemplate,
onUpdateTemplate: UpdateTemplate,
onSetTemplateSharingSettings: SetTemplateSharingSettings,
templateSharingType: string,
storeId: string,
|};
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const TeiWorkingListsSetup = ({
programStageId,
onUpdateList,
onLoadView,
onClearFilters,
onResetListColumnOrder,
onPreserveCurrentViewState,
customColumnOrder,
Expand Down Expand Up @@ -100,7 +99,9 @@ export const TeiWorkingListsSetup = ({
filtersOnly,
programStageFiltersOnly,
columns,
// $FlowFixMe The logic ensures that sortById is defined when this function is called
sortById,
// $FlowFixMe The logic ensures that sortByDirection is defined when this function is called
sortByDirection,
programId: program.id,
programStageId,
Expand Down Expand Up @@ -134,7 +135,9 @@ export const TeiWorkingListsSetup = ({
filtersOnly,
programStageFiltersOnly,
columns,
// $FlowFixMe The logic ensures that sortById is defined when this callback is called
sortById,
// $FlowFixMe The logic ensures that sortByDirection is defined when this callback is called
sortByDirection,
programId: program.id,
programStageId,
Expand All @@ -161,7 +164,9 @@ export const TeiWorkingListsSetup = ({
filtersOnly,
programStageFiltersOnly,
columns,
// $FlowFixMe The logic ensures that sortById is defined when this callback is called
sortById,
// $FlowFixMe The logic ensures that sortByDirection is defined when this callback is called
sortByDirection,
programId: program.id,
programStageId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// @flow
export { TeiWorkingListsSetup } from './TeiWorkingListsSetup.component';
export { TrackerWorkingListsSetupOutputProps } from './teiWorkingListsSetup.types';
Loading
Loading