Skip to content

Commit

Permalink
perf(backend): Move nav module to styles module
Browse files Browse the repository at this point in the history
  • Loading branch information
aXenDeveloper committed Jul 7, 2024
1 parent 6c5c1dc commit db4f520
Show file tree
Hide file tree
Showing 32 changed files with 319 additions and 274 deletions.
8 changes: 4 additions & 4 deletions apps/backend/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,7 @@ type Mutation {
admin__core_main_settings__edit(site_copyright: [TextLanguageInput!]!, site_description: [TextLanguageInput!]!, site_name: String!, site_short_name: String!): EditAdminSettingsObj!
admin__core_manifest_metadata__edit(background_color: String!, display: String!, start_url: String!, theme_color: String!): ShowAdminManifestMetadataObj!
admin__core_members__edit(birthday: DateTime!, email: String!, first_name: String!, id: Int!, last_name: String!, name: String!, newsletter: Boolean!): EditAdminMembersObj!
admin__core_nav__change_position(id: Int!, index_to_move: Int!, parent_id: Int!): String!
admin__core_nav__create(description: [TextLanguageInput!]!, external: Boolean!, href: String!, icon: String, name: [TextLanguageInput!]!): ShowCoreNav!
admin__core_nav__delete(id: Int!): String!
admin__core_nav__edit(description: [TextLanguageInput!]!, external: Boolean!, href: String!, icon: String, id: Int!, name: [TextLanguageInput!]!): ShowCoreNav!
admin__core_nav_styles__change_position(id: Int!, index_to_move: Int!, parent_id: Int!): String!
admin__core_plugins__create(author: String!, author_url: String, code: String!, description: String, name: String!, support_url: String!): ShowAdminPlugins!
admin__core_plugins__delete(code: String!): String!
admin__core_plugins__download(code: String!, version: String, version_code: Int): String!
Expand All @@ -209,6 +206,9 @@ type Mutation {
admin__core_staff_administrators__delete(id: Int!): String!
admin__core_staff_moderators__create(group_id: Int, unrestricted: Boolean!, user_id: Int): ShowAdminStaffModerators!
admin__core_staff_moderators__delete(id: Int!): String!
admin__core_styles__nav__create(description: [TextLanguageInput!]!, external: Boolean!, href: String!, icon: String, name: [TextLanguageInput!]!): ShowCoreNav!
admin__core_styles__nav__delete(id: Int!): String!
admin__core_styles__nav__edit(description: [TextLanguageInput!]!, external: Boolean!, href: String!, icon: String, id: Int!, name: [TextLanguageInput!]!): ShowCoreNav!
admin__core_theme_editor__edit(colors: ColorsEditAdminThemeEditor!): String!
admin__install__create_database: String!
admin_sessions__sign_out: String!
Expand Down
110 changes: 74 additions & 36 deletions apps/frontend/utils/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ export type Scalars = {
Upload: { input: any; output: any; }
};

export const AllowTypeFilesEnum = {
all: 'all',
images: 'images',
images_videos: 'images_videos',
none: 'none'
} as const;

export type AllowTypeFilesEnum = typeof AllowTypeFilesEnum[keyof typeof AllowTypeFilesEnum];
export type AuthorizationAdminSessionsObj = {
__typename?: 'AuthorizationAdminSessionsObj';
nav: Array<NavAdminPluginsAuthorization>;
Expand All @@ -40,6 +48,7 @@ export type AuthorizationCurrentUserObj = {
id: Scalars['Int']['output'];
is_admin: Scalars['Boolean']['output'];
is_mod: Scalars['Boolean']['output'];
language: Scalars['String']['output'];
name: Scalars['String']['output'];
name_seo: Scalars['String']['output'];
newsletter: Scalars['Boolean']['output'];
Expand Down Expand Up @@ -120,6 +129,12 @@ export type EditAdminSettingsObj = {
site_name: Scalars['String']['output'];
};

export type EditorShowCoreMiddleware = {
__typename?: 'EditorShowCoreMiddleware';
files: FilesEditorShowCoreMiddleware;
sticky: Scalars['Boolean']['output'];
};

export type FilesAdminPluginsObj = {
__typename?: 'FilesAdminPluginsObj';
admin_pages: Scalars['Int']['output'];
Expand All @@ -139,6 +154,11 @@ export type FilesAuthorizationCoreSessions = {
total_max_storage: Scalars['Int']['output'];
};

export type FilesEditorShowCoreMiddleware = {
__typename?: 'FilesEditorShowCoreMiddleware';
allow_type: AllowTypeFilesEnum | `${AllowTypeFilesEnum}`;
};

export type GroupUser = {
__typename?: 'GroupUser';
id: Scalars['Int']['output'];
Expand Down Expand Up @@ -201,10 +221,7 @@ export type Mutation = {
admin__core_main_settings__edit: EditAdminSettingsObj;
admin__core_manifest_metadata__edit: ShowAdminManifestMetadataObj;
admin__core_members__edit: EditAdminMembersObj;
admin__core_nav__change_position: Scalars['String']['output'];
admin__core_nav__create: ShowCoreNav;
admin__core_nav__delete: Scalars['String']['output'];
admin__core_nav__edit: ShowCoreNav;
admin__core_nav_styles__change_position: Scalars['String']['output'];
admin__core_plugins__create: ShowAdminPlugins;
admin__core_plugins__delete: Scalars['String']['output'];
admin__core_plugins__download: Scalars['String']['output'];
Expand All @@ -218,6 +235,9 @@ export type Mutation = {
admin__core_staff_administrators__delete: Scalars['String']['output'];
admin__core_staff_moderators__create: ShowAdminStaffModerators;
admin__core_staff_moderators__delete: Scalars['String']['output'];
admin__core_styles__nav__create: ShowCoreNav;
admin__core_styles__nav__delete: Scalars['String']['output'];
admin__core_styles__nav__edit: ShowCoreNav;
admin__core_theme_editor__edit: Scalars['String']['output'];
admin__install__create_database: Scalars['String']['output'];
admin_sessions__sign_out: Scalars['String']['output'];
Expand All @@ -227,9 +247,10 @@ export type Mutation = {
core_members__avatar__delete: Scalars['String']['output'];
core_members__avatar__upload: UploadAvatarCoreMembersObj;
core_members__delete: Scalars['String']['output'];
core_members__sign_up: SignUpCoreMembersObj;
core_members__reset_password__create_key: Scalars['String']['output'];
core_sessions__sign_in: Scalars['String']['output'];
core_sessions__sign_out: Scalars['String']['output'];
core_sessions__sign_up: SignUpCoreSessionsObj;
};


Expand All @@ -255,6 +276,7 @@ export type MutationAdmin__Core_Email_Settings__EditArgs = {
export type MutationAdmin__Core_Email_Settings__TestArgs = {
from: Scalars['String']['input'];
message: Scalars['String']['input'];
preview_text?: InputMaybe<Scalars['String']['input']>;
subject: Scalars['String']['input'];
to: Scalars['String']['input'];
};
Expand Down Expand Up @@ -343,37 +365,13 @@ export type MutationAdmin__Core_Members__EditArgs = {
};


export type MutationAdmin__Core_Nav__Change_PositionArgs = {
export type MutationAdmin__Core_Nav_Styles__Change_PositionArgs = {
id: Scalars['Int']['input'];
index_to_move: Scalars['Int']['input'];
parent_id: Scalars['Int']['input'];
};


export type MutationAdmin__Core_Nav__CreateArgs = {
description: Array<TextLanguageInput>;
external: Scalars['Boolean']['input'];
href: Scalars['String']['input'];
icon?: InputMaybe<Scalars['String']['input']>;
name: Array<TextLanguageInput>;
};


export type MutationAdmin__Core_Nav__DeleteArgs = {
id: Scalars['Int']['input'];
};


export type MutationAdmin__Core_Nav__EditArgs = {
description: Array<TextLanguageInput>;
external: Scalars['Boolean']['input'];
href: Scalars['String']['input'];
icon?: InputMaybe<Scalars['String']['input']>;
id: Scalars['Int']['input'];
name: Array<TextLanguageInput>;
};


export type MutationAdmin__Core_Plugins__CreateArgs = {
author: Scalars['String']['input'];
author_url?: InputMaybe<Scalars['String']['input']>;
Expand Down Expand Up @@ -472,6 +470,30 @@ export type MutationAdmin__Core_Staff_Moderators__DeleteArgs = {
};


export type MutationAdmin__Core_Styles__Nav__CreateArgs = {
description: Array<TextLanguageInput>;
external: Scalars['Boolean']['input'];
href: Scalars['String']['input'];
icon?: InputMaybe<Scalars['String']['input']>;
name: Array<TextLanguageInput>;
};


export type MutationAdmin__Core_Styles__Nav__DeleteArgs = {
id: Scalars['Int']['input'];
};


export type MutationAdmin__Core_Styles__Nav__EditArgs = {
description: Array<TextLanguageInput>;
external: Scalars['Boolean']['input'];
href: Scalars['String']['input'];
icon?: InputMaybe<Scalars['String']['input']>;
id: Scalars['Int']['input'];
name: Array<TextLanguageInput>;
};


export type MutationAdmin__Core_Theme_Editor__EditArgs = {
colors: ColorsEditAdminThemeEditor;
};
Expand Down Expand Up @@ -506,11 +528,8 @@ export type MutationCore_Members__DeleteArgs = {
};


export type MutationCore_Members__Sign_UpArgs = {
export type MutationCore_Members__Reset_Password__Create_KeyArgs = {
email: Scalars['String']['input'];
name: Scalars['String']['input'];
newsletter?: InputMaybe<Scalars['Boolean']['input']>;
password: Scalars['String']['input'];
};


Expand All @@ -521,6 +540,14 @@ export type MutationCore_Sessions__Sign_InArgs = {
remember?: InputMaybe<Scalars['Boolean']['input']>;
};


export type MutationCore_Sessions__Sign_UpArgs = {
email: Scalars['String']['input'];
name: Scalars['String']['input'];
newsletter?: InputMaybe<Scalars['Boolean']['input']>;
password: Scalars['String']['input'];
};

export type NavAdminPluginsAuthorization = {
__typename?: 'NavAdminPluginsAuthorization';
code: Scalars['String']['output'];
Expand Down Expand Up @@ -679,6 +706,12 @@ export type QueryCore_Nav__ShowArgs = {
last?: InputMaybe<Scalars['Int']['input']>;
};

export type RebuildRequiredEditorShowCoreMiddleware = {
__typename?: 'RebuildRequiredEditorShowCoreMiddleware';
langs: Scalars['Boolean']['output'];
plugins: Scalars['Boolean']['output'];
};

export type ShowAdminEmailSettingsServiceObj = {
__typename?: 'ShowAdminEmailSettingsServiceObj';
color_primary: Scalars['String']['output'];
Expand Down Expand Up @@ -761,6 +794,7 @@ export type ShowAdminMembers = {
group: GroupUser;
id: Scalars['Int']['output'];
joined: Scalars['DateTime']['output'];
language: Scalars['String']['output'];
name: Scalars['String']['output'];
name_seo: Scalars['String']['output'];
newsletter: Scalars['Boolean']['output'];
Expand Down Expand Up @@ -980,6 +1014,7 @@ export type ShowCoreMembers = {
group: GroupUser;
id: Scalars['Int']['output'];
joined: Scalars['DateTime']['output'];
language: Scalars['String']['output'];
name: Scalars['String']['output'];
name_seo: Scalars['String']['output'];
posts: Scalars['Int']['output'];
Expand Down Expand Up @@ -1009,8 +1044,10 @@ export const ShowCoreMembersSortingColumnEnum = {
export type ShowCoreMembersSortingColumnEnum = typeof ShowCoreMembersSortingColumnEnum[keyof typeof ShowCoreMembersSortingColumnEnum];
export type ShowCoreMiddlewareObj = {
__typename?: 'ShowCoreMiddlewareObj';
editor: EditorShowCoreMiddleware;
languages: Array<LanguagesCoreMiddleware>;
plugins: Array<Scalars['String']['output']>;
rebuild_required: RebuildRequiredEditorShowCoreMiddleware;
};

export type ShowCoreNav = {
Expand Down Expand Up @@ -1074,8 +1111,8 @@ export type ShowSettingsObj = {
site_short_name: Scalars['String']['output'];
};

export type SignUpCoreMembersObj = {
__typename?: 'SignUpCoreMembersObj';
export type SignUpCoreSessionsObj = {
__typename?: 'SignUpCoreSessionsObj';
email: Scalars['String']['output'];
group_id: Scalars['Int']['output'];
name: Scalars['String']['output'];
Expand Down Expand Up @@ -1141,6 +1178,7 @@ export type User = {
avatar_color: Scalars['String']['output'];
group: GroupUser;
id: Scalars['Int']['output'];
language: Scalars['String']['output'];
name: Scalars['String']['output'];
name_seo: Scalars['String']['output'];
};
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/core/admin/admin.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
GlobalAdminSessionsModule,
} from './sessions/sessions.module';
import { AdminPluginsModule } from './plugins/plugins.module';
import { AdminNavModule } from './nav/nav.module';
import { AdminStaffModule } from './staff/staff.module';
import { AdminLanguagesModule } from './languages/languages.module';
import { AdminFilesModule } from './files/files.module';
Expand All @@ -16,14 +15,15 @@ import { AdminSettingsModule } from './settings/settings.module';
import { AdminThemeEditorModule } from './theme_editor/theme_editor.module';
import { AdminInstallModule } from './install/install.module';
import { AdminEmailModule, GlobalAdminEmailModule } from './email/email.module';
import { AdminStylesModule } from './styles/styles.module';

@Module({
imports: [
GlobalAdminSessionsModule,
GlobalAdminEmailModule,
AdminSessionsModule,
AdminPluginsModule,
AdminNavModule,
AdminStylesModule,
AdminStaffModule,
AdminLanguagesModule,
AdminFilesModule,
Expand Down

This file was deleted.

21 changes: 0 additions & 21 deletions packages/backend/src/core/admin/nav/create/create.resolver.ts

This file was deleted.

20 changes: 0 additions & 20 deletions packages/backend/src/core/admin/nav/delete/delete.resolver.ts

This file was deleted.

9 changes: 0 additions & 9 deletions packages/backend/src/core/admin/nav/edit/dto/edit.args.ts

This file was deleted.

21 changes: 0 additions & 21 deletions packages/backend/src/core/admin/nav/edit/edit.resolver.ts

This file was deleted.

Loading

0 comments on commit db4f520

Please sign in to comment.