diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/files/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/files/page.tsx index f6d6966ba..39939107b 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/files/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/files/page.tsx @@ -1,64 +1,8 @@ -import { getTranslations } from 'next-intl/server'; -import { Metadata } from 'next'; -import { Card } from 'vitnode-frontend/components/ui/card'; -import { fetcher } from 'vitnode-frontend/graphql/fetcher'; -import { HeaderContent } from 'vitnode-frontend/components/ui/header-content'; - -import { - Admin__Core_Files__Show, - ShowCoreFilesSortingColumnEnum, - Admin__Core_Files__ShowQuery, - Admin__Core_Files__ShowQueryVariables, -} from '@/graphql/hooks'; import { - usePaginationAPISsr, - SearchParamsPagination, -} from '@/plugins/core/hooks/utils/use-pagination-api-ssr'; -import { FilesAdvancedCoreAdminView } from '@/plugins/admin/views/core/advanced/files/files-advanced-core-admin-view'; - -const getData = async (variables: Admin__Core_Files__ShowQueryVariables) => { - const { data } = await fetcher< - Admin__Core_Files__ShowQuery, - Admin__Core_Files__ShowQueryVariables - >({ - query: Admin__Core_Files__Show, - variables, - }); - - return data; -}; - -interface Props { - searchParams: SearchParamsPagination; -} - -export async function generateMetadata(): Promise { - const t = await getTranslations('admin.core.advanced.files'); - - return { - title: t('title'), - }; -} - -export default async function Page({ searchParams }: Props) { - const variables = usePaginationAPISsr({ - searchParams, - defaultPageSize: 10, - search: true, - sortByEnum: ShowCoreFilesSortingColumnEnum, - }); - const [t, data] = await Promise.all([ - getTranslations('admin.core.advanced.files'), - getData(variables), - ]); - - return ( - <> - + FilesAdvancedCoreAdminView, + FilesAdvancedCoreAdminViewProps, +} from 'vitnode-frontend/admin/core/advanced/files/files-advanced-core-admin-view'; - - - - - ); +export default function Page(props: FilesAdvancedCoreAdminViewProps) { + return ; } diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/layout.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/layout.tsx deleted file mode 100644 index aaf87f177..000000000 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/layout.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { getTranslations } from 'next-intl/server'; -import * as React from 'react'; -import { Metadata } from 'next'; -import { getConfigFile } from 'vitnode-frontend/helpers/config'; - -interface Props { - children: React.ReactNode; -} - -export async function generateMetadata(): Promise { - const [t, tCore, config] = await Promise.all([ - getTranslations('admin'), - getTranslations('core.admin'), - getConfigFile(), - ]); - - const defaultTitle = `${tCore('nav.advanced')} - ${t('title_short')} - ${config.settings.general.site_name}`; - - return { - title: { - template: `%s - ${defaultTitle}`, - absolute: defaultTitle, - }, - }; -} - -export default async function Layout({ children }: Props) { - return children; -} diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/langs/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/langs/page.tsx index fff6a0d99..487a00e62 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/langs/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/langs/page.tsx @@ -1,72 +1,8 @@ -import { Metadata } from 'next'; -import { getTranslations } from 'next-intl/server'; -import { Card } from 'vitnode-frontend/components/ui/card'; -import { fetcher } from 'vitnode-frontend/graphql/fetcher'; -import { HeaderContent } from 'vitnode-frontend/components/ui/header-content'; - -import { - Core_Languages__Show, - ShowCoreLanguagesSortingColumnEnum, - Core_Languages__ShowQuery, - Core_Languages__ShowQueryVariables, -} from '@/graphql/hooks'; import { - usePaginationAPISsr, - SearchParamsPagination, -} from '@/plugins/core/hooks/utils/use-pagination-api-ssr'; -import { ActionsLangsAdmin } from '@/plugins/admin/views/core/langs/actions/actions'; -import { RebuildRequiredAdmin } from '@/plugins/admin/global/rebuild-required'; -import { LangsCoreAdminView } from '@/plugins/admin/views/core/langs/langs-core-admin-view'; - -const getData = async (variables: Core_Languages__ShowQueryVariables) => { - const { data } = await fetcher< - Core_Languages__ShowQuery, - Core_Languages__ShowQueryVariables - >({ - query: Core_Languages__Show, - variables, - }); - - return data; -}; -interface Props { - params: { - locale: string; - }; - searchParams: SearchParamsPagination; -} - -export async function generateMetadata(): Promise { - const t = await getTranslations('admin.core.langs'); - - return { - title: t('title'), - }; -} - -export default async function Page({ searchParams }: Props) { - const variables = usePaginationAPISsr({ - searchParams, - defaultPageSize: 10, - search: true, - sortByEnum: ShowCoreLanguagesSortingColumnEnum, - }); - - const [t, data] = await Promise.all([ - getTranslations('admin.core.langs'), - getData(variables), - ]); - - return ( - <> - - - + LangsCoreAdminView, + LangsCoreAdminViewProps, +} from 'vitnode-frontend/admin/core/langs/langs-core-admin-view'; - - - - - - ); +export default function Page(props: LangsCoreAdminViewProps) { + return ; } diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/download/hooks/query-api.ts b/apps/frontend/plugins/admin/views/core/langs/table/actions/download/hooks/query-api.ts deleted file mode 100644 index d0db525f1..000000000 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/download/hooks/query-api.ts +++ /dev/null @@ -1,23 +0,0 @@ -'use server'; - -import { fetcher } from 'vitnode-frontend/graphql/fetcher'; - -import { - Admin__Core_Plugins__Show, - Admin__Core_Plugins__ShowQuery, - Admin__Core_Plugins__ShowQueryVariables, -} from '@/graphql/hooks'; - -export const queryApi = async ( - variables: Admin__Core_Plugins__ShowQueryVariables, -) => { - const { data } = await fetcher< - Admin__Core_Plugins__ShowQuery, - Admin__Core_Plugins__ShowQueryVariables - >({ - query: Admin__Core_Plugins__Show, - variables, - }); - - return data; -}; diff --git a/apps/frontend/plugins/core/graphql/queries/languages/core_languages__show.gql b/apps/frontend/plugins/core/graphql/queries/languages/core_languages__show.gql index 68e2402e2..a19e943f3 100644 --- a/apps/frontend/plugins/core/graphql/queries/languages/core_languages__show.gql +++ b/apps/frontend/plugins/core/graphql/queries/languages/core_languages__show.gql @@ -1,4 +1,4 @@ -query Core_languages__show( +query Admin_Core_languages__show( $first: Int $last: Int $cursor: Int diff --git a/packages/frontend/src/components/ui/user/user-input.tsx b/packages/frontend/src/components/ui/user/user-input.tsx index 861a17937..97ea96d2b 100644 --- a/packages/frontend/src/components/ui/user/user-input.tsx +++ b/packages/frontend/src/components/ui/user/user-input.tsx @@ -1,15 +1,13 @@ import * as React from 'react'; import { useTranslations } from 'next-intl'; import { X } from 'lucide-react'; -import { cn } from 'vitnode-frontend/helpers/classnames'; -import { Button } from 'vitnode-frontend/components/ui/button'; -import { Loader } from 'vitnode-frontend/components/ui/loader'; -import { - Popover, - PopoverContent, - PopoverTrigger, -} from 'vitnode-frontend/components/ui/popover'; -import { Badge } from 'vitnode-frontend/components/ui/badge'; + +import { Popover, PopoverContent, PopoverTrigger } from '../popover'; +import { Button } from '../button'; +import { Loader } from '../loader'; +import { Badge } from '../badge'; + +import { cn } from '../../../helpers/classnames'; const UserInputContent = React.lazy(async () => import('../../../utils/components/user/user-input/content').then(module => ({ diff --git a/packages/frontend/src/graphql/code.ts b/packages/frontend/src/graphql/code.ts index 73531ddb5..7dcc25b58 100644 --- a/packages/frontend/src/graphql/code.ts +++ b/packages/frontend/src/graphql/code.ts @@ -1147,6 +1147,62 @@ export type User = { export type UserOrGroupCoreStaffUnion = StaffGroupUser | User; +export type Admin__Core_Files__DeleteMutationVariables = Exact<{ + id: Scalars['Int']['input']; +}>; + + +export type Admin__Core_Files__DeleteMutation = { __typename?: 'Mutation', admin__core_files__delete: string }; + +export type Admin__Core_Languages__CreateMutationVariables = Exact<{ + code: Scalars['String']['input']; + name: Scalars['String']['input']; + timezone: Scalars['String']['input']; + locale: Scalars['String']['input']; + time24: Scalars['Boolean']['input']; + allowInInput: Scalars['Boolean']['input']; +}>; + + +export type Admin__Core_Languages__CreateMutation = { __typename?: 'Mutation', admin__core_languages__create: { __typename?: 'ShowCoreLanguages', code: string, id: number, name: string } }; + +export type Admin__Core_Languages__DeleteMutationVariables = Exact<{ + code: Scalars['String']['input']; +}>; + + +export type Admin__Core_Languages__DeleteMutation = { __typename?: 'Mutation', admin__core_languages__delete: string }; + +export type Admin__Core_Languages__DownloadMutationVariables = Exact<{ + code: Scalars['String']['input']; + plugins: Array | Scalars['String']['input']; +}>; + + +export type Admin__Core_Languages__DownloadMutation = { __typename?: 'Mutation', admin__core_languages__download: string }; + +export type Admin__Core_Languages__EditMutationVariables = Exact<{ + default: Scalars['Boolean']['input']; + enabled: Scalars['Boolean']['input']; + id: Scalars['Int']['input']; + name: Scalars['String']['input']; + timezone: Scalars['String']['input']; + locale: Scalars['String']['input']; + time24: Scalars['Boolean']['input']; + allowInInput: Scalars['Boolean']['input']; +}>; + + +export type Admin__Core_Languages__EditMutation = { __typename?: 'Mutation', admin__core_languages__edit: { __typename?: 'ShowCoreLanguages', code: string, default: boolean, enabled: boolean, id: number, name: string, protected: boolean, timezone: string } }; + +export type Admin__Core_Languages__UpdateMutationVariables = Exact<{ + code: Scalars['String']['input']; + file: Scalars['Upload']['input']; +}>; + + +export type Admin__Core_Languages__UpdateMutation = { __typename?: 'Mutation', admin__core_languages__update: string }; + export type Admin_Sessions__Sign_OutMutationVariables = Exact<{ [key: string]: never; }>; @@ -1216,6 +1272,17 @@ export type Admin__Sessions__AuthorizationQueryVariables = Exact<{ [key: string] export type Admin__Sessions__AuthorizationQuery = { __typename?: 'Query', admin__sessions__authorization: { __typename?: 'AuthorizationAdminSessionsObj', version: string, user?: { __typename?: 'AuthorizationCurrentUserObj', email: string, id: number, name_seo: string, is_admin: boolean, is_mod: boolean, name: string, newsletter: boolean, avatar_color: string, avatar?: { __typename?: 'AvatarUser', id: number, dir_folder: string, file_name: string } | null, group: { __typename?: 'GroupUser', id: number, name: Array<{ __typename?: 'TextLanguage', language_code: string, value: string }> } } | null, nav: Array<{ __typename?: 'NavAdminPluginsAuthorization', code: string, nav: Array<{ __typename?: 'ShowAdminNavPluginsObj', code: string, href: string, icon?: string | null, children?: Array<{ __typename?: 'ShowAdminNavPlugins', code: string, href: string }> | null }> }> } }; +export type Admin__Core_Files__ShowQueryVariables = Exact<{ + cursor?: InputMaybe; + first?: InputMaybe; + sortBy?: InputMaybe; + last?: InputMaybe; + search?: InputMaybe; +}>; + + +export type Admin__Core_Files__ShowQuery = { __typename?: 'Query', admin__core_files__show: { __typename?: 'ShowAdminFilesObj', pageInfo: { __typename?: 'PageInfo', count: number, endCursor?: number | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: number | null, totalCount: number }, edges: Array<{ __typename?: 'ShowAdminFiles', count_uses: number, created: Date, dir_folder: string, extension: string, file_alt?: string | null, file_name: string, file_name_original: string, file_size: number, height?: number | null, id: number, mimetype: string, security_key?: string | null, width?: number | null, user: { __typename?: 'User', id: number, name: string, name_seo: string } }> } }; + export type Admin__Core_Groups__Show_ShortQueryVariables = Exact<{ first?: InputMaybe; search?: InputMaybe; @@ -1229,6 +1296,28 @@ export type Admin__Install__LayoutQueryVariables = Exact<{ [key: string]: never; export type Admin__Install__LayoutQuery = { __typename?: 'Query', admin__install__layout: { __typename?: 'LayoutAdminInstallObj', status: LayoutAdminInstallEnum } }; +export type Admin__Core_Languages__ShowQueryVariables = Exact<{ + first?: InputMaybe; + last?: InputMaybe; + cursor?: InputMaybe; + search?: InputMaybe; + sortBy?: InputMaybe; +}>; + + +export type Admin__Core_Languages__ShowQuery = { __typename?: 'Query', core_languages__show: { __typename?: 'ShowCoreLanguagesObj', edges: Array<{ __typename?: 'ShowCoreLanguages', code: string, default: boolean, allow_in_input: boolean, enabled: boolean, id: number, name: string, protected: boolean, timezone: string, locale: string, time_24: boolean, updated: Date, created: Date }>, pageInfo: { __typename?: 'PageInfo', count: number, endCursor?: number | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: number | null, totalCount: number } } }; + +export type Admin__Core_Plugins__Show__QuickQueryVariables = Exact<{ + cursor?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + sortBy?: InputMaybe; + search?: InputMaybe; +}>; + + +export type Admin__Core_Plugins__Show__QuickQuery = { __typename?: 'Query', admin__core_plugins__show: { __typename?: 'ShowAdminPluginsObj', edges: Array<{ __typename?: 'ShowAdminPlugins', code: string, name: string, version?: string | null, created: Date, version_code?: number | null }> } }; + export type Core_MiddlewareQueryVariables = Exact<{ [key: string]: never; }>; @@ -1272,6 +1361,64 @@ export type Core_Members__Show__SearchQueryVariables = Exact<{ export type Core_Members__Show__SearchQuery = { __typename?: 'Query', core_members__show: { __typename?: 'ShowCoreMembersObj', edges: Array<{ __typename?: 'ShowCoreMembers', avatar_color: string, id: number, name: string, name_seo: string, avatar?: { __typename?: 'AvatarUser', id: number, dir_folder: string, file_name: string } | null, group: { __typename?: 'GroupUser', id: number, name: Array<{ __typename?: 'TextLanguage', language_code: string, value: string }> } }> } }; +export const Admin__Core_Files__Delete = gql` + mutation Admin__core_files__delete($id: Int!) { + admin__core_files__delete(id: $id) +} + `; +export const Admin__Core_Languages__Create = gql` + mutation Admin__core_languages__create($code: String!, $name: String!, $timezone: String!, $locale: String!, $time24: Boolean!, $allowInInput: Boolean!) { + admin__core_languages__create( + code: $code + name: $name + timezone: $timezone + locale: $locale + time_24: $time24 + allow_in_input: $allowInInput + ) { + code + id + name + } +} + `; +export const Admin__Core_Languages__Delete = gql` + mutation Admin__core_languages__delete($code: String!) { + admin__core_languages__delete(code: $code) +} + `; +export const Admin__Core_Languages__Download = gql` + mutation Admin__core_languages__download($code: String!, $plugins: [String!]!) { + admin__core_languages__download(code: $code, plugins: $plugins) +} + `; +export const Admin__Core_Languages__Edit = gql` + mutation Admin__core_languages__edit($default: Boolean!, $enabled: Boolean!, $id: Int!, $name: String!, $timezone: String!, $locale: String!, $time24: Boolean!, $allowInInput: Boolean!) { + admin__core_languages__edit( + default: $default + enabled: $enabled + id: $id + name: $name + timezone: $timezone + locale: $locale + time_24: $time24 + allow_in_input: $allowInInput + ) { + code + default + enabled + id + name + protected + timezone + } +} + `; +export const Admin__Core_Languages__Update = gql` + mutation Admin__core_languages__update($code: String!, $file: Upload!) { + admin__core_languages__update(code: $code, file: $file) +} + `; export const Admin_Sessions__Sign_Out = gql` mutation Admin_sessions__sign_out { admin_sessions__sign_out @@ -1386,6 +1533,46 @@ export const Admin__Sessions__Authorization = gql` } } `; +export const Admin__Core_Files__Show = gql` + query Admin__core_files__show($cursor: Int, $first: Int, $sortBy: ShowCoreFilesSortByArgs, $last: Int, $search: String) { + admin__core_files__show( + cursor: $cursor + first: $first + sortBy: $sortBy + last: $last + search: $search + ) { + pageInfo { + count + endCursor + hasNextPage + hasPreviousPage + startCursor + totalCount + } + edges { + count_uses + created + dir_folder + extension + file_alt + file_name + file_name_original + file_size + height + id + mimetype + security_key + user { + id + name + name_seo + } + width + } + } +} + `; export const Admin__Core_Groups__Show_Short = gql` query Admin__Core_groups__show_short($first: Int, $search: String) { admin__core_groups__show(first: $first, search: $search) { @@ -1407,6 +1594,59 @@ export const Admin__Install__Layout = gql` } } `; +export const Admin__Core_Languages__Show = gql` + query Admin__Core_languages__show($first: Int, $last: Int, $cursor: Int, $search: String, $sortBy: ShowCoreLanguagesSortByArgs) { + core_languages__show( + first: $first + last: $last + cursor: $cursor + search: $search + sortBy: $sortBy + ) { + edges { + code + default + allow_in_input + enabled + id + name + protected + timezone + locale + time_24 + updated + created + } + pageInfo { + count + endCursor + hasNextPage + hasPreviousPage + startCursor + totalCount + } + } +} + `; +export const Admin__Core_Plugins__Show__Quick = gql` + query Admin__core_plugins__show__quick($cursor: Int, $first: Int, $last: Int, $sortBy: ShowAdminPluginsSortByArgs, $search: String) { + admin__core_plugins__show( + cursor: $cursor + first: $first + last: $last + sortBy: $sortBy + search: $search + ) { + edges { + code + name + version + created + version_code + } + } +} + `; export const Core_Middleware = gql` query Core_middleware { core_languages__show { diff --git a/packages/frontend/src/graphql/get-users-short-api.ts b/packages/frontend/src/graphql/get-users-short-api.ts index 3135b4ce9..dabce4f98 100644 --- a/packages/frontend/src/graphql/get-users-short-api.ts +++ b/packages/frontend/src/graphql/get-users-short-api.ts @@ -1,12 +1,11 @@ 'use server'; -import { fetcher } from 'vitnode-frontend/graphql/fetcher'; - import { Core_Members__Show__Search, Core_Members__Show__SearchQuery, Core_Members__Show__SearchQueryVariables, } from '../graphql/code'; +import { fetcher } from './fetcher'; export const getUsersShortApi = async ( variables: Core_Members__Show__SearchQueryVariables, diff --git a/packages/frontend/src/graphql/mutations/admin/advanced/files/admin__core_files__delete.gql b/packages/frontend/src/graphql/mutations/admin/advanced/files/admin__core_files__delete.gql new file mode 100644 index 000000000..165698a3c --- /dev/null +++ b/packages/frontend/src/graphql/mutations/admin/advanced/files/admin__core_files__delete.gql @@ -0,0 +1,3 @@ +mutation Admin__core_files__delete($id: Int!) { + admin__core_files__delete(id: $id) +} diff --git a/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__create.gql b/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__create.gql new file mode 100644 index 000000000..6e8563dd3 --- /dev/null +++ b/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__create.gql @@ -0,0 +1,21 @@ +mutation Admin__core_languages__create( + $code: String! + $name: String! + $timezone: String! + $locale: String! + $time24: Boolean! + $allowInInput: Boolean! +) { + admin__core_languages__create( + code: $code + name: $name + timezone: $timezone + locale: $locale + time_24: $time24 + allow_in_input: $allowInInput + ) { + code + id + name + } +} diff --git a/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__delete.gql b/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__delete.gql new file mode 100644 index 000000000..819182c2d --- /dev/null +++ b/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__delete.gql @@ -0,0 +1,3 @@ +mutation Admin__core_languages__delete($code: String!) { + admin__core_languages__delete(code: $code) +} diff --git a/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__download.gql b/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__download.gql new file mode 100644 index 000000000..e64a83e87 --- /dev/null +++ b/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__download.gql @@ -0,0 +1,3 @@ +mutation Admin__core_languages__download($code: String!, $plugins: [String!]!) { + admin__core_languages__download(code: $code, plugins: $plugins) +} diff --git a/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__edit.gql b/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__edit.gql new file mode 100644 index 000000000..08f640c80 --- /dev/null +++ b/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__edit.gql @@ -0,0 +1,29 @@ +mutation Admin__core_languages__edit( + $default: Boolean! + $enabled: Boolean! + $id: Int! + $name: String! + $timezone: String! + $locale: String! + $time24: Boolean! + $allowInInput: Boolean! +) { + admin__core_languages__edit( + default: $default + enabled: $enabled + id: $id + name: $name + timezone: $timezone + locale: $locale + time_24: $time24 + allow_in_input: $allowInInput + ) { + code + default + enabled + id + name + protected + timezone + } +} diff --git a/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__update.gql b/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__update.gql new file mode 100644 index 000000000..1187372c0 --- /dev/null +++ b/packages/frontend/src/graphql/mutations/admin/languages/admin__core_languages__update.gql @@ -0,0 +1,3 @@ +mutation Admin__core_languages__update($code: String!, $file: Upload!) { + admin__core_languages__update(code: $code, file: $file) +} diff --git a/packages/frontend/src/graphql/queries/admin/advanced/files/admin__core_files__show.gql b/packages/frontend/src/graphql/queries/admin/advanced/files/admin__core_files__show.gql new file mode 100644 index 000000000..d4aee6da9 --- /dev/null +++ b/packages/frontend/src/graphql/queries/admin/advanced/files/admin__core_files__show.gql @@ -0,0 +1,44 @@ +query Admin__core_files__show( + $cursor: Int + $first: Int + $sortBy: ShowCoreFilesSortByArgs + $last: Int + $search: String +) { + admin__core_files__show( + cursor: $cursor + first: $first + sortBy: $sortBy + last: $last + search: $search + ) { + pageInfo { + count + endCursor + hasNextPage + hasPreviousPage + startCursor + totalCount + } + edges { + count_uses + created + dir_folder + extension + file_alt + file_name + file_name_original + file_size + height + id + mimetype + security_key + user { + id + name + name_seo + } + width + } + } +} diff --git a/packages/frontend/src/graphql/queries/admin/languages/admin__core_languages__show.gql b/packages/frontend/src/graphql/queries/admin/languages/admin__core_languages__show.gql new file mode 100644 index 000000000..54855b1e0 --- /dev/null +++ b/packages/frontend/src/graphql/queries/admin/languages/admin__core_languages__show.gql @@ -0,0 +1,38 @@ +query Admin__Core_languages__show( + $first: Int + $last: Int + $cursor: Int + $search: String + $sortBy: ShowCoreLanguagesSortByArgs +) { + core_languages__show( + first: $first + last: $last + cursor: $cursor + search: $search + sortBy: $sortBy + ) { + edges { + code + default + allow_in_input + enabled + id + name + protected + timezone + locale + time_24 + updated + created + } + pageInfo { + count + endCursor + hasNextPage + hasPreviousPage + startCursor + totalCount + } + } +} diff --git a/packages/frontend/src/graphql/queries/admin/languages/admin__core_plugins__show__quick.gql b/packages/frontend/src/graphql/queries/admin/languages/admin__core_plugins__show__quick.gql new file mode 100644 index 000000000..d57b926f0 --- /dev/null +++ b/packages/frontend/src/graphql/queries/admin/languages/admin__core_plugins__show__quick.gql @@ -0,0 +1,23 @@ +query Admin__core_plugins__show__quick( + $cursor: Int + $first: Int + $last: Int + $sortBy: ShowAdminPluginsSortByArgs + $search: String +) { + admin__core_plugins__show( + cursor: $cursor + first: $first + last: $last + sortBy: $sortBy + search: $search + ) { + edges { + code + name + version + created + version_code + } + } +} diff --git a/apps/frontend/plugins/admin/views/core/advanced/files/actions/actions.tsx b/packages/frontend/src/views/admin/views/core/advanced/files/actions/actions.tsx similarity index 78% rename from apps/frontend/plugins/admin/views/core/advanced/files/actions/actions.tsx rename to packages/frontend/src/views/admin/views/core/advanced/files/actions/actions.tsx index 395a9defd..b31681965 100644 --- a/apps/frontend/plugins/admin/views/core/advanced/files/actions/actions.tsx +++ b/packages/frontend/src/views/admin/views/core/advanced/files/actions/actions.tsx @@ -1,17 +1,18 @@ import { Download } from 'lucide-react'; import { useTranslations } from 'next-intl'; -import { Link } from 'vitnode-frontend/navigation'; -import { buttonVariants } from 'vitnode-frontend/components/ui/button'; + +import { DeleteActionFilesAdvancedCoreAdmin } from './delete/delete'; + +import { Admin__Core_Files__ShowQuery } from '../../../../../../../graphql/code'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, -} from 'vitnode-frontend/components/ui/tooltip'; -import { CONFIG } from 'vitnode-frontend/helpers/config-with-env'; - -import { Admin__Core_Files__ShowQuery } from '@/graphql/hooks'; -import { DeleteActionFilesAdvancedCoreAdmin } from './delete/delete'; +} from '../../../../../../../components/ui/tooltip'; +import { Link } from '../../../../../../../navigation'; +import { buttonVariants } from '../../../../../../../components/ui/button'; +import { CONFIG } from '../../../../../../../helpers/config-with-env'; export const ActionsFilesAdvancedCoreAdmin = ( data: Admin__Core_Files__ShowQuery['admin__core_files__show']['edges'][0], diff --git a/apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/content.tsx b/packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/content.tsx similarity index 89% rename from apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/content.tsx rename to packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/content.tsx index 9f40b0f3d..6ab91e7a4 100644 --- a/apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/content.tsx +++ b/packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/content.tsx @@ -1,16 +1,17 @@ import { useTranslations } from 'next-intl'; -import { Button } from 'vitnode-frontend/components/ui/button'; + +import { SubmitDeleteActionFilesAdvancedCoreAdmin } from './submit'; +import { useDeleteFileAdvancedAdmin } from './hooks/use-delete-file-advanced-admin'; + +import { Admin__Core_Files__ShowQuery } from '../../../../../../../../graphql/code'; import { AlertDialogCancel, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, -} from 'vitnode-frontend/components/ui/alert-dialog'; - -import { SubmitDeleteActionFilesAdvancedCoreAdmin } from './submit'; -import { useDeleteFileAdvancedAdmin } from './hooks/use-delete-file-advanced-admin'; -import { Admin__Core_Files__ShowQuery } from '@/graphql/hooks'; +} from '../../../../../../../../components/ui/alert-dialog'; +import { Button } from '../../../../../../../../components/ui/button'; export interface ContentDeleteActionFilesAdvancedCoreAdminProps extends Pick< diff --git a/apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/delete.tsx b/packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/delete.tsx similarity index 83% rename from apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/delete.tsx rename to packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/delete.tsx index 1ff5985e5..6ff6488c6 100644 --- a/apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/delete.tsx +++ b/packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/delete.tsx @@ -1,21 +1,22 @@ import { Trash2 } from 'lucide-react'; import { useTranslations } from 'next-intl'; import * as React from 'react'; + +import { ContentDeleteActionFilesAdvancedCoreAdminProps } from './content'; + import { AlertDialog, AlertDialogContent, AlertDialogTrigger, -} from 'vitnode-frontend/components/ui/alert-dialog'; -import { Button } from 'vitnode-frontend/components/ui/button'; +} from '../../../../../../../../components/ui/alert-dialog'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, -} from 'vitnode-frontend/components/ui/tooltip'; -import { Loader } from 'vitnode-frontend/components/ui/loader'; - -import { ContentDeleteActionFilesAdvancedCoreAdminProps } from './content'; +} from '../../../../../../../../components/ui/tooltip'; +import { Button } from '../../../../../../../../components/ui/button'; +import { Loader } from '../../../../../../../../components/ui/loader'; const Content = React.lazy(async () => import('./content').then(module => ({ diff --git a/apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/hooks/mutation-api.ts b/packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/hooks/mutation-api.ts similarity index 84% rename from apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/hooks/mutation-api.ts rename to packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/hooks/mutation-api.ts index bd79d228c..b86600af1 100644 --- a/apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/hooks/mutation-api.ts +++ b/packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/hooks/mutation-api.ts @@ -1,13 +1,13 @@ 'use server'; import { revalidatePath } from 'next/cache'; -import { fetcher } from 'vitnode-frontend/graphql/fetcher'; +import { fetcher } from '../../../../../../../../../graphql/fetcher'; import { Admin__Core_Files__Delete, Admin__Core_Files__DeleteMutation, Admin__Core_Files__DeleteMutationVariables, -} from '@/graphql/hooks'; +} from '../../../../../../../../../graphql/code'; export const mutationApi = async ( variables: Admin__Core_Files__DeleteMutationVariables, diff --git a/apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/hooks/use-delete-file-advanced-admin.ts b/packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/hooks/use-delete-file-advanced-admin.ts similarity index 90% rename from apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/hooks/use-delete-file-advanced-admin.ts rename to packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/hooks/use-delete-file-advanced-admin.ts index fc969c249..97de8d45c 100644 --- a/apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/hooks/use-delete-file-advanced-admin.ts +++ b/packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/hooks/use-delete-file-advanced-admin.ts @@ -1,9 +1,10 @@ import { useTranslations } from 'next-intl'; import { toast } from 'sonner'; -import { useAlertDialog } from 'vitnode-frontend/components/ui/alert-dialog'; import { mutationApi } from './mutation-api'; +import { useAlertDialog } from '../../../../../../../../../components/ui/alert-dialog'; + interface Args { file_name_original: string; id: number; diff --git a/apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/submit.tsx b/packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/submit.tsx similarity index 84% rename from apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/submit.tsx rename to packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/submit.tsx index f147d1471..c0fd18d51 100644 --- a/apps/frontend/plugins/admin/views/core/advanced/files/actions/delete/submit.tsx +++ b/packages/frontend/src/views/admin/views/core/advanced/files/actions/delete/submit.tsx @@ -1,6 +1,7 @@ import { useTranslations } from 'next-intl'; import { useFormStatus } from 'react-dom'; -import { Button } from 'vitnode-frontend/components/ui/button'; + +import { Button } from '../../../../../../../../components/ui/button'; export const SubmitDeleteActionFilesAdvancedCoreAdmin = () => { const t = useTranslations('admin.core.advanced.files.delete'); diff --git a/apps/frontend/plugins/admin/views/core/advanced/files/files-advanced-core-admin-view.tsx b/packages/frontend/src/views/admin/views/core/advanced/files/content.tsx similarity index 89% rename from apps/frontend/plugins/admin/views/core/advanced/files/files-advanced-core-admin-view.tsx rename to packages/frontend/src/views/admin/views/core/advanced/files/content.tsx index 9bcf841d5..536c8333f 100644 --- a/apps/frontend/plugins/admin/views/core/advanced/files/files-advanced-core-admin-view.tsx +++ b/packages/frontend/src/views/admin/views/core/advanced/files/content.tsx @@ -6,22 +6,23 @@ import { useTranslations } from 'next-intl'; import Image from 'next/image'; import * as React from 'react'; import { formatBytes } from 'vitnode-shared'; -import { Link } from 'vitnode-frontend/navigation'; + +import { ActionsFilesAdvancedCoreAdmin } from './actions/actions'; + +import { Admin__Core_Files__ShowQuery } from '../../../../../../graphql/code'; +import { CONFIG } from '../../../../../../helpers/config-with-env'; +import { HeaderSortingDataTable } from '../../../../../../components/data-table/header'; +import { DateFormat } from '../../../../../../components/date-format'; +import { Link } from '../../../../../../navigation'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, -} from 'vitnode-frontend/components/ui/tooltip'; -import { CONFIG } from 'vitnode-frontend/helpers/config-with-env'; -import { DateFormat } from 'vitnode-frontend/components/date-format'; -import { DataTable } from 'vitnode-frontend/components/data-table/data-table'; -import { HeaderSortingDataTable } from 'vitnode-frontend/components/data-table/header'; - -import { Admin__Core_Files__ShowQuery } from '@/graphql/hooks'; -import { ActionsFilesAdvancedCoreAdmin } from './actions/actions'; +} from '../../../../../../components/ui/tooltip'; +import { DataTable } from '../../../../../../components/data-table/data-table'; -export const FilesAdvancedCoreAdminView = ({ +export const ContentFilesAdvancedCoreAdminView = ({ admin__core_files__show: { edges, pageInfo }, }: Admin__Core_Files__ShowQuery) => { const t = useTranslations('core.settings.files'); diff --git a/packages/frontend/src/views/admin/views/core/advanced/files/files-advanced-core-admin-view.tsx b/packages/frontend/src/views/admin/views/core/advanced/files/files-advanced-core-admin-view.tsx new file mode 100644 index 000000000..c70589215 --- /dev/null +++ b/packages/frontend/src/views/admin/views/core/advanced/files/files-advanced-core-admin-view.tsx @@ -0,0 +1,59 @@ +import { getTranslations } from 'next-intl/server'; + +import { ContentFilesAdvancedCoreAdminView } from './content'; + +import { + SearchParamsPagination, + getPaginationTool, +} from '../../../../../../graphql/get-pagination-tool'; +import { + Admin__Core_Files__Show, + Admin__Core_Files__ShowQuery, + Admin__Core_Files__ShowQueryVariables, + ShowCoreFilesSortingColumnEnum, +} from '../../../../../../graphql/code'; +import { HeaderContent } from '../../../../../../components/ui/header-content'; +import { Card } from '../../../../../../components/ui/card'; +import { fetcher } from '../../../../../../graphql/fetcher'; + +const getData = async (variables: Admin__Core_Files__ShowQueryVariables) => { + const { data } = await fetcher< + Admin__Core_Files__ShowQuery, + Admin__Core_Files__ShowQueryVariables + >({ + query: Admin__Core_Files__Show, + variables, + }); + + return data; +}; + +export interface FilesAdvancedCoreAdminViewProps { + searchParams: SearchParamsPagination; +} + +export const FilesAdvancedCoreAdminView = async ({ + searchParams, +}: FilesAdvancedCoreAdminViewProps) => { + const variables = getPaginationTool({ + searchParams, + defaultPageSize: 10, + search: true, + sortByEnum: ShowCoreFilesSortingColumnEnum, + }); + + const [t, data] = await Promise.all([ + getTranslations('admin.core.advanced.files'), + getData(variables), + ]); + + return ( + <> + + + + + + + ); +}; diff --git a/apps/frontend/plugins/admin/views/core/langs/actions/actions.tsx b/packages/frontend/src/views/admin/views/core/langs/actions/actions.tsx similarity index 60% rename from apps/frontend/plugins/admin/views/core/langs/actions/actions.tsx rename to packages/frontend/src/views/admin/views/core/langs/actions/actions.tsx index 1b588d611..43b0db073 100644 --- a/apps/frontend/plugins/admin/views/core/langs/actions/actions.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/actions/actions.tsx @@ -1,9 +1,5 @@ import { CreateActionLangAdmin } from './create'; export const ActionsLangsAdmin = () => { - return ( - <> - - - ); + return ; }; diff --git a/apps/frontend/plugins/admin/views/core/langs/actions/create.tsx b/packages/frontend/src/views/admin/views/core/langs/actions/create.tsx similarity index 80% rename from apps/frontend/plugins/admin/views/core/langs/actions/create.tsx rename to packages/frontend/src/views/admin/views/core/langs/actions/create.tsx index fd096865c..f2129917b 100644 --- a/apps/frontend/plugins/admin/views/core/langs/actions/create.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/actions/create.tsx @@ -3,13 +3,14 @@ import { Plus } from 'lucide-react'; import { useTranslations } from 'next-intl'; import * as React from 'react'; -import { Button } from 'vitnode-frontend/components/ui/button'; + import { Dialog, DialogContent, DialogTrigger, -} from 'vitnode-frontend/components/ui/dialog'; -import { Loader } from 'vitnode-frontend/components/ui/loader'; +} from '../../../../../../components/ui/dialog'; +import { Button } from '../../../../../../components/ui/button'; +import { Loader } from '../../../../../../components/ui/loader'; const Content = React.lazy(async () => import('../create-edit/create-edit').then(module => ({ diff --git a/apps/frontend/plugins/admin/views/core/langs/langs-core-admin-view.tsx b/packages/frontend/src/views/admin/views/core/langs/content.tsx similarity index 77% rename from apps/frontend/plugins/admin/views/core/langs/langs-core-admin-view.tsx rename to packages/frontend/src/views/admin/views/core/langs/content.tsx index 3c385030d..5e54b7502 100644 --- a/apps/frontend/plugins/admin/views/core/langs/langs-core-admin-view.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/content.tsx @@ -3,20 +3,22 @@ import { useTranslations } from 'next-intl'; import { ColumnDef } from '@tanstack/react-table'; import * as React from 'react'; -import { Badge } from 'vitnode-frontend/components/ui/badge'; -import { DateFormat } from 'vitnode-frontend/components/date-format'; -import { DataTable } from 'vitnode-frontend/components/data-table/data-table'; -import { HeaderSortingDataTable } from 'vitnode-frontend/components/data-table/header'; -import { Core_Languages__ShowQuery, ShowCoreLanguages } from '@/graphql/hooks'; import { ActionsTableLangsCoreAdmin } from './table/actions/actions'; import { EnabledRowTableLangsCoreAdmin } from './enabled-row'; -export interface LangsCoreAdminViewProps { - data: Core_Languages__ShowQuery; -} +import { + Admin__Core_Languages__ShowQuery, + ShowCoreLanguages, +} from '../../../../../graphql/code'; +import { Badge } from '../../../../../components/ui/badge'; +import { HeaderSortingDataTable } from '../../../../../components/data-table/header'; +import { DateFormat } from '../../../../../components/date-format'; +import { DataTable } from '../../../../../components/data-table/data-table'; -export const LangsCoreAdminView = ({ data }: LangsCoreAdminViewProps) => { +export const ContentLangsCoreAdminView = ({ + core_languages__show: { edges, pageInfo }, +}: Admin__Core_Languages__ShowQuery) => { const t = useTranslations('admin.core.langs'); const tCore = useTranslations('core'); @@ -89,8 +91,8 @@ export const LangsCoreAdminView = ({ data }: LangsCoreAdminViewProps) => { return ( > { field: ControllerRenderProps; diff --git a/apps/frontend/plugins/admin/views/core/langs/create-edit/fields/timezone.tsx b/packages/frontend/src/views/admin/views/core/langs/create-edit/fields/timezone.tsx similarity index 89% rename from apps/frontend/plugins/admin/views/core/langs/create-edit/fields/timezone.tsx rename to packages/frontend/src/views/admin/views/core/langs/create-edit/fields/timezone.tsx index b2b8d15ab..99a78abef 100644 --- a/apps/frontend/plugins/admin/views/core/langs/create-edit/fields/timezone.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/create-edit/fields/timezone.tsx @@ -2,19 +2,22 @@ import { useTranslations } from 'next-intl'; import * as React from 'react'; import { Check } from 'lucide-react'; import { ControllerRenderProps, FieldValues, Path } from 'react-hook-form'; -import { cn } from 'vitnode-frontend/helpers/classnames'; + +import { timeZones } from '../timezones'; + import { FormControl, FormItem, FormLabel, FormMessage, -} from 'vitnode-frontend/components/ui/form'; +} from '../../../../../../../components/ui/form'; import { Popover, PopoverContent, PopoverTrigger, -} from 'vitnode-frontend/components/ui/popover'; -import { Button } from 'vitnode-frontend/components/ui/button'; +} from '../../../../../../../components/ui/popover'; +import { Button } from '../../../../../../../components/ui/button'; +import { cn } from '../../../../../../../helpers/classnames'; import { Command, CommandEmpty, @@ -22,9 +25,7 @@ import { CommandInput, CommandItem, CommandList, -} from 'vitnode-frontend/components/ui/command'; - -import { timeZones } from '../timezones'; +} from '../../../../../../../components/ui/command'; interface Props> { field: ControllerRenderProps; diff --git a/apps/frontend/plugins/admin/views/core/langs/create-edit/hooks/create-mutation-api.ts b/packages/frontend/src/views/admin/views/core/langs/create-edit/hooks/create-mutation-api.ts similarity index 85% rename from apps/frontend/plugins/admin/views/core/langs/create-edit/hooks/create-mutation-api.ts rename to packages/frontend/src/views/admin/views/core/langs/create-edit/hooks/create-mutation-api.ts index d27ac556d..9c5dfa9c2 100644 --- a/apps/frontend/plugins/admin/views/core/langs/create-edit/hooks/create-mutation-api.ts +++ b/packages/frontend/src/views/admin/views/core/langs/create-edit/hooks/create-mutation-api.ts @@ -1,13 +1,13 @@ 'use server'; import { revalidatePath } from 'next/cache'; -import { fetcher } from 'vitnode-frontend/graphql/fetcher'; +import { fetcher } from '../../../../../../../graphql/fetcher'; import { - Admin__Core_Languages__CreateMutationVariables, Admin__Core_Languages__Create, Admin__Core_Languages__CreateMutation, -} from '@/graphql/hooks'; + Admin__Core_Languages__CreateMutationVariables, +} from '../../../../../../../graphql/code'; export const createMutationApi = async ( variables: Admin__Core_Languages__CreateMutationVariables, diff --git a/apps/frontend/plugins/admin/views/core/langs/create-edit/hooks/edit-mutation-api.ts b/packages/frontend/src/views/admin/views/core/langs/create-edit/hooks/edit-mutation-api.ts similarity index 85% rename from apps/frontend/plugins/admin/views/core/langs/create-edit/hooks/edit-mutation-api.ts rename to packages/frontend/src/views/admin/views/core/langs/create-edit/hooks/edit-mutation-api.ts index 4e2f5b92a..79fcb93ea 100644 --- a/apps/frontend/plugins/admin/views/core/langs/create-edit/hooks/edit-mutation-api.ts +++ b/packages/frontend/src/views/admin/views/core/langs/create-edit/hooks/edit-mutation-api.ts @@ -1,13 +1,13 @@ 'use server'; import { revalidatePath } from 'next/cache'; -import { fetcher } from 'vitnode-frontend/graphql/fetcher'; +import { fetcher } from '../../../../../../../graphql/fetcher'; import { Admin__Core_Languages__Edit, Admin__Core_Languages__EditMutation, Admin__Core_Languages__EditMutationVariables, -} from '@/graphql/hooks'; +} from '../../../../../../../graphql/code'; export const editMutationApi = async ( variables: Admin__Core_Languages__EditMutationVariables, diff --git a/apps/frontend/plugins/admin/views/core/langs/create-edit/hooks/use-create-edit-lang-admin.ts b/packages/frontend/src/views/admin/views/core/langs/create-edit/hooks/use-create-edit-lang-admin.ts similarity index 91% rename from apps/frontend/plugins/admin/views/core/langs/create-edit/hooks/use-create-edit-lang-admin.ts rename to packages/frontend/src/views/admin/views/core/langs/create-edit/hooks/use-create-edit-lang-admin.ts index c463a85c3..ff8fcc9eb 100644 --- a/apps/frontend/plugins/admin/views/core/langs/create-edit/hooks/use-create-edit-lang-admin.ts +++ b/packages/frontend/src/views/admin/views/core/langs/create-edit/hooks/use-create-edit-lang-admin.ts @@ -3,13 +3,14 @@ import { useTranslations } from 'next-intl'; import { useForm } from 'react-hook-form'; import { toast } from 'sonner'; import * as z from 'zod'; -import { zodInput } from 'vitnode-frontend/helpers/zod'; -import { useDialog } from 'vitnode-frontend/components/ui/dialog'; -import { ShowCoreLanguages } from '@/graphql/hooks'; import { editMutationApi } from './edit-mutation-api'; import { createMutationApi } from './create-mutation-api'; +import { ShowCoreLanguages } from '../../../../../../../graphql/code'; +import { useDialog } from '../../../../../../../components/ui/dialog'; +import { zodInput } from '../../../../../../../helpers/zod'; + interface Args { data?: ShowCoreLanguages; } diff --git a/apps/frontend/plugins/admin/views/core/langs/create-edit/timezones.ts b/packages/frontend/src/views/admin/views/core/langs/create-edit/timezones.ts similarity index 100% rename from apps/frontend/plugins/admin/views/core/langs/create-edit/timezones.ts rename to packages/frontend/src/views/admin/views/core/langs/create-edit/timezones.ts diff --git a/apps/frontend/plugins/admin/views/core/langs/enabled-row.tsx b/packages/frontend/src/views/admin/views/core/langs/enabled-row.tsx similarity index 89% rename from apps/frontend/plugins/admin/views/core/langs/enabled-row.tsx rename to packages/frontend/src/views/admin/views/core/langs/enabled-row.tsx index e23ad16a2..f66b1b39a 100644 --- a/apps/frontend/plugins/admin/views/core/langs/enabled-row.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/enabled-row.tsx @@ -1,11 +1,12 @@ import { useLocale, useTranslations } from 'next-intl'; import { toast } from 'sonner'; import * as React from 'react'; -import { Switch } from 'vitnode-frontend/components/ui/switch'; -import { ShowCoreLanguages } from '@/graphql/hooks'; import { editMutationApi } from './create-edit/hooks/edit-mutation-api'; +import { ShowCoreLanguages } from '../../../../../graphql/code'; +import { Switch } from '../../../../../components/ui/switch'; + interface Props { data: ShowCoreLanguages; } diff --git a/packages/frontend/src/views/admin/views/core/langs/langs-core-admin-view.tsx b/packages/frontend/src/views/admin/views/core/langs/langs-core-admin-view.tsx new file mode 100644 index 000000000..ead60904c --- /dev/null +++ b/packages/frontend/src/views/admin/views/core/langs/langs-core-admin-view.tsx @@ -0,0 +1,69 @@ +import { getTranslations } from 'next-intl/server'; + +import { ActionsLangsAdmin } from './actions/actions'; +import { ContentLangsCoreAdminView } from './content'; + +import { + Admin__Core_Languages__Show, + Admin__Core_Languages__ShowQuery, + Admin__Core_Languages__ShowQueryVariables, + ShowCoreLanguagesSortingColumnEnum, +} from '../../../../../graphql/code'; +import { + SearchParamsPagination, + getPaginationTool, +} from '../../../../../graphql/get-pagination-tool'; +import { HeaderContent } from '../../../../../components/ui/header-content'; +import { Card } from '../../../../../components/ui/card'; +import { fetcher } from '../../../../../graphql/fetcher'; + +const getData = async ( + variables: Admin__Core_Languages__ShowQueryVariables, +) => { + const { data } = await fetcher< + Admin__Core_Languages__ShowQuery, + Admin__Core_Languages__ShowQueryVariables + >({ + query: Admin__Core_Languages__Show, + variables, + }); + + return data; +}; + +export interface LangsCoreAdminViewProps { + params: { + locale: string; + }; + searchParams: SearchParamsPagination; +} + +export const LangsCoreAdminView = async ({ + searchParams, +}: LangsCoreAdminViewProps) => { + const variables = getPaginationTool({ + searchParams, + defaultPageSize: 10, + search: true, + sortByEnum: ShowCoreLanguagesSortingColumnEnum, + }); + + const [t, data] = await Promise.all([ + getTranslations('admin.core.langs'), + getData(variables), + ]); + + return ( + <> + + + + + + {/* // TODO: Add this */} + {/* */} + + + + ); +}; diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/actions.tsx b/packages/frontend/src/views/admin/views/core/langs/table/actions/actions.tsx similarity index 91% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/actions.tsx rename to packages/frontend/src/views/admin/views/core/langs/table/actions/actions.tsx index 94658d928..8890770db 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/actions.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/actions.tsx @@ -1,20 +1,21 @@ import { ChevronDown, Trash2, Upload } from 'lucide-react'; import { useLocale, useTranslations } from 'next-intl'; import * as React from 'react'; -import { Button } from 'vitnode-frontend/components/ui/button'; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from 'vitnode-frontend/components/ui/dropdown-menu'; -import { ShowCoreLanguages } from '@/graphql/hooks'; import { EditActionsTableLangsCoreAdmin } from './edit'; import { DeleteActionsTableLangsCoreAdmin } from './delete/delete'; import { DownloadActionsTableLangsCoreAdmin } from './download/download'; import { UpdateActionsTableLangsCoreAdmin } from './update/update'; +import { ShowCoreLanguages } from '../../../../../../../graphql/code'; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from '../../../../../../../components/ui/dropdown-menu'; +import { Button } from '../../../../../../../components/ui/button'; + export const ActionsTableLangsCoreAdmin = (data: ShowCoreLanguages) => { const t = useTranslations('core'); const locale = useLocale(); diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/delete/content.tsx b/packages/frontend/src/views/admin/views/core/langs/table/actions/delete/content.tsx similarity index 86% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/delete/content.tsx rename to packages/frontend/src/views/admin/views/core/langs/table/actions/delete/content.tsx index d3c6a834d..161143497 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/delete/content.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/delete/content.tsx @@ -1,23 +1,24 @@ import { useTranslations } from 'next-intl'; -import { - AlertDialogCancel, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, -} from 'vitnode-frontend/components/ui/alert-dialog'; -import { Button } from 'vitnode-frontend/components/ui/button'; + +import { useDeleteLangAdmin } from './hooks/use-delete-lang-admin'; + +import { ShowCoreLanguages } from '../../../../../../../../graphql/code'; import { Form, FormControl, FormField, FormItem, FormMessage, -} from 'vitnode-frontend/components/ui/form'; -import { Input } from 'vitnode-frontend/components/ui/input'; - -import { useDeleteLangAdmin } from './hooks/use-delete-lang-admin'; -import { ShowCoreLanguages } from '@/graphql/hooks'; +} from '../../../../../../../../components/ui/form'; +import { + AlertDialogCancel, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, +} from '../../../../../../../../components/ui/alert-dialog'; +import { Input } from '../../../../../../../../components/ui/input'; +import { Button } from '../../../../../../../../components/ui/button'; export const ContentDeleteActionsTableLangsCoreAdmin = ({ code, diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/delete/delete.tsx b/packages/frontend/src/views/admin/views/core/langs/table/actions/delete/delete.tsx similarity index 77% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/delete/delete.tsx rename to packages/frontend/src/views/admin/views/core/langs/table/actions/delete/delete.tsx index 71082fda8..c7047143d 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/delete/delete.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/delete/delete.tsx @@ -1,11 +1,11 @@ import * as React from 'react'; + +import { ShowCoreLanguages } from '../../../../../../../../graphql/code'; import { AlertDialog, AlertDialogContent, -} from 'vitnode-frontend/components/ui/alert-dialog'; -import { Loader } from 'vitnode-frontend/components/ui/loader'; - -import { ShowCoreLanguages } from '@/graphql/hooks'; +} from '../../../../../../../../components/ui/alert-dialog'; +import { Loader } from '../../../../../../../../components/ui/loader'; const Content = React.lazy(async () => import('./content').then(module => ({ diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/delete/hooks/mutation-api.ts b/packages/frontend/src/views/admin/views/core/langs/table/actions/delete/hooks/mutation-api.ts similarity index 83% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/delete/hooks/mutation-api.ts rename to packages/frontend/src/views/admin/views/core/langs/table/actions/delete/hooks/mutation-api.ts index d03f2956c..bd69ce68d 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/delete/hooks/mutation-api.ts +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/delete/hooks/mutation-api.ts @@ -1,13 +1,13 @@ 'use server'; import { revalidatePath } from 'next/cache'; -import { fetcher } from 'vitnode-frontend/graphql/fetcher'; +import { fetcher } from '../../../../../../../../../graphql/fetcher'; import { Admin__Core_Languages__Delete, Admin__Core_Languages__DeleteMutation, Admin__Core_Languages__DeleteMutationVariables, -} from '@/graphql/hooks'; +} from '../../../../../../../../../graphql/code'; export const mutationApi = async ( variables: Admin__Core_Languages__DeleteMutationVariables, diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/delete/hooks/use-delete-lang-admin.ts b/packages/frontend/src/views/admin/views/core/langs/table/actions/delete/hooks/use-delete-lang-admin.ts similarity index 83% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/delete/hooks/use-delete-lang-admin.ts rename to packages/frontend/src/views/admin/views/core/langs/table/actions/delete/hooks/use-delete-lang-admin.ts index c1c9f5df2..29e5b421c 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/delete/hooks/use-delete-lang-admin.ts +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/delete/hooks/use-delete-lang-admin.ts @@ -3,11 +3,12 @@ import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { useTranslations } from 'next-intl'; import { toast } from 'sonner'; -import { usePathname, useRouter } from 'vitnode-frontend/navigation'; -import { useAlertDialog } from 'vitnode-frontend/components/ui/alert-dialog'; import { mutationApi } from './mutation-api'; -import { ShowCoreLanguages } from '@/graphql/hooks'; + +import { ShowCoreLanguages } from '../../../../../../../../../graphql/code'; +import { useAlertDialog } from '../../../../../../../../../components/ui/alert-dialog'; +import { usePathname, useRouter } from '../../../../../../../../../navigation'; export const useDeleteLangAdmin = ({ code, diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/download/content.tsx b/packages/frontend/src/views/admin/views/core/langs/table/actions/download/content.tsx similarity index 86% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/download/content.tsx rename to packages/frontend/src/views/admin/views/core/langs/table/actions/download/content.tsx index d82d3c394..f493220e1 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/download/content.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/download/content.tsx @@ -1,13 +1,17 @@ import { useTranslations } from 'next-intl'; import { Check } from 'lucide-react'; -import { cn } from 'vitnode-frontend/helpers/classnames'; -import { Loader } from 'vitnode-frontend/components/ui/loader'; + +import { useDownloadLangAdmin } from './hooks/use-download-lang-admin'; + +import { ShowCoreLanguages } from '../../../../../../../../graphql/code'; +import { useSessionAdmin } from '../../../../../../../../hooks/use-session-admin'; +import { Loader } from '../../../../../../../../components/ui/loader'; import { DialogDescription, DialogFooter, DialogHeader, DialogTitle, -} from 'vitnode-frontend/components/ui/dialog'; +} from '../../../../../../../../components/ui/dialog'; import { Form, FormControl, @@ -16,14 +20,15 @@ import { FormItem, FormLabel, FormMessage, -} from 'vitnode-frontend/components/ui/form'; -import { Switch } from 'vitnode-frontend/components/ui/switch'; +} from '../../../../../../../../components/ui/form'; +import { Switch } from '../../../../../../../../components/ui/switch'; import { Popover, PopoverContent, PopoverTrigger, -} from 'vitnode-frontend/components/ui/popover'; -import { Button } from 'vitnode-frontend/components/ui/button'; +} from '../../../../../../../../components/ui/popover'; +import { Button } from '../../../../../../../../components/ui/button'; +import { cn } from '../../../../../../../../helpers/classnames'; import { Command, CommandEmpty, @@ -31,21 +36,17 @@ import { CommandInput, CommandItem, CommandList, -} from 'vitnode-frontend/components/ui/command'; -import { useSessionAdmin } from 'vitnode-frontend/hooks/use-session-admin'; - -import { ShowCoreLanguages } from '@/graphql/hooks'; -import { useDownloadLangAdmin } from './hooks/use-download-lang-admin'; +} from '../../../../../../../../components/ui/command'; export const ContentDownloadActionsTableLangsCoreAdmin = ({ code, }: Pick) => { const t = useTranslations('admin.core.langs.actions.download'); - const { form, onSubmit, query } = useDownloadLangAdmin({ code }); + const { form, onSubmit, queryPlugins } = useDownloadLangAdmin({ code }); const { version } = useSessionAdmin(); - const { data } = query; + const { data } = queryPlugins; - if (query.isLoading || !data) { + if (queryPlugins.isLoading || !data) { return ; } @@ -128,7 +129,7 @@ export const ContentDownloadActionsTableLangsCoreAdmin = ({ {plugins.map(item => ( { const values = field.value; diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/download/download.tsx b/packages/frontend/src/views/admin/views/core/langs/table/actions/download/download.tsx similarity index 75% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/download/download.tsx rename to packages/frontend/src/views/admin/views/core/langs/table/actions/download/download.tsx index ef92b1c3d..265fff19a 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/download/download.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/download/download.tsx @@ -1,15 +1,15 @@ import { Download } from 'lucide-react'; import { useTranslations } from 'next-intl'; import * as React from 'react'; + +import { ShowCoreLanguages } from '../../../../../../../../graphql/code'; import { Dialog, DialogContent, DialogTrigger, -} from 'vitnode-frontend/components/ui/dialog'; -import { Button } from 'vitnode-frontend/components/ui/button'; -import { Loader } from 'vitnode-frontend/components/ui/loader'; - -import { ShowCoreLanguages } from '@/graphql/hooks'; +} from '../../../../../../../../components/ui/dialog'; +import { Button } from '../../../../../../../../components/ui/button'; +import { Loader } from '../../../../../../../../components/ui/loader'; const Content = React.lazy(async () => import('./content').then(module => ({ diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/download/hooks/mutation-api.ts b/packages/frontend/src/views/admin/views/core/langs/table/actions/download/hooks/mutation-api.ts similarity index 84% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/download/hooks/mutation-api.ts rename to packages/frontend/src/views/admin/views/core/langs/table/actions/download/hooks/mutation-api.ts index f5a34e3dc..a7d42a4c5 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/download/hooks/mutation-api.ts +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/download/hooks/mutation-api.ts @@ -1,13 +1,13 @@ 'use server'; import { revalidatePath } from 'next/cache'; -import { fetcher } from 'vitnode-frontend/graphql/fetcher'; +import { fetcher } from '../../../../../../../../../graphql/fetcher'; import { Admin__Core_Languages__Download, Admin__Core_Languages__DownloadMutation, Admin__Core_Languages__DownloadMutationVariables, -} from '@/graphql/hooks'; +} from '../../../../../../../../../graphql/code'; export const mutationApi = async ( variables: Admin__Core_Languages__DownloadMutationVariables, diff --git a/packages/frontend/src/views/admin/views/core/langs/table/actions/download/hooks/query-api.ts b/packages/frontend/src/views/admin/views/core/langs/table/actions/download/hooks/query-api.ts new file mode 100644 index 000000000..15799118b --- /dev/null +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/download/hooks/query-api.ts @@ -0,0 +1,22 @@ +'use server'; + +import { + Admin__Core_Plugins__Show__Quick, + Admin__Core_Plugins__Show__QuickQuery, + Admin__Core_Plugins__Show__QuickQueryVariables, +} from '../../../../../../../../../graphql/code'; +import { fetcher } from '../../../../../../../../../graphql/fetcher'; + +export const queryApi = async ( + variables: Admin__Core_Plugins__Show__QuickQueryVariables, +) => { + const { data } = await fetcher< + Admin__Core_Plugins__Show__QuickQuery, + Admin__Core_Plugins__Show__QuickQueryVariables + >({ + query: Admin__Core_Plugins__Show__Quick, + variables, + }); + + return data; +}; diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/download/hooks/use-download-lang-admin.ts b/packages/frontend/src/views/admin/views/core/langs/table/actions/download/hooks/use-download-lang-admin.ts similarity index 78% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/download/hooks/use-download-lang-admin.ts rename to packages/frontend/src/views/admin/views/core/langs/table/actions/download/hooks/use-download-lang-admin.ts index 4fa0313c4..3663562e7 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/download/hooks/use-download-lang-admin.ts +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/download/hooks/use-download-lang-admin.ts @@ -4,20 +4,21 @@ import { useForm } from 'react-hook-form'; import * as z from 'zod'; import { toast } from 'sonner'; import { useTranslations } from 'next-intl'; -import { useDialog } from 'vitnode-frontend/components/ui/dialog'; -import { CONFIG } from 'vitnode-frontend/helpers/config-with-env'; import { queryApi } from './query-api'; import { mutationApi } from './mutation-api'; -import { ShowCoreLanguages } from '@/graphql/hooks'; + +import { ShowCoreLanguages } from '../../../../../../../../../graphql/code'; +import { useDialog } from '../../../../../../../../../components/ui/dialog'; +import { CONFIG } from '../../../../../../../../../helpers/config-with-env'; export const useDownloadLangAdmin = ({ code, }: Pick) => { const t = useTranslations('core'); const { setOpen } = useDialog(); - const query = useQuery({ - queryKey: ['Admin__Core_Plugins__Show'], + const queryPlugins = useQuery({ + queryKey: ['Admin__Core_Plugins__Show__Quick'], queryFn: async () => queryApi({}), }); @@ -56,5 +57,5 @@ export const useDownloadLangAdmin = ({ ); }; - return { form, onSubmit, query }; + return { form, onSubmit, queryPlugins }; }; diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/edit.tsx b/packages/frontend/src/views/admin/views/core/langs/table/actions/edit.tsx similarity index 75% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/edit.tsx rename to packages/frontend/src/views/admin/views/core/langs/table/actions/edit.tsx index 50e700a62..01b367123 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/edit.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/edit.tsx @@ -1,15 +1,15 @@ import { Pencil } from 'lucide-react'; import * as React from 'react'; import { useTranslations } from 'next-intl'; + +import { ShowCoreLanguages } from '../../../../../../../graphql/code'; import { Dialog, DialogContent, DialogTrigger, -} from 'vitnode-frontend/components/ui/dialog'; -import { Button } from 'vitnode-frontend/components/ui/button'; -import { Loader } from 'vitnode-frontend/components/ui/loader'; - -import { ShowCoreLanguages } from '@/graphql/hooks'; +} from '../../../../../../../components/ui/dialog'; +import { Button } from '../../../../../../../components/ui/button'; +import { Loader } from '../../../../../../../components/ui/loader'; const Content = React.lazy(async () => import('../../create-edit/create-edit').then(module => ({ diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/update/content.tsx b/packages/frontend/src/views/admin/views/core/langs/table/actions/update/content.tsx similarity index 78% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/update/content.tsx rename to packages/frontend/src/views/admin/views/core/langs/table/actions/update/content.tsx index ec0c5920e..72b2d9208 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/update/content.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/update/content.tsx @@ -1,15 +1,16 @@ import { useTranslations } from 'next-intl'; -import { Form, FormField } from 'vitnode-frontend/components/ui/form'; -import { Button } from 'vitnode-frontend/components/ui/button'; + +import { useUpdateLangAdmin } from './hooks/use-update-lang-admin'; + +import { ShowCoreLanguages } from '../../../../../../../../graphql/code'; import { DialogFooter, DialogHeader, DialogTitle, -} from 'vitnode-frontend/components/ui/dialog'; -import { FilesInput } from 'vitnode-frontend/components/ui/files-input'; - -import { ShowCoreLanguages } from '@/graphql/hooks'; -import { useUpdateLangAdmin } from './hooks/use-update-lang-admin'; +} from '../../../../../../../../components/ui/dialog'; +import { Form, FormField } from '../../../../../../../../components/ui/form'; +import { FilesInput } from '../../../../../../../../components/ui/files-input'; +import { Button } from '../../../../../../../../components/ui/button'; export const ContentUpdateActionsTableLangsCoreAdmin = ({ code, diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/update/hooks/mutation-api.ts b/packages/frontend/src/views/admin/views/core/langs/table/actions/update/hooks/mutation-api.ts similarity index 87% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/update/hooks/mutation-api.ts rename to packages/frontend/src/views/admin/views/core/langs/table/actions/update/hooks/mutation-api.ts index 1ff52275c..85b6582db 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/update/hooks/mutation-api.ts +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/update/hooks/mutation-api.ts @@ -1,13 +1,13 @@ 'use server'; import { revalidatePath } from 'next/cache'; -import { fetcher } from 'vitnode-frontend/graphql/fetcher'; +import { fetcher } from '../../../../../../../../../graphql/fetcher'; import { - Admin__Core_Languages__UpdateMutation, Admin__Core_Languages__Update, + Admin__Core_Languages__UpdateMutation, Admin__Core_Languages__UpdateMutationVariables, -} from '@/graphql/hooks'; +} from '../../../../../../../../../graphql/code'; export const mutationApi = async (formData: FormData) => { try { diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/update/hooks/use-update-lang-admin.ts b/packages/frontend/src/views/admin/views/core/langs/table/actions/update/hooks/use-update-lang-admin.ts similarity index 88% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/update/hooks/use-update-lang-admin.ts rename to packages/frontend/src/views/admin/views/core/langs/table/actions/update/hooks/use-update-lang-admin.ts index 3b7786fa0..5f2217ca0 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/update/hooks/use-update-lang-admin.ts +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/update/hooks/use-update-lang-admin.ts @@ -2,11 +2,12 @@ import { useTranslations } from 'next-intl'; import { useForm } from 'react-hook-form'; import { toast } from 'sonner'; import * as z from 'zod'; -import { useDialog } from 'vitnode-frontend/components/ui/dialog'; -import { ShowCoreLanguages } from '@/graphql/hooks'; import { mutationApi } from './mutation-api'; +import { ShowCoreLanguages } from '../../../../../../../../../graphql/code'; +import { useDialog } from '../../../../../../../../../components/ui/dialog'; + export const useUpdateLangAdmin = ({ code, name, diff --git a/apps/frontend/plugins/admin/views/core/langs/table/actions/update/update.tsx b/packages/frontend/src/views/admin/views/core/langs/table/actions/update/update.tsx similarity index 72% rename from apps/frontend/plugins/admin/views/core/langs/table/actions/update/update.tsx rename to packages/frontend/src/views/admin/views/core/langs/table/actions/update/update.tsx index 88fc8adfc..43564badb 100644 --- a/apps/frontend/plugins/admin/views/core/langs/table/actions/update/update.tsx +++ b/packages/frontend/src/views/admin/views/core/langs/table/actions/update/update.tsx @@ -1,8 +1,11 @@ import * as React from 'react'; -import { Dialog, DialogContent } from 'vitnode-frontend/components/ui/dialog'; -import { Loader } from 'vitnode-frontend/components/ui/loader'; -import { ShowCoreLanguages } from '@/graphql/hooks'; +import { ShowCoreLanguages } from '../../../../../../../../graphql/code'; +import { + Dialog, + DialogContent, +} from '../../../../../../../../components/ui/dialog'; +import { Loader } from '../../../../../../../../components/ui/loader'; const Content = React.lazy(async () => import('./content').then(module => ({