refactor: enter Goethe-Uni data (f-u)

This commit is contained in:
Jovan Krunić
2020-11-27 14:27:53 +01:00
committed by Rainer Killinger
parent 32c8a2149a
commit 26f3f4620b
2 changed files with 55 additions and 14 deletions

41
config/default-f-u.ts Normal file
View File

@@ -0,0 +1,41 @@
// tslint:disable:no-default-export
// tslint:disable:no-magic-numbers
import {SCConfigFile} from '@openstapps/core';
import {RecursivePartial} from '@openstapps/logger/lib/common';
import moment from 'moment';
import {inRangeInclusive} from '../src/common';
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<SCConfigFile> = {
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;

View File

@@ -21,24 +21,24 @@ const config: Partial<SCConfigFile> = {
coordinates: [
[
[
13.31916332244873,
52.50796756998264,
8.660432999690723,
50.123027017044436,
],
[
13.336544036865234,
52.50796756998264,
8.675496285518358,
50.123027017044436,
],
[
13.336544036865234,
52.51726547416385,
8.675496285518358,
50.13066176448642,
],
[
13.31916332244873,
52.51726547416385,
8.660432999690723,
50.13066176448642,
],
[
13.31916332244873,
52.50796756998264,
8.660432999690723,
50.123027017044436,
],
],
],
@@ -144,8 +144,8 @@ const config: Partial<SCConfigFile> = {
},
},
],
name: 'StApps - Technische Universität Berlin',
privacyPolicyUrl: 'https://stappsbe01.innocampus.tu-berlin.de/_static/privacy.md',
name: 'Goethe-Uni - Goethe-Universität Frankfurt am Main',
privacyPolicyUrl: 'https://mobile.server.uni-frankfurt.de/_static/privacy.md',
settings: [
{
categories: ['profile'],
@@ -266,7 +266,7 @@ const config: Partial<SCConfigFile> = {
mappingIgnoredTags: ['minlength', 'pattern', 'see', 'tjs-format'],
maxMultiSearchRouteQueries: 5,
maxRequestBodySize: 512 * 1024,
name: 'Technische Universität Berlin',
name: 'Goethe-Universität Frankfurt am Main',
namespace: '909a8cbc-8520-456c-b474-ef1525f14209',
sortableFields: [
{
@@ -464,7 +464,7 @@ const config: Partial<SCConfigFile> = {
],
},
},
uid: 'b-tu',
uid: 'f-u',
};
// tslint:disable-next-line:no-default-export