From 805c1f093715541b94a86b0915748eedbbeabb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jovan=20Kruni=C4=87?= Date: Wed, 21 Jul 2021 15:57:49 +0200 Subject: [PATCH] refactor: specific settings for user group and language --- src/config/app.ts | 7 +++--- src/things/setting.ts | 57 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/src/config/app.ts b/src/config/app.ts index ae0865fa..869781b7 100644 --- a/src/config/app.ts +++ b/src/config/app.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 StApps + * Copyright (C) 2019-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. @@ -15,7 +15,7 @@ // tslint:disable-next-line:no-implicit-dependencies import {Polygon} from 'geojson'; import {SCTranslations} from '../general/i18n'; -import {SCSetting} from '../things/setting'; +import {SCLanguageSetting, SCSetting, SCUserGroupSetting} from '../things/setting'; /** * An app configuration menu item @@ -112,8 +112,9 @@ export interface SCAppConfiguration { /** * A list of available settings in the app + * !Important! Use provided specific settings, for other settings use general SCSetting */ - settings: SCSetting[]; + settings: Array; /** * Map of store URLs diff --git a/src/things/setting.ts b/src/things/setting.ts index d0da766a..9212694a 100644 --- a/src/things/setting.ts +++ b/src/things/setting.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 StApps + * Copyright (C) 2019-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. @@ -12,7 +12,7 @@ * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ -import {SCMetaTranslations, SCTranslations} from '../general/i18n'; +import {SCLanguageCode, SCMetaTranslations, SCTranslations} from '../general/i18n'; import {SCThing, SCThingMeta, SCThingType} from './abstract/thing'; import { SCThingWithCategories, @@ -21,6 +21,7 @@ import { SCThingWithCategoriesWithoutReferences, SCThingWithCategoriesWithoutReferencesMeta, } from './abstract/thing-with-categories'; +import {SCUserGroup} from './abstract/user-groups'; /** * A setting without references @@ -177,3 +178,55 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations