Update packages and refactored code for improved performance
Updated versions of various packages including "@tanstack/react-query", "@typescript-eslint/eslint-plugin", "@typescript-eslint/parser", and "@marsidev/react-turnstile". Additionally, refactored the code in several files including package.json, members-page.loader.ts, page.tsx to ensure proper import statements and optimal function execution order.
This commit is contained in:
@@ -4,7 +4,6 @@ import { notFound, redirect } from 'next/navigation';
|
||||
|
||||
import { getBillingGatewayProvider } from '@kit/billing-gateway';
|
||||
import { BillingSessionStatus } from '@kit/billing-gateway/components';
|
||||
import { requireUser } from '@kit/supabase/require-user';
|
||||
import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client';
|
||||
|
||||
import billingConfig from '~/config/billing.config';
|
||||
|
||||
@@ -2,10 +2,9 @@ import 'server-only';
|
||||
|
||||
import { SupabaseClient } from '@supabase/supabase-js';
|
||||
|
||||
import { loadTeamWorkspace } from '~/home/[account]/_lib/server/team-account-workspace.loader';
|
||||
import { Database } from '~/lib/database.types';
|
||||
|
||||
import { loadTeamWorkspace } from '../../../_lib/server/team-account-workspace.loader';
|
||||
|
||||
/**
|
||||
* Load data for the members page
|
||||
* @param client
|
||||
@@ -16,10 +15,10 @@ export async function loadMembersPageData(
|
||||
slug: string,
|
||||
) {
|
||||
return Promise.all([
|
||||
loadTeamWorkspace(slug),
|
||||
loadAccountMembers(client, slug),
|
||||
loadInvitations(client, slug),
|
||||
canAddMember,
|
||||
loadTeamWorkspace(slug),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ import { If } from '@kit/ui/if';
|
||||
import { PageBody } from '@kit/ui/page';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
import { loadTeamWorkspace } from '~/home/[account]/_lib/server/team-account-workspace.loader';
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
@@ -44,9 +43,7 @@ export const generateMetadata = async () => {
|
||||
async function TeamAccountMembersPage({ params }: Params) {
|
||||
const client = getSupabaseServerComponentClient();
|
||||
|
||||
const { user } = await loadTeamWorkspace(params.account);
|
||||
|
||||
const [{ account }, members, invitations, canAddMember] =
|
||||
const [members, invitations, canAddMember, { user, account }] =
|
||||
await loadMembersPageData(client, params.account);
|
||||
|
||||
const canManageRoles = account.permissions.includes('roles.manage');
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client';
|
||||
import { createTeamAccountsApi } from '@kit/team-accounts/api';
|
||||
import { TeamAccountSettingsContainer } from '@kit/team-accounts/components';
|
||||
import { PageBody } from '@kit/ui/page';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
@@ -7,7 +9,6 @@ import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
|
||||
// local imports
|
||||
import { TeamAccountLayoutPageHeader } from '../_components/team-account-layout-page-header';
|
||||
import { loadTeamWorkspace } from '../_lib/server/team-account-workspace.loader';
|
||||
|
||||
export const generateMetadata = async () => {
|
||||
const i18n = await createI18nServerInstance();
|
||||
@@ -29,14 +30,15 @@ const paths = {
|
||||
};
|
||||
|
||||
async function TeamAccountSettingsPage(props: Props) {
|
||||
const data = await loadTeamWorkspace(props.params.account);
|
||||
const api = createTeamAccountsApi(getSupabaseServerComponentClient());
|
||||
const data = await api.getTeamAccount(props.params.account);
|
||||
|
||||
const account = {
|
||||
id: data.account.id,
|
||||
name: data.account.name,
|
||||
pictureUrl: data.account.picture_url,
|
||||
slug: data.account.slug,
|
||||
primaryOwnerUserId: data.account.primary_owner_user_id,
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
pictureUrl: data.picture_url,
|
||||
slug: data.slug as string,
|
||||
primaryOwnerUserId: data.primary_owner_user_id,
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -52,10 +52,10 @@
|
||||
"@kit/ui": "workspace:^",
|
||||
"@makerkit/data-loader-supabase-core": "^0.0.8",
|
||||
"@makerkit/data-loader-supabase-nextjs": "^1.2.3",
|
||||
"@marsidev/react-turnstile": "^0.6.1",
|
||||
"@marsidev/react-turnstile": "^0.7.0",
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"@supabase/supabase-js": "^2.43.4",
|
||||
"@tanstack/react-query": "5.40.0",
|
||||
"@tanstack/react-query": "5.40.1",
|
||||
"@tanstack/react-query-next-experimental": "^5.40.0",
|
||||
"@tanstack/react-table": "^8.17.3",
|
||||
"date-fns": "^3.6.0",
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@stripe/react-stripe-js": "^2.7.1",
|
||||
"@stripe/stripe-js": "^3.4.0",
|
||||
"stripe": "^15.8.0"
|
||||
"@stripe/stripe-js": "^3.5.0",
|
||||
"stripe": "^15.9.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kit/billing": "workspace:^",
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
"@kit/ui": "workspace:^",
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"@supabase/supabase-js": "^2.43.4",
|
||||
"@tanstack/react-query": "5.40.0",
|
||||
"@tanstack/react-query": "5.40.1",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"lucide-react": "^0.383.0",
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"@makerkit/data-loader-supabase-core": "^0.0.8",
|
||||
"@makerkit/data-loader-supabase-nextjs": "^1.2.3",
|
||||
"@supabase/supabase-js": "^2.43.4",
|
||||
"@tanstack/react-query": "5.40.0",
|
||||
"@tanstack/react-query": "5.40.1",
|
||||
"@tanstack/react-table": "^8.17.3",
|
||||
"@types/react": "^18.3.3",
|
||||
"lucide-react": "^0.383.0",
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
"@kit/tailwind-config": "workspace:*",
|
||||
"@kit/tsconfig": "workspace:*",
|
||||
"@kit/ui": "workspace:^",
|
||||
"@marsidev/react-turnstile": "^0.6.1",
|
||||
"@marsidev/react-turnstile": "^0.7.0",
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"@supabase/supabase-js": "^2.43.4",
|
||||
"@tanstack/react-query": "5.40.0",
|
||||
"@tanstack/react-query": "5.40.1",
|
||||
"@types/react": "^18.3.3",
|
||||
"lucide-react": "^0.383.0",
|
||||
"next": "14.2.3",
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"@kit/tsconfig": "workspace:*",
|
||||
"@kit/ui": "workspace:*",
|
||||
"@supabase/supabase-js": "^2.43.4",
|
||||
"@tanstack/react-query": "5.40.0",
|
||||
"@tanstack/react-query": "5.40.1",
|
||||
"@types/react": "^18.3.3",
|
||||
"lucide-react": "^0.383.0",
|
||||
"react": "18.3.1",
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
"@kit/tsconfig": "workspace:*",
|
||||
"@kit/ui": "workspace:^",
|
||||
"@supabase/supabase-js": "^2.43.4",
|
||||
"@tanstack/react-query": "5.40.0",
|
||||
"@tanstack/react-query": "5.40.1",
|
||||
"@tanstack/react-table": "^8.17.3",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"@kit/shared": "workspace:^",
|
||||
"@kit/tailwind-config": "workspace:*",
|
||||
"@kit/tsconfig": "workspace:*",
|
||||
"@tanstack/react-query": "5.40.0",
|
||||
"@tanstack/react-query": "5.40.1",
|
||||
"react-i18next": "^14.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"@supabase/gotrue-js": "2.62.2",
|
||||
"@supabase/ssr": "^0.3.0",
|
||||
"@supabase/supabase-js": "^2.43.4",
|
||||
"@tanstack/react-query": "5.40.0",
|
||||
"@tanstack/react-query": "5.40.1",
|
||||
"@types/react": "^18.3.3",
|
||||
"next": "14.2.3",
|
||||
"react": "18.3.1",
|
||||
|
||||
1185
pnpm-lock.yaml
generated
1185
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -16,8 +16,8 @@
|
||||
"@next/eslint-plugin-next": "^14.2.3",
|
||||
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
||||
"@types/eslint": "^8.56.10",
|
||||
"@typescript-eslint/eslint-plugin": "^7.11.0",
|
||||
"@typescript-eslint/parser": "^7.11.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.12.0",
|
||||
"@typescript-eslint/parser": "^7.12.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-config-turbo": "^1.13.3",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
|
||||
Reference in New Issue
Block a user