diff --git a/.changeset/big-corners-act.md b/.changeset/big-corners-act.md new file mode 100644 index 000000000..ff00fe219 --- /dev/null +++ b/.changeset/big-corners-act.md @@ -0,0 +1,5 @@ +--- +'@baseplate-dev/react-generators': patch +--- + +Add a default pending component to router diff --git a/packages/react-generators/src/generators/core/react-router/templates/src/app/router.tsx b/packages/react-generators/src/generators/core/react-router/templates/src/app/router.tsx index 1ec44fcbc..94a2a6a15 100644 --- a/packages/react-generators/src/generators/core/react-router/templates/src/app/router.tsx +++ b/packages/react-generators/src/generators/core/react-router/templates/src/app/router.tsx @@ -3,7 +3,12 @@ import type { ErrorRouteComponent } from '@tanstack/react-router'; import { routeTree } from '$routeTree'; -import { Button, ErrorDisplay, NotFoundCard } from '%reactComponentsImports'; +import { + Button, + ErrorDisplay, + Loader, + NotFoundCard, +} from '%reactComponentsImports'; import { createRouter } from '@tanstack/react-router'; function ErrorComponent({ @@ -26,6 +31,7 @@ export const router = createRouter({ routeTree, defaultNotFoundComponent: NotFoundCard, defaultErrorComponent: ErrorComponent, + defaultPendingComponent: Loader, TPL_ADDITIONAL_ROUTER_OPTIONS, }); diff --git a/plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/extractor.json b/plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/extractor.json index c2bf44e38..cfc119ced 100644 --- a/plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/extractor.json +++ b/plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/extractor.json @@ -25,7 +25,7 @@ "fileOptions": { "kind": "singleton" }, "pathRootRelativePath": "{routes-root}/-components/password-reset-dialog.gql", "sourceFile": "routes/-components/password-reset-dialog.gql", - "variables": {} + "variables": { "TPL_USER_ROW_FRAGMENT": {} } } } } diff --git a/plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.ts b/plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.ts index a6a745fd2..bebf9ced2 100644 --- a/plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.ts +++ b/plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.ts @@ -37,7 +37,7 @@ const passwordResetDialogGql = createTextTemplateFile({ '../templates/routes/-components/password-reset-dialog.gql', ), }, - variables: {}, + variables: { TPL_USER_ROW_FRAGMENT: {} }, }); export const LOCAL_AUTH_ADMIN_ADMIN_CRUD_RESET_PASSWORD_ACTION_TEMPLATES = { diff --git a/plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.gql b/plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.gql index 2eea2ad59..216d02f0a 100644 --- a/plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.gql +++ b/plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.gql @@ -1,9 +1,7 @@ mutation ResetUserPassword($input: ResetUserPasswordInput!) { resetUserPassword(input: $input) { user { - id - name - email + ...TPL_USER_ROW_FRAGMENT } } }