refactor: add client log on task list change
This commit is contained in:
@ -10,10 +10,24 @@ import isSameOrAfter from 'dayjs/plugin/isSameOrAfter';
|
||||
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
||||
import isBetween from 'dayjs/plugin/isBetween';
|
||||
import weekday from 'dayjs/plugin/weekday';
|
||||
import log from 'loglevel';
|
||||
import remote from 'loglevel-plugin-remote';
|
||||
import cache from './App/cache';
|
||||
import App from './App';
|
||||
|
||||
// https://able.bio/AnasT/apollo-graphql-async-access-token-refresh--470t1c8
|
||||
if (process.env.REACT_APP_NODE_ENV === 'production') {
|
||||
remote.apply(log, { format: remote.json });
|
||||
switch (process.env.REACT_APP_LOG_LEVEL) {
|
||||
case 'info':
|
||||
log.setLevel(log.levels.INFO);
|
||||
break;
|
||||
case 'debug':
|
||||
log.setLevel(log.levels.DEBUG);
|
||||
break;
|
||||
default:
|
||||
log.setLevel(log.levels.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
enableMapSet();
|
||||
|
||||
@ -30,7 +44,6 @@ dayjs.updateLocale('en', {
|
||||
});
|
||||
|
||||
const client = new ApolloClient({ uri: '/graphql', cache });
|
||||
console.log('cloient', client);
|
||||
|
||||
ReactDOM.render(
|
||||
<ApolloProvider client={client}>
|
||||
|
@ -4,6 +4,7 @@ import List, { ListCards } from 'shared/components/List';
|
||||
import Card from 'shared/components/Card';
|
||||
import CardComposer from 'shared/components/CardComposer';
|
||||
import AddList from 'shared/components/AddList';
|
||||
import log from 'loglevel';
|
||||
import {
|
||||
isPositionChanged,
|
||||
getSortedDraggables,
|
||||
@ -262,6 +263,9 @@ const SimpleLists: React.FC<SimpleProps> = ({
|
||||
id: destination.droppableId,
|
||||
},
|
||||
};
|
||||
log.debug(
|
||||
`action=move taskId=${droppedTask.id} source=${source.droppableId} dest=${destination.droppableId} oldPos=${droppedTask.position} newPos=${newPosition}`,
|
||||
);
|
||||
onTaskDrop(newTask, droppedTask.taskGroup.id);
|
||||
}
|
||||
}
|
||||
|
2
frontend/src/taskcafe.d.ts
vendored
2
frontend/src/taskcafe.d.ts
vendored
@ -1,3 +1,5 @@
|
||||
declare module 'loglevel-plugin-remote';
|
||||
|
||||
interface JWTToken {
|
||||
userId: string;
|
||||
orgRole: string;
|
||||
|
Reference in New Issue
Block a user