Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C-719: Remove business status display #39

Merged
merged 1 commit into from
Mar 11, 2024
Merged
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
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 @@
'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 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 {
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 @@
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 @@
}
};

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 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 @@
};

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
Loading