mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-03 06:28:01 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 409bc65427 | |||
| 0ff6556e4d | |||
| 2021d9394d |
@@ -179,6 +179,8 @@ jobs:
|
||||
# Prepare builder
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
|
||||
|
||||
# Build and push
|
||||
- name: Build and push
|
||||
|
||||
+4
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ontime-ui",
|
||||
"version": "1.9.6",
|
||||
"version": "1.9.8",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@chakra-ui/react": "^2.3.2",
|
||||
@@ -15,6 +15,7 @@
|
||||
"autosize": "^5.0.1",
|
||||
"axios": "^0.27.2",
|
||||
"color": "^4.2.3",
|
||||
"csv-stringify": "^6.2.3",
|
||||
"framer-motion": "^7.3.2",
|
||||
"jotai": "^1.7.8",
|
||||
"luxon": "^3.0.1",
|
||||
@@ -34,7 +35,7 @@
|
||||
"build": "vite build",
|
||||
"lint": "eslint .",
|
||||
"stylelint": "npx stylelint \"**/*.scss\"\n",
|
||||
"test": "vitest ",
|
||||
"test": "vitest",
|
||||
"test:pipeline": "vitest run"
|
||||
},
|
||||
"browserslist": {
|
||||
@@ -80,4 +81,4 @@
|
||||
"vite-tsconfig-paths": "^3.5.0",
|
||||
"vitest": "^0.23.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ export const useFetch = (namespace, fn) => {
|
||||
const { data, status, isError, refetch } = useQuery(namespace, fn, {
|
||||
refetchInterval: refetchIntervalMs,
|
||||
cacheTime: Infinity,
|
||||
networkMode: 'always',
|
||||
});
|
||||
|
||||
return { data, status, isError, refetch };
|
||||
|
||||
@@ -9,6 +9,7 @@ import { EVENTS_TABLE } from '../api/apiConstants';
|
||||
export default function useMutateEvents(mutation){
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation(mutation, {
|
||||
networkMode: 'always',
|
||||
onMutate: async (newEvent) => {
|
||||
// cancel ongoing queries
|
||||
queryClient.cancelQueries(EVENTS_TABLE, { exact: true });
|
||||
|
||||
@@ -30,6 +30,7 @@ export default function EventListWrapper() {
|
||||
const [events, setEvents] = useState(null);
|
||||
|
||||
const addEvent = useMutation(requestPost, {
|
||||
networkMode: 'always',
|
||||
// we optimistically update here
|
||||
onMutate: async (newEvent) => {
|
||||
// cancel ongoing queries
|
||||
@@ -76,6 +77,7 @@ export default function EventListWrapper() {
|
||||
});
|
||||
|
||||
const updateEvent = useMutation(requestPut, {
|
||||
networkMode: 'always',
|
||||
// we optimistically update here
|
||||
onMutate: async (newEvent) => {
|
||||
// cancel ongoing queries
|
||||
@@ -103,6 +105,7 @@ export default function EventListWrapper() {
|
||||
});
|
||||
|
||||
const patchEvent = useMutation(requestPatch, {
|
||||
networkMode: 'always',
|
||||
// we optimistically update here
|
||||
onMutate: async (newEvent) => {
|
||||
// cancel ongoing queries
|
||||
@@ -134,6 +137,7 @@ export default function EventListWrapper() {
|
||||
});
|
||||
|
||||
const deleteEvent = useMutation(requestDelete, {
|
||||
networkMode: 'always',
|
||||
// we optimistically update here
|
||||
onMutate: async (eventId) => {
|
||||
// cancel ongoing queries
|
||||
@@ -163,6 +167,7 @@ export default function EventListWrapper() {
|
||||
});
|
||||
|
||||
const deleteAllEvents = useMutation(requestDeleteAll, {
|
||||
networkMode: 'always',
|
||||
// we optimistically update here
|
||||
onMutate: async () => {
|
||||
// cancel ongoing queries
|
||||
@@ -192,6 +197,7 @@ export default function EventListWrapper() {
|
||||
});
|
||||
|
||||
const applyDelay = useMutation(requestApplyDelay, {
|
||||
networkMode: 'always',
|
||||
// Mutation finished, failed or successful
|
||||
onSettled: () => {
|
||||
queryClient.invalidateQueries(EVENTS_TABLE);
|
||||
@@ -199,6 +205,7 @@ export default function EventListWrapper() {
|
||||
});
|
||||
|
||||
const reorderEvent = useMutation(requestReorder, {
|
||||
networkMode: 'always',
|
||||
// we optimistically update here
|
||||
onMutate: async (data) => {
|
||||
// cancel ongoing queries
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { stringify } from 'csv-stringify/browser/esm/sync';
|
||||
|
||||
/**
|
||||
* @description parses a field for export
|
||||
* @param {string} field
|
||||
@@ -99,9 +101,6 @@ export const makeTable = (headerData, tableData, userFields) => {
|
||||
*/
|
||||
export const makeCSV = (arrayOfArrays) => {
|
||||
let csvData = 'data:text/csv;charset=utf-8,';
|
||||
arrayOfArrays.forEach((rowArray) => {
|
||||
const row = rowArray.join(',');
|
||||
csvData += `${row}\n`;
|
||||
});
|
||||
return csvData;
|
||||
const stringifiedData = stringify(arrayOfArrays);
|
||||
return csvData + stringifiedData;
|
||||
};
|
||||
|
||||
@@ -2403,6 +2403,11 @@ csstype@^3.0.2:
|
||||
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.10.tgz#2ad3a7bed70f35b965707c092e5f30b327c290e5"
|
||||
integrity sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA==
|
||||
|
||||
csv-stringify@^6.2.3:
|
||||
version "6.2.3"
|
||||
resolved "https://registry.yarnpkg.com/csv-stringify/-/csv-stringify-6.2.3.tgz#fefd25e66fd48f8f42f43b85a66a4663a2c3e796"
|
||||
integrity sha512-4qGjUMwnlaRc00gc2jrIYh2w/h1fo25B0mTuY9K8fBiIgtmCX3LcgUbrEGViL98Ci4Se/F5LFEtu8k+dItJVZQ==
|
||||
|
||||
data-urls@^3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-3.0.2.tgz#9cf24a477ae22bcef5cd5f6f0bfbc1d2d3be9143"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ontime",
|
||||
"version": "1.9.6",
|
||||
"version": "1.10.0",
|
||||
"author": "Carlos Valente",
|
||||
"description": "Time keeping for live events",
|
||||
"repository": "https://github.com/cpvalente/ontime",
|
||||
|
||||
Reference in New Issue
Block a user