Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
SailingSteve committed Jan 21, 2025
1 parent 0be1738 commit f089262
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/js/components/Drawers/EditTaskDefinitionDrawer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,15 @@ import DrawerTemplateA from './DrawerTemplateA';

const EditTaskDefinitionDrawer = () => {
renderLog('EditTaskDefinitionDrawer'); // Set LOG_RENDER_EVENTS to log all renders
const [headerTitleJsx, setHeaderTitleJsx] = useState(<></>);
const [headerFixedJsx] = useState(<></>);

const { getAppContextValue } = useConnectAppContext();

useEffect(() => {
const taskGroup = getAppContextValue('editTaskDefinitionDrawerTaskGroup');
if (taskGroup >= 0) {
setHeaderTitleJsx(<>Edit Task</>);
} else {
setHeaderTitleJsx(<>Add Task</>);
}
}, []);


return (
<DrawerTemplateA
drawerId="editTaskDefinitionDrawer"
drawerOpenGlobalVariableName="editTaskDefinitionDrawerOpen"
mainContentJsx={<EditTaskDefinitionDrawerMainContent />}
headerTitleJsx={headerTitleJsx}
headerFixedJsx={headerFixedJsx}
headerTitleJsx={getAppContextValue('editTaskDefinitionDrawerLabel')}
headerFixedJsx={<></>}
/>
);
};
Expand Down
2 changes: 2 additions & 0 deletions src/js/pages/SystemSettings/TaskGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ const TaskGroup = ({ classes, match }) => {
setAppContextValue('editTaskDefinitionDrawerOpen', true);
setAppContextValue('editTaskDefinitionDrawerTaskDefinitionId', -1);
setAppContextValue('editTaskDefinitionDrawerTaskGroup', taskGroup);
setAppContextValue('editTaskDefinitionDrawerLabel', 'Add Task');
};

// eslint-disable-next-line no-unused-vars
const editTaskDefinitionClick = (taskDefinition) => {
setAppContextValue('editTaskDefinitionDrawerOpen', true);
setAppContextValue('editTaskDefinitionDrawerTaskDefinition', taskDefinition);
setAppContextValue('editTaskDefinitionDrawerTaskGroup', taskGroup);
setAppContextValue('editTaskDefinitionDrawerLabel', 'Edit Task');
};

const editTaskGroupClick = () => {
Expand Down

0 comments on commit f089262

Please sign in to comment.