Compare commits

..

26 Commits

Author SHA1 Message Date
Rainer Killinger
1214b31cfc refactor: overhaul minimal-deployment compose file
fix: changeset crashes because it uses internal prettier version

refactor: add asdf tool versioning file

fix: iOS build resources

fix: backend tests break every year

refactor: update some backend unit tests

feat: add direnv for nix

feat: update nix flake to not rely on buildFHSUserEnv

feat: enable checkJs by default

feat: custom ion-icon package

feat: custom ion-icon package

feat: custom ion-icon element

feat: custom ion-icon element

feat: custom ion-icon element

feat: custom ion icon element

fix: e2e tests
2024-04-16 13:19:01 +02:00
Thea Schöbl
1ab5c0c355 fix: inPlace in list items is placed weird 2024-03-27 13:45:22 +00:00
Rainer Killinger
b0f6ffb21c refactor: ajdust app environment to backend version >= v3.1.0 2024-03-27 10:11:32 +01:00
Rainer Killinger
e658cff9d2 refactor: use GET for id-cards requests 2024-03-27 09:55:31 +01:00
Rainer Killinger
e71355a2fb fix: malformed Bearer header in id-cards provider 2024-03-27 09:55:30 +01:00
100607740b fix: angular lsp broken 2024-03-27 09:55:30 +01:00
Thea Schöbl
10c4466b37 feat: update to angular 17 2024-03-27 09:55:30 +01:00
Rainer Killinger
09faa66e98 fix: broken build and test stage 2024-03-27 09:55:30 +01:00
Rainer Killinger
7c5687111f fix: check-icons script in app 2024-03-27 09:55:30 +01:00
Rainer Killinger
c066028e49 refactor: update asdf .tool-versions 2024-03-27 09:55:30 +01:00
0858a26dc1 fix: dish prices sometimes go missing 2024-03-27 09:55:30 +01:00
8667603bd6 feat: export core version in package 2024-03-27 09:55:29 +01:00
65bc9a76b6 feat: add syncpack semver ranges 2024-03-27 09:55:29 +01:00
912ae42270 feat: add ability to check for existence of a field 2024-03-27 09:55:29 +01:00
c4a5d6e73b fix: exclude app.js and lib from typescript compliation 2024-03-27 09:55:29 +01:00
deed376c24 feat: enable checkJs by default 2024-03-27 09:55:29 +01:00
a4cc23e9a8 feat: add direnv for nix
feat: update nix flake to not rely on buildFHSUserEnv
2024-03-27 09:55:29 +01:00
e8d72683ef fix: backend tests break every year
refactor: update some backend unit tests
2024-03-27 09:55:28 +01:00
Rainer Killinger
e3d068f8d4 fix: iOS build resources 2024-03-27 09:55:28 +01:00
Rainer Killinger
b346d216a3 refactor: add asdf tool versioning file 2024-03-27 09:55:28 +01:00
dbb558508f fix: changeset crashes because it uses internal prettier version 2024-03-27 09:55:28 +01:00
Rainer Killinger
754d99c1b4 refactor: overhaul minimal-deployment compose file 2024-03-27 09:55:27 +01:00
Rainer Killinger
689ac68be3 fix: pin alpine version to 3.18 and add healthchecks 2024-03-06 11:45:40 +01:00
Rainer Killinger
d36d9596fc docs: update changelogs for release 2023-12-19 15:32:42 +01:00
Thea Schöbl
8d50f669e7 feat: collapse detail titles into header bar 2023-12-19 14:16:38 +01:00
Jovan Krunić
dce08d9c03 fix: reverse workaround after update of capacitor
Closes #179
2023-12-19 13:12:25 +00:00
317 changed files with 9461 additions and 9106 deletions

View File

@@ -0,0 +1,9 @@
---
"@openstapps/node-builder": patch
"@openstapps/database": patch
"@openstapps/node-base": patch
"@openstapps/backend": patch
"@openstapps/app": patch
---
pin alpine version to 3.18 and add healthchecks

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

2
.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
@@ -101,6 +102,7 @@ typings/
# ignore lib # ignore lib
lib lib
dist
# ignore docs # ignore docs
docs docs

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.19.1
pnpm 8.15.4
python 3.11.5

View File

@@ -9,4 +9,6 @@ ENV NODE_ENV=production
WORKDIR /app WORKDIR /app
EXPOSE 3000 EXPOSE 3000
HEALTHCHECK --interval=10s --timeout=10s --start-period=10s --retries=12 CMD curl -s --fail --request POST --data '{}' --header 'Content-Type: application/json' http://localhost:3000/ >/dev/null || exit 1
ENTRYPOINT ["node", "app.js"] ENTRYPOINT ["node", "app.js"]

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

@@ -64,7 +64,7 @@
"express-prom-bundle": "6.6.0", "express-prom-bundle": "6.6.0",
"express-promise-router": "4.1.1", "express-promise-router": "4.1.1",
"got": "12.6.0", "got": "12.6.0",
"moment": "2.29.4", "moment": "2.30.1",
"morgan": "1.10.0", "morgan": "1.10.0",
"nock": "13.3.1", "nock": "13.3.1",
"node-cache": "5.1.2", "node-cache": "5.1.2",
@@ -98,9 +98,9 @@
"sinon": "15.0.4", "sinon": "15.0.4",
"sinon-express-mock": "2.2.1", "sinon-express-mock": "2.2.1",
"supertest": "6.3.3", "supertest": "6.3.3",
"ts-node": "10.9.1", "ts-node": "10.9.2",
"tsup": "6.7.0", "tsup": "6.7.0",
"typescript": "5.1.6" "typescript": "5.4.2"
}, },
"tsup": { "tsup": {
"entry": [ "entry": [

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

@@ -14,4 +14,6 @@ RUN chown elasticsearch:elasticsearch config/elasticsearch.yml
USER elasticsearch USER elasticsearch
HEALTHCHECK --interval=10s --timeout=10s --start-period=60s --retries=12 CMD curl --fail -s http://localhost:9200/ >/dev/null || exit 1
CMD ["/usr/share/elasticsearch/bin/elasticsearch"] CMD ["/usr/share/elasticsearch/bin/elasticsearch"]

View File

@@ -3,3 +3,4 @@ discovery.type: "single-node"
cluster.routing.allocation.disk.threshold_enabled: false cluster.routing.allocation.disk.threshold_enabled: false
network.bind_host: 0.0.0.0 network.bind_host: 0.0.0.0
xpack.security.enabled: false xpack.security.enabled: false
ingest.geoip.downloader.enabled: false

View File

@@ -16,7 +16,7 @@
// ESM is not supported, and cts is not detected, so we use type-checked cjs instead. // ESM is not supported, and cts is not detected, so we use type-checked cjs instead.
/** @type {import('../src/common').ConfigFile} */ /** @type {import('../src/common').ConfigFile} */
const configFile = { module.exports = {
activeVersions: ['1\\.0\\.\\d+', '2\\.0\\.\\d+'], activeVersions: ['1\\.0\\.\\d+', '2\\.0\\.\\d+'],
hiddenRoutes: ['/bulk'], hiddenRoutes: ['/bulk'],
logFormat: 'default', logFormat: 'default',
@@ -31,5 +31,3 @@ const configFile = {
dhparam: '/etc/nginx/certs/dhparam.pem', dhparam: '/etc/nginx/certs/dhparam.pem',
}, },
}; };
export default configFile;

View File

@@ -50,8 +50,8 @@
"dockerode": "3.3.5", "dockerode": "3.3.5",
"is-cidr": "4.0.2", "is-cidr": "4.0.2",
"mustache": "4.2.0", "mustache": "4.2.0",
"semver": "7.5.4", "semver": "7.6.0",
"typescript": "5.1.6" "typescript": "5.4.2"
}, },
"devDependencies": { "devDependencies": {
"@openstapps/api-cli": "workspace:*", "@openstapps/api-cli": "workspace:*",
@@ -65,7 +65,7 @@
"@types/mustache": "4.2.2", "@types/mustache": "4.2.2",
"@types/node": "18.15.3", "@types/node": "18.15.3",
"@types/proxyquire": "1.3.28", "@types/proxyquire": "1.3.28",
"@types/semver": "7.5.6", "@types/semver": "7.5.8",
"@types/sha1": "1.1.3", "@types/sha1": "1.1.3",
"@types/sinon": "10.0.14", "@types/sinon": "10.0.14",
"@types/sinon-chai": "3.2.9", "@types/sinon-chai": "3.2.9",
@@ -75,7 +75,7 @@
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.0",
"sinon": "15.0.4", "sinon": "15.0.4",
"sinon-chai": "3.7.0", "sinon-chai": "3.7.0",
"ts-node": "10.9.1", "ts-node": "10.9.2",
"tsup": "6.7.0" "tsup": "6.7.0"
}, },
"tsup": { "tsup": {

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

@@ -18,16 +18,15 @@
"devDependencies": { "devDependencies": {
"@openstapps/tsconfig": "workspace:*", "@openstapps/tsconfig": "workspace:*",
"@types/node": "18.15.3", "@types/node": "18.15.3",
"eslint": "8.43.0", "eslint": "8.57.0",
"typescript": "5.1.6" "typescript": "5.4.2"
}, },
"peerDependencies": { "peerDependencies": {
"@typescript-eslint/eslint-plugin": "5.60.1", "@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "5.60.1", "@typescript-eslint/parser": "7.2.0",
"eslint": "8.43.0", "eslint": "8.57.0",
"eslint-config-prettier": "8.8.0", "eslint-config-prettier": "9.1.0",
"eslint-plugin-jsdoc": "46.4.2", "eslint-plugin-jsdoc": "48.2.1",
"eslint-plugin-prettier": "4.2.1", "eslint-plugin-unicorn": "51.0.1"
"eslint-plugin-unicorn": "47.0.0"
} }
} }

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

@@ -43,8 +43,8 @@
"@openstapps/logger": "workspace:*", "@openstapps/logger": "workspace:*",
"@slack/web-api": "6.8.1", "@slack/web-api": "6.8.1",
"commander": "10.0.0", "commander": "10.0.0",
"date-fns": "2.30.0", "date-fns": "3.6.0",
"glob": "10.2.7", "glob": "10.3.10",
"mustache": "4.2.0" "mustache": "4.2.0"
}, },
"devDependencies": { "devDependencies": {
@@ -53,7 +53,7 @@
"@openstapps/tsconfig": "workspace:*", "@openstapps/tsconfig": "workspace:*",
"@types/chai": "4.3.5", "@types/chai": "4.3.5",
"@types/chai-as-promised": "7.1.5", "@types/chai-as-promised": "7.1.5",
"@types/glob": "8.0.1", "@types/glob": "8.1.0",
"@types/mocha": "10.0.1", "@types/mocha": "10.0.1",
"@types/mustache": "4.2.2", "@types/mustache": "4.2.2",
"@types/node": "18.15.3", "@types/node": "18.15.3",
@@ -63,9 +63,9 @@
"chai-as-promised": "7.1.1", "chai-as-promised": "7.1.1",
"mocha": "10.2.0", "mocha": "10.2.0",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.0",
"ts-node": "10.9.1", "ts-node": "10.9.2",
"tsup": "6.7.0", "tsup": "6.7.0",
"typescript": "5.1.6" "typescript": "5.4.2"
}, },
"tsup": { "tsup": {
"entry": [ "entry": [

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

@@ -53,9 +53,9 @@
"mocha": "10.2.0", "mocha": "10.2.0",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.0",
"nock": "13.3.1", "nock": "13.3.1",
"ts-node": "10.9.1", "ts-node": "10.9.2",
"tsup": "6.7.0", "tsup": "6.7.0",
"typescript": "5.1.6" "typescript": "5.4.2"
}, },
"tsup": { "tsup": {
"entry": [ "entry": [

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

@@ -35,7 +35,7 @@
"@openstapps/logger": "workspace:*", "@openstapps/logger": "workspace:*",
"commander": "10.0.0", "commander": "10.0.0",
"express": "4.18.2", "express": "4.18.2",
"ts-node": "10.9.1" "ts-node": "10.9.2"
}, },
"devDependencies": { "devDependencies": {
"@openstapps/eslint-config": "workspace:*", "@openstapps/eslint-config": "workspace:*",
@@ -44,7 +44,7 @@
"@types/express": "4.17.17", "@types/express": "4.17.17",
"@types/node": "18.15.3", "@types/node": "18.15.3",
"tsup": "6.7.0", "tsup": "6.7.0",
"typescript": "5.1.6" "typescript": "5.4.2"
}, },
"tsup": { "tsup": {
"entry": [ "entry": [

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

@@ -5,10 +5,4 @@
# You can see what browsers were selected by your queries by running: # You can see what browsers were selected by your queries by running:
# npx browserslist # npx browserslist
> 0.5% > 0.5% in DE and last 2 major versions and supports es6 and not dead
last 2 versions
Firefox ESR
not dead
not kaios 2.5
not op_mini all
not IE 9-11

View File

@@ -11,6 +11,7 @@ log.txt
*.sublime-workspace *.sublime-workspace
.vscode/* .vscode/*
npm-debug.log* npm-debug.log*
.browser-data
# This file is sometimes created automatically, even though # This file is sometimes created automatically, even though
# we actually use the capacitor.config.ts # we actually use the capacitor.config.ts

View File

@@ -1,5 +1,11 @@
# @openstapps/app # @openstapps/app
## 3.1.2
### Patch Changes
- Fix for Android users not being able to log in
## 3.1.1 ## 3.1.1
### Patch Changes ### Patch Changes

View File

@@ -1,7 +1,7 @@
# Creates a docker image with only the app as an executable unit # Creates a docker image with only the app as an executable unit
# Dependencies need to be installed beforehand # Dependencies need to be installed beforehand
# Needs to be build beforehand # Needs to be build beforehand
FROM node:18-alpine FROM node:18-alpine3.18
WORKDIR /app WORKDIR /app
COPY www/ /app/www COPY www/ /app/www

View File

@@ -21,10 +21,10 @@ as usual.
The modified `ion-icon` comes with a few extra features: The modified `ion-icon` comes with a few extra features:
- `[fill]` controls the fill color of the icon. - `[style.--fill]` controls the fill color of the icon.
- `[weight]` controls the font weight of the icon. - `[style.--weight]` controls the font weight of the icon.
- `[size]` controls the font size of the icon. - `[style.--size]` controls the font size of the icon.
- `[grade]` controls the font grade of the icon. - `[style.--grade]` controls the font grade of the icon.
All of these attributes are animated as described All of these attributes are animated as described
[here](https://developers.google.com/fonts/docs/material_symbols). [here](https://developers.google.com/fonts/docs/material_symbols).
@@ -50,11 +50,10 @@ the config file.
Icon font minification is done automatically, but requires you to Icon font minification is done automatically, but requires you to
follow a few simple rules: follow a few simple rules:
1. Use the tagged template literal for referencing icon names in 1. Use the Proxy object to reference icon names in TypeScript files and code
TypeScript files and code
```ts ```ts
SCIcon`icon_name`; SCIcon.icon_name;
``` ```
2. When using `ion-icon` in HTML, reference either icons that went through 2. When using `ion-icon` in HTML, reference either icons that went through

View File

@@ -45,7 +45,7 @@ include ':capacitor-splash-screen'
project(':capacitor-splash-screen').projectDir = new File('../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen/android') project(':capacitor-splash-screen').projectDir = new File('../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen/android')
include ':transistorsoft-capacitor-background-fetch' include ':transistorsoft-capacitor-background-fetch'
project(':transistorsoft-capacitor-background-fetch').projectDir = new File('../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@1.0.2_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch/android') project(':transistorsoft-capacitor-background-fetch').projectDir = new File('../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.1.1_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch/android')
include ':capacitor-secure-storage-plugin' include ':capacitor-secure-storage-plugin'
project(':capacitor-secure-storage-plugin').projectDir = new File('../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.8.1_@capacitor+core@5.5.0/node_modules/capacitor-secure-storage-plugin/android') project(':capacitor-secure-storage-plugin').projectDir = new File('../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.9.0_@capacitor+core@5.5.0/node_modules/capacitor-secure-storage-plugin/android')

View File

@@ -97,20 +97,20 @@
"serve": { "serve": {
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
"options": { "options": {
"browserTarget": "app:build" "buildTarget": "app:build"
}, },
"configurations": { "configurations": {
"production": { "production": {
"browserTarget": "app:build:production" "buildTarget": "app:build:production"
}, },
"development": { "development": {
"browserTarget": "app:build:development" "buildTarget": "app:build:development"
}, },
"ci": { "ci": {
"browserTarget": "app:build" "buildTarget": "app:build"
}, },
"fake": { "fake": {
"browserTarget": "app:build:fake" "buildTarget": "app:build:fake"
} }
}, },
"defaultConfiguration": "development" "defaultConfiguration": "development"

View File

@@ -173,7 +173,7 @@ describe('dashboard', async function () {
cy.visit('/overview'); cy.visit('/overview');
cy.get('ion-searchbar').click({scrollBehavior: 'center'}); cy.get('ion-searchbar').click({scrollBehavior: 'center'});
cy.url().should('eq', Cypress.config().baseUrl + '/search'); cy.url().should('include', '/search');
cy.get('ion-searchbar').should('not.have.value'); cy.get('ion-searchbar').should('not.have.value');
cy.get('ion-searchbar input.searchbar-input').should('have.focus'); cy.get('ion-searchbar input.searchbar-input').should('have.focus');

View File

@@ -16,7 +16,7 @@
describe('favorites', function () { describe('favorites', function () {
beforeEach(() => { beforeEach(() => {
cy.interceptSearch({ cy.interceptSearch({
extends: {query: 'test'}, extends: {query: 'a'},
fixture: 'search/generic', fixture: 'search/generic',
alias: 'search', alias: 'search',
}); });
@@ -29,7 +29,7 @@ describe('favorites', function () {
it('should add a favorite', function () { it('should add a favorite', function () {
cy.visit('/search'); cy.visit('/search');
cy.patchSearchPage(); cy.patchSearchPage();
cy.get('ion-searchbar').type('test'); cy.get('ion-searchbar').type('a');
let text!: string; let text!: string;
cy.get('stapps-data-list-item') cy.get('stapps-data-list-item')
.first() .first()
@@ -40,9 +40,7 @@ describe('favorites', function () {
text = it; text = it;
}); });
cy.get('stapps-favorite-button').click(); cy.get('stapps-favorite-button').click();
cy.get('stapps-favorite-button > ion-button > ion-icon') cy.get('stapps-favorite-button > ion-button > ion-icon').should('have.class', 'selected');
.invoke('attr', 'ng-reflect-fill')
.should('eq', 'true');
}); });
cy.visit('/favorites'); cy.visit('/favorites');
cy.get('stapps-data-list-item').within(() => { cy.get('stapps-data-list-item').within(() => {

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

@@ -1,7 +1,7 @@
{ {
"name": "@openstapps/app", "name": "@openstapps/app",
"description": "The generic app tailored to fulfill needs of German universities, written using Ionic Framework.", "description": "The generic app tailored to fulfill needs of German universities, written using Ionic Framework.",
"version": "3.1.1", "version": "3.1.2",
"private": true, "private": true,
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>", "author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
@@ -21,7 +21,7 @@
"build:prod": "ng build --configuration=production", "build:prod": "ng build --configuration=production",
"build:stats": "ng build --configuration=production --stats-json", "build:stats": "ng build --configuration=production --stats-json",
"changelog": "conventional-changelog -p angular -i src/assets/about/CHANGELOG.md -s -r 0", "changelog": "conventional-changelog -p angular -i src/assets/about/CHANGELOG.md -s -r 0",
"check-icons": "ts-node-esm scripts/check-icon-correctness.ts", "check-icons": "ts-node scripts/check-icon-correctness.ts",
"chromium:no-cors": "chromium --disable-web-security --user-data-dir=\".browser-data/chromium\"", "chromium:no-cors": "chromium --disable-web-security --user-data-dir=\".browser-data/chromium\"",
"chromium:virtual-host": "chromium --host-resolver-rules=\"MAP mobile.app.uni-frankfurt.de:* localhost:8100\" --ignore-certificate-errors", "chromium:virtual-host": "chromium --host-resolver-rules=\"MAP mobile.app.uni-frankfurt.de:* localhost:8100\" --ignore-certificate-errors",
"cypress:open": "cypress open", "cypress:open": "cypress open",
@@ -52,34 +52,34 @@
"test:integration": "sh integration-test.sh" "test:integration": "sh integration-test.sh"
}, },
"dependencies": { "dependencies": {
"@angular/animations": "16.1.4", "@angular/animations": "17.3.0",
"@angular/cdk": "16.1.4", "@angular/cdk": "17.3.0",
"@angular/common": "16.1.4", "@angular/common": "17.3.0",
"@angular/core": "16.1.4", "@angular/core": "17.3.0",
"@angular/forms": "16.1.4", "@angular/forms": "17.3.0",
"@angular/platform-browser": "16.1.4", "@angular/platform-browser": "17.3.0",
"@angular/router": "16.1.4", "@angular/router": "17.3.0",
"@asymmetrik/ngx-leaflet": "16.0.1", "@asymmetrik/ngx-leaflet": "17.0.0",
"@asymmetrik/ngx-leaflet-markercluster": "16.0.0", "@asymmetrik/ngx-leaflet-markercluster": "17.0.0",
"@awesome-cordova-plugins/calendar": "5.45.0", "@awesome-cordova-plugins/calendar": "6.6.0",
"@awesome-cordova-plugins/core": "5.45.0", "@awesome-cordova-plugins/core": "6.6.0",
"@capacitor/app": "5.0.6", "@capacitor/app": "5.0.7",
"@capacitor/browser": "5.1.0", "@capacitor/browser": "5.2.0",
"@capacitor/clipboard": "5.0.6", "@capacitor/clipboard": "5.0.7",
"@capacitor/core": "5.5.0", "@capacitor/core": "5.7.3",
"@capacitor/device": "5.0.6", "@capacitor/device": "5.0.7",
"@capacitor/dialog": "5.0.6", "@capacitor/dialog": "5.0.7",
"@capacitor/filesystem": "5.1.4", "@capacitor/filesystem": "5.2.1",
"@capacitor/geolocation": "5.0.6", "@capacitor/geolocation": "5.0.7",
"@capacitor/haptics": "5.0.6", "@capacitor/haptics": "5.0.7",
"@capacitor/keyboard": "5.0.6", "@capacitor/keyboard": "5.0.8",
"@capacitor/local-notifications": "5.0.6", "@capacitor/local-notifications": "5.0.7",
"@capacitor/network": "5.0.6", "@capacitor/network": "5.0.7",
"@capacitor/preferences": "5.0.6", "@capacitor/preferences": "5.0.7",
"@capacitor/share": "5.0.6", "@capacitor/share": "5.0.7",
"@capacitor/splash-screen": "5.0.6", "@capacitor/splash-screen": "5.0.7",
"@ionic-native/core": "5.36.0", "@ionic-native/core": "5.36.0",
"@ionic/angular": "7.1.3", "@ionic/angular": "7.8.0",
"@ionic/storage-angular": "4.0.0", "@ionic/storage-angular": "4.0.0",
"@ngx-translate/core": "15.0.0", "@ngx-translate/core": "15.0.0",
"@ngx-translate/http-loader": "8.0.0", "@ngx-translate/http-loader": "8.0.0",
@@ -87,104 +87,105 @@
"@openstapps/api": "workspace:*", "@openstapps/api": "workspace:*",
"@openstapps/collection-utils": "workspace:*", "@openstapps/collection-utils": "workspace:*",
"@openstapps/core": "workspace:*", "@openstapps/core": "workspace:*",
"@transistorsoft/capacitor-background-fetch": "5.1.1", "@transistorsoft/capacitor-background-fetch": "5.2.0",
"@types/dom-view-transitions": "1.0.1", "@types/dom-view-transitions": "1.0.4",
"capacitor-secure-storage-plugin": "0.9.0", "capacitor-secure-storage-plugin": "0.9.0",
"cordova-plugin-calendar": "5.1.6", "cordova-plugin-calendar": "5.1.6",
"date-fns": "2.30.0", "date-fns": "3.6.0",
"deepmerge": "4.3.1", "deepmerge": "4.3.1",
"form-data": "4.0.0", "form-data": "4.0.0",
"geojson": "0.5.0", "geojson": "0.5.0",
"ionic-appauth": "0.9.0", "ionic-appauth": "0.9.0",
"ionicons": "7.2.1",
"jsonpath-plus": "6.0.1", "jsonpath-plus": "6.0.1",
"leaflet": "1.9.3", "leaflet": "1.9.4",
"leaflet.markercluster": "1.5.3", "leaflet.markercluster": "1.5.3",
"material-symbols": "0.10.0", "material-symbols": "0.17.0",
"moment": "2.29.4", "moment": "2.30.1",
"ngx-date-fns": "10.0.1", "ngx-date-fns": "11.0.0",
"ngx-logger": "5.0.12", "ngx-logger": "5.0.12",
"ngx-markdown": "16.0.0", "ngx-markdown": "17.1.1",
"ngx-moment": "6.0.2", "ngx-moment": "6.0.2",
"opening_hours": "3.8.0", "opening_hours": "3.8.0",
"rxjs": "7.8.1", "rxjs": "7.8.1",
"semver": "7.5.4", "semver": "7.6.0",
"swiper": "8.4.5", "swiper": "8.4.5",
"tslib": "2.4.1", "tslib": "2.6.2",
"zone.js": "0.13.1" "zone.js": "0.14.4"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/architect": "0.1601.4", "@angular-devkit/architect": "0.1703.0",
"@angular-devkit/build-angular": "16.1.4", "@angular-devkit/build-angular": "17.3.0",
"@angular-devkit/core": "16.1.4", "@angular-devkit/core": "17.3.0",
"@angular-devkit/schematics": "16.1.4", "@angular-devkit/schematics": "17.3.0",
"@angular-eslint/builder": "16.1.0", "@angular-eslint/builder": "17.3.0",
"@angular-eslint/eslint-plugin": "16.1.0", "@angular-eslint/eslint-plugin": "17.3.0",
"@angular-eslint/eslint-plugin-template": "16.1.0", "@angular-eslint/eslint-plugin-template": "17.3.0",
"@angular-eslint/schematics": "16.1.0", "@angular-eslint/schematics": "17.3.0",
"@angular-eslint/template-parser": "16.1.0", "@angular-eslint/template-parser": "17.3.0",
"@angular/cli": "16.1.4", "@angular/cli": "17.3.0",
"@angular/compiler": "16.1.4", "@angular/compiler": "17.3.0",
"@angular/compiler-cli": "16.1.4", "@angular/compiler-cli": "17.3.0",
"@angular/language-service": "16.1.4", "@angular/language-server": "17.3.0",
"@angular/platform-browser-dynamic": "16.1.4", "@angular/language-service": "17.3.0",
"@capacitor/android": "5.5.0", "@angular/platform-browser-dynamic": "17.3.0",
"@capacitor/assets": "3.0.1", "@capacitor/android": "5.7.3",
"@capacitor/cli": "5.5.0", "@capacitor/assets": "3.0.4",
"@capacitor/ios": "5.5.0", "@capacitor/cli": "5.7.3",
"@compodoc/compodoc": "1.1.19", "@capacitor/ios": "5.7.3",
"@cypress/schematic": "1.7.0", "@compodoc/compodoc": "1.1.23",
"@ionic/angular-toolkit": "10.0.0", "@cypress/schematic": "2.5.1",
"@ionic/cli": "7.1.1", "@ionic/angular-toolkit": "11.0.1",
"@ionic/cli": "7.2.0",
"@openstapps/prettier-config": "workspace:*", "@openstapps/prettier-config": "workspace:*",
"@openstapps/tsconfig": "workspace:*", "@openstapps/tsconfig": "workspace:*",
"@types/fontkit": "1.8.0", "@types/fontkit": "2.0.7",
"@types/geojson": "1.0.6", "@types/geojson": "1.0.6",
"@types/glob": "8.0.1", "@types/glob": "8.1.0",
"@types/jasmine": "4.3.1", "@types/jasmine": "5.1.4",
"@types/jasminewd2": "2.0.10", "@types/jasminewd2": "2.0.13",
"@types/jsonpath": "0.2.0", "@types/jsonpath": "0.2.0",
"@types/karma": "6.3.4", "@types/karma": "6.3.8",
"@types/karma-coverage": "2.0.1", "@types/karma-coverage": "2.0.3",
"@types/karma-jasmine": "4.0.2", "@types/karma-jasmine": "4.0.5",
"@types/leaflet": "1.9.0", "@types/leaflet": "1.9.8",
"@types/leaflet.markercluster": "1.5.1", "@types/leaflet.markercluster": "1.5.4",
"@types/node": "18.15.3", "@types/node": "18.15.3",
"@types/semver": "7.5.6", "@types/semver": "7.5.8",
"@typescript-eslint/eslint-plugin": "5.60.1", "@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "5.60.1", "@typescript-eslint/parser": "7.2.0",
"cordova-res": "0.15.4", "cordova-res": "0.15.4",
"cypress": "13.2.0", "cypress": "13.7.0",
"eslint": "8.43.0", "eslint": "8.57.0",
"eslint-plugin-jsdoc": "46.4.2", "eslint-plugin-jsdoc": "48.2.1",
"eslint-plugin-prettier": "4.2.1", "eslint-plugin-prettier": "5.1.3",
"eslint-plugin-unicorn": "47.0.0", "eslint-plugin-unicorn": "51.0.1",
"fast-deep-equal": "3.1.3", "fast-deep-equal": "3.1.3",
"fontkit": "2.0.2", "fontkit": "2.0.2",
"glob": "10.2.7", "glob": "10.3.10",
"http-server": "14.1.1", "http-server": "14.1.1",
"is-docker": "2.2.1", "is-docker": "2.2.1",
"jasmine-core": "5.0.1", "jasmine-core": "5.1.2",
"jasmine-spec-reporter": "7.0.0", "jasmine-spec-reporter": "7.0.0",
"jetifier": "2.0.0", "jetifier": "2.0.0",
"junit-report-merger": "6.0.2", "junit-report-merger": "6.0.3",
"karma": "6.4.2", "karma": "6.4.3",
"karma-chrome-launcher": "3.2.0", "karma-chrome-launcher": "3.2.0",
"karma-coverage": "2.2.1", "karma-coverage": "2.2.1",
"karma-jasmine": "5.1.0", "karma-jasmine": "5.1.0",
"karma-junit-reporter": "2.0.1", "karma-junit-reporter": "2.0.1",
"karma-mocha-reporter": "2.2.5", "karma-mocha-reporter": "2.2.5",
"license-checker": "25.0.1", "license-checker": "25.0.1",
"stylelint": "15.10.1", "stylelint": "16.2.1",
"stylelint-config-clean-order": "5.0.1", "stylelint-config-clean-order": "5.4.1",
"stylelint-config-prettier-scss": "1.0.0", "stylelint-config-prettier-scss": "1.0.0",
"stylelint-config-recommended-scss": "12.0.0", "stylelint-config-recommended-scss": "14.0.0",
"stylelint-config-standard-scss": "10.0.0", "stylelint-config-standard-scss": "13.0.0",
"surge": "0.23.1", "surge": "0.23.1",
"ts-node": "10.9.1", "ts-node": "10.9.2",
"typescript": "5.1.6", "typescript": "5.4.2",
"webpack-bundle-analyzer": "4.7.0" "webpack-bundle-analyzer": "4.10.1"
}, },
"prettier": "@openstapps/prettier-config",
"cordova": { "cordova": {
"plugins": {}, "plugins": {},
"platforms": [ "platforms": [

View File

@@ -1,3 +1,4 @@
// @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
@@ -25,7 +26,6 @@ const config = {
}, },
}, },
], ],
ignorePath: ['.prettierignore', '../../.gitignore'],
}; };
export default config; export default config;

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

@@ -14,7 +14,7 @@
*/ */
import {AnimationBuilder, AnimationController} from '@ionic/angular'; import {AnimationBuilder, AnimationController} from '@ionic/angular';
import {AnimationOptions} from '@ionic/angular/providers/nav-controller'; import {AnimationOptions} from '@ionic/angular/common/providers/nav-controller';
import {iosDuration, iosEasing, mdDuration, mdEasing} from './easings'; import {iosDuration, iosEasing, mdDuration, mdEasing} from './easings';
/** /**

View File

@@ -25,7 +25,6 @@ import moment from 'moment';
import 'moment/min/locales'; import 'moment/min/locales';
import {LoggerModule, NGXLogger, NgxLoggerLevel} from 'ngx-logger'; import {LoggerModule, NGXLogger, NgxLoggerLevel} from 'ngx-logger';
import SwiperCore, {FreeMode, Navigation} from 'swiper'; import SwiperCore, {FreeMode, Navigation} from 'swiper';
import {environment} from '../environments/environment'; import {environment} from '../environments/environment';
import {AppRoutingModule} from './app-routing.module'; import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component'; import {AppComponent} from './app.component';
@@ -62,12 +61,12 @@ import {RoutingStackService} from './util/routing-stack.service';
import {SCLanguageCode, SCSettingValue} from '@openstapps/core'; import {SCLanguageCode, SCSettingValue} from '@openstapps/core';
import {DefaultAuthService} from './modules/auth/default-auth.service'; import {DefaultAuthService} from './modules/auth/default-auth.service';
import {PAIAAuthService} from './modules/auth/paia/paia-auth.service'; import {PAIAAuthService} from './modules/auth/paia/paia-auth.service';
import {IonIconModule} from './util/ion-icon/ion-icon.module';
import {NavigationModule} from './modules/menu/navigation/navigation.module'; import {NavigationModule} from './modules/menu/navigation/navigation.module';
import {browserFactory, SimpleBrowser} from './util/browser.factory'; import {browserFactory, SimpleBrowser} from './util/browser.factory';
import {getDateFnsLocale} from './translation/dfns-locale'; import {getDateFnsLocale} from './translation/dfns-locale';
import {setDefaultOptions} from 'date-fns'; import {setDefaultOptions} from 'date-fns';
import {DateFnsConfigurationService} from 'ngx-date-fns'; import {DateFnsConfigurationService} from 'ngx-date-fns';
import {SCIcon} from './util/ion-icon/icon';
import {Capacitor} from '@capacitor/core'; import {Capacitor} from '@capacitor/core';
import {SplashScreen} from '@capacitor/splash-screen'; import {SplashScreen} from '@capacitor/splash-screen';
@@ -155,8 +154,9 @@ export function createTranslateLoader(http: HttpClient) {
DashboardModule, DashboardModule,
DataModule, DataModule,
HebisModule, HebisModule,
IonicModule.forRoot(), IonicModule.forRoot({
IonIconModule, backButtonIcon: SCIcon.arrow_back,
}),
JobModule, JobModule,
FavoritesModule, FavoritesModule,
LibraryModule, LibraryModule,

View File

@@ -1,17 +1,17 @@
<!-- <!--
~ Copyright (C) 2023 StApps ~ Copyright (C) 2023 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
~ under the terms of the GNU General Public License as published by the Free ~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3. ~ Software Foundation, version 3.
~ ~
~ This program is distributed in the hope that it will be useful, but WITHOUT ~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details. ~ more details.
~ ~
~ 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/>.
--> -->
<ion-header> <ion-header>
<ion-toolbar color="primary" mode="ios"> <ion-toolbar color="primary" mode="ios">
@@ -24,28 +24,29 @@
</ion-header> </ion-header>
<ion-content parallax> <ion-content parallax>
<div class="licenses-content"> <div class="licenses-content">
<ion-card @for (license of licenses; track license) {
*ngFor="let license of licenses" <ion-card [href]="license.url || license.repository" rel="external" target="_blank">
[href]="license.url || license.repository" <ion-card-header>
rel="external" <ion-card-title>
target="_blank" {{ license.name }}
> <ion-icon
<ion-card-header> [size]="16"
<ion-card-title> [style.--weight]="300"
{{ license.name }} class="supertext-icon"
<ion-icon [size]="16" [weight]="300" class="supertext-icon" name="open_in_browser"></ion-icon> name="open_in_browser"
</ion-card-title> ></ion-icon>
</ion-card-title>
<ion-card-subtitle *ngIf="license.authors || license.publisher"> @if (license.authors || license.publisher) {
{{ license.authors || license.publisher }} <ion-card-subtitle> {{ license.authors || license.publisher }} </ion-card-subtitle>
</ion-card-subtitle> }
</ion-card-header> </ion-card-header>
<ion-card-content> <ion-card-content>
<ion-chip (click)="$event.preventDefault(); viewLicense(license)"> <ion-chip (click)="$event.preventDefault(); viewLicense(license)">
<ion-icon name="copyright"></ion-icon> <ion-icon name="copyright"></ion-icon>
<ion-label>{{ license.licenses }} License</ion-label> <ion-label>{{ license.licenses }} License</ion-label>
</ion-chip> </ion-chip>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
}
</div> </div>
</ion-content> </ion-content>

View File

@@ -1,41 +1,56 @@
<!-- <!--
~ Copyright (C) 2023 StApps ~ Copyright (C) 2023 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
~ under the terms of the GNU General Public License as published by the Free ~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3. ~ Software Foundation, version 3.
~ ~
~ This program is distributed in the hope that it will be useful, but WITHOUT ~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details. ~ more details.
~ ~
~ 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/>.
--> -->
<markdown *ngIf="content.type === 'markdown'" [data]="'value' | translateSimple : content"></markdown> @if (content.type === 'markdown') {
<div *ngIf="content.type ==='section'"> <markdown [data]="'value' | translateSimple: content"></markdown>
<ion-card *ngIf="content.card; else noCard"> }
<ion-card-header> @if (content.type === 'section') {
<ion-card-title>{{ 'title' | translateSimple : content }}</ion-card-title> <div>
</ion-card-header> @if (content.card) {
<ion-card-content> <ion-card>
<ion-card-header>
<ion-card-title>{{ 'title' | translateSimple: content }}</ion-card-title>
</ion-card-header>
<ion-card-content>
<about-page-content [content]="content.content"></about-page-content>
</ion-card-content>
</ion-card>
} @else {
<h2>{{ 'title' | translateSimple: content }}</h2>
<about-page-content [content]="content.content"></about-page-content> <about-page-content [content]="content.content"></about-page-content>
</ion-card-content> }
</ion-card> </div>
<ng-template #noCard> }
<h2>{{ 'title' | translateSimple : content }}</h2> @if (content.type === 'table') {
<about-page-content [content]="content.content"></about-page-content> <ion-grid>
</ng-template> @for (row of content.rows; track row) {
</div> <ion-row>
<ion-grid *ngIf="content.type === 'table'"> @for (col of row; track col) {
<ion-row *ngFor="let row of content.rows"> <ion-col>
<ion-col *ngFor="let col of row"> <about-page-content [content]="col"></about-page-content>
<about-page-content [content]="col"></about-page-content> </ion-col>
</ion-col> }
</ion-row> </ion-row>
</ion-grid> }
<ion-item *ngIf="content.type === 'router link'" [routerLink]="content.link"> </ion-grid>
<ion-icon *ngIf="content.icon" [name]="content.icon" slot="start"></ion-icon> }
<ion-label>{{ 'title' | translateSimple : content }}</ion-label> @if (content.type === 'router link') {
</ion-item> <ion-item [routerLink]="content.link">
@if (content.icon) {
<ion-icon [name]="content.icon" slot="start"></ion-icon>
}
<ion-label>{{ 'title' | translateSimple: content }}</ion-label>
</ion-item>
}

View File

@@ -1,32 +1,37 @@
<!-- <!--
~ Copyright (C) 2023 StApps ~ Copyright (C) 2023 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
~ under the terms of the GNU General Public License as published by the Free ~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3. ~ Software Foundation, version 3.
~ ~
~ This program is distributed in the hope that it will be useful, but WITHOUT ~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details. ~ more details.
~ ~
~ 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/>.
--> -->
<ion-header> <ion-header>
<ion-toolbar color="primary" mode="ios"> <ion-toolbar color="primary" mode="ios">
<ion-buttons slot="start"> <ion-buttons slot="start">
<ion-back-button></ion-back-button> <ion-back-button></ion-back-button>
</ion-buttons> </ion-buttons>
<ion-title *ngIf="content; else titleLoading">{{ 'title' | translateSimple : content }}</ion-title> @if (content) {
<ng-template #titleLoading> <ion-title>{{ 'title' | translateSimple: content }}</ion-title>
} @else {
<ion-title><ion-skeleton-text animated="true"></ion-skeleton-text></ion-title> <ion-title><ion-skeleton-text animated="true"></ion-skeleton-text></ion-title>
</ng-template> }
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content parallax *ngIf="content"> @if (content) {
<ion-text>{{ 'about.VERSION_INFO' | translate: {name, version, stappsVersion} }}</ion-text> <ion-content parallax>
<div class="page-content"> <ion-text>{{ 'about.VERSION_INFO' | translate: {name, version, stappsVersion} }}</ion-text>
<about-page-content *ngFor="let element of content.content" [content]="element"></about-page-content> <div class="page-content">
</div> @for (element of content.content; track element) {
</ion-content> <about-page-content [content]="element"></about-page-content>
}
</div>
</ion-content>
}

View File

@@ -29,7 +29,6 @@ import {ScrollingModule} from '@angular/cdk/scrolling';
import {AboutLicenseModalComponent} from './about-license-modal.component'; import {AboutLicenseModalComponent} from './about-license-modal.component';
import {AboutChangelogComponent} from './about-changelog.component'; import {AboutChangelogComponent} from './about-changelog.component';
import {UtilModule} from '../../util/util.module'; import {UtilModule} from '../../util/util.module';
import {IonIconModule} from '../../util/ion-icon/ion-icon.module';
const settingsRoutes: Routes = [ const settingsRoutes: Routes = [
{path: 'about', component: AboutPageComponent}, {path: 'about', component: AboutPageComponent},
@@ -53,9 +52,8 @@ const settingsRoutes: Routes = [
], ],
imports: [ imports: [
CommonModule, CommonModule,
IonIconModule,
FormsModule, FormsModule,
IonicModule.forRoot(), IonicModule,
TranslateModule.forChild(), TranslateModule.forChild(),
ThingTranslateModule.forChild(), ThingTranslateModule.forChild(),
RouterModule.forChild(settingsRoutes), RouterModule.forChild(settingsRoutes),

View File

@@ -5,7 +5,6 @@ import {ThingTranslateModule} from '../../translation/thing-translate.module';
import {IonicModule, ModalController} from '@ionic/angular'; import {IonicModule, ModalController} from '@ionic/angular';
import {TranslateModule} from '@ngx-translate/core'; import {TranslateModule} from '@ngx-translate/core';
import {UtilModule} from '../../util/util.module'; import {UtilModule} from '../../util/util.module';
import {CommonModule} from '@angular/common';
@Component({ @Component({
selector: 'stapps-release-notes', selector: 'stapps-release-notes',
@@ -13,7 +12,7 @@ import {CommonModule} from '@angular/common';
styleUrls: ['release-notes.scss'], styleUrls: ['release-notes.scss'],
standalone: true, standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
imports: [UtilModule, MarkdownModule, ThingTranslateModule, IonicModule, TranslateModule, CommonModule], imports: [UtilModule, MarkdownModule, ThingTranslateModule, IonicModule, TranslateModule],
}) })
export class ReleaseNotesComponent { export class ReleaseNotesComponent {
@Input() versionInfos: SCAppVersionInfo[]; @Input() versionInfos: SCAppVersionInfo[];

View File

@@ -1,18 +1,20 @@
<ion-header> <ion-header>
<ion-toolbar> <ion-toolbar>
<ion-title><span class="ion-text-wrap">{{'releaseNotes.TITLE_UPDATED' | translate}}</span></ion-title> <ion-title
><span class="ion-text-wrap">{{ 'releaseNotes.TITLE_UPDATED' | translate }}</span></ion-title
>
<ion-buttons slot="end"> <ion-buttons slot="end">
<ion-button [strong]="true" (click)="modalController.dismiss()" <ion-button [strong]="true" (click)="modalController.dismiss()">{{
>{{'modal.DISMISS_NEUTRAL' | translate}}</ion-button 'modal.DISMISS_NEUTRAL' | translate
> }}</ion-button>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content parallax> <ion-content parallax>
<ng-container *ngFor="let versionInfo of versionInfos"> @for (versionInfo of versionInfos; track versionInfo) {
<markdown <markdown
class="content-card ion-padding" class="content-card ion-padding"
[data]="'releaseNotes' | translateSimple: versionInfo" [data]="'releaseNotes' | translateSimple: versionInfo"
></markdown> ></markdown>
</ng-container> }
</ion-content> </ion-content>

View File

@@ -35,7 +35,6 @@ import {AssessmentsProvider} from './assessments.provider';
import {AssessmentsSimpleDataListComponent} from './list/assessments-simple-data-list.component'; import {AssessmentsSimpleDataListComponent} from './list/assessments-simple-data-list.component';
import {ProtectedRoutes} from '../auth/protected.routes'; import {ProtectedRoutes} from '../auth/protected.routes';
import {AssessmentsTreeListComponent} from './list/assessments-tree-list.component'; import {AssessmentsTreeListComponent} from './list/assessments-tree-list.component';
import {IonIconModule} from '../../util/ion-icon/ion-icon.module';
import {UtilModule} from '../../util/util.module'; import {UtilModule} from '../../util/util.module';
const routes: ProtectedRoutes = [ const routes: ProtectedRoutes = [
@@ -69,7 +68,6 @@ const routes: ProtectedRoutes = [
imports: [ imports: [
CommonModule, CommonModule,
FormsModule, FormsModule,
IonIconModule,
IonicModule, IonicModule,
RouterModule.forChild(routes), RouterModule.forChild(routes),
TranslateModule, TranslateModule,

View File

@@ -36,7 +36,7 @@
class="ion-text-wrap" class="ion-text-wrap"
*ngIf="assessments[key].courseOfStudy | async as course; else defaultLabel" *ngIf="assessments[key].courseOfStudy | async as course; else defaultLabel"
> >
{{ 'name' | thingTranslate : course }} ({{ 'academicDegree' | thingTranslate : course }}) {{ 'name' | thingTranslate: course }} ({{ 'academicDegree' | thingTranslate: course }})
</ion-label> </ion-label>
</div> </div>
<ng-template #defaultLabel> <ng-template #defaultLabel>

View File

@@ -14,8 +14,12 @@
--> -->
<ion-label [color]="passed ? undefined : 'danger'" <ion-label [color]="passed ? undefined : 'danger'"
>{{ (_item.grade | isNumeric) ? (_item.grade | numberLocalized : >{{
'minimumFractionDigits:1,maximumFractionDigits:1') : '' }} {{ 'status' | thingTranslate : _item | titlecase (_item.grade | isNumeric)
}}, {{ 'attempt' | propertyNameTranslate : _item }} {{ _item.attempt }} ? (_item.grade | numberLocalized: 'minimumFractionDigits:1,maximumFractionDigits:1')
: ''
}}
{{ 'status' | thingTranslate: _item | titlecase }}, {{ 'attempt' | propertyNameTranslate: _item }}
{{ _item.attempt }}
</ion-label> </ion-label>
<ion-note> {{ _item.ects }} {{ 'ects' | propertyNameTranslate : _item }}</ion-note> <ion-note> {{ _item.ects }} {{ 'ects' | propertyNameTranslate: _item }}</ion-note>

View File

@@ -1,24 +1,28 @@
<!-- <!--
~ 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
~ under the terms of the GNU General Public License as published by the Free ~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3. ~ Software Foundation, version 3.
~ ~
~ This program is distributed in the hope that it will be useful, but WITHOUT ~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details. ~ more details.
~ ~
~ 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/>.
--> -->
<ion-card> <ion-card>
<ion-card-content> <ion-card-content>
<ion-note *ngIf="item.courseOfStudy as courseOfStudy"> @if (item.courseOfStudy; as courseOfStudy) {
{{ $any('courseOfStudy' | propertyNameTranslate : item) | titlecase }}: {{ 'name' | thingTranslate : <ion-note>
$any(courseOfStudy) }} ({{ 'academicDegree' | thingTranslate : $any(courseOfStudy) }}) {{ $any('courseOfStudy' | propertyNameTranslate: item) | titlecase }}:
</ion-note> {{ 'name' | thingTranslate: $any(courseOfStudy) }} ({{
'academicDegree' | thingTranslate: $any(courseOfStudy)
}})
</ion-note>
}
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
<ion-list class="container"> <ion-list class="container">

View File

@@ -14,6 +14,6 @@
--> -->
<div class="container"> <div class="container">
<h2 class="name">{{ 'name' | thingTranslate : item }} {{ item.date ? (item.date | amDateFormat) : '' }}</h2> <h2 class="name">{{ 'name' | thingTranslate: item }} {{ item.date ? (item.date | amDateFormat) : '' }}</h2>
<assessment-base-info [item]="item"></assessment-base-info> <assessment-base-info [item]="item"></assessment-base-info>
</div> </div>

View File

@@ -51,11 +51,7 @@ export class CapacitorRequestor extends Requestor {
private async post<T>(url: string, data: any, headers: HttpHeaders) { private async post<T>(url: string, data: any, headers: HttpHeaders) {
return CapacitorHttp.post({ return CapacitorHttp.post({
url, url,
// Workaround for CapacitorHttp bug (JSONException when "x-www-form-urlencoded" text is provided) data,
data:
headers['Content-Type'] === 'application/x-www-form-urlencoded'
? this.decodeURLSearchParams(data)
: data,
headers, headers,
}).then((response: HttpResponse) => { }).then((response: HttpResponse) => {
return response.data as T; return response.data as T;
@@ -66,11 +62,7 @@ export class CapacitorRequestor extends Requestor {
private async put<T>(url: string, data: any, headers: HttpHeaders) { private async put<T>(url: string, data: any, headers: HttpHeaders) {
return CapacitorHttp.put({ return CapacitorHttp.put({
url, url,
// Workaround for CapacitorHttp bug (JSONException when "x-www-form-urlencoded" text is provided) data,
data:
headers['Content-Type'] === 'application/x-www-form-urlencoded'
? this.decodeURLSearchParams(data)
: data,
headers, headers,
}).then((response: HttpResponse) => response.data as T); }).then((response: HttpResponse) => response.data as T);
} }
@@ -78,14 +70,4 @@ export class CapacitorRequestor extends Requestor {
private async delete<T>(url: string, headers: HttpHeaders) { private async delete<T>(url: string, headers: HttpHeaders) {
return CapacitorHttp.delete({url, headers}).then((response: HttpResponse) => response.data as T); return CapacitorHttp.delete({url, headers}).then((response: HttpResponse) => response.data as T);
} }
private decodeURLSearchParams(parameters: string): Record<string, unknown> {
const searchParameters = new URLSearchParams(parameters);
return Object.fromEntries(
[...searchParameters.keys()].map(k => [
k,
searchParameters.getAll(k).length === 1 ? searchParameters.get(k) : searchParameters.getAll(k),
]),
);
}
} }

View File

@@ -1,17 +1,17 @@
<!-- <!--
~ 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
~ under the terms of the GNU General Public License as published by the Free ~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3. ~ Software Foundation, version 3.
~ ~
~ This program is distributed in the hope that it will be useful, but WITHOUT ~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details. ~ more details.
~ ~
~ 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/>.
--> -->
<div> <div>
<ion-card-header> <ion-card-header>
<ion-card-title>{{ 'schedule.toCalendar.reviewModal.TITLE' | translate }}</ion-card-title> <ion-card-title>{{ 'schedule.toCalendar.reviewModal.TITLE' | translate }}</ion-card-title>
@@ -22,50 +22,63 @@
<ion-card-content> <ion-card-content>
<ion-list lines="none"> <ion-list lines="none">
<ion-item-group *ngFor="let event of iCalEvents"> @for (event of iCalEvents; track event) {
<ion-item-divider> <ion-item-group>
<ion-label>{{ event.title }}</ion-label> <ion-item-divider>
<ion-note slot="start" *ngIf="event.events.length > 1"> <ion-label>{{ event.title }}</ion-label>
<ion-icon name="insert_page_break"></ion-icon> @if (event.events.length > 1) {
</ion-note> <ion-note slot="start">
</ion-item-divider> <ion-icon name="insert_page_break"></ion-icon>
<ion-item *ngFor="let iCalEvent of event.events"> </ion-note>
<ion-label> }
<s *ngIf="iCalEvent.cancelled; else date" </ion-item-divider>
><ng-container [ngTemplateOutlet]="date"></ng-container> @for (iCalEvent of event.events; track iCalEvent) {
</s> <ion-item>
<ng-template #date> {{ moment(iCalEvent.start) | amDateFormat : 'll, HH:mm' }} </ng-template> <ion-label>
</ion-label> @if (iCalEvent.cancelled) {
<ion-note *ngIf="iCalEvent.rrule"> <s><ng-container [ngTemplateOutlet]="date"></ng-container> </s>
{{ iCalEvent.rrule.interval }} {{ iCalEvent.rrule.freq | sentencecase }} } @else {
</ion-note> {{ moment(iCalEvent.start) | amDateFormat: 'll, HH:mm' }}
<ion-icon *ngIf="iCalEvent.rrule" name="event_repeat"></ion-icon> }
</ion-item> <ng-template #date> {{ moment(iCalEvent.start) | amDateFormat: 'll, HH:mm' }} </ng-template>
</ion-item-group> </ion-label>
@if (iCalEvent.rrule) {
<ion-note>
{{ iCalEvent.rrule.interval }} {{ iCalEvent.rrule.freq | sentencecase }}
</ion-note>
}
@if (iCalEvent.rrule) {
<ion-icon name="event_repeat"></ion-icon>
}
</ion-item>
}
</ion-item-group>
}
</ion-list> </ion-list>
</ion-card-content> </ion-card-content>
<div class="horizontal-flex"> <div class="horizontal-flex">
<ion-item lines="none"> <ion-item lines="none">
<ion-checkbox [(ngModel)]="includeCancelled" <ion-checkbox [(ngModel)]="includeCancelled">{{
>{{ 'schedule.toCalendar.reviewModal.INCLUDE_CANCELLED' | translate }}</ion-checkbox 'schedule.toCalendar.reviewModal.INCLUDE_CANCELLED' | translate
> }}</ion-checkbox>
</ion-item> </ion-item>
</div> </div>
<div class="horizontal-flex"> <div class="horizontal-flex">
<ion-button fill="clear" (click)="export()"> <ion-button fill="clear" (click)="export()">
{{ 'share' | translate }} {{ 'share' | translate }}
<ion-icon slot="end" md="share" ios="ios_share"></ion-icon> <ion-icon slot="end" name="share"></ion-icon>
</ion-button> </ion-button>
<ion-button fill="outline" (click)="download()" *ngIf="isWeb; else exportButton"> @if (isWeb) {
{{ 'schedule.toCalendar.reviewModal.DOWNLOAD' | translate }} <ion-button fill="outline" (click)="download()">
<ion-icon slot="end" name="download"></ion-icon> {{ 'schedule.toCalendar.reviewModal.DOWNLOAD' | translate }}
</ion-button> <ion-icon slot="end" name="download"></ion-icon>
<ng-template #exportButton> </ion-button>
} @else {
<ion-button fill="outline" (click)="toCalendar()"> <ion-button fill="outline" (click)="toCalendar()">
{{ 'schedule.toCalendar.reviewModal.EXPORT' | translate }} {{ 'schedule.toCalendar.reviewModal.EXPORT' | translate }}
<ion-icon slot="end" name="event_upcoming"></ion-icon> <ion-icon slot="end" name="event_upcoming"></ion-icon>
</ion-button> </ion-button>
</ng-template> }
</div> </div>
</div> </div>

View File

@@ -25,15 +25,13 @@ import {FormsModule} from '@angular/forms';
import {CommonModule} from '@angular/common'; import {CommonModule} from '@angular/common';
import {MomentModule} from 'ngx-moment'; import {MomentModule} from 'ngx-moment';
import {UtilModule} from '../../util/util.module'; import {UtilModule} from '../../util/util.module';
import {IonIconModule} from '../../util/ion-icon/ion-icon.module';
@NgModule({ @NgModule({
declarations: [AddEventReviewModalComponent], declarations: [AddEventReviewModalComponent],
imports: [ imports: [
IonicModule.forRoot(), IonicModule,
TranslateModule.forChild(), TranslateModule.forChild(),
ThingTranslateModule.forChild(), ThingTranslateModule.forChild(),
IonIconModule,
FormsModule, FormsModule,
CommonModule, CommonModule,
MomentModule, MomentModule,

View File

@@ -1,17 +1,17 @@
<!-- <!--
~ 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
~ under the terms of the GNU General Public License as published by the Free ~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3. ~ Software Foundation, version 3.
~ ~
~ This program is distributed in the hope that it will be useful, but WITHOUT ~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details. ~ more details.
~ ~
~ 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/>.
--> -->
<ion-header> <ion-header>
<ion-toolbar color="primary" mode="ios"> <ion-toolbar color="primary" mode="ios">
@@ -23,33 +23,45 @@
</ion-toolbar> </ion-toolbar>
<ion-toolbar color="primary" mode="md"> <ion-toolbar color="primary" mode="md">
<ion-segment (ionChange)="segmentChanged($event)" [value]="selectedSemesterUID" mode="md"> <ion-segment (ionChange)="segmentChanged($event)" [value]="selectedSemesterUID" mode="md">
<ion-segment-button *ngFor="let semester of availableSemesters" [value]="semester.uid"> @for (semester of availableSemesters; track semester) {
<ion-label>{{ semester.acronym }}</ion-label> <ion-segment-button [value]="semester.uid">
</ion-segment-button> <ion-label>{{ semester.acronym }}</ion-label>
</ion-segment-button>
}
</ion-segment> </ion-segment>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content> <ion-content>
<ion-list *ngIf="catalogs && catalogs.length > 0"> @if (catalogs && catalogs.length > 0) {
<ion-item *ngFor="let catalog of catalogs" button="true" lines="inset" (click)="notifySelect(catalog)"> <ion-list>
<ion-label> @for (catalog of catalogs; track catalog) {
<h2>{{ catalog.name }}</h2> <ion-item button="true" lines="inset" (click)="notifySelect(catalog)">
</ion-label>
</ion-item>
</ion-list>
<ion-list *ngIf="!catalogs">
<stapps-skeleton-list-item *ngFor="let skeleton of [].constructor(10)"> </stapps-skeleton-list-item>
</ion-list>
<ion-grid *ngIf="catalogs && catalogs.length === 0">
<ion-row>
<ion-col>
<div class="ion-text-center margin-top">
<ion-label> <ion-label>
{{ 'catalog.detail.EMPTY_SEMESTER' | translate }} <h2>{{ catalog.name }}</h2>
</ion-label> </ion-label>
</div> </ion-item>
</ion-col> }
</ion-row> </ion-list>
</ion-grid> }
@if (!catalogs) {
<ion-list>
@for (skeleton of [].constructor(10); track skeleton) {
<stapps-skeleton-list-item> </stapps-skeleton-list-item>
}
</ion-list>
}
@if (catalogs && catalogs.length === 0) {
<ion-grid>
<ion-row>
<ion-col>
<div class="ion-text-center margin-top">
<ion-label>
{{ 'catalog.detail.EMPTY_SEMESTER' | translate }}
</ion-label>
</div>
</ion-col>
</ion-row>
</ion-grid>
}
</ion-content> </ion-content>

View File

@@ -23,7 +23,6 @@ import {DataModule} from '../data/data.module';
import {SettingsProvider} from '../settings/settings.provider'; import {SettingsProvider} from '../settings/settings.provider';
import {CatalogComponent} from './catalog.component'; import {CatalogComponent} from './catalog.component';
import {UtilModule} from '../../util/util.module'; import {UtilModule} from '../../util/util.module';
import {IonIconModule} from '../../util/ion-icon/ion-icon.module';
const catalogRoutes: Routes = [ const catalogRoutes: Routes = [
{path: 'catalog', component: CatalogComponent}, {path: 'catalog', component: CatalogComponent},
@@ -36,11 +35,10 @@ const catalogRoutes: Routes = [
@NgModule({ @NgModule({
declarations: [CatalogComponent], declarations: [CatalogComponent],
imports: [ imports: [
IonicModule.forRoot(), IonicModule,
FormsModule, FormsModule,
TranslateModule.forChild(), TranslateModule.forChild(),
RouterModule.forChild(catalogRoutes), RouterModule.forChild(catalogRoutes),
IonIconModule,
CommonModule, CommonModule,
MomentModule, MomentModule,
DataModule, DataModule,

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

@@ -20,7 +20,7 @@
</ion-header> </ion-header>
<div #schedule class="schedule"> <div #schedule class="schedule">
<a [routerLink]="['/schedule/week-overview']"> <a [routerLink]="['/schedule/week-overview']">
<ion-icon [size]="36" [weight]="300" name="calendar_month"></ion-icon> <ion-icon [size]="36" [style.--weight]="300" name="calendar_month"></ion-icon>
<ion-label [innerHTML]="'schedule.recurring' | translate"></ion-label> <ion-label [innerHTML]="'schedule.recurring' | translate"></ion-label>
</a> </a>
<!-- Avoid structural directives here, they might interfere with the collapse animation --> <!-- Avoid structural directives here, they might interfere with the collapse animation -->

View File

@@ -30,7 +30,6 @@ import {MensaSectionContentComponent} from './sections/mensa-section/mensa-secti
import {FavoritesSectionComponent} from './sections/favorites-section/favorites-section.component'; import {FavoritesSectionComponent} from './sections/favorites-section/favorites-section.component';
import {ThingTranslateModule} from '../../translation/thing-translate.module'; import {ThingTranslateModule} from '../../translation/thing-translate.module';
import {UtilModule} from '../../util/util.module'; import {UtilModule} from '../../util/util.module';
import {IonIconModule} from '../../util/ion-icon/ion-icon.module';
import {NewsModule} from '../news/news.module'; import {NewsModule} from '../news/news.module';
import {JobSectionComponent} from './sections/jobs-section/job-section.component'; import {JobSectionComponent} from './sections/jobs-section/job-section.component';
import {JobModule} from '../jobs/jobs.module'; import {JobModule} from '../jobs/jobs.module';
@@ -56,8 +55,7 @@ const catalogRoutes: Routes = [
JobSectionComponent, JobSectionComponent,
], ],
imports: [ imports: [
IonicModule.forRoot(), IonicModule,
IonIconModule,
FormsModule, FormsModule,
TranslateModule.forChild(), TranslateModule.forChild(),
RouterModule.forChild(catalogRoutes), RouterModule.forChild(catalogRoutes),

View File

@@ -1,32 +1,34 @@
<!-- <!--
~ Copyright (C) 2023 StApps ~ Copyright (C) 2023 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
~ under the terms of the GNU General Public License as published by the Free ~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3. ~ Software Foundation, version 3.
~ ~
~ This program is distributed in the hope that it will be useful, but WITHOUT ~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details. ~ more details.
~ ~
~ 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/>.
--> -->
<stapps-section [title]="'dashboard.favorites.title' | translate"> <stapps-section [title]="'dashboard.favorites.title' | translate">
<ion-button slot="button-end" fill="clear" color="medium" [routerLink]="['/favorites']"> <ion-button slot="button-end" fill="clear" color="medium" [routerLink]="['/favorites']">
<ion-icon slot="icon-only" name="search" [size]="24"></ion-icon> <ion-icon slot="icon-only" name="search" [size]="24"></ion-icon>
</ion-button> </ion-button>
<simple-swiper *ngIf="items | async as items; else noItems" @fade> @if (items | async; as items) {
<stapps-data-list-item <simple-swiper @fade>
*ngFor="let item of items" @for (item of items; track item) {
[hideThumbnail]="true" <stapps-data-list-item
[listItemEndInteraction]="false" [hideThumbnail]="true"
[item]="item" [listItemEndInteraction]="false"
appearance="square" [item]="item"
></stapps-data-list-item> appearance="square"
</simple-swiper> ></stapps-data-list-item>
<ng-template #noItems> }
</simple-swiper>
} @else {
<ion-item class="nothing-selected" lines="none"> <ion-item class="nothing-selected" lines="none">
<ion-label class="ion-text-wrap"> <ion-label class="ion-text-wrap">
{{ 'dashboard.favorites.no_favorite_prefix' | translate }} {{ 'dashboard.favorites.no_favorite_prefix' | translate }}
@@ -34,5 +36,5 @@
{{ 'dashboard.favorites.no_favorite_suffix' | translate }} {{ 'dashboard.favorites.no_favorite_suffix' | translate }}
</ion-label> </ion-label>
</ion-item> </ion-item>
</ng-template> }
</stapps-section> </stapps-section>

View File

@@ -1,43 +1,44 @@
<!-- <!--
~ Copyright (C) 2023 StApps ~ Copyright (C) 2023 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
~ under the terms of the GNU General Public License as published by the Free ~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3. ~ Software Foundation, version 3.
~ ~
~ This program is distributed in the hope that it will be useful, but WITHOUT ~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details. ~ more details.
~ ~
~ 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/>.
--> -->
<stapps-section [title]="'dashboard.jobs.title' | translate"> <stapps-section [title]="'dashboard.jobs.title' | translate">
<ion-button slot="button-end" fill="clear" color="medium" [routerLink]="['/jobs']"> <ion-button slot="button-end" fill="clear" color="medium" [routerLink]="['/jobs']">
<ion-icon slot="icon-only" name="search" [size]="24"></ion-icon> <ion-icon slot="icon-only" name="search" [size]="24"></ion-icon>
</ion-button> </ion-button>
<simple-swiper *ngIf="jobs | async as jobs; else noItems" @fade> @if (jobs | async; as jobs) {
<stapps-data-list-item <simple-swiper @fade>
*ngFor="let item of jobs" @for (item of jobs; track item) {
[hideThumbnail]="true" <stapps-data-list-item
[item]="item" [hideThumbnail]="true"
appearance="square" [item]="item"
></stapps-data-list-item> appearance="square"
<ion-item [routerLink]="['/jobs']" class="more-jobs" lines="none"> ></stapps-data-list-item>
<ion-label>{{ 'dashboard.jobs.title' | translate | titlecase }}</ion-label> }
<ion-icon color="medium" name="read_more" [size]="40"></ion-icon> <ion-item [routerLink]="['/jobs']" class="more-jobs" lines="none">
</ion-item> <ion-label>{{ 'dashboard.jobs.title' | translate | titlecase }}</ion-label>
</simple-swiper> <ion-icon color="medium" name="read_more" [size]="40"></ion-icon>
<ng-template #noItems> </ion-item>
</simple-swiper>
} @else {
<ion-item class="nothing-selected" lines="none"> <ion-item class="nothing-selected" lines="none">
<ion-label class="ion-text-wrap"> <ion-label class="ion-text-wrap">
{{ 'dashboard.jobs.noJobs' | translate }} {{ 'dashboard.jobs.noJobs' | translate }}
</ion-label> </ion-label>
</ion-item> </ion-item>
<ion-button slot="button-end" fill="clear" color="medium" [routerLink]="['/jobs']"> <ion-button slot="button-end" fill="clear" color="medium" [routerLink]="['/jobs']">
<ion-icon slot="icon-only" name="search" [size]="24"></ion-icon> <ion-icon slot="icon-only" name="search" [size]="24"></ion-icon>
</ion-button> </ion-button>
</ng-template> }
</stapps-section> </stapps-section>

View File

@@ -1,33 +1,37 @@
<!-- <!--
~ Copyright (C) 2023 StApps ~ Copyright (C) 2023 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
~ under the terms of the GNU General Public License as published by the Free ~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3. ~ Software Foundation, version 3.
~ ~
~ This program is distributed in the hope that it will be useful, but WITHOUT ~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details. ~ more details.
~ ~
~ 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/>.
--> -->
<ng-container *ngIf="dishes | async as dishes; else loading"> @if (dishes | async; as dishes) {
<simple-swiper *ngIf="dishes.length > 0" @fade> @if (dishes.length > 0) {
<stapps-data-list-item <simple-swiper @fade>
*ngFor="let dish of dishes" @for (dish of dishes; track dish) {
[hideThumbnail]="true" <stapps-data-list-item
[item]="dish" [hideThumbnail]="true"
appearance="square" [item]="dish"
></stapps-data-list-item> appearance="square"
</simple-swiper> ></stapps-data-list-item>
<ion-item class="no-dishes" *ngIf="!dishes || dishes.length === 0" lines="none"> }
<ion-label> </simple-swiper>
{{ 'dashboard.canteens.no_dishes_available' | translate }} }
</ion-label> @if (!dishes || dishes.length === 0) {
</ion-item> <ion-item class="no-dishes" lines="none">
</ng-container> <ion-label>
<ng-template #loading> {{ 'dashboard.canteens.no_dishes_available' | translate }}
</ion-label>
</ion-item>
}
} @else {
<div class="placeholder"></div> <div class="placeholder"></div>
</ng-template> }

View File

@@ -1,21 +1,21 @@
<!-- <!--
~ Copyright (C) 2023 StApps ~ Copyright (C) 2023 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
~ under the terms of the GNU General Public License as published by the Free ~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3. ~ Software Foundation, version 3.
~ ~
~ This program is distributed in the hope that it will be useful, but WITHOUT ~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details. ~ more details.
~ ~
~ 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/>.
--> -->
<ng-container *ngIf="items | async as items"> @if (items | async; as items) {
<ng-container *ngIf="items.length !== 0; else nothingSelected"> @if (items.length !== 0) {
<ng-container *ngFor="let item of items"> @for (item of items; track item) {
<stapps-section @fade [item]="item" [title]="'name' | thingTranslate: item"> <stapps-section @fade [item]="item" [title]="'name' | thingTranslate: item">
<ion-button slot="button-end" fill="clear" color="medium" (click)="favoritesService.delete(item)"> <ion-button slot="button-end" fill="clear" color="medium" (click)="favoritesService.delete(item)">
<ion-icon slot="icon-only" name="delete" [size]="24"></ion-icon> <ion-icon slot="icon-only" name="delete" [size]="24"></ion-icon>
@@ -23,9 +23,8 @@
<stapps-opening-hours slot="subtitle" [openingHours]="$any(item).openingHours"></stapps-opening-hours> <stapps-opening-hours slot="subtitle" [openingHours]="$any(item).openingHours"></stapps-opening-hours>
<stapps-mensa-section-content [item]="item"></stapps-mensa-section-content> <stapps-mensa-section-content [item]="item"></stapps-mensa-section-content>
</stapps-section> </stapps-section>
</ng-container> }
</ng-container> } @else {
<ng-template #nothingSelected>
<stapps-section [title]="'dashboard.canteens.title' | translate"> <stapps-section [title]="'dashboard.canteens.title' | translate">
<ion-item class="nothing-selected" lines="none"> <ion-item class="nothing-selected" lines="none">
<ion-label class="ion-text-wrap"> <ion-label class="ion-text-wrap">
@@ -35,5 +34,5 @@
</ion-label> </ion-label>
</ion-item> </ion-item>
</stapps-section> </stapps-section>
</ng-template> }
</ng-container> }

View File

@@ -1,29 +1,33 @@
<!-- <!--
~ Copyright (C) 2023 StApps ~ Copyright (C) 2023 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
~ under the terms of the GNU General Public License as published by the Free ~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3. ~ Software Foundation, version 3.
~ ~
~ This program is distributed in the hope that it will be useful, but WITHOUT ~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details. ~ more details.
~ ~
~ 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/>.
--> -->
<stapps-section [title]="'dashboard.news.title' | translate"> <stapps-section [title]="'dashboard.news.title' | translate">
<ion-button size="small" slot="button-end" fill="clear" color="medium" [routerLink]="['/news']"> <ion-button size="small" slot="button-end" fill="clear" color="medium" [routerLink]="['/news']">
<ion-icon slot="icon-only" name="read_more"></ion-icon> <ion-icon slot="icon-only" name="read_more"></ion-icon>
</ion-button> </ion-button>
<simple-swiper class="news-swiper card-swiper" *ngIf="news | async as news" @fade> @if (news | async; as news) {
<stapps-news-item *ngFor="let newsItem of news" [item]="newsItem"> </stapps-news-item> <simple-swiper class="news-swiper card-swiper" @fade>
<ion-item [routerLink]="['/news']" class="more-news" lines="none"> @for (newsItem of news; track newsItem) {
<ion-label>{{ 'dashboard.news.moreNews' | translate | titlecase }}</ion-label> <stapps-news-item [item]="newsItem"> </stapps-news-item>
<ion-thumbnail class="ion-margin-end"> }
<ion-icon color="medium" name="read_more" [size]="150"></ion-icon> <ion-item [routerLink]="['/news']" class="more-news" lines="none">
</ion-thumbnail> <ion-label>{{ 'dashboard.news.moreNews' | translate | titlecase }}</ion-label>
</ion-item> <ion-thumbnail class="ion-margin-end">
</simple-swiper> <ion-icon color="medium" name="read_more" [size]="150"></ion-icon>
</ion-thumbnail>
</ion-item>
</simple-swiper>
}
</stapps-section> </stapps-section>

View File

@@ -63,10 +63,10 @@ simple-swiper {
.title { .title {
overflow: hidden; overflow: hidden;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical;
white-space: break-spaces; white-space: break-spaces;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
} }

View File

@@ -14,7 +14,7 @@
*/ */
import {AnimationController} from '@ionic/angular'; import {AnimationController} from '@ionic/angular';
import {AnimationOptions} from '@ionic/angular/providers/nav-controller'; import {AnimationOptions} from '@ionic/angular/common/providers/nav-controller';
/** /**
* *

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