From e26042957c4eafffb8cd8c0ef9ee87460e4735b8 Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Fri, 14 Jan 2022 10:47:48 +0100 Subject: [PATCH] refactor: remodel features in app config --- src/config/app.ts | 14 ++----------- src/config/feature.ts | 48 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 src/config/feature.ts diff --git a/src/config/app.ts b/src/config/app.ts index 96c0d33b..9844963a 100644 --- a/src/config/app.ts +++ b/src/config/app.ts @@ -95,9 +95,9 @@ export interface SCAppConfiguration { campusPolygon: Polygon; /** - * A list of features to en- or disable + * Maps of enabled features (plugins and external services) */ - features: SCAppConfigurationFeature; + features: SCFeatureConfiguration; /** * A URL where images are available @@ -136,16 +136,6 @@ export interface SCAppConfiguration { url?: string; } -/** - * Map of features - */ -export interface SCAppConfigurationFeature { - /** - * Whether or not widgets are enabled - */ - widgets: boolean; -} - /** * URLs of published apps */ diff --git a/src/config/feature.ts b/src/config/feature.ts new file mode 100644 index 00000000..464acd5f --- /dev/null +++ b/src/config/feature.ts @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 StApps + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +import {SCAuthorizationProviderType} from './authorization'; + +export interface SCFeatureConfiguration { + /** + * Map of extern services mapped by their name (statically) + */ + extern?: Map; + + /** + * Map of plugins registered with the backend mapped by their name. + */ + plugins?: Map; +} + + +export interface SCFeatureConfigurationPlugin { + /** + * URL path registered with the backend + */ + urlPath: string; +} + +export interface SCFeatureConfigurationExtern { + /** + * Key of authorization provider available in SCConfigFile + */ + authProvider?: SCAuthorizationProviderType; + + /** + * URL of extern service + */ + url: string; +}