- Changes required by ESLint.
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"extends": [
|
||||
"react-app"
|
||||
]
|
||||
],
|
||||
"rules": {
|
||||
"no-useless-rename": "off"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,15 +243,15 @@ function TaskListComponent({
|
||||
filteredInfo: {text: ""},
|
||||
});
|
||||
|
||||
const handleCreateTask = () => {
|
||||
setTaskUpsertContext({
|
||||
actions: {},
|
||||
context: {
|
||||
jobid: parentJobId,
|
||||
[relationshipType]: relationshipId,
|
||||
},
|
||||
});
|
||||
};
|
||||
const handleCreateTask = useCallback(() => {
|
||||
setTaskUpsertContext({
|
||||
actions: {},
|
||||
context: {
|
||||
jobid: parentJobId,
|
||||
[relationshipType]: relationshipId,
|
||||
},
|
||||
});
|
||||
}, [ parentJobId, relationshipId, relationshipType, setTaskUpsertContext]);
|
||||
|
||||
const handleTableChange = (pagination, filters, sorter) => {
|
||||
setState({...state, filteredInfo: filters, sortedInfo: sorter});
|
||||
@@ -261,14 +261,14 @@ function TaskListComponent({
|
||||
history({search: queryString.stringify(search)});
|
||||
};
|
||||
|
||||
const handleSwitchChange = (param, value) => {
|
||||
const handleSwitchChange = useCallback((param, value) => {
|
||||
if (value) {
|
||||
search[param] = "true";
|
||||
} else {
|
||||
delete search[param];
|
||||
}
|
||||
history({search: queryString.stringify(search)});
|
||||
};
|
||||
}, [history, search]);
|
||||
|
||||
const expandableRow = (record) => {
|
||||
return <Card title={t('tasks.fields.description')} size='small'>
|
||||
@@ -315,7 +315,7 @@ function TaskListComponent({
|
||||
</Button>
|
||||
</Space>
|
||||
);
|
||||
}, [refetch, deleted, completed, mine]);
|
||||
}, [refetch, deleted, completed, mine, onlyMine, t, handleSwitchChange, handleCreateTask]);
|
||||
|
||||
return (
|
||||
<Card
|
||||
|
||||
@@ -47,9 +47,9 @@ export function TaskUpsertModalContainer({
|
||||
const [jobIdState, setJobIdState] = useState(null);
|
||||
|
||||
const {
|
||||
loading: loading,
|
||||
error: error,
|
||||
data: data
|
||||
loading,
|
||||
error,
|
||||
data
|
||||
} = useQuery(QUERY_GET_TASKS_JOB_DETAILS_BY_ID, {
|
||||
variables: {id: jobIdState},
|
||||
skip: !jobIdState,
|
||||
@@ -70,7 +70,7 @@ export function TaskUpsertModalContainer({
|
||||
form.setFieldsValue(taskData.tasks_by_pk);
|
||||
setSelectedJobId(taskData.tasks_by_pk.jobid);
|
||||
}
|
||||
}, [taskLoading, taskError, taskData]);
|
||||
}, [taskLoading, taskError, taskData, form]);
|
||||
|
||||
// Use Effect to hydrate selected job details
|
||||
useEffect(() => {
|
||||
|
||||
@@ -14,6 +14,8 @@ export default function TasksPageComponent({bodyshop, currentUser, type}) {
|
||||
return <TaskListContainer query={QUERY_ALL_TASKS_PAGINATED} bodyshop={bodyshop}
|
||||
titleTranslation={'tasks.titles.all_tasks'}
|
||||
currentUser={currentUser}/>
|
||||
default:
|
||||
return <></>
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user