diff --git a/config/default-b-tu.ts b/config/default-b-tu.ts index f6532b66..62267705 100644 --- a/config/default-b-tu.ts +++ b/config/default-b-tu.ts @@ -2,40 +2,11 @@ // tslint:disable:no-magic-numbers import {SCConfigFile} from '@openstapps/core'; import {RecursivePartial} from '@openstapps/logger/lib/common'; -import moment from 'moment'; -import {inRangeInclusive} from './default'; - -const ssRange = [4, 9]; -const wsRange = [10, 3]; -const month = moment() - .month(); -const year = moment() - .year(); -const wsYearOffset = (month < wsRange[0] ? -1 : 0); -const wsAcronym = `WS ${year + wsYearOffset}/${(year + 1 + wsYearOffset) - .toString() - .slice(-2)}`; -const ssAcronym = `SS ${year + (month <= wsRange[1] ? -1 : 0)}`; /** * This is the default configuration for the technical university of Berlin */ const config: RecursivePartial = { - internal: { - boostings: { - default: [ - { - factor: 1, - fields: { - 'academicTerms.acronym': { - [ssAcronym]: inRangeInclusive(month, ssRange) ? 1.1 : 1.05, - [wsAcronym]: inRangeInclusive(month, wsRange) ? 1.1 : 1.05, - }, - }, - }, - ], - }, - }, }; export default config; diff --git a/config/default-f-u.ts b/config/default-f-u.ts index 8a8c711f..8347c6e3 100644 --- a/config/default-f-u.ts +++ b/config/default-f-u.ts @@ -579,6 +579,18 @@ const config: RecursivePartial = { }, }, app: { + features: { + extern: { + hisometry: { + authProvider: 'default', + url: 'https://his-self-service.rz.uni-frankfurt.de', + }, + paia: { + authProvider: 'paia', + url: 'https://hds.hebis.de:8443/core', + }, + }, + }, aboutPages: { 'about': { title: 'Über das StApps Projekt', diff --git a/config/default-fb-fh.ts b/config/default-fb-fh.ts index 1e1b8360..a6501b1c 100644 --- a/config/default-fb-fh.ts +++ b/config/default-fb-fh.ts @@ -2,41 +2,11 @@ // tslint:disable:no-magic-numbers import {SCConfigFile} from '@openstapps/core'; import {RecursivePartial} from '@openstapps/logger/lib/common'; -import moment from 'moment'; -import {inRangeInclusive} from './default'; - -const ssRange = [4, 9]; -const wsRange = [10, 3]; -const month = moment() - .month(); -const year = moment() - .year(); -const wsYearOffset = (month < wsRange[0] ? -1 : 0); -const wsAcronym = `WS ${(year + wsYearOffset).toString() - .slice(-2)}/${(year + 1 + wsYearOffset).toString() - .slice(-2)}`; -const ssAcronym = `SS ${(year + (month <= wsRange[1] ? -1 : 0)).toString() - .slice(-2)}`; /** * This is the default configuration for the university of Kassel */ const config: RecursivePartial = { - internal: { - boostings: { - default: [ - { - factor: 1, - fields: { - 'academicTerms.acronym': { - [ssAcronym]: inRangeInclusive(month, ssRange) ? 1.1 : 1.05, - [wsAcronym]: inRangeInclusive(month, wsRange) ? 1.1 : 1.05, - }, - }, - }, - ], - }, - }, }; export default config; diff --git a/config/default-ks-ug.ts b/config/default-ks-ug.ts index 61365b72..d9c9b645 100644 --- a/config/default-ks-ug.ts +++ b/config/default-ks-ug.ts @@ -2,41 +2,12 @@ // tslint:disable:no-magic-numbers import {SCConfigFile} from '@openstapps/core'; import {RecursivePartial} from '@openstapps/logger/lib/common'; -import moment from 'moment'; -import {inRangeInclusive} from './default'; -const ssRange = [4, 9]; -const wsRange = [10, 3]; -const month = moment() - .month(); -const year = moment() - .year(); -const wsYearOffset = (month < wsRange[0] ? -1 : 0); -const wsAcronym = `WiSe ${(year + wsYearOffset).toString() - .slice(-2)}/${(year + 1 + wsYearOffset).toString() - .slice(-2)}`; -const ssAcronym = `SoSe ${(year + (month <= wsRange[1] ? -1 : 0)).toString() - .slice(-2)}`; /** * This is the default configuration for the university of Kassel */ const config: RecursivePartial = { - internal: { - boostings: { - default: [ - { - factor: 1, - fields: { - 'academicTerms.acronym': { - [ssAcronym]: inRangeInclusive(month, ssRange) ? 1.1 : 1.05, - [wsAcronym]: inRangeInclusive(month, wsRange) ? 1.1 : 1.05, - }, - }, - }, - ], - }, - }, }; export default config; diff --git a/config/default.ts b/config/default.ts index 7d49d2eb..9a8ccecc 100644 --- a/config/default.ts +++ b/config/default.ts @@ -22,6 +22,22 @@ export function inRangeInclusive(num: number, range: number[]): boolean { return num >= range[0] && num <= 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 sommerYear = year + (month <= winterRange[1] ? -1 : 0); +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', @@ -430,6 +446,19 @@ const config: Partial = { }, }, }, + { + icon: 'search', + route: '/hebis-search', + title: 'library catalog', + translations: { + de: { + title: 'Bibliothekskatalog', + }, + en: { + title: 'library catalog', + }, + }, + }, { icon: 'folder', route: '/catalog', @@ -471,6 +500,19 @@ const config: Partial = { icon: 'person', id: 'personal', items: [ + { + icon: 'library', + route: '/library-account', + title: 'library account', + translations: { + de: { + title: 'Bibliothekskonto', + }, + en: { + title: 'library account', + }, + }, + }, { icon: 'star', route: '/favorites', @@ -713,8 +755,10 @@ const config: Partial = { factor: 1, fields: { 'academicTerms.acronym': { - 'SoSe 2022': 1.05, - 'WiSe 2021/2022': 1.1, + [ssAcronymShort]: inRangeInclusive(month, sommerRange) ? 1.1 : 1.05, + [wsAcronymShort]: inRangeInclusive(month, winterRange) ? 1.1 : 1.05, + [ssAcronymLong]: inRangeInclusive(month, sommerRange) ? 1.1 : 1.05, + [wsAcronymLong]: inRangeInclusive(month, winterRange) ? 1.1 : 1.05, }, }, type: SCThingType.AcademicEvent,