Skip to content

Commit

Permalink
Merge pull request #23 from SailingSteve/steveStaffClientFeb6-420pm
Browse files Browse the repository at this point in the history
Got the drawers working again to reflect changes from invalidated queries
  • Loading branch information
DaleMcGrew authored Feb 8, 2025
2 parents 281ba7e + bbe4592 commit 1a016cb
Show file tree
Hide file tree
Showing 28 changed files with 2,537 additions and 2,226 deletions.
14 changes: 4 additions & 10 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ function App () {
const [showDevtools] = useState(webAppConfig.ENABLE_REACT_QUERY_TOOLS !== undefined ? webAppConfig.ENABLE_REACT_QUERY_TOOLS : true);


// Inject this once for the app, for all react-query queries
// Inject this once for the app, then it is the default for all ReactQuery queries
const queryClient = new QueryClient({
defaultOptions: {
queries: {
networkMode: 'always', // Send queries to the server even if the cache has the data
// networkMode: 'always', // <-- This is not a solution, it just covers up some problem in our code, while disabling the biggest benefit of ReactQueries. Send queries to the server even if the cache has the data
refetchOnWindowFocus: false,
refetchOnMount: true,
staleTime: 1000 * 60 * 5, // 5 minutes
Expand All @@ -53,19 +53,13 @@ function App () {
useEffect(() => {
console.log('--------- App.jsx loading ---------');
initializejQuery(() => {
console.log('--------- jQuery has been initialized ---------');
console.log('--------- jQuery has been initialized, indicates that a new session has been created ---------');
});
return () => {
// Anything in here is fired on component unmount, equiv to componentDidUnmount()
};
}, []);


const isAuth = localStorage.getItem('isAuthenticated');
if (isAuth) {
console.log('======================================== isAuthenticated: " ', isAuth, ' =============================');
}

return (
<>
<StyledEngineProvider injectFirst>
Expand All @@ -92,7 +86,7 @@ function App () {
<Route path="/" element={<Teams />} />
<Route path="*" element={<PageNotFound />} />
</Routes>
{/* Hack 1/14/25 <Footer /> */}
{/* <Footer /> has problems */}
{showDevtools && (
<ReactQueryDevtools />
)}
Expand Down
68 changes: 34 additions & 34 deletions src/js/actions/PersonActions.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
import Dispatcher from '../common/dispatcher/Dispatcher';

export default {
personListRetrieve (searchText = '') {
// console.log('PersonActions, personListRetrieve searchText:', searchText);
if (searchText) {
Dispatcher.loadEndpoint('person-list-retrieve', {
searchText,
});
} else {
Dispatcher.loadEndpoint('person-list-retrieve');
}
},

personRetrieve (personId = '') {
// console.log('PersonActions, personRetrieve personId:', personId);
if (personId) {
Dispatcher.loadEndpoint('person-retrieve', {
personId,
});
} else {
Dispatcher.loadEndpoint('person-retrieve');
}
},

personSave (personId = 0, incomingData = {}) {
// console.log('PersonActions, personSave personId:', personId, ', incomingData:', incomingData);
const data = {
personId,
...incomingData,
};
Dispatcher.loadEndpoint('person-save', data);
},
};
// import Dispatcher from '../common/dispatcher/Dispatcher';
//
// export default {
// personListRetrieve (searchText = '') {
// // console.log('PersonActions, personListRetrieve searchText:', searchText);
// if (searchText) {
// Dispatcher.loadEndpoint('person-list-retrieve', {
// searchText,
// });
// } else {
// Dispatcher.loadEndpoint('person-list-retrieve');
// }
// },
//
// personRetrieve (personId = '') {
// // console.log('PersonActions, personRetrieve personId:', personId);
// if (personId) {
// Dispatcher.loadEndpoint('person-retrieve', {
// personId,
// });
// } else {
// Dispatcher.loadEndpoint('person-retrieve');
// }
// },
//
// personSave (personId = 0, incomingData = {}) {
// // console.log('PersonActions, personSave personId:', personId, ', incomingData:', incomingData);
// const data = {
// personId,
// ...incomingData,
// };
// Dispatcher.loadEndpoint('person-save', data);
// },
// };
160 changes: 80 additions & 80 deletions src/js/actions/TaskActions.js
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
import Dispatcher from '../common/dispatcher/Dispatcher';

export default {
taskDefinitionListRetrieve (taskGroupId, searchText = '') {
// console.log('TaskActions, taskDefinitionListRetrieve searchText:', searchText);
if (searchText) {
Dispatcher.loadEndpoint('task-definition-list-retrieve', {
taskGroupId,
searchText,
});
} else {
Dispatcher.loadEndpoint('task-definition-list-retrieve', {
taskGroupId,
});
}
},

taskDefinitionSave (taskGroupId = -1, taskDefinitionId = -1, incomingData = {}) {
// console.log('TaskActions, taskSave taskDefinitionId:', taskDefinitionId, ', incomingData:', incomingData);
const data = {
taskDefinitionId,
taskGroupId,
...incomingData,
};
Dispatcher.loadEndpoint('task-definition-save', data);
},

taskGroupListRetrieve (searchText = '') {
// console.log('TaskActions, taskGroupListRetrieve searchText:', searchText);
if (searchText) {
Dispatcher.loadEndpoint('task-group-list-retrieve', {
searchText,
});
} else {
Dispatcher.loadEndpoint('task-group-list-retrieve');
}
},

taskGroupRetrieve (taskGroupId = '') {
// console.log('TaskActions, taskGroupRetrieve taskGroupId:', taskGroupId);
if (taskGroupId) {
Dispatcher.loadEndpoint('task-group-retrieve', {
taskGroupId,
});
} else {
Dispatcher.loadEndpoint('task-group-retrieve');
}
},

taskGroupSave (taskGroupId = -1, incomingData = {}) {
// console.log('TaskActions, taskGroupSave taskGroupId:', taskGroupId, ', incomingData:', incomingData);
const data = {
taskGroupId,
...incomingData,
};
Dispatcher.loadEndpoint('task-group-save', data);
},

taskSave (personId = -1, taskDefinitionId = -1, taskGroupId = -1, incomingData = {}) {
// console.log('TaskActions, taskSave personId:', personId, ', taskDefinitionId:', taskDefinitionId, ', ', taskGroupId:', taskGroupId, ', incomingData:', incomingData);
const data = {
personId,
taskDefinitionId,
taskGroupId,
...incomingData,
};
Dispatcher.loadEndpoint('task-save', data);
},

taskStatusListRetrieve (personIdList = []) {
// console.log('TaskActions, taskStatusListRetrieve personIdList:', personIdList);
if (personIdList) {
Dispatcher.loadEndpoint('task-status-list-retrieve', {
personIdList,
});
} else {
Dispatcher.loadEndpoint('task-status-list-retrieve');
}
},
};
// import Dispatcher from '../common/dispatcher/Dispatcher';
//
// export default {
// taskDefinitionListRetrieve (taskGroupId, searchText = '') {
// // console.log('TaskActions, taskDefinitionListRetrieve searchText:', searchText);
// if (searchText) {
// Dispatcher.loadEndpoint('task-definition-list-retrieve', {
// taskGroupId,
// searchText,
// });
// } else {
// Dispatcher.loadEndpoint('task-definition-list-retrieve', {
// taskGroupId,
// });
// }
// },
//
// taskDefinitionSave (taskGroupId = -1, taskDefinitionId = -1, incomingData = {}) {
// // console.log('TaskActions, taskSave taskDefinitionId:', taskDefinitionId, ', incomingData:', incomingData);
// const data = {
// taskDefinitionId,
// taskGroupId,
// ...incomingData,
// };
// Dispatcher.loadEndpoint('task-definition-save', data);
// },
//
// taskGroupListRetrieve (searchText = '') {
// // console.log('TaskActions, taskGroupListRetrieve searchText:', searchText);
// if (searchText) {
// Dispatcher.loadEndpoint('task-group-list-retrieve', {
// searchText,
// });
// } else {
// Dispatcher.loadEndpoint('task-group-list-retrieve');
// }
// },
//
// taskGroupRetrieve (taskGroupId = '') {
// // console.log('TaskActions, taskGroupRetrieve taskGroupId:', taskGroupId);
// if (taskGroupId) {
// Dispatcher.loadEndpoint('task-group-retrieve', {
// taskGroupId,
// });
// } else {
// Dispatcher.loadEndpoint('task-group-retrieve');
// }
// },
//
// taskGroupSave (taskGroupId = -1, incomingData = {}) {
// // console.log('TaskActions, taskGroupSave taskGroupId:', taskGroupId, ', incomingData:', incomingData);
// const data = {
// taskGroupId,
// ...incomingData,
// };
// Dispatcher.loadEndpoint('task-group-save', data);
// },
//
// taskSave (personId = -1, taskDefinitionId = -1, taskGroupId = -1, incomingData = {}) {
// // console.log('TaskActions, taskSave personId:', personId, ', taskDefinitionId:', taskDefinitionId, ', ', taskGroupId:', taskGroupId, ', incomingData:', incomingData);
// const data = {
// personId,
// taskDefinitionId,
// taskGroupId,
// ...incomingData,
// };
// Dispatcher.loadEndpoint('task-save', data);
// },
//
// taskStatusListRetrieve (personIdList = []) {
// // console.log('TaskActions, taskStatusListRetrieve personIdList:', personIdList);
// if (personIdList) {
// Dispatcher.loadEndpoint('task-status-list-retrieve', {
// personIdList,
// });
// } else {
// Dispatcher.loadEndpoint('task-status-list-retrieve');
// }
// },
// };
108 changes: 54 additions & 54 deletions src/js/actions/TeamActions.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
import Dispatcher from '../common/dispatcher/Dispatcher';
import PersonStore from '../stores/PersonStore'; // eslint-disable-line import/no-cycle
import TeamStore from '../stores/TeamStore'; // eslint-disable-line import/no-cycle

export default {
addPersonToTeam (personId, teamId) {
// console.log('TeamActions, addPersonToTeam personId:', personId, ', teamId:', teamId);
const teamMemberFirstName = PersonStore.getFirstName(personId) || '';
const teamMemberLastName = PersonStore.getLastName(personId) || '';
const teamName = TeamStore.getTeamName(teamId) || '';
const data = {
personId,
teamId,
teamMemberFirstName,
teamMemberLastName,
teamName,
};
Dispatcher.loadEndpoint('add-person-to-team', data);
},

removePersonFromTeam (personId, teamId) {
// console.log('TeamActions, removePersonFromTeam personId:', personId, ', teamId:', teamId);
const data = {
personId,
teamId,
};
Dispatcher.loadEndpoint('remove-person-from-team', data);
},

teamRetrieve (teamId = '') {
// console.log('TeamActions, teamRetrieve teamId:', teamId);
if (teamId) {
Dispatcher.loadEndpoint('team-retrieve', {
teamId,
});
} else {
Dispatcher.loadEndpoint('team-retrieve');
}
},

teamListRetrieve () {
// console.log('TeamActions, teamListRetrieve');
Dispatcher.loadEndpoint('team-list-retrieve');
},

teamSave (teamId = '', incomingData = {}) {
// console.log('PersonActions, teamSave teamId:', teamId, ', incomingData:', incomingData);
const data = {
teamId,
...incomingData,
};
Dispatcher.loadEndpoint('team-save', data);
},
};
// import Dispatcher from '../common/dispatcher/Dispatcher';
// import PersonStore from '../stores/PersonStore'; // eslint-disable-line import/no-cycle
// import TeamStore from '../stores/TeamStore'; // eslint-disable-line import/no-cycle
//
// export default {
// addPersonToTeam (personId, teamId) {
// // console.log('TeamActions, addPersonToTeam personId:', personId, ', teamId:', teamId);
// const teamMemberFirstName = PersonStore.getFirstName(personId) || '';
// const teamMemberLastName = PersonStore.getLastName(personId) || '';
// const teamName = TeamStore.getTeamName(teamId) || '';
// const data = {
// personId,
// teamId,
// teamMemberFirstName,
// teamMemberLastName,
// teamName,
// };
// Dispatcher.loadEndpoint('add-person-to-team', data);
// },
//
// removePersonFromTeam (personId, teamId) {
// // console.log('TeamActions, removePersonFromTeam personId:', personId, ', teamId:', teamId);
// const data = {
// personId,
// teamId,
// };
// Dispatcher.loadEndpoint('remove-person-from-team', data);
// },
//
// teamRetrieve (teamId = '') {
// // console.log('TeamActions, teamRetrieve teamId:', teamId);
// if (teamId) {
// Dispatcher.loadEndpoint('team-retrieve', {
// teamId,
// });
// } else {
// Dispatcher.loadEndpoint('team-retrieve');
// }
// },
//
// teamListRetrieve () {
// // console.log('TeamActions, teamListRetrieve');
// Dispatcher.loadEndpoint('team-list-retrieve');
// },
//
// teamSave (teamId = '', incomingData = {}) {
// // console.log('PersonActions, teamSave teamId:', teamId, ', incomingData:', incomingData);
// const data = {
// teamId,
// ...incomingData,
// };
// Dispatcher.loadEndpoint('team-save', data);
// },
// };
2 changes: 1 addition & 1 deletion src/js/components/Drawers/AddTeamDrawer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const AddTeamDrawer = () => {
drawerId="addTeamDrawer"
drawerOpenGlobalVariableName="addTeamDrawerOpen"
mainContentJsx={<AddTeamDrawerMainContent />}
headerTitleJsx={getAppContextValue('AddTeamDrawerLabel')}
headerTitleJsx={<>{getAppContextValue('AddTeamDrawerLabel')}</>}
headerFixedJsx={<></>}
/>
);
Expand Down
Loading

0 comments on commit 1a016cb

Please sign in to comment.