From 9e1017edfb45ed6495d1b3a5f05ddb857b3c1f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jovan=20Kruni=C4=87?= Date: Mon, 22 Aug 2022 15:25:00 +0000 Subject: [PATCH] refactor: use material symbols for menu --- config/default-f-u.ts | 55 ++++++------- config/default.ts | 182 ++++++++++++++---------------------------- 2 files changed, 85 insertions(+), 152 deletions(-) diff --git a/config/default-f-u.ts b/config/default-f-u.ts index d462c30d..6ec156d2 100644 --- a/config/default-f-u.ts +++ b/config/default-f-u.ts @@ -3,19 +3,20 @@ import {SCAboutPageContentType, SCConfigFile, SCLanguageCode} from '@openstapps/core'; import {RecursivePartial} from '@openstapps/logger/lib/common'; -const markdownSources: {[key in SCLanguageCode]?: { - /** - * Privacy policy markdown - */ - privacyPolicy?: string; - /** - * Terms and conditions markdown - */ - termsAndConditions?: string; -}} = {en: {}, de: {}}; +const markdownSources: { + [key in SCLanguageCode]?: { + /** + * Privacy policy markdown + */ + privacyPolicy?: string; + /** + * Terms and conditions markdown + */ + termsAndConditions?: string; + }; +} = {en: {}, de: {}}; -markdownSources.de!.privacyPolicy = -` +markdownSources.de!.privacyPolicy = ` Diese Datenschutzerklärung dient zur Erfüllung der nach Artikel 13 EU DSGVO geforderten Informationspflicht bei Erhebung von Daten zum Zeitpunkt der Erhebung bei betroffenen Personen. # **Name und Anschrift des Verantwortlichen** @@ -176,8 +177,7 @@ Pseudonymisierung gehören kann. `; -markdownSources.de!.termsAndConditions = -` +markdownSources.de!.termsAndConditions = `

Stand: 04. November 2015

Es gilt der jeweilige Datenschutz der Hochschule im jeweiligen Bundesland. Darüber hinaus gelten die folgenden Vereinbarungen. Mit der Installation erklären Sie sich bereit die folgenden Bedingungen zu akzeptieren.

@@ -282,8 +282,7 @@ markdownSources.de!.termsAndConditions =

Fragen oder Anmerkungen zu dieser AGB richten Sie bitte an: app@rz.uni-frankfurt.de

`; -markdownSources.en!.privacyPolicy = -` +markdownSources.en!.privacyPolicy = ` This data protection declaration serves to fulfill the information obligation required under Article 13 EU DSGVO when data is collected at the time of collection from data subjects. # **Name and address of the responsible person** @@ -445,8 +444,7 @@ Pseudonymization may include. `; -markdownSources.en!.termsAndConditions = -` +markdownSources.en!.termsAndConditions = `

As of November 04, 2015

The respective data protection of the university in the respective federal state applies. In addition, the following agreements apply. By installing you agree to accept the following terms and conditions.

@@ -551,7 +549,6 @@ markdownSources.en!.termsAndConditions =

If you have any questions or comments about these terms and conditions, please contact: app@rz.uni-frankfurt.de

`; - /** * This is the default configuration for the Goethe university of Frankfurt */ @@ -598,8 +595,7 @@ const config: RecursivePartial = { title: 'Über das StApps Projekt', content: [ { - title: - 'Verbundprojekt mehrerer Hochschulen für eine generische Studierenden-App', + title: 'Verbundprojekt mehrerer Hochschulen für eine generische Studierenden-App', content: { type: SCAboutPageContentType.MARKDOWN, value: ` @@ -622,8 +618,7 @@ const config: RecursivePartial = { }, translations: { en: { - title: - 'Collaborative project of multiple universities for a single generic study app', + title: 'Collaborative project of multiple universities for a single generic study app', }, }, type: SCAboutPageContentType.SECTION, @@ -649,8 +644,7 @@ const config: RecursivePartial = { Norbert-Wollheim-Platz 1
60629 Frankfurt `, - translations: { - }, + translations: {}, type: SCAboutPageContentType.MARKDOWN, }, ], @@ -669,8 +663,7 @@ const config: RecursivePartial = { '[app@rz.uni-frankfurt.de](mailto:app@rz.uni-frankfurt.de)
' + '[+49 69 798 32936](tel:+496979832936)
' + '[https://app.rz.uni-frankfurt.de](https://app.rz.uni-frankfurt.de)', - translations: { - }, + translations: {}, type: SCAboutPageContentType.MARKDOWN, }, ], @@ -696,7 +689,7 @@ const config: RecursivePartial = { type: SCAboutPageContentType.ROUTER_LINK, }, { - icon: 'document', + icon: 'description', title: 'Impressum', link: 'imprint', translations: { @@ -707,7 +700,7 @@ const config: RecursivePartial = { type: SCAboutPageContentType.ROUTER_LINK, }, { - icon: 'shield-half', + icon: 'policy', title: 'Datenschutz', link: 'privacy', translations: { @@ -718,7 +711,7 @@ const config: RecursivePartial = { type: SCAboutPageContentType.ROUTER_LINK, }, { - icon: 'reader', + icon: 'text_snippet', title: 'Allgemeine Geschäftsbedingungen', link: 'terms', translations: { @@ -729,7 +722,7 @@ const config: RecursivePartial = { type: SCAboutPageContentType.ROUTER_LINK, }, { - icon: 'library', + icon: 'copyright', title: 'Bibliotheken und Lizenzen', link: 'licenses', translations: { diff --git a/config/default.ts b/config/default.ts index 0c5b0765..72e2a804 100644 --- a/config/default.ts +++ b/config/default.ts @@ -18,31 +18,29 @@ import {resolve} from 'path'; * @param num The number that should be checked * @param range Array of two numbers representing a range (inclusive interval) */ -export function inRangeInclusive(num: number, range: number[]): boolean { - return num >= range[0] && num <= range[1]; +export function inRangeInclusive(number_: number, range: number[]): boolean { + return number_ >= range[0] && number_ <= range[1]; } const sommerRange = [4, 9]; const winterRange = [10, 3]; const month = new Date().getMonth(); const year = new Date().getFullYear(); -const winterYearOffset = (month < winterRange[0] ? -1 : 0); +const winterYearOffset = month < winterRange[0] ? -1 : 0; const sommerYear = year + (month <= winterRange[1] ? -1 : 0); -const winterYear = `${year + winterYearOffset}/${(year + 1 + winterYearOffset) - .toString() - .slice(-2)}`; +const winterYear = `${year + winterYearOffset}/${(year + 1 + winterYearOffset).toString().slice(-2)}`; const wsAcronymShort = `WS ${winterYear}`; const ssAcronymShort = `SS ${sommerYear}`; const wsAcronymLong = `WiSe ${winterYear}`; const ssAcronymLong = `SoSe ${sommerYear}`; - const userGroupSetting: SCUserGroupSetting = { categories: ['profile'], defaultValue: 'students', - description: 'The user group the app is going to be used.' - + 'This settings for example is getting used for the predefined price category of mensa meals.', + description: + 'The user group the app is going to be used.' + + 'This settings for example is getting used for the predefined price category of mensa meals.', inputType: SCSettingInputType.SingleChoice, name: 'group', order: 1, @@ -53,24 +51,17 @@ const userGroupSetting: SCUserGroupSetting = { }, translations: { de: { - description: 'Mit welcher Benutzergruppe soll die App verwendet werden?' - + ' Die Einstellung wird beispielsweise für die Vorauswahl der Preiskategorie der Mensa verwendet.', + description: + 'Mit welcher Benutzergruppe soll die App verwendet werden?' + + ' Die Einstellung wird beispielsweise für die Vorauswahl der Preiskategorie der Mensa verwendet.', name: 'Gruppe', - values: [ - 'Student', - 'Angestellter', - 'Gast', - ], + values: ['Student', 'Angestellter', 'Gast'], }, en: { description: `The user group the app is going to be used.' + ' This settings for example is getting used for the predefined price category of mensa meals.`, name: 'Group', - values: [ - 'student', - 'employee', - 'guest', - ], + values: ['student', 'employee', 'guest'], }, }, type: SCThingType.Setting, @@ -94,18 +85,12 @@ const languageSetting: SCLanguageSetting = { de: { description: 'Die Sprache in der die App angezeigt wird.', name: 'Sprache', - values: [ - 'Deutsch', - 'English', - ], + values: ['Deutsch', 'English'], }, en: { description: 'The language this app is going to use.', name: 'Language', - values: [ - 'Deutsch', - 'English', - ], + values: ['Deutsch', 'English'], }, }, type: SCThingType.Setting, @@ -132,8 +117,7 @@ const config: Partial = { title: 'Über das StApps Projekt', content: [ { - title: - 'Verbundprojekt mehrerer Hochschulen für eine generische Studierenden-App', + title: 'Verbundprojekt mehrerer Hochschulen für eine generische Studierenden-App', content: { type: SCAboutPageContentType.MARKDOWN, value: ` @@ -154,8 +138,7 @@ const config: Partial = { }, translations: { en: { - title: - 'Collaborative project of multiple universities for a single generic study app', + title: 'Collaborative project of multiple universities for a single generic study app', }, }, type: SCAboutPageContentType.SECTION, @@ -200,10 +183,7 @@ const config: Partial = { type: SCAboutPageContentType.MARKDOWN, }, { - value: - '[mail]()
' + - '[+49 12 345 67890]()
' + - '[https://localhost/]()', + value: '[mail]()
' + '[+49 12 345 67890]()
' + '[https://localhost/]()', translations: { en: { value: 'This would be the english contact information', @@ -223,7 +203,7 @@ const config: Partial = { type: SCAboutPageContentType.SECTION, }, { - icon: 'newspaper', + icon: 'campaign', title: 'Neue Funktionen / Gelöste Probleme', link: 'changelog', translations: { @@ -234,7 +214,7 @@ const config: Partial = { type: SCAboutPageContentType.ROUTER_LINK, }, { - icon: 'document', + icon: 'description', title: 'Impressum', link: 'imprint', translations: { @@ -245,7 +225,7 @@ const config: Partial = { type: SCAboutPageContentType.ROUTER_LINK, }, { - icon: 'shield-half', + icon: 'policy', title: 'Datenschutz', link: 'privacy', translations: { @@ -256,7 +236,7 @@ const config: Partial = { type: SCAboutPageContentType.ROUTER_LINK, }, { - icon: 'reader', + icon: 'text_snippet', title: 'Allgemeine Geschäftsbedingungen', link: 'terms', translations: { @@ -267,7 +247,7 @@ const config: Partial = { type: SCAboutPageContentType.ROUTER_LINK, }, { - icon: 'library', + icon: 'copyright', title: 'Bibliotheken und Lizenzen', link: 'licenses', translations: { @@ -363,26 +343,11 @@ const config: Partial = { campusPolygon: { coordinates: [ [ - [ - 8.660432999690723, - 50.123027017044436, - ], - [ - 8.675496285518358, - 50.123027017044436, - ], - [ - 8.675496285518358, - 50.13066176448642, - ], - [ - 8.660432999690723, - 50.13066176448642, - ], - [ - 8.660432999690723, - 50.123027017044436, - ], + [8.660_432_999_690_723, 50.123_027_017_044_436], + [8.675_496_285_518_358, 50.123_027_017_044_436], + [8.675_496_285_518_358, 50.130_661_764_486_42], + [8.660_432_999_690_723, 50.130_661_764_486_42], + [8.660_432_999_690_723, 50.123_027_017_044_436], ], ], type: 'Polygon', @@ -397,6 +362,7 @@ const config: Partial = { }, menus: [ { + // unused icon: 'menu', id: 'main', items: [ @@ -427,7 +393,7 @@ const config: Partial = { }, }, { - icon: 'calendar', + icon: 'calendar_month', route: '/schedule', title: 'schedule', translations: { @@ -440,7 +406,7 @@ const config: Partial = { }, }, { - icon: 'cafe', + icon: 'local_cafe', route: '/canteen', title: 'canteen', translations: { @@ -453,7 +419,7 @@ const config: Partial = { }, }, { - icon: 'search', + icon: 'local_library', route: '/hebis-search', title: 'library catalog', translations: { @@ -466,7 +432,7 @@ const config: Partial = { }, }, { - icon: 'folder', + icon: 'inventory_2', route: '/catalog', title: 'course catalog', translations: { @@ -503,11 +469,12 @@ const config: Partial = { }, }, { - icon: 'person', + // unused + icon: 'account_circle', id: 'personal', items: [ { - icon: 'library', + icon: 'account_circle', route: '/library-account', title: 'library account', translations: { @@ -520,7 +487,7 @@ const config: Partial = { }, }, { - icon: 'star', + icon: 'grade', route: '/favorites', title: 'favorites', translations: { @@ -533,7 +500,7 @@ const config: Partial = { }, }, { - icon: 'person', + icon: 'account_circle', route: '/profile', title: 'profile', translations: { @@ -559,7 +526,7 @@ const config: Partial = { }, }, { - icon: 'information', + icon: 'info', route: '/about', title: 'about', translations: { @@ -572,7 +539,7 @@ const config: Partial = { }, }, { - icon: 'chatbubbles', + icon: 'rate_review', route: '/feedback', title: 'feedback', translations: { @@ -598,10 +565,7 @@ const config: Partial = { ], name: 'Goethe-Uni', privacyPolicyUrl: 'https://mobile.server.uni-frankfurt.de/_static/privacy.md', - settings: [ - userGroupSetting, - languageSetting, - ], + settings: [userGroupSetting, languageSetting], }, auth: { paia: { @@ -611,7 +575,8 @@ const config: Partial = { url: 'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php', }, endpoints: { - authorization: 'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php', + authorization: + 'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php', mapping: { id: '$.email', name: '$.name', @@ -623,14 +588,11 @@ const config: Partial = { }, }, backend: { - SCVersion: JSON.parse((readFileSync(resolve('.', '.', 'package.json'), 'utf-8')).toString()) - .dependencies['@openstapps/core'], - externalRequestTimeout: 5000, - hiddenTypes: [ - SCThingType.DateSeries, - SCThingType.Diff, - SCThingType.Floor, + SCVersion: JSON.parse(readFileSync(resolve('.', '.', 'package.json'), 'utf-8').toString()).dependencies[ + '@openstapps/core' ], + externalRequestTimeout: 5000, + hiddenTypes: [SCThingType.DateSeries, SCThingType.Diff, SCThingType.Floor], mappingIgnoredTags: ['minlength', 'pattern', 'see', 'tjs-format'], maxMultiSearchRouteQueries: 5, maxRequestBodySize: 512 * 1024, @@ -659,20 +621,12 @@ const config: Partial = { }, { fieldName: 'geo', - onlyOnTypes: [ - SCThingType.Building, - SCThingType.PointOfInterest, - SCThingType.Room, - ], + onlyOnTypes: [SCThingType.Building, SCThingType.PointOfInterest, SCThingType.Room], sortTypes: ['distance'], }, { fieldName: 'geo', - onlyOnTypes: [ - SCThingType.Building, - SCThingType.PointOfInterest, - SCThingType.Room, - ], + onlyOnTypes: [SCThingType.Building, SCThingType.PointOfInterest, SCThingType.Room], sortTypes: ['distance'], }, { @@ -690,9 +644,7 @@ const config: Partial = { }, { fieldName: 'offers', - onlyOnTypes: [ - SCThingType.Dish, - ], + onlyOnTypes: [SCThingType.Dish], sortTypes: ['price'], }, ], @@ -725,31 +677,19 @@ const config: Partial = { }, { fieldName: 'academicTerms.acronym', - onlyOnTypes: [ - SCThingType.AcademicEvent, - SCThingType.SportCourse, - ], + onlyOnTypes: [SCThingType.AcademicEvent, SCThingType.SportCourse], }, { fieldName: 'academicTerm.acronym', - onlyOnTypes: [ - SCThingType.Catalog, - ], + onlyOnTypes: [SCThingType.Catalog], }, { fieldName: 'majors', - onlyOnTypes: [ - SCThingType.AcademicEvent, - ], + onlyOnTypes: [SCThingType.AcademicEvent], }, { fieldName: 'keywords', - onlyOnTypes: [ - SCThingType.Article, - SCThingType.Book, - SCThingType.Message, - SCThingType.Video, - ], + onlyOnTypes: [SCThingType.Article, SCThingType.Book, SCThingType.Message, SCThingType.Video], }, { fieldName: 'type', @@ -772,7 +712,7 @@ const config: Partial = { { factor: 1, fields: { - 'categories': { + categories: { 'course': 1.08, 'integrated course': 1.08, 'introductory class': 1.05, @@ -790,11 +730,11 @@ const config: Partial = { { factor: 1, fields: { - 'categories': { - 'cafe': 1.1, - 'learn': 1.1, - 'library': 1.2, - 'restaurant': 1.1, + categories: { + cafe: 1.1, + learn: 1.1, + library: 1.2, + restaurant: 1.1, }, }, type: SCThingType.PointOfInterest, @@ -802,7 +742,7 @@ const config: Partial = { { factor: 1, fields: { - 'categories': { + categories: { 'main dish': 2, }, }, @@ -813,7 +753,7 @@ const config: Partial = { { factor: 1, fields: { - 'categories': { + categories: { 'cafe': 2, 'canteen': 2, 'restaurant': 2,