MOBILE-3320 DX: Extract config declarations
parent
3a3a441f7b
commit
684afd3cee
|
@ -4,10 +4,7 @@
|
||||||
* You can create your own environment files such as "moodle.config.prod.json" and "moodle.config.dev.json"
|
* You can create your own environment files such as "moodle.config.prod.json" and "moodle.config.dev.json"
|
||||||
* to override some values. The values will be merged, so you don't need to duplicate everything in this file.
|
* to override some values. The values will be merged, so you don't need to duplicate everything in this file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{
|
{
|
||||||
// @todo This could be read from package.json.
|
// You can find all the properties you can configure in src/types/config.d.ts
|
||||||
"versionname": "3.9.3-dev",
|
|
||||||
// Override default language here.
|
|
||||||
"default_lang": "es"
|
"default_lang": "es"
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,13 +12,8 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
|
||||||
|
|
||||||
import { CoreColorScheme, CoreZoomLevel } from '@features/settings/services/settings-helper';
|
|
||||||
import { CoreMainMenuLocalizedCustomItem } from '@features/mainmenu/services/mainmenu';
|
|
||||||
import { CoreSitesDemoSiteData } from '@services/sites';
|
|
||||||
import envJson from '@/assets/env.json';
|
import envJson from '@/assets/env.json';
|
||||||
import { OpenFileAction } from '@services/utils/utils';
|
import { EnvironmentConfig } from '@/types/config';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Context levels enumeration.
|
* Context levels enumeration.
|
||||||
|
@ -141,46 +136,7 @@ export class CoreConstants {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EnvironmentConfig {
|
interface EnvironmentBuild {
|
||||||
app_id: string;
|
|
||||||
appname: string;
|
|
||||||
versioncode: number;
|
|
||||||
versionname: string;
|
|
||||||
cache_update_frequency_usually: number;
|
|
||||||
cache_update_frequency_often: number;
|
|
||||||
cache_update_frequency_sometimes: number;
|
|
||||||
cache_update_frequency_rarely: number;
|
|
||||||
default_lang: string;
|
|
||||||
languages: Record<string, string>;
|
|
||||||
wsservice: string;
|
|
||||||
wsextservice: string;
|
|
||||||
demo_sites: Record<string, CoreSitesDemoSiteData>;
|
|
||||||
zoomlevels: Record<CoreZoomLevel, number>;
|
|
||||||
customurlscheme: string;
|
|
||||||
siteurl: string;
|
|
||||||
sitename: string;
|
|
||||||
multisitesdisplay: string;
|
|
||||||
sitefindersettings: Record<string, unknown>;
|
|
||||||
onlyallowlistedsites: boolean;
|
|
||||||
skipssoconfirmation: boolean;
|
|
||||||
forcedefaultlanguage: boolean;
|
|
||||||
privacypolicy: string;
|
|
||||||
notificoncolor: string;
|
|
||||||
enableanalytics: boolean;
|
|
||||||
enableonboarding: boolean;
|
|
||||||
forceColorScheme: CoreColorScheme;
|
|
||||||
forceLoginLogo: boolean;
|
|
||||||
ioswebviewscheme: string;
|
|
||||||
appstores: Record<string, string>;
|
|
||||||
displayqroncredentialscreen?: boolean;
|
|
||||||
displayqronsitescreen?: boolean;
|
|
||||||
forceOpenLinksIn: 'app' | 'browser';
|
|
||||||
iOSDefaultOpenFileAction?: OpenFileAction;
|
|
||||||
customMainMenuItems?: CoreMainMenuLocalizedCustomItem[];
|
|
||||||
feedbackFormUrl?: string | false;
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface EnvironmentBuild {
|
|
||||||
version: string;
|
version: string;
|
||||||
isProduction: boolean;
|
isProduction: boolean;
|
||||||
isTesting: boolean;
|
isTesting: boolean;
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
// (C) Copyright 2015 Moodle Pty Ltd.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
import { CoreColorScheme, CoreZoomLevel } from '@features/settings/services/settings-helper';
|
||||||
|
import { CoreMainMenuLocalizedCustomItem } from '@features/mainmenu/services/mainmenu';
|
||||||
|
import { CoreSitesDemoSiteData } from '@services/sites';
|
||||||
|
import { OpenFileAction } from '@services/utils/utils';
|
||||||
|
|
||||||
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
|
|
||||||
|
export interface EnvironmentConfig {
|
||||||
|
app_id: string;
|
||||||
|
appname: string;
|
||||||
|
versioncode: number;
|
||||||
|
versionname: string; // @todo This could be removed and use build variables instead.
|
||||||
|
cache_update_frequency_usually: number;
|
||||||
|
cache_update_frequency_often: number;
|
||||||
|
cache_update_frequency_sometimes: number;
|
||||||
|
cache_update_frequency_rarely: number;
|
||||||
|
default_lang: string;
|
||||||
|
languages: Record<string, string>;
|
||||||
|
wsservice: string;
|
||||||
|
wsextservice: string;
|
||||||
|
demo_sites: Record<string, CoreSitesDemoSiteData>;
|
||||||
|
zoomlevels: Record<CoreZoomLevel, number>;
|
||||||
|
customurlscheme: string;
|
||||||
|
siteurl: string;
|
||||||
|
sitename: string;
|
||||||
|
multisitesdisplay: string;
|
||||||
|
sitefindersettings: Record<string, unknown>;
|
||||||
|
onlyallowlistedsites: boolean;
|
||||||
|
skipssoconfirmation: boolean;
|
||||||
|
forcedefaultlanguage: boolean;
|
||||||
|
privacypolicy: string;
|
||||||
|
notificoncolor: string;
|
||||||
|
enableanalytics: boolean;
|
||||||
|
enableonboarding: boolean;
|
||||||
|
forceColorScheme: CoreColorScheme;
|
||||||
|
forceLoginLogo: boolean;
|
||||||
|
ioswebviewscheme: string;
|
||||||
|
appstores: Record<string, string>;
|
||||||
|
displayqroncredentialscreen?: boolean;
|
||||||
|
displayqronsitescreen?: boolean;
|
||||||
|
forceOpenLinksIn: 'app' | 'browser';
|
||||||
|
iOSDefaultOpenFileAction?: OpenFileAction;
|
||||||
|
customMainMenuItems?: CoreMainMenuLocalizedCustomItem[];
|
||||||
|
feedbackFormUrl?: string | false;
|
||||||
|
}
|
Loading…
Reference in New Issue