-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #380 from aXenDeveloper/performerce/reduce_query_t…
…o_backend_in_middleware perf(frontend): Reduce calls to API
- Loading branch information
Showing
75 changed files
with
942 additions
and
838 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
import { Module } from "@nestjs/common"; | ||
|
||
import { CoreMiddlewareCron } from "./middleware.cron"; | ||
import { ShowCoreMiddlewareService } from "./show/show.service"; | ||
import { ShowCoreMiddlewareResolver } from "./show/show.resolver"; | ||
|
||
@Module({ | ||
providers: [CoreMiddlewareCron] | ||
providers: [ | ||
CoreMiddlewareCron, | ||
ShowCoreMiddlewareService, | ||
ShowCoreMiddlewareResolver | ||
] | ||
}) | ||
export class CoreMiddlewareModule {} |
22 changes: 22 additions & 0 deletions
22
backend/src/plugins/core/middleware/show/dto/languages.obj.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Field, ObjectType } from "@nestjs/graphql"; | ||
|
||
@ObjectType() | ||
export class LanguagesCoreMiddleware { | ||
@Field(() => String) | ||
code: string; | ||
|
||
@Field(() => Boolean) | ||
enabled: boolean; | ||
|
||
@Field(() => Boolean) | ||
default: boolean; | ||
} | ||
|
||
@ObjectType() | ||
export class ShowCoreMiddlewareObj { | ||
@Field(() => [LanguagesCoreMiddleware]) | ||
languages: LanguagesCoreMiddleware[]; | ||
|
||
@Field(() => [String]) | ||
plugins: string[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Query, Resolver } from "@nestjs/graphql"; | ||
|
||
import { ShowCoreMiddlewareService } from "./show.service"; | ||
import { ShowCoreMiddlewareObj } from "./dto/languages.obj"; | ||
|
||
@Resolver() | ||
export class ShowCoreMiddlewareResolver { | ||
constructor(private readonly service: ShowCoreMiddlewareService) {} | ||
|
||
@Query(() => ShowCoreMiddlewareObj) | ||
async core_middleware__show(): Promise<ShowCoreMiddlewareObj> { | ||
return this.service.languages(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { readdir } from "fs/promises"; | ||
|
||
import { Injectable } from "@nestjs/common"; | ||
|
||
import { ShowCoreMiddlewareObj } from "./dto/languages.obj"; | ||
|
||
import { ABSOLUTE_PATHS, getConfigFile } from "@/config"; | ||
|
||
@Injectable() | ||
export class ShowCoreMiddlewareService { | ||
async languages(): Promise<ShowCoreMiddlewareObj> { | ||
const config = getConfigFile(); | ||
|
||
const plugins = await readdir(ABSOLUTE_PATHS.plugins); | ||
|
||
return { | ||
languages: config.langs, | ||
plugins: [ | ||
"admin", | ||
...plugins.filter(plugin => !["plugins.module.ts"].includes(plugin)) | ||
] | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
frontend/components/editor/footer/files/hooks/upload-mutation-api.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.