-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added ZSCustomField to replace data-name-field attribute - Added proper support for booleans (fixed some issues) - Allow custom types in MapFieldTypeToElement - Added globalClassName to easily style all forms - Cleaned up form-config by moving queryClient
- Loading branch information
1 parent
67dc529
commit 677ee34
Showing
10 changed files
with
191 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
form { | ||
.mantine-Checkbox-root { | ||
@apply my-2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { MutationCache, QueryCache, QueryClient } from '@tanstack/react-query'; | ||
import { TRPCClientError } from '@trpc/client'; | ||
import { toast } from 'sonner'; | ||
|
||
// Query Client with UI notification logging | ||
export const queryClient = new QueryClient({ | ||
defaultOptions: { | ||
queries: { | ||
retry: true, | ||
staleTime: 1000 * 60 * 5, // 5 minutes | ||
gcTime: 1000 * 60 * 60 * 24, // 1 day | ||
}, | ||
}, | ||
queryCache: new QueryCache({ | ||
onError: (error, query) => { | ||
if (error instanceof TRPCClientError) { | ||
console.error('trpc query error'); | ||
console.dir(error); | ||
toast.error(`TRPC Server Error: ${error.message}`); | ||
} else { | ||
console.error('ZenStack query error'); | ||
// @ts-expect-error Need to find correct type for error | ||
const message = error['info']['message']; | ||
console.error('ZenStack Server Error:', message); | ||
toast.error(`ZenStack Server Error: ${message}`); | ||
} | ||
}, | ||
}), | ||
mutationCache: new MutationCache({ | ||
onError: (error, mutation) => { | ||
if (error instanceof TRPCClientError) { | ||
console.error('trpc mutation error'); | ||
console.error('TRPC Server Error:', error.message); | ||
toast.error(`TRPC Server Error: ${error.message}`); | ||
} else { | ||
console.error('ZenStack mutation error'); | ||
// @ts-expect-error Need to find correct type for error | ||
const message = error['info']['message']; | ||
console.error('ZenStack Server Error:', message); | ||
toast.error(`ZenStack Server Error: ${message}`); | ||
} | ||
}, | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.