Skip to content

Commit

Permalink
C-719: Remove business status display (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
dborowiecki authored Mar 11, 2024
1 parent acd59c6 commit f894602
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,25 @@ const TASK_FULL_PROJECTION = () => [
'jsonExt',
];

const TASKS_FULL_PROJECTION = () => [
const TASK_PROJECTION = () => [

Check failure on line 39 in src/actions.js

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces not allowed
'id',
'entityId',
'entityString',
'source',
'status',
'executorActionEvent',
'businessEvent',
'businessStatus',
'dateCreated',
'isDeleted',
'taskGroup{id, code, completionPolicy}',
'data',
'jsonExt',
];

const TASKS_FULL_PROJECTION = () => [

Check failure on line 54 in src/actions.js

View workflow job for this annotation

GitHub Actions / lint

'TASKS_FULL_PROJECTION' is assigned a value but never used
...TASK_PROJECTION, 'businessEvent'

Check failure on line 55 in src/actions.js

View workflow job for this annotation

GitHub Actions / lint

Missing trailing comma
];

export const formatTaskGroupGQL = (taskGroup) => {
const executors = taskGroup?.taskexecutorSet?.map((executor) => decodeId(executor.id));
const taskSources = taskGroup?.taskSources?.map((taskSource) => taskSource.name);
Expand Down Expand Up @@ -101,7 +104,7 @@ export function fetchTaskGroups(modulesManager, params) {
}

export function fetchTasks(modulesManager, params) {
const payload = formatPageQueryWithCount('task', params, TASKS_FULL_PROJECTION());
const payload = formatPageQueryWithCount('task', params, TASK_PROJECTION());
return graphql(payload, ACTION_TYPE.SEARCH_TASKS);
}

Expand Down
15 changes: 15 additions & 0 deletions src/components/TaskApprovementPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import CheckIcon from '@material-ui/icons/Check';
import {
APPROVED, EMPTY_STRING,
FAILED, TASK_STATUS,
TASK_CONTRIBUTION_KEY

Check failure on line 16 in src/components/TaskApprovementPanel.js

View workflow job for this annotation

GitHub Actions / lint

Missing trailing comma
} from '../constants';
import { resolveTask } from '../actions';

Expand Down Expand Up @@ -49,6 +50,7 @@ function TaskApprovementPanel({
const [disable, setDisable] = useState(false);
const task = { ...edited };


Check failure on line 53 in src/components/TaskApprovementPanel.js

View workflow job for this annotation

GitHub Actions / lint

More than 1 blank line not allowed
useEffect(() => {
if (task?.businessStatus && user) {
const businesStatus = JSON.parse(task.businessStatus);
Expand Down Expand Up @@ -99,6 +101,19 @@ function TaskApprovementPanel({
}
};

if (task.source) {
const contrib = modulesManager.getContribs(TASK_CONTRIBUTION_KEY)
.find((c) => c.taskSource.includes(task.source));

if (contrib?.confirmationPanel) {
return <contrib.confirmationPanel

Check failure on line 109 in src/components/TaskApprovementPanel.js

View workflow job for this annotation

GitHub Actions / lint

Missing parentheses around multilines JSX

Check failure on line 109 in src/components/TaskApprovementPanel.js

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces not allowed
task
defaultAction={handleButtonClick}
defaultDisabled={disable}
/>

Check failure on line 113 in src/components/TaskApprovementPanel.js

View workflow job for this annotation

GitHub Actions / lint

Missing semicolon
}
}

return (
<Paper className={classes.paper}>
<div className={classes.fabContainer}>
Expand Down
3 changes: 0 additions & 3 deletions src/components/TaskSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ function TaskSearcher({
'task.type',
'task.entity',
'task.assignee',
'task.businessStatus',
'task.status',
];
if (rights.includes(RIGHT_TASKS_MANAGEMENT_SEARCH)) {
Expand All @@ -66,7 +65,6 @@ function TaskSearcher({
['type', true],
['entity', true],
['assignee', true],
['businessStatus', true],
['status', true],
];

Expand All @@ -75,7 +73,6 @@ function TaskSearcher({
(task) => trimBusinessEvent(task.businessEvent),
(task) => task.entityString,
(task) => task?.taskGroup?.code,
(task) => task.businessStatus,
(task) => task.status,
(task) => (
<Tooltip title={formatMessage('viewDetailsButton.tooltip')}>
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import TaskGroupPicker from './pickers/TaskGroupPicker';
import TaskSearcher from './components/TaskSearcher';
import getAdminMainMenuContributions from './contributions/AdminMainMenuContributions';
import { TASK_ROUTE } from './constants';
import { fetchTask } from './actions';
import { fetchTask, resolveTask } from './actions';

const ROUTE_TASKS_MANAGEMENT = 'tasks';
const ROUTE_TASK_MANAGEMENT = 'tasks/task';
Expand Down Expand Up @@ -47,3 +47,5 @@ const DEFAULT_CONFIG = {
};

export const TasksManagementModule = (cfg) => ({ ...DEFAULT_CONFIG, ...cfg });

export { resolveTask };

Check failure on line 51 in src/index.js

View workflow job for this annotation

GitHub Actions / lint

Newline required at end of file but not found

0 comments on commit f894602

Please sign in to comment.