Compare commits

...

13 Commits

Author SHA1 Message Date
f6098d554c feat: database start script 2024-02-07 13:18:08 +01:00
6e565ee0df feat: sport course booking 2024-02-05 17:10:01 +01:00
eef0829528 feat: export core version in package 2024-01-25 15:48:34 +00:00
f828f6fc13 feat: add syncpack semver ranges 2024-01-12 11:27:40 +01:00
b67a0a9c5a feat: add ability to check for existence of a field 2024-01-12 11:27:28 +01:00
40d72fa0cc fix: exclude app.js and lib from typescript compliation 2024-01-04 10:14:47 +01:00
63a38e0077 feat: enable checkJs by default 2024-01-03 12:15:15 +00:00
c8b260201c feat: add direnv for nix
feat: update nix flake to not rely on buildFHSUserEnv
2024-01-03 12:15:15 +00:00
123c50d1af fix: backend tests break every year
refactor: update some backend unit tests
2024-01-03 12:57:24 +01:00
Rainer Killinger
d65e6351e9 fix: iOS build resources 2023-12-21 12:51:39 +01:00
Rainer Killinger
2c5d7403db refactor: add asdf tool versioning file 2023-12-21 12:25:38 +01:00
6ca03f463d fix: changeset crashes because it uses internal prettier version 2023-12-21 11:26:01 +01:00
Rainer Killinger
1f74a9bc82 refactor: overhaul minimal-deployment compose file 2023-12-19 16:52:58 +01:00
101 changed files with 710 additions and 512 deletions

View File

@@ -0,0 +1,5 @@
---
"@openstapps/prettier-config": patch
---
Update Prettier to 3.1.1

View File

@@ -0,0 +1,6 @@
---
"@openstapps/backend": minor
"@openstapps/core": minor
---
Add the ability to filter by existence of a field

View File

@@ -0,0 +1,5 @@
---
"@openstapps/backend": patch
---
Backend unit tests break every year

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

1
.gitignore vendored
View File

@@ -24,6 +24,7 @@ report-junit.xml
# NixOS flake # NixOS flake
result result
hsperfdata_root hsperfdata_root
.direnv/
# Directory for instrumented libs generated by jscoverage/JSCover # Directory for instrumented libs generated by jscoverage/JSCover
lib-cov lib-cov

View File

@@ -2,7 +2,7 @@
/** @type {import('syncpack').RcFile} */ /** @type {import('syncpack').RcFile} */
const config = { const config = {
semverRange: '', semverGroups: [{range: ''}],
source: ['package.json', '**/package.json'], source: ['package.json', '**/package.json'],
indent: ' ', indent: ' ',
sortFirst: [ sortFirst: [
@@ -49,7 +49,7 @@ const config = {
{ {
label: 'Packages should use workspace version', label: 'Packages should use workspace version',
dependencies: ['@openstapps/**'], dependencies: ['@openstapps/**'],
dependencyTypes: ['prod', 'dev'], dependencyTypes: ['prod', 'dev', 'peer'],
packages: ['**'], packages: ['**'],
pinVersion: 'workspace:*', pinVersion: 'workspace:*',
}, },

3
.tool-versions Normal file
View File

@@ -0,0 +1,3 @@
nodejs 18.16.1
pnpm 8.8.0
python 3.11.5

View File

@@ -1,5 +1,3 @@
// @ts-check
/** /**
* This is the database configuration for the technical university of berlin * This is the database configuration for the technical university of berlin
* *

View File

@@ -1,4 +1,3 @@
// @ts-check
import {SCSettingInputType, SCThingOriginType, SCThingType} from '@openstapps/core'; import {SCSettingInputType, SCThingOriginType, SCThingType} from '@openstapps/core';
/** @type {import('@openstapps/core').SCLanguageSetting} */ /** @type {import('@openstapps/core').SCLanguageSetting} */

View File

@@ -1,4 +1,3 @@
// @ts-check
/** @type {import('@openstapps/core').SCAppConfigurationMenuCategory[]} */ /** @type {import('@openstapps/core').SCAppConfigurationMenuCategory[]} */
const menus = [ const menus = [
{ {

View File

@@ -1,4 +1,3 @@
// @ts-check
import {SCSettingInputType, SCThingOriginType, SCThingType} from '@openstapps/core'; import {SCSettingInputType, SCThingOriginType, SCThingType} from '@openstapps/core';
/** @type {import('@openstapps/core').SCUserGroupSetting} */ /** @type {import('@openstapps/core').SCUserGroupSetting} */

View File

@@ -1,4 +1,3 @@
// @ts-check
import {SCThingType} from '@openstapps/core'; import {SCThingType} from '@openstapps/core';
/** @type {import('@openstapps/core').SCBackendAggregationConfiguration[]} */ /** @type {import('@openstapps/core').SCBackendAggregationConfiguration[]} */

View File

@@ -1,4 +1,3 @@
// @ts-check
import { import {
month, month,
sommerRange, sommerRange,

View File

@@ -1,4 +1,3 @@
// @ts-check
import {SCThingType} from '@openstapps/core'; import {SCThingType} from '@openstapps/core';
import aggregations from './aggregations.js'; import aggregations from './aggregations.js';
import boostings from './boostings.js'; import boostings from './boostings.js';
@@ -17,7 +16,7 @@ export const backend = {
hiddenTypes: [SCThingType.DateSeries, SCThingType.Diff, SCThingType.Floor], hiddenTypes: [SCThingType.DateSeries, SCThingType.Diff, SCThingType.Floor],
mappingIgnoredTags: ['minlength', 'pattern', 'see', 'tjs-format'], mappingIgnoredTags: ['minlength', 'pattern', 'see', 'tjs-format'],
maxMultiSearchRouteQueries: 5, maxMultiSearchRouteQueries: 5,
maxRequestBodySize: 2 * 10 ** 6, maxRequestBodySize: 2e6,
name: 'Goethe-Universität Frankfurt am Main', name: 'Goethe-Universität Frankfurt am Main',
namespace: '909a8cbc-8520-456c-b474-ef1525f14209', namespace: '909a8cbc-8520-456c-b474-ef1525f14209',
sortableFields: [ sortableFields: [

View File

@@ -1,4 +1,3 @@
// @ts-check
import app from './app/index.js'; import app from './app/index.js';
import {backend, internal} from './backend/index.js'; import {backend, internal} from './backend/index.js';

View File

@@ -1,5 +1,3 @@
// @ts-check
/** /**
* This is the default configuration for elasticsearch (a database) * This is the default configuration for elasticsearch (a database)
* *

View File

@@ -1,4 +1,3 @@
// @ts-check
import {readFile} from 'fs/promises'; import {readFile} from 'fs/promises';
import {SCAboutPageContentType} from '@openstapps/core'; import {SCAboutPageContentType} from '@openstapps/core';

View File

@@ -1,4 +1,3 @@
// @ts-check
/** /**
* Generates a range of numbers that represent consecutive calendar months * Generates a range of numbers that represent consecutive calendar months
* *

View File

@@ -1,4 +1,3 @@
// @ts-check
import {readFile, readdir} from 'fs/promises'; import {readFile, readdir} from 'fs/promises';
import url from 'url'; import url from 'url';
import path from 'path'; import path from 'path';

View File

@@ -1,4 +1,3 @@
// @ts-check
import {SCAboutPageContentType} from '@openstapps/core'; import {SCAboutPageContentType} from '@openstapps/core';
import {markdown} from '../../default/tools/markdown.js'; import {markdown} from '../../default/tools/markdown.js';

View File

@@ -1,4 +1,3 @@
// @ts-check
import {SCAboutPageContentType} from '@openstapps/core'; import {SCAboutPageContentType} from '@openstapps/core';
/** @type {import('@openstapps/core').SCAboutPage} */ /** @type {import('@openstapps/core').SCAboutPage} */

View File

@@ -1,4 +1,3 @@
// @ts-check
import about from './about.js'; import about from './about.js';
import imprint from './imprint.js'; import imprint from './imprint.js';
import privacy from './privacy.js'; import privacy from './privacy.js';

View File

@@ -1,4 +1,3 @@
// @ts-check
import {markdown} from '../../default/tools/markdown.js'; import {markdown} from '../../default/tools/markdown.js';
/** @type {import('@openstapps/core').SCAboutPage} */ /** @type {import('@openstapps/core').SCAboutPage} */

View File

@@ -1,4 +1,3 @@
// @ts-check
import aboutPages from './about-pages/index.js'; import aboutPages from './about-pages/index.js';
import defaultApp from '../default/app/index.js'; import defaultApp from '../default/app/index.js';
import {backend as defaultBackend, internal as defaultInternal} from '../default/backend/index.js'; import {backend as defaultBackend, internal as defaultInternal} from '../default/backend/index.js';

View File

@@ -1,4 +1,3 @@
// @ts-check
import {versions} from '../../default/tools/version.js'; import {versions} from '../../default/tools/version.js';
/** @type {import('@openstapps/core').SCAppVersionInfo[]} */ /** @type {import('@openstapps/core').SCAppVersionInfo[]} */

View File

@@ -21,16 +21,31 @@ import {QueryDslSpecificQueryContainer} from '../../types/util.js';
*/ */
export function buildValueFilter( export function buildValueFilter(
filter: SCSearchValueFilter, filter: SCSearchValueFilter,
): QueryDslSpecificQueryContainer<'term'> | QueryDslSpecificQueryContainer<'terms'> { ):
return Array.isArray(filter.arguments.value) | QueryDslSpecificQueryContainer<'exists'>
? { | QueryDslSpecificQueryContainer<'term'>
terms: { | QueryDslSpecificQueryContainer<'terms'> {
[`${filter.arguments.field}.raw`]: filter.arguments.value, switch (typeof filter.arguments.value) {
case 'undefined': {
return {
exists: {
field: filter.arguments.field,
}, },
} };
: { }
case 'string': {
return {
term: { term: {
[`${filter.arguments.field}.raw`]: filter.arguments.value, [`${filter.arguments.field}.raw`]: filter.arguments.value,
}, },
}; };
}
case 'object': {
return {
terms: {
[`${filter.arguments.field}.raw`]: filter.arguments.value,
},
};
}
}
} }

View File

@@ -14,6 +14,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { import {
SCBook,
SCBulkAddRoute, SCBulkAddRoute,
SCBulkDoneRoute, SCBulkDoneRoute,
SCBulkRequest, SCBulkRequest,
@@ -23,29 +24,30 @@ import {
import {expect} from 'chai'; import {expect} from 'chai';
import {bulk, DEFAULT_TEST_TIMEOUT} from '../common.js'; import {bulk, DEFAULT_TEST_TIMEOUT} from '../common.js';
import {testApp} from '../tests-setup.js'; import {testApp} from '../tests-setup.js';
import {readFile} from 'fs/promises';
import {v4} from 'uuid'; import {v4} from 'uuid';
import bookFile from '@openstapps/core/test/resources/indexable/Book.2.json' assert {type: 'json'};
const book = JSON.parse( const book = bookFile.instance as SCBook;
await readFile('node_modules/@openstapps/core/test/resources/indexable/Book.2.json', 'utf8'),
).instance;
describe('Bulk routes', async function () { describe('Bulk routes', async function () {
// increase timeout for the suite // increase timeout for the suite
this.timeout(DEFAULT_TEST_TIMEOUT); this.timeout(DEFAULT_TEST_TIMEOUT);
const request: SCBulkRequest = { let request: SCBulkRequest;
expiration: bulk.expiration, let bulkRoute: SCBulkRoute;
source: bulk.source, let bulkAddRoute: SCBulkAddRoute;
type: bulk.type, let bulkDoneRoute: SCBulkDoneRoute;
};
const bulkRoute = new SCBulkRoute();
const bulkAddRoute = new SCBulkAddRoute();
const bulkDoneRoute = new SCBulkDoneRoute();
// afterEach(async function() { before(function () {
// TODO: Delete saved bulks request = {
// }); expiration: bulk.expiration,
source: bulk.source,
type: bulk.type,
};
bulkRoute = new SCBulkRoute();
bulkAddRoute = new SCBulkAddRoute();
bulkDoneRoute = new SCBulkDoneRoute();
});
it('should create bulk', async function () { it('should create bulk', async function () {
const {status, body, error} = await testApp const {status, body, error} = await testApp

View File

@@ -21,7 +21,12 @@ import {expect} from 'chai';
describe('Index route', async function () { describe('Index route', async function () {
// increase timeout for the suite // increase timeout for the suite
this.timeout(DEFAULT_TEST_TIMEOUT); this.timeout(DEFAULT_TEST_TIMEOUT);
const indexRoute = new SCIndexRoute();
let indexRoute: SCIndexRoute;
before(function () {
indexRoute = new SCIndexRoute();
});
it('should respond with both app and backend configuration', async function () { it('should respond with both app and backend configuration', async function () {
const request: SCIndexRequest = {}; const request: SCIndexRequest = {};

View File

@@ -30,15 +30,11 @@ import chaiAsPromised from 'chai-as-promised';
import {DEFAULT_TEST_TIMEOUT} from '../common.js'; import {DEFAULT_TEST_TIMEOUT} from '../common.js';
import {testApp} from '../tests-setup.js'; import {testApp} from '../tests-setup.js';
import {backendConfig} from '../../src/config.js'; import {backendConfig} from '../../src/config.js';
import {readFile} from 'fs/promises'; import registerRequest from '@openstapps/core/test/resources/PluginRegisterRequest.1.json' assert {type: 'json'};
// for using promises in expectations (to.eventually.be...) // for using promises in expectations (to.eventually.be...)
use(chaiAsPromised); use(chaiAsPromised);
const registerRequest = JSON.parse(
await readFile('node_modules/@openstapps/core/test/resources/PluginRegisterRequest.1.json', 'utf8'),
);
// cast it because of "TS2322: Type 'string' is not assignable to type '"add"'" // cast it because of "TS2322: Type 'string' is not assignable to type '"add"'"
export const registerAddRequest: SCPluginAdd = registerRequest.instance as SCPluginAdd; export const registerAddRequest: SCPluginAdd = registerRequest.instance as SCPluginAdd;

View File

@@ -47,8 +47,8 @@ describe('Create route', async function () {
const statusCodeSuccess = 222; const statusCodeSuccess = 222;
const bodySuccess = {foo: true}; const bodySuccess = {foo: true};
const sandbox = sinon.createSandbox(); const sandbox = sinon.createSandbox();
const validationError = new SCValidationErrorResponse([]); let validationError: SCValidationErrorResponse;
const internalServerError = new SCInternalServerErrorResponse(); let internalServerError: SCInternalServerErrorResponse;
beforeEach(function () { beforeEach(function () {
app = express(); app = express();
@@ -64,6 +64,9 @@ describe('Create route', async function () {
handler = (_request, _app) => { handler = (_request, _app) => {
return Promise.resolve(bodySuccess); return Promise.resolve(bodySuccess);
}; };
validationError = new SCValidationErrorResponse([]);
internalServerError = new SCInternalServerErrorResponse();
}); });
afterEach(function () { afterEach(function () {

View File

@@ -29,11 +29,19 @@ import {backendConfig} from '../../src/config.js';
describe('Search route', async function () { describe('Search route', async function () {
// increase timeout for the suite // increase timeout for the suite
this.timeout(DEFAULT_TEST_TIMEOUT); this.timeout(DEFAULT_TEST_TIMEOUT);
const searchRoute = new SCSearchRoute(); let searchRoute: SCSearchRoute;
const multiSearchRoute = new SCMultiSearchRoute(); let multiSearchRoute: SCMultiSearchRoute;
const syntaxError = new SCSyntaxErrorResponse('Foo Message'); let syntaxError: SCSyntaxErrorResponse;
const methodNotAllowedError = new SCMethodNotAllowedErrorResponse(); let methodNotAllowedError: SCMethodNotAllowedErrorResponse;
const tooManyRequestsError = new SCTooManyRequestsErrorResponse(); let tooManyRequestsError: SCTooManyRequestsErrorResponse;
before(function () {
searchRoute = new SCSearchRoute();
multiSearchRoute = new SCMultiSearchRoute();
syntaxError = new SCSyntaxErrorResponse('Foo Message');
methodNotAllowedError = new SCMethodNotAllowedErrorResponse();
tooManyRequestsError = new SCTooManyRequestsErrorResponse();
});
it('should reject GET, PUT with a valid search query', async function () { it('should reject GET, PUT with a valid search query', async function () {
// const expectedParams = JSON.parse(JSON.stringify(defaultParams)); // const expectedParams = JSON.parse(JSON.stringify(defaultParams));

View File

@@ -13,23 +13,25 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import {SCThingUpdateRoute} from '@openstapps/core'; import {SCBook, SCThingUpdateRoute} from '@openstapps/core';
import chaiAsPromised from 'chai-as-promised'; import chaiAsPromised from 'chai-as-promised';
import {bulkStorageMock, DEFAULT_TEST_TIMEOUT} from '../common.js'; import {bulkStorageMock, DEFAULT_TEST_TIMEOUT} from '../common.js';
import {expect, use} from 'chai'; import {expect, use} from 'chai';
import {testApp} from '../tests-setup.js'; import {testApp} from '../tests-setup.js';
import {readFile} from 'fs/promises'; import bookFile from '@openstapps/core/test/resources/indexable/Book.1.json' assert {type: 'json'};
use(chaiAsPromised); use(chaiAsPromised);
const book = JSON.parse( const book = bookFile.instance as SCBook;
await readFile('node_modules/@openstapps/core/test/resources/indexable/Book.1.json', 'utf8'),
).instance;
describe('Thing update route', async function () { describe('Thing update route', async function () {
// increase timeout for the suite // increase timeout for the suite
this.timeout(DEFAULT_TEST_TIMEOUT); this.timeout(DEFAULT_TEST_TIMEOUT);
const thingUpdateRoute = new SCThingUpdateRoute(); let thingUpdateRoute: SCThingUpdateRoute;
before(function () {
thingUpdateRoute = new SCThingUpdateRoute();
});
it('should update a thing', async function () { it('should update a thing', async function () {
const thingUpdateRouteurlPath = thingUpdateRoute.urlPath const thingUpdateRouteurlPath = thingUpdateRoute.urlPath

View File

@@ -39,7 +39,6 @@ import {Elasticsearch} from '../../../src/storage/elasticsearch/elasticsearch.js
import {bulk, DEFAULT_TEST_TIMEOUT, getTransport, getIndex} from '../../common.js'; import {bulk, DEFAULT_TEST_TIMEOUT, getTransport, getIndex} from '../../common.js';
import fs from 'fs'; import fs from 'fs';
import {backendConfig} from '../../../src/config.js'; import {backendConfig} from '../../../src/config.js';
import {readFile} from 'fs/promises';
import { import {
ACTIVE_INDICES_ALIAS, ACTIVE_INDICES_ALIAS,
getIndexUID, getIndexUID,
@@ -50,6 +49,11 @@ import {
} from '../../../src/storage/elasticsearch/util/index.js'; } from '../../../src/storage/elasticsearch/util/index.js';
import cron from 'node-cron'; import cron from 'node-cron';
import {query} from './query.js'; import {query} from './query.js';
import messageFile from '@openstapps/core/test/resources/indexable/Message.1.json' assert {type: 'json'};
import bookFile from '@openstapps/core/test/resources/indexable/Book.1.json' assert {type: 'json'};
const message = messageFile.instance as SCMessage;
const book = bookFile.instance as SCBook;
use(chaiAsPromised); use(chaiAsPromised);
@@ -60,13 +64,6 @@ function searchResponse<T>(...hits: SearchHit<T>[]): SearchResponse<T> {
return {hits: {hits}, took: 0, timed_out: false, _shards: {total: 1, failed: 0, successful: 1}}; return {hits: {hits}, took: 0, timed_out: false, _shards: {total: 1, failed: 0, successful: 1}};
} }
const message = JSON.parse(
await readFile('node_modules/@openstapps/core/test/resources/indexable/Message.1.json', 'utf8'),
);
const book = JSON.parse(
await readFile('node_modules/@openstapps/core/test/resources/indexable/Book.1.json', 'utf8'),
);
describe('Elasticsearch', function () { describe('Elasticsearch', function () {
// increase timeout for the suite // increase timeout for the suite
this.timeout(DEFAULT_TEST_TIMEOUT); this.timeout(DEFAULT_TEST_TIMEOUT);
@@ -74,8 +71,15 @@ describe('Elasticsearch', function () {
before(function () { before(function () {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log('before');
sandbox.stub(fs, 'readFileSync').returns('{}'); sandbox.stub(fs, 'readFileSync').returns('{}');
sandbox.stub(backendConfig.internal.boostings.default[0], 'fields').value({
'academicTerms.acronym': {
'SS 2023': 1.05,
'WS 2023/24': 1.1,
'SoSe 2023': 1.05,
'WiSe 2023/24': 1.1,
},
});
}); });
after(function () { after(function () {
sandbox.restore(); sandbox.restore();
@@ -445,7 +449,7 @@ describe('Elasticsearch', function () {
_id: '', _id: '',
_index: '', _index: '',
_score: 0, _score: 0,
_source: message as SCMessage, _source: message,
}; };
sandbox.stub(es.client, 'search').resolves(searchResponse(foundObject)); sandbox.stub(es.client, 'search').resolves(searchResponse(foundObject));
@@ -475,7 +479,7 @@ describe('Elasticsearch', function () {
const object: SearchHit<SCMessage> = { const object: SearchHit<SCMessage> = {
_id: '', _id: '',
_index: oldIndex, _index: oldIndex,
_source: message as SCMessage, _source: message,
}; };
sandbox.stub(es.client, 'search').resolves(searchResponse<SCMessage>(object)); sandbox.stub(es.client, 'search').resolves(searchResponse<SCMessage>(object));
sandbox.stub(es, 'prepareBulkWrite').resolves(index); sandbox.stub(es, 'prepareBulkWrite').resolves(index);
@@ -489,7 +493,7 @@ describe('Elasticsearch', function () {
sandbox.stub(es.client, 'create').resolves({result: 'not_found'} as CreateResponse); sandbox.stub(es.client, 'create').resolves({result: 'not_found'} as CreateResponse);
await es.init(); await es.init();
return expect(es.post(message as SCMessage, bulk)).to.rejectedWith('creation'); return expect(es.post(message, bulk)).to.rejectedWith('creation');
}); });
it('should create a new object', async function () { it('should create a new object', async function () {
@@ -502,7 +506,7 @@ describe('Elasticsearch', function () {
}); });
await es.init(); await es.init();
await es.post(message as SCMessage, bulk); await es.post(message, bulk);
expect(createStub.called).to.be.true; expect(createStub.called).to.be.true;
expect(caughtParameter.document).to.be.eql({ expect(caughtParameter.document).to.be.eql({
@@ -527,7 +531,7 @@ describe('Elasticsearch', function () {
_id: '', _id: '',
_index: getIndex(), _index: getIndex(),
_score: 0, _score: 0,
_source: message as SCMessage, _source: message,
}; };
sandbox.stub(es.client, 'search').resolves(searchResponse()); sandbox.stub(es.client, 'search').resolves(searchResponse());
@@ -541,7 +545,7 @@ describe('Elasticsearch', function () {
_id: '', _id: '',
_index: getIndex(), _index: getIndex(),
_score: 0, _score: 0,
_source: message as SCMessage, _source: message,
}; };
sandbox.stub(es.client, 'search').resolves(searchResponse(object)); sandbox.stub(es.client, 'search').resolves(searchResponse(object));
// @ts-expect-error unused // @ts-expect-error unused
@@ -564,13 +568,13 @@ describe('Elasticsearch', function () {
_id: '123', _id: '123',
_index: getIndex(), _index: getIndex(),
_score: 0, _score: 0,
_source: message as SCMessage, _source: message,
}; };
const objectBook: SearchHit<SCBook> = { const objectBook: SearchHit<SCBook> = {
_id: '321', _id: '321',
_index: getIndex(), _index: getIndex(),
_score: 0, _score: 0,
_source: book as SCBook, _source: book,
}; };
const fakeEsAggregations = { const fakeEsAggregations = {
'@all': { '@all': {

View File

@@ -2,9 +2,7 @@
"extends": "@openstapps/tsconfig", "extends": "@openstapps/tsconfig",
"compilerOptions": { "compilerOptions": {
"resolveJsonModule": true, "resolveJsonModule": true,
"useUnknownInCatchVariables": false, "useUnknownInCatchVariables": false
"allowJs": true,
"checkJs": true
}, },
"exclude": ["app.js", "lib/"] "exclude": ["lib", "app.js"]
} }

View File

@@ -2,6 +2,9 @@
"name": "@openstapps/database", "name": "@openstapps/database",
"version": "3.0.0", "version": "3.0.0",
"private": true, "private": true,
"scripts": {
"start": "docker run -it -p 9200:9200 $(docker build -q .)"
},
"files": [ "files": [
"config", "config",
"Dockerfile", "Dockerfile",

View File

@@ -1,4 +1,4 @@
{ {
"extends": "@openstapps/tsconfig", "extends": "@openstapps/tsconfig",
"exclude": ["./config/", "./lib/"] "exclude": ["config", "lib", "app.js"]
} }

View File

@@ -1,4 +1,3 @@
// @ts-check
const fs = require("fs"); const fs = require("fs");
const path = require("node:path"); const path = require("node:path");
const child_process = require("child_process"); const child_process = require("child_process");

View File

@@ -1,4 +1,3 @@
// @ts-check
"use strict" "use strict"
const rule = require('./copyright-header-rule') const rule = require('./copyright-header-rule')

View File

@@ -1,5 +1,3 @@
// @ts-check
/** @type {import('eslint').Linter.Config} */ /** @type {import('eslint').Linter.Config} */
const config = { const config = {
root: true, root: true,

View File

@@ -19,9 +19,9 @@
"test": "prettier --config index.js --check \"test/*.js\"" "test": "prettier --config index.js --check \"test/*.js\""
}, },
"devDependencies": { "devDependencies": {
"prettier": "3.1.0" "prettier": "3.1.1"
}, },
"peerDependencies": { "peerDependencies": {
"prettier": "3.1.0" "prettier": "3.1.1"
} }
} }

View File

@@ -1,3 +1,4 @@
{ {
"extends": "@openstapps/tsconfig" "extends": "@openstapps/tsconfig",
"exclude": ["lib", "app.js"]
} }

View File

@@ -14,6 +14,7 @@
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"isolatedModules": true, "isolatedModules": true,
"allowJs": true, "allowJs": true,
"checkJs": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"noImplicitAny": true, "noImplicitAny": true,

View File

@@ -1,3 +1,4 @@
{ {
"extends": "@openstapps/tsconfig" "extends": "@openstapps/tsconfig",
"exclude": ["lib", "app.js"]
} }

View File

@@ -1,44 +1,62 @@
version: '3.7' version: '3.7'
x-development-variables: &development-variables
NODE_ENV: "development"
ALLOW_NO_TRANSPORT: "true"
services: services:
database: database:
image: registry.gitlab.com/openstapps/openstapps/database:2.0.0 image: registry.gitlab.com/openstapps/openstapps/database:3.0.0
volumes: # If you need persistence for debugging purposes uncomment the following lines
- ./database:/usr/share/elasticsearch/data #volumes:
# - ./database:/usr/share/elasticsearch/data
expose: expose:
- "9200" - 9200
ports:
- 127.0.0.1:9200:9200
environment:
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
- discovery.type=single-node
ulimits:
memlock:
soft: -1
hard: -1
restart: unless-stopped restart: unless-stopped
backend: backend:
image: registry.gitlab.com/openstapps/openstapps/backend:3.0.0-next.0 image: registry.gitlab.com/openstapps/openstapps/backend:3.1.0
environment: environment:
<<: *development-variables
ES_ADDR: "http://database:9200" ES_ADDR: "http://database:9200"
NODE_CONFIG_ENV: "elasticsearch" NODE_CONFIG_ENV: "elasticsearch"
ALLOW_NO_TRANSPORT: "true" NODE_APP_INSTANCE: "f-u"
PROMETHEUS_MIDDLEWARE: "false"
expose: expose:
- 3000 - 3000
ports: ports:
- 3000:3000 - 127.0.0.1:3000:3000
links:
- "database"
labels: labels:
- stapps.version=1.0.0 - stapps.version=4.1.0
restart: unless-stopped restart: unless-stopped
depends_on: depends_on:
- database - database
api:
image: registry.gitlab.com/openstapps/openstapps/api:3.0.0-next.0
links: links:
- "backend" - database
minimal-connector: # api:
image: registry.gitlab.com/openstapps/minimal-connector:core-0.23 # image: registry.gitlab.com/openstapps/openstapps/api:3.0.0
container_name: minimal-connector-0.23 # links:
command: ["http://backend:3000", "minimal-connector", "f-u"] # - backend
app: # minimal-connector:
image: registry.gitlab.com/openstapps/app/executable:core-0.23 # image: registry.gitlab.com/openstapps/minimal-connector:core-0.23
expose: # container_name: minimal-connector-0.23
- 8100 # command: ["http://backend:3000", "minimal-connector", "f-u"]
ports:
- 8100:8100 # app:
# image: registry.gitlab.com/openstapps/app/executable:core-0.23
# expose:
# - 8100
# ports:
# - 8100:8100

View File

@@ -1,3 +1,4 @@
{ {
"extends": "@openstapps/tsconfig" "extends": "@openstapps/tsconfig",
"exclude": ["lib", "app.js"]
} }

34
flake.lock generated
View File

@@ -1,5 +1,23 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1701626906, "lastModified": 1701626906,
@@ -18,8 +36,24 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

142
flake.nix
View File

@@ -1,77 +1,75 @@
{ {
description = "A Nix-flake-based development environment for OpenStApps"; description = "A Nix-flake-based development environment for OpenStApps";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; inputs = {
outputs = { self, nixpkgs }: nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
let flake-utils.url = "github:numtide/flake-utils";
buildToolsVersion = "30.0.3"; };
overlays = [ outputs = {
(final: prev: rec { self,
nodejs = prev.nodejs-18_x; nixpkgs,
pnpm = prev.nodePackages.pnpm; flake-utils,
chrome = prev.google-chrome; }: let
firefox = prev.firefox; aapt2buildToolsVersion = "33.0.2";
webkit = prev.epiphany; # Safari-ish browser in
android = prev.androidenv.composeAndroidPackages { flake-utils.lib.eachDefaultSystem (system: let
buildToolsVersions = [ "${buildToolsVersion}" ]; pkgs = import nixpkgs {
platformVersions = [ "33" ]; inherit system;
}; overlays = [
cypress = prev.cypress.overrideAttrs(cyPrev: rec { (final: prev: rec {
version = "13.2.0"; fontMin = prev.python311.withPackages (ps: with ps; [brotli fonttools] ++ (with fonttools.optional-dependencies; [woff]));
src = prev.fetchzip { android = prev.androidenv.composeAndroidPackages {
url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip"; buildToolsVersions = ["30.0.3" aapt2buildToolsVersion];
hash = "sha256-9o0nprGcJhudS1LNm+T7Vf0Dwd1RBauYKI+w1FBQ3ZM="; platformVersions = ["33"];
}; };
}); cypress = prev.cypress.overrideAttrs (cyPrev: rec {
}) version = "13.2.0";
]; src = prev.fetchzip {
# TODO: aarch64-linux, x68_64-darwin, aarch64-darwin url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip";
supportedSystems = [ "x86_64-linux" ]; hash = "sha256-9o0nprGcJhudS1LNm+T7Vf0Dwd1RBauYKI+w1FBQ3ZM=";
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { };
pkgs = import nixpkgs { });
inherit overlays system; })
config = { ];
allowUnfree = true; config = {
android_sdk.accept_license = true; allowUnfree = true;
}; android_sdk.accept_license = true;
}; };
}); };
in androidFhs = pkgs.buildFHSUserEnv {
{ name = "android-env";
devShells = forEachSupportedSystem ({ pkgs }: targetPkgs = pkgs: with pkgs; [];
let runScript = "bash";
python = (pkgs.python311.withPackages(ps: with ps; [ brotli fonttools ] ++ (with fonttools.optional-dependencies; [ ufo lxml unicode woff ]))); profile = ''
in export ALLOW_NINJA_ENV=true
{ export USE_CCACHE=1
default = (pkgs.buildFHSUserEnv { export LD_LIBRARY_PATH=/usr/lib:/usr/lib32
name = "StApps Dev"; '';
targetPkgs = pkgs: with pkgs; [ };
nodejs in {
pnpm devShell = pkgs.mkShell rec {
python nativeBuildInputs = [androidFhs];
docker buildInputs = with pkgs; [
# tools nodejs-18_x
curl nodePackages.pnpm
jq # tools
# browsers curl
firefox jq
chrome fontMin
webkit # browsers
cypress firefox
# android google-chrome
jdk17 epiphany # Safari-ish browser
android.androidsdk cypress
musl # android
]; jdk17
runScript = "bash"; android.androidsdk
profile = '' musl
export CYPRESS_INSTALL_BINARY=0 ];
export CYPRESS_RUN_BINARY=${pkgs.cypress}/bin/Cypress ANDROID_JAVA_HOME = "${pkgs.jdk.home}";
export ANDROID_SDK_ROOT=${pkgs.android.androidsdk}/libexec/android-sdk ANDROID_SDK_ROOT = "${pkgs.android.androidsdk}/libexec/android-sdk";
export ANDROID_JAVA_HOME=${pkgs.jdk.home} GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_SDK_ROOT}/build-tools/${aapt2buildToolsVersion}/aapt2";
export DOCKER_HOST=unix:///run/user/1000/docker.sock CYPRESS_INSTALL_BINARY = "0";
{ dockerd-rootless & } 2>/dev/null CYPRESS_RUN_BINARY = "${pkgs.cypress}/bin/Cypress";
''; };
}).env; });
});
};
} }

View File

@@ -25,7 +25,7 @@ def capacitor_pods
pod 'CapacitorPreferences', :path => '../../../../node_modules/.pnpm/@capacitor+preferences@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/preferences' pod 'CapacitorPreferences', :path => '../../../../node_modules/.pnpm/@capacitor+preferences@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/preferences'
pod 'CapacitorShare', :path => '../../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/share' pod 'CapacitorShare', :path => '../../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/share'
pod 'CapacitorSplashScreen', :path => '../../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen' pod 'CapacitorSplashScreen', :path => '../../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen'
pod 'TransistorsoftCapacitorBackgroundFetch', :path => '../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@1.0.2_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch' pod 'TransistorsoftCapacitorBackgroundFetch', :path => '../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.1.1_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch'
pod 'CapacitorSecureStoragePlugin', :path => '../../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.9.0_@capacitor+core@5.5.0/node_modules/capacitor-secure-storage-plugin' pod 'CapacitorSecureStoragePlugin', :path => '../../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.9.0_@capacitor+core@5.5.0/node_modules/capacitor-secure-storage-plugin'
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins' pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
end end

View File

@@ -36,7 +36,7 @@ PODS:
- CordovaPlugins (5.5.0): - CordovaPlugins (5.5.0):
- CapacitorCordova - CapacitorCordova
- SwiftKeychainWrapper (4.0.1) - SwiftKeychainWrapper (4.0.1)
- TransistorsoftCapacitorBackgroundFetch (1.0.2): - TransistorsoftCapacitorBackgroundFetch (5.1.1):
- Capacitor - Capacitor
DEPENDENCIES: DEPENDENCIES:
@@ -58,7 +58,7 @@ DEPENDENCIES:
- "CapacitorShare (from `../../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/share`)" - "CapacitorShare (from `../../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/share`)"
- "CapacitorSplashScreen (from `../../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen`)" - "CapacitorSplashScreen (from `../../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen`)"
- CordovaPlugins (from `../capacitor-cordova-ios-plugins`) - CordovaPlugins (from `../capacitor-cordova-ios-plugins`)
- "TransistorsoftCapacitorBackgroundFetch (from `../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@1.0.2_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch`)" - "TransistorsoftCapacitorBackgroundFetch (from `../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.1.1_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch`)"
SPEC REPOS: SPEC REPOS:
trunk: trunk:
@@ -102,7 +102,7 @@ EXTERNAL SOURCES:
CordovaPlugins: CordovaPlugins:
:path: "../capacitor-cordova-ios-plugins" :path: "../capacitor-cordova-ios-plugins"
TransistorsoftCapacitorBackgroundFetch: TransistorsoftCapacitorBackgroundFetch:
:path: "../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@1.0.2_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch" :path: "../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.1.1_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch"
SPEC CHECKSUMS: SPEC CHECKSUMS:
Capacitor: 57890b363df14d5d2d5d8461aa23e886cb34da2a Capacitor: 57890b363df14d5d2d5d8461aa23e886cb34da2a
@@ -124,8 +124,8 @@ SPEC CHECKSUMS:
CapacitorSplashScreen: 5fa2ab5e46cf5cc530cf16a51c80c7a986579ccd CapacitorSplashScreen: 5fa2ab5e46cf5cc530cf16a51c80c7a986579ccd
CordovaPlugins: de5669381702d76ed5b1d442177a6a5fc3252a9d CordovaPlugins: de5669381702d76ed5b1d442177a6a5fc3252a9d
SwiftKeychainWrapper: 807ba1d63c33a7d0613288512399cd1eda1e470c SwiftKeychainWrapper: 807ba1d63c33a7d0613288512399cd1eda1e470c
TransistorsoftCapacitorBackgroundFetch: 74ca62dae7ec78639eaf3d0d1e24c595ada213dd TransistorsoftCapacitorBackgroundFetch: ce4b3e01b898cef516e68485d2160a078016ee97
PODFILE CHECKSUM: 073b899f90bacc5049101cb9c562a168757d554e PODFILE CHECKSUM: 229278f2c257e8ab555325c7115b2e187e8e628d
COCOAPODS: 1.13.0 COCOAPODS: 1.13.0

View File

@@ -1,4 +1,3 @@
// @ts-check
/* /*
* Copyright (C) 2022 StApps * Copyright (C) 2022 StApps
* This program is free software: you can redistribute it and/or modify it * This program is free software: you can redistribute it and/or modify it

View File

@@ -21,7 +21,7 @@ import {
SCThingOriginType, SCThingOriginType,
SCThingType, SCThingType,
} from '@openstapps/core'; } from '@openstapps/core';
import packageInfo from '@openstapps/core/package.json'; import {CORE_VERSION} from '@openstapps/core';
import {Polygon} from 'geojson'; import {Polygon} from 'geojson';
// provides sample aggregations to be used in tests or backendless development // provides sample aggregations to be used in tests or backendless development
@@ -195,7 +195,7 @@ export const sampleIndexResponse: SCIndexResponse = {
}, },
auth: {}, auth: {},
backend: { backend: {
SCVersion: packageInfo.version, SCVersion: CORE_VERSION,
externalRequestTimeout: 5000, externalRequestTimeout: 5000,
hiddenTypes: [SCThingType.DateSeries, SCThingType.Diff, SCThingType.Floor], hiddenTypes: [SCThingType.DateSeries, SCThingType.Diff, SCThingType.Floor],
mappingIgnoredTags: [], mappingIgnoredTags: [],

View File

@@ -70,6 +70,7 @@ import {setDefaultOptions} from 'date-fns';
import {DateFnsConfigurationService} from 'ngx-date-fns'; import {DateFnsConfigurationService} from 'ngx-date-fns';
import {Capacitor} from '@capacitor/core'; import {Capacitor} from '@capacitor/core';
import {SplashScreen} from '@capacitor/splash-screen'; import {SplashScreen} from '@capacitor/splash-screen';
import {SportCoursesModule} from './modules/sport-courses/sport-courses.module';
registerLocaleData(localeDe); registerLocaleData(localeDe);
@@ -170,6 +171,7 @@ export function createTranslateLoader(http: HttpClient) {
ScheduleModule, ScheduleModule,
SettingsModule, SettingsModule,
StorageModule, StorageModule,
SportCoursesModule,
ThingTranslateModule.forRoot(), ThingTranslateModule.forRoot(),
TranslateModule.forRoot({ TranslateModule.forRoot({
defaultLanguage: 'en', defaultLanguage: 'en',

View File

@@ -15,7 +15,7 @@
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {Client} from '@openstapps/api'; import {Client} from '@openstapps/api';
import {SCAppConfiguration, SCIndexResponse} from '@openstapps/core'; import {SCAppConfiguration, SCIndexResponse} from '@openstapps/core';
import packageInfo from '@openstapps/core/package.json'; import {CORE_VERSION} from '@openstapps/core';
import {NGXLogger} from 'ngx-logger'; import {NGXLogger} from 'ngx-logger';
import {environment} from '../../../environments/environment'; import {environment} from '../../../environments/environment';
import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider'; import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider';
@@ -55,7 +55,7 @@ export class ConfigProvider {
/** /**
* Version of the @openstapps/core package that app is using * Version of the @openstapps/core package that app is using
*/ */
scVersion = packageInfo.version; scVersion = CORE_VERSION;
/** /**
* First session indicator (config not found in storage) * First session indicator (config not found in storage)

View File

@@ -13,7 +13,7 @@
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {SCDateSeries, SCThingType, SCThings} from '@openstapps/core'; import {SCThingType, SCThings} from '@openstapps/core';
/** /**
* Shows a horizontal list of action chips * Shows a horizontal list of action chips
@@ -47,9 +47,7 @@ export class ActionChipListComponent {
const isNullIsland = maybeCoords ? maybeCoords[0] === 0 && maybeCoords[1] === 0 : false; const isNullIsland = maybeCoords ? maybeCoords[0] === 0 && maybeCoords[1] === 0 : false;
this.applicable = { this.applicable = {
locate: false, // TODO: reimplement this at a later date locate: false, // TODO: reimplement this at a later date
event: event: item.type === SCThingType.AcademicEvent || item.type === SCThingType.SportCourse,
item.type === SCThingType.AcademicEvent ||
(item.type === SCThingType.DateSeries && (item as SCDateSeries).dates.length > 0),
navigate: (hasDirectGeo || isInPlace) && !isNullIsland, navigate: (hasDirectGeo || isInPlace) && !isNullIsland,
}; };
} }

View File

@@ -39,7 +39,7 @@ export const DataIcons: Record<SCThingType, string> = {
'room': SCIcon`meeting_room`, 'room': SCIcon`meeting_room`,
'semester': SCIcon`date_range`, 'semester': SCIcon`date_range`,
'setting': SCIcon`settings`, 'setting': SCIcon`settings`,
'sport course': SCIcon`sports_soccer`, 'sport course': SCIcon`sports_gymnastics`,
'study module': SCIcon`view_module`, 'study module': SCIcon`view_module`,
'ticket': SCIcon`confirmation_number`, 'ticket': SCIcon`confirmation_number`,
'todo': SCIcon`task`, 'todo': SCIcon`task`,

View File

@@ -107,6 +107,8 @@ import {SemesterListItemComponent} from './types/semester/semester-list-item.com
import {VideoDetailContentComponent} from './types/video/video-detail-content.component'; import {VideoDetailContentComponent} from './types/video/video-detail-content.component';
import {VideoListItemComponent} from './types/video/video-list-item.component'; import {VideoListItemComponent} from './types/video/video-list-item.component';
import {ShareButtonComponent} from './elements/share-button.component'; import {ShareButtonComponent} from './elements/share-button.component';
import {SanitizeHtmlPipe} from '../../util/sanitize-html.pipe';
import {BypassTrustUrlPipe} from '../../util/bypass-trust-url.pipe';
/** /**
* Module for handling data * Module for handling data
@@ -193,6 +195,8 @@ import {ShareButtonComponent} from './elements/share-button.component';
MarkdownModule.forRoot(), MarkdownModule.forRoot(),
MenuModule, MenuModule,
IonIconModule, IonIconModule,
SanitizeHtmlPipe,
BypassTrustUrlPipe,
MomentModule.forRoot({ MomentModule.forRoot({
relativeTimeThresholdOptions: { relativeTimeThresholdOptions: {
m: 59, m: 59,

View File

@@ -13,12 +13,23 @@
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '@openstapps/core'; import {SCAcademicPriceGroup, SCThingThatCanBeOffered, SCThingType, SCThings} from '@openstapps/core';
import {SimpleBrowser} from 'src/app/util/browser.factory';
type WithRequired<T, K extends keyof T> = T & {[P in K]-?: T[P]};
@Component({ @Component({
selector: 'stapps-offers-detail', selector: 'stapps-offers-detail',
templateUrl: 'offers-detail.html', templateUrl: 'offers-detail.html',
}) })
export class OffersDetailComponent { export class OffersDetailComponent {
@Input() offers: Array<SCThingThatCanBeOfferedOffer<SCAcademicPriceGroup>>; @Input() item: SCThings & WithRequired<SCThingThatCanBeOffered<SCAcademicPriceGroup>, 'offers'>;
constructor(readonly browser: SimpleBrowser) {}
async submit(id: string) {
if (this.item.type === SCThingType.DateSeries && this.item.event.type === SCThingType.SportCourse) {
this.browser.open(`${this.item.event.sameAs}#${id}`);
}
}
} }

View File

@@ -16,7 +16,7 @@
<ion-card> <ion-card>
<ion-card-header>{{ 'data.detail.offers.TITLE' | translate | titlecase }}</ion-card-header> <ion-card-header>{{ 'data.detail.offers.TITLE' | translate | titlecase }}</ion-card-header>
<ion-card-content> <ion-card-content>
<div *ngFor="let offer of offers"> <div *ngFor="let offer of item.offers">
<ion-grid> <ion-grid>
<ion-row> <ion-row>
<ion-col *ngIf="offer.inPlace"> <ion-col *ngIf="offer.inPlace">
@@ -45,16 +45,24 @@
</ng-container> </ng-container>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
<ion-grid *ngIf="offer.availability === 'out of stock'"> <ion-button
<ion-row> *ngIf="item.identifiers?.zfh as id; else availability"
<ion-col></ion-col> (click)="submit(id)"
<ion-col width-20 text-right> [color]="offer.availability === 'out of stock' ? 'danger' : offer.availability === 'limited availability' ? 'warning' : 'primary'"
<ion-text color="danger"> >{{'data.detail.offers.' + offer.availability | translate}}</ion-button
<p>{{ 'data.detail.offers.sold_out' | translate }}</p> >
</ion-text> <ng-template #availability>
</ion-col> <ion-grid *ngIf="offer.availability === 'out of stock'">
</ion-row> <ion-row>
</ion-grid> <ion-col></ion-col>
<ion-col width-20 text-right>
<ion-text color="danger">
<p>{{ 'data.detail.offers.' + offer.availability | translate }}</p>
</ion-text>
</ion-col>
</ion-row>
</ion-grid>
</ng-template>
</div> </div>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>

View File

@@ -18,7 +18,7 @@
<h2>{{ price | currency : 'EUR' : 'symbol' : undefined : 'de' }}</h2> <h2>{{ price | currency : 'EUR' : 'symbol' : undefined : 'de' }}</h2>
</ion-text> </ion-text>
<ion-text *ngIf="soldOut" color="danger" class="sold-out" style="white-space: nowrap"> <ion-text *ngIf="soldOut" color="danger" class="sold-out" style="white-space: nowrap">
<h2>{{ 'data.detail.offers.sold_out' | translate }}</h2> <h2>{{ 'data.detail.offers.out of stock' | translate }}</h2>
</ion-text> </ion-text>
<p *ngIf="_offers[0].inPlace && !soldOut" class="place" style="white-space: nowrap"> <p *ngIf="_offers[0].inPlace && !soldOut" class="place" style="white-space: nowrap">
<ion-icon name="pin_drop"></ion-icon>{{ _offers[0].inPlace.name }}<span *ngIf="_offers.length > 1" <ion-icon name="pin_drop"></ion-icon>{{ _offers[0].inPlace.name }}<span *ngIf="_offers.length > 1"

View File

@@ -30,20 +30,5 @@
<div *ngIf="$any(item).openingHours as openingHours" class="opening-hours"> <div *ngIf="$any(item).openingHours as openingHours" class="opening-hours">
<stapps-opening-hours [openingHours]="openingHours"></stapps-opening-hours> <stapps-opening-hours [openingHours]="openingHours"></stapps-opening-hours>
</div> </div>
<!-- TODO obviously this is bad style. Tbd where to put the differentiation. Job Postings always have a description, but it's going to be shown in `stapps-job-posting-detail-content` anyways, no need to repeat here. For this view, I would use other fields of the schema.org JobPosting like the `ThingWithCategory.category` -->
<div *ngIf="item.description && item.type !== 'job posting'" class="description">
<div class="text-accordion" [style.-webkit-line-clamp]="descriptionLinesToDisplay" #accordionTextArea>
{{ 'description' | thingTranslate: item }}
</div>
</div>
<!-- TODO see above -->
<ion-button
expand="full"
fill="clear"
*ngIf="item.description && item.type !== 'job posting' && buttonShown"
(click)="toggleDescriptionAccordion()"
>
<ion-icon [name]="buttonState" size="large"></ion-icon>
</ion-button>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>

View File

@@ -13,14 +13,6 @@
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
.text-accordion {
overflow: hidden;
display: -webkit-box;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
}
ion-card { ion-card {
--background: var(--ion-color-primary); --background: var(--ion-color-primary);
@@ -40,10 +32,6 @@ ion-card {
ion-card-content { ion-card-content {
padding: 0 0 var(--header-spacing-bottom); padding: 0 0 var(--header-spacing-bottom);
.description * {
color: var(--ion-color-primary-contrast);
}
.opening-hours { .opening-hours {
color: var(--ion-color-primary-contrast); color: var(--ion-color-primary-contrast);
} }

View File

@@ -13,81 +13,17 @@
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import {Component, ElementRef, HostListener, Input, OnChanges, OnInit, ViewChild} from '@angular/core'; import {Component, Input} from '@angular/core';
import {SCThings} from '@openstapps/core'; import {SCThings} from '@openstapps/core';
import {SCIcon} from '../../../util/ion-icon/icon';
const AccordionButtonState = {
collapsed: SCIcon`expand_more`,
expanded: SCIcon`expand_less`,
};
@Component({ @Component({
selector: 'stapps-title-card', selector: 'stapps-title-card',
templateUrl: './title-card.component.html', templateUrl: './title-card.component.html',
styleUrls: ['./title-card.component.scss'], styleUrls: ['./title-card.component.scss'],
}) })
export class TitleCardComponent implements OnInit, OnChanges { export class TitleCardComponent {
/** /**
* The item whose title (and description) to display * The item whose title (and description) to display
*/ */
@Input() item: SCThings; @Input() item: SCThings;
@ViewChild('accordionTextArea') accordionTextArea: ElementRef;
buttonState = AccordionButtonState.collapsed;
buttonShown = true;
descriptionLinesShown: number;
descriptionLinesTotal: number;
descriptionPreviewLines = 3;
descriptionLinesToDisplay = 0;
ngOnInit(): void {
if (this.item.description) {
this.descriptionLinesToDisplay = this.descriptionPreviewLines;
setTimeout(() => this.checkTextElipsis(), 100);
}
}
ngOnChanges() {
this.checkTextElipsis();
}
@HostListener('window:resize', ['$event'])
checkTextElipsis() {
if (this.accordionTextArea === undefined) {
return;
}
const element = this.accordionTextArea.nativeElement as HTMLElement;
const lineHeight = Number.parseInt(getComputedStyle(element).getPropertyValue('line-height'));
this.descriptionLinesTotal = element?.scrollHeight / lineHeight;
this.descriptionLinesShown = element?.offsetHeight / lineHeight;
if (this.buttonState === AccordionButtonState.expanded) {
this.descriptionLinesToDisplay = this.descriptionLinesTotal;
}
const isElipsed = element?.offsetHeight < element?.scrollHeight;
this.buttonShown =
(isElipsed && this.buttonState === AccordionButtonState.collapsed) ||
(!isElipsed && this.buttonState === AccordionButtonState.expanded);
}
toggleDescriptionAccordion() {
if (this.descriptionLinesToDisplay > 0) {
this.descriptionLinesToDisplay =
this.descriptionLinesToDisplay === this.descriptionPreviewLines
? this.descriptionLinesTotal
: this.descriptionPreviewLines;
}
this.buttonState =
this.buttonState === AccordionButtonState.collapsed
? AccordionButtonState.expanded
: AccordionButtonState.collapsed;
setTimeout(() => this.checkTextElipsis(), 0);
}
} }

View File

@@ -40,7 +40,7 @@ const DataListItemIndex: Partial<Record<SCThingType, Type<DataListItem>>> = {
[SCThingType.Dish]: DishListItemComponent, [SCThingType.Dish]: DishListItemComponent,
[SCThingType.DateSeries]: DateSeriesListItemComponent, [SCThingType.DateSeries]: DateSeriesListItemComponent,
[SCThingType.AcademicEvent]: EventListItemComponent, [SCThingType.AcademicEvent]: EventListItemComponent,
[SCThingType.SportCourse]: DateSeriesListItemComponent, [SCThingType.SportCourse]: EventListItemComponent,
[SCThingType.Favorite]: FavoriteListItemComponent, [SCThingType.Favorite]: FavoriteListItemComponent,
[SCThingType.Message]: MessageListItemComponent, [SCThingType.Message]: MessageListItemComponent,
[SCThingType.Organization]: OrganizationListItemComponent, [SCThingType.Organization]: OrganizationListItemComponent,

View File

@@ -50,7 +50,7 @@
[title]="'performers' | propertyNameTranslate : item | titlecase" [title]="'performers' | propertyNameTranslate : item | titlecase"
[content]="item.performers" [content]="item.performers"
></stapps-simple-card> ></stapps-simple-card>
<stapps-offers-detail *ngIf="item.offers" [offers]="item.offers"></stapps-offers-detail> <stapps-offers-detail *ngIf="item.offers" [item]="$any(item)"></stapps-offers-detail>
<ion-card> <ion-card>
<ion-card-header> {{ 'event' | propertyNameTranslate : item | titlecase }} </ion-card-header> <ion-card-header> {{ 'event' | propertyNameTranslate : item | titlecase }} </ion-card-header>
<ion-card-content> <ion-card-content>

View File

@@ -20,7 +20,7 @@
<ion-label class="title">{{ 'event.name' | thingTranslate : item }}</ion-label> <ion-label class="title">{{ 'event.name' | thingTranslate : item }}</ion-label>
<p> <p>
<ion-icon name="calendar_today"></ion-icon> <ion-icon name="calendar_today"></ion-icon>
<span *ngIf="item.dates[0] && item.dates[item.dates.length - 1]"> <span *ngIf="item.dates && item.dates[0] && item.dates[item.dates.length - 1]">
<span *ngIf="item.repeatFrequency"> <span *ngIf="item.repeatFrequency">
{{ item.repeatFrequency | durationLocalized : true | sentencecase }}, {{ item.dates[0] | {{ item.repeatFrequency | durationLocalized : true | sentencecase }}, {{ item.dates[0] |
dateFormat : 'weekday:long' }} dateFormat : 'weekday:long' }}
@@ -30,7 +30,7 @@
</span> </span>
</span> </span>
</p> </p>
<ion-note *ngIf="item.event.type === 'academic event'" <ion-note *ngIf="item.event?.type === 'academic event'"
>{{ 'categories' | thingTranslate : item.event | join : ', ' }}</ion-note >{{ 'categories' | thingTranslate : item.event | join : ', ' }}</ion-note
> >
</div> </div>

View File

@@ -14,7 +14,7 @@
--> -->
<stapps-dish-characteristics *ngIf="item.characteristics" [item]="item"></stapps-dish-characteristics> <stapps-dish-characteristics *ngIf="item.characteristics" [item]="item"></stapps-dish-characteristics>
<stapps-offers-detail *ngIf="item.offers" [offers]="item.offers"></stapps-offers-detail> <stapps-offers-detail *ngIf="item.offers" [item]="$any(item)"></stapps-offers-detail>
<stapps-certifications-in-detail <stapps-certifications-in-detail
*ngIf="item.certifications" *ngIf="item.certifications"
[certifications]="item.certifications" [certifications]="item.certifications"

View File

@@ -13,7 +13,15 @@
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {SCAcademicEvent, SCSportCourse, SCThing, SCThingTranslator, SCTranslations} from '@openstapps/core'; import {
SCAcademicEvent,
SCDateSeries,
SCSportCourse,
SCThing,
SCThingType,
SCTranslations,
} from '@openstapps/core';
import {DataProvider} from '../../data.provider';
/** /**
* TODO * TODO
@@ -24,30 +32,41 @@ import {SCAcademicEvent, SCSportCourse, SCThing, SCThingTranslator, SCTranslatio
styleUrls: ['event-detail-content.scss'], styleUrls: ['event-detail-content.scss'],
}) })
export class EventDetailContentComponent { export class EventDetailContentComponent {
/** @Input() set item(value: SCAcademicEvent | SCSportCourse) {
* TODO this._item = value;
*/ this.dateSeries = this.dataProvider
@Input() item: SCAcademicEvent | SCSportCourse; .search({
filter: {
type: 'boolean',
arguments: {
operation: 'and',
filters: [
{
type: 'value',
arguments: {
field: 'type',
value: SCThingType.DateSeries,
},
},
{
type: 'value',
arguments: {
field: 'event.uid',
value: value.uid,
},
},
],
},
},
})
.then(result => result.data as SCDateSeries[]);
}
_item: SCAcademicEvent | SCSportCourse;
dateSeries: Promise<SCDateSeries[]>;
/**
* TODO
*/
@Input() language: keyof SCTranslations<SCThing>; @Input() language: keyof SCTranslations<SCThing>;
/** constructor(readonly dataProvider: DataProvider) {}
* TODO
*/
objectKeys = Object.keys;
/**
* TODO
*/
translator: SCThingTranslator;
/**
* TODO
*/
constructor() {
this.translator = new SCThingTranslator(this.language);
}
} }

View File

@@ -12,39 +12,39 @@
~ You should have received a copy of the GNU General Public License along with ~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>. ~ this program. If not, see <https://www.gnu.org/licenses/>.
--> -->
<p *ngIf="'description' | thingTranslate: _item as description" [innerHtml]="description | sanitizeHtml"></p>
<stapps-simple-card <stapps-simple-card
*ngIf="item.type === 'academic event' && item.categories" *ngIf="_item.type === 'academic event' && _item.categories"
[title]="'categories' | propertyNameTranslate : item | titlecase" [title]="'categories' | propertyNameTranslate : _item | titlecase"
[content]="'categories' | thingTranslate : item" [content]="'categories' | thingTranslate : _item"
> >
</stapps-simple-card> </stapps-simple-card>
<stapps-add-event-action-chip *ngIf="item.type === 'academic event'" [item]="item"> <stapps-add-event-action-chip [item]="_item"></stapps-add-event-action-chip>
</stapps-add-event-action-chip>
<stapps-simple-card <stapps-simple-card
*ngIf="item.performers" *ngIf="_item.performers"
[title]="'performers' | propertyNameTranslate : item | titlecase" [title]="'performers' | propertyNameTranslate : _item | titlecase"
[content]="item.performers" [content]="_item.performers"
></stapps-simple-card> ></stapps-simple-card>
<stapps-simple-card <stapps-simple-card
*ngIf="item.organizers" *ngIf="_item.organizers"
[title]="'organizers' | propertyNameTranslate : item | titlecase" [title]="'organizers' | propertyNameTranslate : _item | titlecase"
[content]="item.organizers" [content]="_item.organizers"
></stapps-simple-card> ></stapps-simple-card>
<ng-container *ngIf="item.type === 'academic event'"> <ng-container *ngIf="_item.type === 'academic event'">
<stapps-simple-card <stapps-simple-card
*ngIf="item.majors" *ngIf="_item.majors"
[title]="'majors' | propertyNameTranslate : item" [title]="'majors' | propertyNameTranslate : _item"
[content]="item.majors" [content]="_item.majors"
></stapps-simple-card> ></stapps-simple-card>
</ng-container> </ng-container>
<ion-card *ngIf="item.catalogs"> <ion-card *ngIf="_item.catalogs">
<ion-card-header>{{ 'superCatalogs' | propertyNameTranslate : 'catalog' | titlecase }}</ion-card-header> <ion-card-header>{{ 'superCatalogs' | propertyNameTranslate : 'catalog' | titlecase }}</ion-card-header>
<ion-card-content> <ion-card-content>
<event-route-path <event-route-path
*ngFor="let item of item.catalogs" *ngFor="let item of _item.catalogs"
[maxItems]="1" [maxItems]="1"
[itemsAfterCollapse]="1" [itemsAfterCollapse]="1"
[itemsBeforeCollapse]="0" [itemsBeforeCollapse]="0"
@@ -54,3 +54,4 @@
</event-route-path> </event-route-path>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
<stapps-simple-data-list [items]="dateSeries"></stapps-simple-data-list>

View File

@@ -13,6 +13,10 @@
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
p {
margin-inline: var(--spacing-md);
}
stapps-add-event-action-chip { stapps-add-event-action-chip {
position: absolute; position: absolute;
top: 0; top: 0;

View File

@@ -22,6 +22,7 @@ import {DataListItemComponent} from '../../list/data-list-item.component';
@Component({ @Component({
selector: 'stapps-event-list-item', selector: 'stapps-event-list-item',
templateUrl: 'event-list-item.html', templateUrl: 'event-list-item.html',
styleUrls: ['event-list-item.scss'],
}) })
export class EventListItemComponent extends DataListItemComponent { export class EventListItemComponent extends DataListItemComponent {
/** /**

View File

@@ -14,27 +14,25 @@
--> -->
<ion-grid> <ion-grid>
<ion-row *ngIf="item.type === 'academic event'"> <ion-row>
<ion-col> <ion-col>
<div class="ion-text-wrap"> <div class="ion-text-wrap">
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label> <ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
<p *ngIf="item.description" class="title-sub">{{ 'description' | thingTranslate: item }}</p> <p
*ngIf="'description' | thingTranslate: item as description"
class="title-sub"
[innerHtml]="description | sanitizeHtml"
></p>
<p *ngIf="item.academicTerms" class="title-sub"> <p *ngIf="item.academicTerms" class="title-sub">
{{ 'name' | thingTranslate: item.academicTerms[0] }} {{ 'name' | thingTranslate: item.academicTerms[0] }}
</p> </p>
<ion-note *ngIf="!item.categories">{{ 'type' | thingTranslate: item | titlecase }}</ion-note> <ng-container *ngIf="item.type === 'academic event'">
<ion-note *ngIf="item.categories"> <ion-note *ngIf="!item.categories">{{ 'type' | thingTranslate: item | titlecase }}</ion-note>
{{ 'categories' | thingTranslate: item | join: ', ' | titlecase }} <ion-note *ngIf="item.categories">
</ion-note> {{ 'categories' | thingTranslate: item | join: ', ' | titlecase }}
</ion-note>
</ng-container>
</div> </div>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row *ngIf="item.type === 'sport course'">
<ion-col>
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
<p *ngIf="item.description" class="title-sub">{{ 'description' | thingTranslate: item }}</p>
<p *ngIf="item.academicTerms" class="title-sub">{{ 'name' | thingTranslate: item.academicTerms[0] }}</p>
<ion-note>{{ 'type' | thingTranslate: item }}</ion-note>
</ion-col>
</ion-row>
</ion-grid> </ion-grid>

View File

@@ -0,0 +1,5 @@
.title-sub {
max-height: 2.8rem;
overflow: hidden;
opacity: 0.8;
}

View File

@@ -29,4 +29,4 @@
[content]="item.datePublished | amDateFormat : 'll'" [content]="item.datePublished | amDateFormat : 'll'"
> >
</stapps-simple-card> </stapps-simple-card>
<stapps-offers-detail *ngIf="item.offers" [offers]="item.offers"></stapps-offers-detail> <stapps-offers-detail *ngIf="item.offers" [item]="$any(item)"></stapps-offers-detail>

View File

@@ -0,0 +1,20 @@
import {Component} from '@angular/core';
import {DataModule} from '../data/data.module';
import {TranslateModule} from '@ngx-translate/core';
import {SCSearchFilter, SCThingType} from '@openstapps/core';
@Component({
selector: 'stapps-sport-course-search-page',
templateUrl: 'sport-course-search-page.html',
standalone: true,
imports: [DataModule, TranslateModule],
})
export class SportCourseSearchPageComponent {
forcedFilter: SCSearchFilter = {
type: 'value',
arguments: {
field: 'type',
value: SCThingType.SportCourse,
},
};
}

View File

@@ -0,0 +1,6 @@
<stapps-search-page
[title]="'sportCourses.title' | translate"
[placeholder]="'sportCourses.placeholder' | translate"
[showDefaultData]="true"
[forcedFilter]="forcedFilter"
></stapps-search-page>

View File

@@ -0,0 +1,8 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {SportCourseSearchPageComponent} from './sport-course-search-page.component';
@NgModule({
imports: [RouterModule.forChild([{path: 'sport-courses', component: SportCourseSearchPageComponent}])],
})
export class SportCoursesModule {}

View File

@@ -45,7 +45,7 @@ export class ThingTranslateDefaultParser extends ThingTranslateParser {
let property = instance as any; let property = instance as any;
for (const key of keyPathChain) { for (const key of keyPathChain) {
property = property[key] ?? undefined; property = property?.[key] ?? undefined;
} }
return property; return property;

View File

@@ -0,0 +1,15 @@
import {Pipe, PipeTransform} from '@angular/core';
import {DomSanitizer} from '@angular/platform-browser';
@Pipe({
name: 'bypassSecurityTrustResourceUrl',
standalone: true,
pure: true,
})
export class BypassTrustUrlPipe implements PipeTransform {
constructor(private sanitizer: DomSanitizer) {}
transform(url: string) {
return this.sanitizer.bypassSecurityTrustUrl(url);
}
}

View File

@@ -0,0 +1,15 @@
import {Pipe, PipeTransform, SecurityContext} from '@angular/core';
import {DomSanitizer, SafeHtml} from '@angular/platform-browser';
@Pipe({
name: 'sanitizeHtml',
standalone: true,
pure: true,
})
export class SanitizeHtmlPipe implements PipeTransform {
constructor(private sanitizer: DomSanitizer) {}
transform(value: string): SafeHtml {
return this.sanitizer.sanitize(SecurityContext.HTML, value)!;
}
}

View File

@@ -153,7 +153,10 @@
"employee": "Angestellte", "employee": "Angestellte",
"guest": "Gäste", "guest": "Gäste",
"student": "Studierende", "student": "Studierende",
"sold_out": "Ausverkauft!" "out of stock": "Ausverkauft!",
"in stock": "Verfügbar",
"limited availability": "Begrenzte Verfügbarkeit",
"online only": "Nur online"
} }
}, },
"chips": { "chips": {
@@ -420,6 +423,10 @@
"instruction": "Finde alle Informationen rund ums Studium und den Campus", "instruction": "Finde alle Informationen rund ums Studium und den Campus",
"nothing_found": "Keine Ergebnisse" "nothing_found": "Keine Ergebnisse"
}, },
"sportCourses": {
"title": "Sportkurse",
"placeholder": "Sportkurse"
},
"hebisSearch": { "hebisSearch": {
"title": "Bibliothekssuche", "title": "Bibliothekssuche",
"type": "Bibliothek", "type": "Bibliothek",

View File

@@ -153,7 +153,10 @@
"employee": "Employees", "employee": "Employees",
"guest": "Guests", "guest": "Guests",
"student": "Students", "student": "Students",
"sold_out": "Sold Out!" "out of stock": "Sold Out!",
"in stock": "Available",
"limited": "Limited availability",
"online only": "Online only"
} }
}, },
"chips": { "chips": {
@@ -420,6 +423,10 @@
"instruction": "Find all information related to your studies and campus", "instruction": "Find all information related to your studies and campus",
"nothing_found": "No results" "nothing_found": "No results"
}, },
"sportCourses": {
"title": "Sport Courses",
"placeholder": "Sport courses"
},
"hebisSearch": { "hebisSearch": {
"title": "Library Search", "title": "Library Search",
"type": "Library", "type": "Library",

View File

@@ -93,6 +93,28 @@ export const profilePageSections: SCSection[] = [
}, },
...SCSectionLinkConstantValues, ...SCSectionLinkConstantValues,
}, },
{
name: 'Sport Courses',
icon: SCIcon`sports_gymnastics`,
link: ['/sport-courses'],
translations: {
de: {
name: 'Sportkurse',
},
},
...SCSectionLinkConstantValues,
},
{
name: 'Job Postings',
icon: SCIcon`work`,
link: ['/jobs'],
translations: {
de: {
name: 'Stellenangebote',
},
},
...SCSectionLinkConstantValues,
},
{ {
name: 'Settings', name: 'Settings',
icon: SCIcon`settings`, icon: SCIcon`settings`,

View File

@@ -18,7 +18,7 @@
// The list of which env maps to which file can be found in `.angular-cli.json`. // The list of which env maps to which file can be found in `.angular-cli.json`.
export const environment = { export const environment = {
backend_url: 'https://mobile.server.uni-frankfurt.de', backend_url: 'http://localhost:3000',
app_host: 'mobile.app.uni-frankfurt.de', app_host: 'mobile.app.uni-frankfurt.de',
custom_url_scheme: 'de.anyschool.app', custom_url_scheme: 'de.anyschool.app',
backend_version: '4.1.0', backend_version: '4.1.0',

View File

@@ -5,11 +5,9 @@
"baseUrl": "./", "baseUrl": "./",
"outDir": "./dist/out-tsc", "outDir": "./dist/out-tsc",
"declaration": false, "declaration": false,
"emitDecoratorMetadata": true,
"skipLibCheck": false, "skipLibCheck": false,
"isolatedModules": false, "isolatedModules": false,
"strictPropertyInitialization": false, "strictPropertyInitialization": false,
"resolveJsonModule": true,
"downlevelIteration": true, "downlevelIteration": true,
"importHelpers": true, "importHelpers": true,
"useDefineForClassFields": false, "useDefineForClassFields": false,

View File

@@ -35,7 +35,8 @@
"dotenv-cli": "7.2.1", "dotenv-cli": "7.2.1",
"glob": "10.2.7", "glob": "10.2.7",
"junit-report-merger": "6.0.2", "junit-report-merger": "6.0.2",
"syncpack": "10.5.1", "prettier": "3.1.1",
"syncpack": "12.3.0",
"turbo": "1.10.16", "turbo": "1.10.16",
"turbo-ignore": "1.10.16", "turbo-ignore": "1.10.16",
"typedoc": "0.24.8", "typedoc": "0.24.8",

View File

@@ -1,3 +1,4 @@
{ {
"extends": "@openstapps/tsconfig" "extends": "@openstapps/tsconfig",
"exclude": ["lib", "app.js"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"extends": "@openstapps/tsconfig" "extends": "@openstapps/tsconfig",
"exclude": ["lib", "app.js"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"extends": "@openstapps/tsconfig" "extends": "@openstapps/tsconfig",
"exclude": ["lib", "app.js"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"extends": "@openstapps/tsconfig" "extends": "@openstapps/tsconfig",
"exclude": ["lib", "app.js"]
} }

View File

@@ -52,6 +52,7 @@ export class Converter {
path: sourcePath, path: sourcePath,
sortProps: true, sortProps: true,
topRef: false, topRef: false,
skipTypeCheck: true,
tsconfig: path.join(getTsconfigPath(projectPath), 'tsconfig.json'), tsconfig: path.join(getTsconfigPath(projectPath), 'tsconfig.json'),
type: 'SC', type: 'SC',
}; };

View File

@@ -3,5 +3,6 @@
"compilerOptions": { "compilerOptions": {
"noUnusedLocals": false, "noUnusedLocals": false,
"stripInternal": true "stripInternal": true
} },
"exclude": ["lib", "app.js"]
} }

View File

@@ -76,15 +76,6 @@
"typedoc": "0.24.8", "typedoc": "0.24.8",
"typescript": "5.1.6" "typescript": "5.1.6"
}, },
"tsup": {
"entry": [
"src/index.ts"
],
"sourcemap": true,
"clean": true,
"format": "esm",
"outDir": "lib"
},
"prettier": "@openstapps/prettier-config", "prettier": "@openstapps/prettier-config",
"eslintConfig": { "eslintConfig": {
"extends": [ "extends": [

View File

@@ -1,3 +1,5 @@
export const CORE_VERSION = process.env.CORE_VERSION!;
export * from './guards.js'; export * from './guards.js';
export * from './meta.js'; export * from './meta.js';
export * from './translator.js'; export * from './translator.js';

View File

@@ -33,6 +33,8 @@ export interface SCValueFilterArguments extends SCSearchAbstractFilterArguments
/** /**
* Value to filter. One or more values has to match the field exactly. * Value to filter. One or more values has to match the field exactly.
*
* Leaving the value out will check if the field exists.
*/ */
value: string | string[]; value?: string | string[];
} }

View File

@@ -1,3 +1,4 @@
{ {
"extends": "@openstapps/tsconfig" "extends": "@openstapps/tsconfig",
"exclude": ["lib", "app.js"]
} }

View File

@@ -0,0 +1,13 @@
import {defineConfig} from 'tsup';
import packageJson from './package.json' assert {type: 'json'};
export default defineConfig({
entry: ['src/index.ts'],
sourcemap: true,
clean: true,
format: 'esm',
outDir: 'lib',
env: {
CORE_VERSION: packageJson.version,
},
});

View File

@@ -1,3 +1,4 @@
{ {
"extends": "@openstapps/tsconfig" "extends": "@openstapps/tsconfig",
"exclude": ["lib", "app.js"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"extends": "@openstapps/tsconfig" "extends": "@openstapps/tsconfig",
"exclude": ["lib", "app.js"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"extends": "@openstapps/tsconfig" "extends": "@openstapps/tsconfig",
"exclude": ["lib", "app.js"]
} }

Some files were not shown because too many files have changed in this diff Show More