Skip to content

Commit

Permalink
CM-728: remove iso parse (#40)
Browse files Browse the repository at this point in the history
* CM-728: remove iso parse

* CM-728: order by dateCreated

---------

Co-authored-by: Jan <j.dolkowski@soldevelo.com>
  • Loading branch information
jdolkowski and Jan authored Mar 21, 2024
1 parent f894602 commit 5159e73
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
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 @@ const TASK_FULL_PROJECTION = () => [
'jsonExt',
];

const TASK_PROJECTION = () => [
const TASK_PROJECTION = () => [
'id',
'entityId',
'entityString',
Expand All @@ -52,7 +52,7 @@ const TASK_PROJECTION = () => [
];

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

0 comments on commit 5159e73

Please sign in to comment.