mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 12:07:08 -04:00
refactor(config): extract note config from app config
This commit separates the app config object from a new note config object. This was done to separate different concerns in different config files. Especially if the number of settings that are about notes increase, it is a good idea to keep them separate from the app config. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
baa6606729
commit
f4a580cf2a
30 changed files with 161 additions and 78 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -13,6 +13,7 @@ import { CustomizationConfig } from '../config/customization.config';
|
|||
import { ExternalServicesConfig } from '../config/external-services.config';
|
||||
import { GitlabScope, GitlabVersion } from '../config/gitlab.enum';
|
||||
import { Loglevel } from '../config/loglevel.enum';
|
||||
import { NoteConfig } from '../config/note.config';
|
||||
import { LoggerModule } from '../logger/logger.module';
|
||||
import { getServerVersionFromPackageJson } from '../utils/serverVersion';
|
||||
import { AuthProviderType } from './frontend-config.dto';
|
||||
|
@ -194,8 +195,6 @@ describe('FrontendConfigService', () => {
|
|||
rendererOrigin: renderOrigin ?? domain,
|
||||
port: 3000,
|
||||
loglevel: Loglevel.ERROR,
|
||||
forbiddenNoteIds: [],
|
||||
maxDocumentLength: maxDocumentLength,
|
||||
};
|
||||
const authConfig: AuthConfig = {
|
||||
...emptyAuthConfig,
|
||||
|
@ -221,6 +220,10 @@ describe('FrontendConfigService', () => {
|
|||
plantUmlServer: plantUmlServer,
|
||||
imageProxy: imageProxy,
|
||||
};
|
||||
const noteConfig: NoteConfig = {
|
||||
forbiddenNoteIds: [],
|
||||
maxDocumentLength: maxDocumentLength,
|
||||
};
|
||||
const module: TestingModule =
|
||||
await Test.createTestingModule({
|
||||
imports: [
|
||||
|
@ -240,6 +243,10 @@ describe('FrontendConfigService', () => {
|
|||
'externalServicesConfig',
|
||||
() => externalServicesConfig,
|
||||
),
|
||||
registerAs(
|
||||
'noteConfig',
|
||||
() => noteConfig,
|
||||
),
|
||||
],
|
||||
}),
|
||||
LoggerModule,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue