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

CM-728: remove iso parse #40

Merged
merged 2 commits into from
Mar 21, 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
4 changes: 2 additions & 2 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
'jsonExt',
];

const TASK_PROJECTION = () => [
const TASK_PROJECTION = () => [
'id',
'entityId',
'entityString',
Expand All @@ -51,8 +51,8 @@
'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'
...TASK_PROJECTION, 'businessEvent',
];

export const formatTaskGroupGQL = (taskGroup) => {
Expand Down
15 changes: 8 additions & 7 deletions src/components/TaskApprovementPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import CheckIcon from '@material-ui/icons/Check';
import {
APPROVED, EMPTY_STRING,
FAILED, TASK_STATUS,
TASK_CONTRIBUTION_KEY
TASK_CONTRIBUTION_KEY,
} from '../constants';
import { resolveTask } from '../actions';

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


useEffect(() => {
if (task?.businessStatus && user) {
const businesStatus = JSON.parse(task.businessStatus);
Expand Down Expand Up @@ -106,11 +105,13 @@ function TaskApprovementPanel({
.find((c) => c.taskSource.includes(task.source));

if (contrib?.confirmationPanel) {
return <contrib.confirmationPanel
task
defaultAction={handleButtonClick}
defaultDisabled={disable}
/>
return (
<contrib.confirmationPanel
task
defaultAction={handleButtonClick}
defaultDisabled={disable}
/>
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/TaskSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function TaskSearcher({
sorts={sorts}
rowsPerPageOptions={ROWS_PER_PAGE_OPTIONS}
defaultPageSize={DEFAULT_PAGE_SIZE}
defaultOrderBy="source"
defaultOrderBy="-dateCreated"
rowIdentifier={rowIdentifier}
onDoubleClick={onDoubleClick}
defaultFilters={defaultFilters()}
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ const DEFAULT_CONFIG = {

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

export { resolveTask };
export { resolveTask };
7 changes: 1 addition & 6 deletions src/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,7 @@ function reducer(
task: parseData(action.payload.data.task)?.map((task) => ({
...task,
id: decodeId(task.id),
businessData: parseTaskData(JSON.parse(task.businessData, (key, value) => {
if (['date_valid_to', 'date_valid_from'].includes(key)) {
return `${value} 00:00:00`;
}
return value;
})),
businessData: parseTaskData(JSON.parse(task.businessData)),
}))?.[0],
errorTask: null,
};
Expand Down
Loading