From 3a4f12443e9be8165dfb1f37266baaff60bb3852 Mon Sep 17 00:00:00 2001 From: sniedzielski Date: Wed, 24 Apr 2024 15:34:23 +0200 Subject: [PATCH] CM-880: added picker for source and task type --- src/components/TaskAllFilter.js | 26 +++++++++++++++++++------- src/constants.js | 26 ++++++++++++++++++++++++++ src/index.js | 4 ++++ src/pickers/TaskSourcesPicker.js | 25 +++++++++++++++++++++++++ src/pickers/TaskTypesPicker.js | 25 +++++++++++++++++++++++++ src/translations/en.json | 23 ++++++++++++++++++++++- 6 files changed, 121 insertions(+), 8 deletions(-) create mode 100644 src/pickers/TaskSourcesPicker.js create mode 100644 src/pickers/TaskTypesPicker.js diff --git a/src/components/TaskAllFilter.js b/src/components/TaskAllFilter.js index 05f738e..70b5152 100644 --- a/src/components/TaskAllFilter.js +++ b/src/components/TaskAllFilter.js @@ -43,18 +43,30 @@ function TaskAllFilter({ return ( - onChangeFilters([ + { + id: 'source', + value, + filter: value ? `source: "${value}"` : EMPTY_STRING, + }, + ])} /> - diff --git a/src/constants.js b/src/constants.js index ca1cdaf..50f72b0 100644 --- a/src/constants.js +++ b/src/constants.js @@ -66,3 +66,29 @@ export const FAILED = 'FAILED'; export const DOT = '.'; export const TASK_ROUTE = 'tasksManagement.route.task'; + +export const TASK_AVAILABLE_SOURCES = [ + 'IndividualService', + 'GroupIndividualService', + 'CreateGroupAndMoveIndividualService', + 'BenefitPlanService', + 'BeneficiaryService', + 'calcrule_social_protection', + 'import_valid_items', + 'payroll', + 'payroll_reconciliation', + 'payroll_reject', + 'payroll_delete', + 'CreateDeduplicationReviewTasksService', +]; + +export const TASK_AVAILABLE_TYPES = [ + 'create', + 'update', + 'calculate', + 'import_valid_items', + 'accept_payroll', + 'payroll_reconciliation', + 'payroll_reject', + 'payroll_delete', +]; diff --git a/src/index.js b/src/index.js index 5bef5a0..24464e3 100644 --- a/src/index.js +++ b/src/index.js @@ -17,6 +17,8 @@ import getAdminMainMenuContributions from './contributions/AdminMainMenuContribu import { TASK_ROUTE } from './constants'; import { fetchTask, resolveTask } from './actions'; import TasksAllPage from './pages/TasksAllPage'; +import TaskTypesPicker from './pickers/TaskTypesPicker'; +import TaskSourcesPicker from './pickers/TaskSourcesPicker'; const ROUTE_TASKS_MANAGEMENT = 'tasks'; const ROUTE_TASK_MANAGEMENT = 'tasks/task'; @@ -41,6 +43,8 @@ const DEFAULT_CONFIG = { { key: TASK_ROUTE, ref: ROUTE_TASK_MANAGEMENT }, { key: 'tasksManagement.route.group', ref: ROUTE_GROUP_MANAGEMENT }, { key: 'tasksManagement.taskStatusPicker', ref: TaskStatusPicker }, + { key: 'tasksManagement.taskTypesPicker', ref: TaskTypesPicker }, + { key: 'tasksManagement.taskSourcesPicker', ref: TaskSourcesPicker }, { key: 'tasksManagement.taskPreviewCell', ref: TaskPreviewCell }, { key: 'tasksManagement.taskGroupPicker', ref: TaskGroupPicker }, { key: 'tasksManagement.taskSearcher', ref: TaskSearcher }, diff --git a/src/pickers/TaskSourcesPicker.js b/src/pickers/TaskSourcesPicker.js new file mode 100644 index 0000000..fcf99f6 --- /dev/null +++ b/src/pickers/TaskSourcesPicker.js @@ -0,0 +1,25 @@ +import React from 'react'; +import { ConstantBasedPicker } from '@openimis/fe-core'; +import { TASK_AVAILABLE_SOURCES } from '../constants'; + +function TaskSourcesPicker(props) { + const { + required, withNull, readOnly, onChange, value, nullLabel, withLabel, + } = props; + return ( + + ); +} + +export default TaskSourcesPicker; diff --git a/src/pickers/TaskTypesPicker.js b/src/pickers/TaskTypesPicker.js new file mode 100644 index 0000000..6e1288d --- /dev/null +++ b/src/pickers/TaskTypesPicker.js @@ -0,0 +1,25 @@ +import React from 'react'; +import { ConstantBasedPicker } from '@openimis/fe-core'; +import { TASK_AVAILABLE_TYPES } from '../constants'; + +function TaskTypesPicker(props) { + const { + required, withNull, readOnly, onChange, value, nullLabel, withLabel, + } = props; + return ( + + ); +} + +export default TaskTypesPicker; diff --git a/src/translations/en.json b/src/translations/en.json index e1aad4a..25c0666 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -53,5 +53,26 @@ "tasksManagement.menu.taskExecutionerGroups": "Task Executioner Groups", "tasksManagement.TaskSourcePicker.label": "Task Sources", "tasksManagement.TaskSourcePicker.placeholder": "Search for task sources...", - "tasksManagement.entries.tasksManagementAllView": "All Tasks" + "tasksManagement.entries.tasksManagementAllView": "All Tasks", + "tasksManagement.task.source.mutationLabel": "Resolving task", + "tasksManagement.task.source.IndividualService": "Individual Service", + "tasksManagement.task.source.GroupIndividualService": "Group Individual Service", + "tasksManagement.task.source.CreateGroupAndMoveIndividualService": "Create Group And Move Individual Service", + "tasksManagement.task.source.BenefitPlanService": "Benefit Plan Service", + "tasksManagement.task.source.BeneficiaryService": "Beneficiary Service", + "tasksManagement.task.source.calcrule_social_protection": "Calculation Rule: Social Protection", + "tasksManagement.task.source.import_valid_items": "Import Valid Items", + "tasksManagement.task.source.payroll": "Payroll", + "tasksManagement.task.source.payroll_reconciliation": "Payroll Reconciliation", + "tasksManagement.task.source.payroll_reject": "Reject Payroll", + "tasksManagement.task.source.payroll_delete": "Delete Payroll", + "tasksManagement.task.source.CreateDeduplicationReviewTasksService": "Create Deduplication Review Tasks Service", + "tasksManagement.task.type.create": "Create", + "tasksManagement.task.type.update": "Update", + "tasksManagement.task.type.calculate": "Calculate", + "tasksManagement.task.type.import_valid_items": "Import Valid Items", + "tasksManagement.task.type.accept_payroll": "Reject Payroll", + "tasksManagement.task.type.payroll_reconciliation": "Payroll Reconciliation", + "tasksManagement.task.type.payroll_reject": "Reject Payroll", + "tasksManagement.task.type.payroll_delete": "Delete Payroll" }