Compare commits

..

41 Commits

Author SHA1 Message Date
1628849d1b feat: update to node 22 2024-06-04 11:13:58 +02:00
91e0f2a255 feat: temporarily use external node image in ci 2024-06-03 13:18:51 +02:00
0a99aa4bde refactor: update node to 22 2024-06-03 12:35:38 +02:00
851a7460aa fix: test 2024-05-30 14:54:29 +02:00
1d56db6bfe fix: build 2024-05-30 14:44:58 +02:00
09376bde02 refactor: update to ionic v8
refactor: remove deprecated @ionic-native/core (replaced by
@awesome-cordova-plugins/core)
2024-05-30 14:18:45 +02:00
0bf41bf569 refactor: update ngx-markdown to v18 2024-05-30 14:09:35 +02:00
7421006c08 refactor: update capacitor to v6 2024-05-30 14:07:33 +02:00
1b02d44f4b fix: angular warning 2024-05-30 13:48:39 +02:00
b8ced7ffa1 refactor: base migration to Angular v18 2024-05-30 13:44:34 +02:00
dbc8ff97aa refactor: remove deprecated "jetifier" 2024-05-30 13:30:01 +02:00
Rainer Killinger
a6b88d3534 refactor: add f-u specific changelogs 2024-05-27 16:27:37 +02:00
Rainer Killinger
be863daaef refactor: updated used licences within the app 2024-05-27 15:36:00 +02:00
2f64d69693 feat: migrate to protomaps and maplibre 2024-05-27 15:07:27 +02:00
964516d3cf fix: remove noUnused* TSConfig options
TSConfig options prevent Angular from compiling the app. This is
specifically harsh with the noUnused* rules, which require you to
strictly remove any unused variables even in dev mode while testing.
Since this case is already covered by ESLint, the TSConfig option was
removed.
2024-05-27 15:07:27 +02:00
71ff9fd960 fix: favorite button 2024-05-27 15:07:27 +02:00
abf9999461 feat: type-safe sc-icons 2024-05-27 15:07:26 +02:00
53c3d0ba0c refactor: replace rfdc with native structuredClone 2024-05-27 15:07:25 +02:00
Rainer Killinger
622481a3c9 docs: update changelogs for release\n\nci: publish release 2024-03-28 14:27:56 +01: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
372 changed files with 14028 additions and 11735 deletions

View File

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

View File

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

View File

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

View File

@@ -30,13 +30,11 @@ variables:
description: Bypass turbo cache description: Bypass turbo cache
default: default:
image: registry.gitlab.com/openstapps/openstapps/node-builder image: registry.gitlab.com/openstapps/openstapps/node-builder:node-22
tags: tags:
- saas-linux-xlarge-amd64 - saas-linux-xlarge-amd64
interruptible: true interruptible: true
before_script: before_script:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- echo TURBO_API=$TURBO_API >> .env.local - echo TURBO_API=$TURBO_API >> .env.local
- echo TURBO_TOKEN=$TURBO_TOKEN >> .env.local - echo TURBO_TOKEN=$TURBO_TOKEN >> .env.local
- echo TURBO_TEAM=$TURBO_TEAM >> .env.local - echo TURBO_TEAM=$TURBO_TEAM >> .env.local
@@ -101,7 +99,7 @@ stop review:
rules: *deploy-rules rules: *deploy-rules
unit: unit:
image: registry.gitlab.com/openstapps/openstapps/app-builder image: registry.gitlab.com/openstapps/openstapps/app-builder:node-22
stage: test stage: test
needs: ['build'] needs: ['build']
script: script:

View File

@@ -2,7 +2,13 @@
/** @type {import('syncpack').RcFile} */ /** @type {import('syncpack').RcFile} */
const config = { const config = {
semverGroups: [{range: ''}], semverGroups: [
{
range: '',
dependencies: ['**'],
packages: ['**'],
}
],
source: ['package.json', '**/package.json'], source: ['package.json', '**/package.json'],
indent: ' ', indent: ' ',
sortFirst: [ sortFirst: [
@@ -21,6 +27,7 @@ const config = {
'bin', 'bin',
'files', 'files',
'engines', 'engines',
'packageManager',
'scripts', 'scripts',
'dependencies', 'dependencies',
'devDependencies', 'devDependencies',

View File

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

View File

@@ -1,5 +1,5 @@
integration: integration:
image: registry.gitlab.com/openstapps/openstapps/node-builder image: registry.gitlab.com/openstapps/openstapps/node-builder:node-22
stage: test stage: test
needs: ['build'] needs: ['build']
variables: variables:

View File

@@ -1,5 +1,20 @@
# @openstapps/backend # @openstapps/backend
## 3.2.0
### Minor Changes
- 912ae422: Add the ability to filter by existence of a field
### Patch Changes
- 689ac68b: pin alpine version to 3.18 and add healthchecks
- e8d72683: Backend unit tests break every year
- Updated dependencies [912ae422]
- @openstapps/core@4.0.0
- @openstapps/core-tools@3.0.0
- @openstapps/logger@3.0.0
## 3.1.2 ## 3.1.2
### Patch Changes ### Patch Changes

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

@@ -0,0 +1,15 @@
# Goethe-Uni App 2.5
Die Goethe-Uni App ist noch besser geworden!
## Komplett neue Kartenansicht
Wir haben die Karte überarbeitet, um eine klarere und schnellere Übersicht zu bieten.
## Deutschlandticket mit an Bord
Wenn du das Upgrade des Semesterticket zum Deutschlandticket gemacht hast und eingeloggt bist, findet es sich jetzt auch in der App.
## Bibliotheksdienste sind wieder voll funktionsfähig
Aufgrund einiger Adhoc-Änderungen im Bibliothekssystem haben wir die App so angepasst, dass sie damit umgehen kann.

View File

@@ -0,0 +1,15 @@
# Goethe-Uni App 2.5
The Goethe-Uni App got even better!
## Completelty new map view
We overhauled the map to offer you a clearer and faster and overview.
## Deutschlandticket included
If you upgraded your Semesterticket to a Deutschlandticket it will now reside in the App if you are logged in.
## Library services are fully functional again
Due to some adhoc changes in the library system we adjusted the app to handle them properly.

View File

@@ -1,7 +1,7 @@
{ {
"name": "@openstapps/backend", "name": "@openstapps/backend",
"description": "A reference implementation for a StApps backend", "description": "A reference implementation for a StApps backend",
"version": "3.1.2", "version": "3.2.0",
"private": true, "private": true,
"type": "module", "type": "module",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
@@ -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

@@ -13,15 +13,34 @@
* 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 {SCConfigFile, SCSearchQuery, SCSearchResponse, SCThings, SCUuid} from '@openstapps/core'; import {
SCConfigFile,
SCPlace,
SCPlaceWithoutReferences,
SCSearchQuery,
SCSearchResponse,
SCThingWithCategoriesWithoutReferences,
SCThings,
SCUuid,
} from '@openstapps/core';
import {MailQueue} from '../notification/mail-queue.js'; import {MailQueue} from '../notification/mail-queue.js';
import {Bulk} from './bulk-storage.js'; import {Bulk} from './bulk-storage.js';
import {FeatureCollection, Point, Polygon} from 'geojson';
/** /**
* Creates an instance of a database * Creates an instance of a database
*/ */
export type DatabaseConstructor = new (config: SCConfigFile, mailQueue?: MailQueue) => Database; export type DatabaseConstructor = new (config: SCConfigFile, mailQueue?: MailQueue) => Database;
export type SupplementaryGeoJSON = FeatureCollection<Point | Polygon, SupplementaryGeoJSONThing>;
export type SupplementaryGeoJSONThing = Pick<
Extract<SCThings, SCPlace>,
Exclude<
keyof SCPlaceWithoutReferences | keyof SCThingWithCategoriesWithoutReferences<never, never>,
'geo' | 'origin' | 'translations'
>
>;
/** /**
* Defines what one database class needs to have defined * Defines what one database class needs to have defined
*/ */
@@ -82,4 +101,9 @@ export interface Database {
* @param params Parameters which form a search query to search the backend data * @param params Parameters which form a search query to search the backend data
*/ */
search(parameters: SCSearchQuery): Promise<SCSearchResponse>; search(parameters: SCSearchQuery): Promise<SCSearchResponse>;
/**
* Get geo info for display on a map
*/
geo(): Promise<SupplementaryGeoJSON>;
} }

View File

@@ -26,7 +26,7 @@ import {Logger} from '@openstapps/logger';
import moment from 'moment'; import moment from 'moment';
import {MailQueue} from '../../notification/mail-queue.js'; import {MailQueue} from '../../notification/mail-queue.js';
import {Bulk} from '../bulk-storage.js'; import {Bulk} from '../bulk-storage.js';
import {Database} from '../database.js'; import {Database, SupplementaryGeoJSON, SupplementaryGeoJSONThing} from '../database.js';
import {parseAggregations} from './aggregations.js'; import {parseAggregations} from './aggregations.js';
import * as Monitoring from './monitoring.js'; import * as Monitoring from './monitoring.js';
import {buildQuery} from './query/query.js'; import {buildQuery} from './query/query.js';
@@ -46,6 +46,7 @@ import {
} from './util/index.js'; } from './util/index.js';
import {noUndefined} from './util/no-undefined.js'; import {noUndefined} from './util/no-undefined.js';
import {retryCatch, RetryOptions} from './util/retry.js'; import {retryCatch, RetryOptions} from './util/retry.js';
import {Feature, Point, Polygon} from 'geojson';
/** /**
* A database interface for elasticsearch * A database interface for elasticsearch
@@ -405,4 +406,49 @@ export class Elasticsearch implements Database {
}, },
}; };
} }
async geo(): Promise<SupplementaryGeoJSON> {
const searchResponse = await this.client.search<Extract<SCThings, {geo: unknown}>>({
body: {
query: {
exists: {
field: 'geo',
},
},
},
from: 0,
allow_no_indices: true,
index: ACTIVE_INDICES_ALIAS,
size: 1,
});
return {
type: 'FeatureCollection',
features: searchResponse.hits.hits
.map(thing => {
return thing._source?.geo
? ({
id: Number(thing._source.identifiers?.['OSM']) || undefined,
type: 'Feature',
geometry: thing._source.geo.polygon ?? thing._source.geo.point,
properties: {
name: thing._source.name,
sameAs: thing._source.sameAs,
image: thing._source.image,
alternateNames: thing._source.alternateNames,
description: thing._source.description,
identifiers: thing._source.identifiers,
categories: thing._source.categories,
categorySpecificValues: thing._source.categorySpecificValues,
openingHours: thing._source.openingHours,
address: thing._source.address,
uid: thing._source.uid,
type: thing._source.type,
},
} satisfies Feature<Polygon | Point, SupplementaryGeoJSONThing>)
: undefined;
})
.filter(noUndefined),
};
}
} }

View File

@@ -19,14 +19,29 @@ import {QueryDslSpecificQueryContainer} from '../../types/util.js';
* Converts a geo filter to elasticsearch syntax * Converts a geo filter to elasticsearch syntax
* @param filter A search filter for the retrieval of the data * @param filter A search filter for the retrieval of the data
*/ */
export function buildGeoFilter(filter: SCGeoFilter): QueryDslSpecificQueryContainer<'geo_shape'> { export function buildGeoFilter(filter: SCGeoFilter): QueryDslSpecificQueryContainer<'bool'> {
return { return {
geo_shape: { bool: {
ignore_unmapped: true, should: [
[`${filter.arguments.field}.polygon`]: { {
shape: filter.arguments.shape, geo_shape: {
relation: filter.arguments.spatialRelation, ignore_unmapped: true,
}, [`${filter.arguments.field}.polygon`]: {
shape: filter.arguments.shape,
relation: filter.arguments.spatialRelation,
},
},
} satisfies QueryDslSpecificQueryContainer<'geo_shape'>,
{
geo_shape: {
ignore_unmapped: true,
[`${filter.arguments.field}.point`]: {
shape: filter.arguments.shape,
relation: filter.arguments.spatialRelation,
},
},
} satisfies QueryDslSpecificQueryContainer<'geo_shape'>,
],
}, },
}; };
} }

View File

@@ -22,7 +22,7 @@ import http from 'http';
import {MailQueue} from '../src/notification/mail-queue.js'; import {MailQueue} from '../src/notification/mail-queue.js';
import {Bulk, BulkStorage} from '../src/storage/bulk-storage.js'; import {Bulk, BulkStorage} from '../src/storage/bulk-storage.js';
import getPort from 'get-port'; import getPort from 'get-port';
import {Database} from '../src/storage/database.js'; import {Database, SupplementaryGeoJSON} from '../src/storage/database.js';
import {v4} from 'uuid'; import {v4} from 'uuid';
import {backendConfig} from '../src/config.js'; import {backendConfig} from '../src/config.js';
import {getIndexUID} from '../src/storage/elasticsearch/util/index.js'; import {getIndexUID} from '../src/storage/elasticsearch/util/index.js';
@@ -58,7 +58,6 @@ export async function startApp(): Promise<Express> {
* An elasticsearch mock * An elasticsearch mock
*/ */
export class ElasticsearchMock implements Database { export class ElasticsearchMock implements Database {
// @ts-expect-error never read
private bulk: Bulk | undefined; private bulk: Bulk | undefined;
private storageMock = new Map<string, SCThings>(); private storageMock = new Map<string, SCThings>();
@@ -67,6 +66,10 @@ export class ElasticsearchMock implements Database {
// Nothing to do here // Nothing to do here
} }
geo(): Promise<SupplementaryGeoJSON> {
throw new Error('Method not implemented.');
}
bulkCreated(bulk: Bulk): Promise<void> { bulkCreated(bulk: Bulk): Promise<void> {
this.bulk = bulk; this.bulk = bulk;
return Promise.resolve(undefined); return Promise.resolve(undefined);

View File

@@ -44,7 +44,6 @@ describe('Search route', async function () {
}); });
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 {status} = await testApp.get('/search').set('Accept', 'application/json').send({ const {status} = await testApp.get('/search').set('Accept', 'application/json').send({
query: 'Some search terms', query: 'Some search terms',
}); });

View File

@@ -479,18 +479,39 @@ describe('Query', function () {
it('should build geo filter for shapes and points', function () { it('should build geo filter for shapes and points', function () {
const filter = buildFilter(searchFilters.geoPoint); const filter = buildFilter(searchFilters.geoPoint);
const expectedFilter = { const expectedFilter = {
geo_shape: { bool: {
'geo.polygon': { should: [
relation: undefined, {
shape: { geo_shape: {
type: 'envelope', 'geo.polygon': {
coordinates: [ relation: undefined,
[50.123, 8.123], shape: {
[50.123, 8.123], coordinates: [
], [50.123, 8.123],
[50.123, 8.123],
],
type: 'envelope',
},
},
'ignore_unmapped': true,
},
}, },
}, {
'ignore_unmapped': true, geo_shape: {
'geo.point': {
relation: undefined,
shape: {
coordinates: [
[50.123, 8.123],
[50.123, 8.123],
],
type: 'envelope',
},
},
'ignore_unmapped': true,
},
},
],
}, },
}; };
@@ -500,18 +521,39 @@ describe('Query', function () {
it('should build geo filter for shapes only', function () { it('should build geo filter for shapes only', function () {
const filter = buildFilter(searchFilters.geoShape); const filter = buildFilter(searchFilters.geoShape);
const expectedFilter = { const expectedFilter = {
geo_shape: { bool: {
'geo.polygon': { should: [
relation: 'contains', {
shape: { geo_shape: {
type: 'envelope', 'geo.polygon': {
coordinates: [ relation: 'contains',
[50.123, 8.123], shape: {
[50.123, 8.123], coordinates: [
], [50.123, 8.123],
[50.123, 8.123],
],
type: 'envelope',
},
},
'ignore_unmapped': true,
},
}, },
}, {
'ignore_unmapped': true, geo_shape: {
'geo.point': {
relation: 'contains',
shape: {
coordinates: [
[50.123, 8.123],
[50.123, 8.123],
],
type: 'envelope',
},
},
'ignore_unmapped': true,
},
},
],
}, },
}; };

View File

@@ -1,5 +1,11 @@
# @openstapps/database # @openstapps/database
## 3.2.0
### Patch Changes
- 689ac68b: pin alpine version to 3.18 and add healthchecks
## 3.0.0 ## 3.0.0
### Patch Changes ### Patch Changes

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

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

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

@@ -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

@@ -1,5 +1,11 @@
# @openstapps/prettier-config # @openstapps/prettier-config
## 3.2.0
### Patch Changes
- dbb55850: Update Prettier to 3.1.1
## 3.0.0 ## 3.0.0
### Major Changes ### Major Changes
@@ -30,7 +36,7 @@
```js ```js
#!/usr/bin/env node #!/usr/bin/env node
import './lib/app.js'; import "./lib/app.js";
``` ```
- 64caebaf: Migrate to ESM - 64caebaf: Migrate to ESM
@@ -69,11 +75,14 @@
- 64caebaf: Migrated changelogs to changeset format - 64caebaf: Migrated changelogs to changeset format
```js ```js
import fs from 'fs'; import fs from "fs";
const path = 'packages/logger/CHANGELOG.md'; const path = "packages/logger/CHANGELOG.md";
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## [')); fs.writeFileSync(
path,
fs.readFileSync(path, "utf8").replace(/^#+\s+\[/gm, "## ["),
);
``` ```
- 98546a97: Migrate away from @openstapps/configuration - 98546a97: Migrate away from @openstapps/configuration
@@ -115,7 +124,7 @@
```js ```js
#!/usr/bin/env node #!/usr/bin/env node
import './lib/app.js'; import "./lib/app.js";
``` ```
- 64caebaf: Migrate to ESM - 64caebaf: Migrate to ESM
@@ -154,11 +163,14 @@
- 64caebaf: Migrated changelogs to changeset format - 64caebaf: Migrated changelogs to changeset format
```js ```js
import fs from 'fs'; import fs from "fs";
const path = 'packages/logger/CHANGELOG.md'; const path = "packages/logger/CHANGELOG.md";
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## [')); fs.writeFileSync(
path,
fs.readFileSync(path, "utf8").replace(/^#+\s+\[/gm, "## ["),
);
``` ```
- 98546a97: Migrate away from @openstapps/configuration - 98546a97: Migrate away from @openstapps/configuration

View File

@@ -1,7 +1,7 @@
{ {
"name": "@openstapps/prettier-config", "name": "@openstapps/prettier-config",
"description": "StApps Prettier Config", "description": "StApps Prettier Config",
"version": "3.0.0", "version": "3.2.0",
"type": "module", "type": "module",
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"repository": "git@gitlab.com:openstapps/prettier-config.git", "repository": "git@gitlab.com:openstapps/prettier-config.git",

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

@@ -19,15 +19,21 @@
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"noImplicitAny": true, "noImplicitAny": true,
"noImplicitReturns": true, "noImplicitReturns": true,
"noUnusedLocals": true, "noUnusedLocals": false,
"noUnusedParameters": true, "noUnusedParameters": false,
"outDir": "../../../lib/", "outDir": "../../../lib/",
"lib": ["ES2022", "DOM"], "lib": [
"ES2022",
"DOM"
],
"strict": true, "strict": true,
"target": "ES2022" "target": "ES2022"
}, },
"ts-node": { "ts-node": {
"transpileOnly": true "transpileOnly": true
}, },
"exclude": ["../../../app.js", "../../../lib/"] "exclude": [
"../../../app.js",
"../../../lib/"
]
} }

View File

@@ -9,7 +9,7 @@ const args = files.map(it => `${it.split('/', 2)[1]}='${it}'`);
console.log( console.log(
'Collecting coverage...', 'Collecting coverage...',
await promisify(exec)(`cobertura-merge -o ./coverage.xml ${args.join(' ')}`), await promisify(exec)(`merge-cobertura -o ./coverage.xml ${args.join(' ')}`),
); );
const reportFiles = await glob('./*/*/coverage/report-junit.xml'); const reportFiles = await glob('./*/*/coverage/report-junit.xml');

View File

@@ -1,5 +1,14 @@
# @openstapps/minimal-connector # @openstapps/minimal-connector
## 3.2.0
### Patch Changes
- Updated dependencies [912ae422]
- @openstapps/core@4.0.0
- @openstapps/api@4.0.0
- @openstapps/logger@3.0.0
## 3.1.1 ## 3.1.1
### Patch Changes ### Patch Changes

View File

@@ -1,7 +1,7 @@
{ {
"name": "@openstapps/minimal-connector", "name": "@openstapps/minimal-connector",
"description": "This is a minimal connector which serves as an example", "description": "This is a minimal connector which serves as an example",
"version": "3.1.1", "version": "3.2.0",
"private": true, "private": true,
"type": "module", "type": "module",
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
@@ -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,5 +1,16 @@
# @openstapps/minimal-plugin # @openstapps/minimal-plugin
## 3.2.0
### Patch Changes
- Updated dependencies [912ae422]
- @openstapps/core@4.0.0
- @openstapps/api@4.0.0
- @openstapps/api-plugin@4.0.0
- @openstapps/core-tools@3.0.0
- @openstapps/logger@3.0.0
## 3.1.1 ## 3.1.1
### Patch Changes ### Patch Changes

View File

@@ -1,7 +1,7 @@
{ {
"name": "@openstapps/minimal-plugin", "name": "@openstapps/minimal-plugin",
"description": "Minimal Plugin", "description": "Minimal Plugin",
"version": "3.1.1", "version": "3.2.0",
"private": true, "private": true,
"type": "module", "type": "module",
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
@@ -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": [

12
flake.lock generated
View File

@@ -5,11 +5,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1701680307, "lastModified": 1710146030,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1701626906, "lastModified": 1717112898,
"narHash": "sha256-ugr1QyzzwNk505ICE4VMQzonHQ9QS5W33xF2FXzFQ00=", "narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0c6d8c783336a59f4c59d4a6daed6ab269c4b361", "rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0",
"type": "github" "type": "github"
}, },
"original": { "original": {

146
flake.nix
View File

@@ -4,72 +4,86 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { outputs =
self, {
nixpkgs, self,
flake-utils, nixpkgs,
}: let flake-utils,
aapt2buildToolsVersion = "33.0.2"; }:
in let
flake-utils.lib.eachDefaultSystem (system: let aapt2buildToolsVersion = "34.0.0";
pkgs = import nixpkgs { in
inherit system; flake-utils.lib.eachDefaultSystem (
overlays = [ system:
(final: prev: rec { let
fontMin = prev.python311.withPackages (ps: with ps; [brotli fonttools] ++ (with fonttools.optional-dependencies; [woff])); pkgs = import nixpkgs {
android = prev.androidenv.composeAndroidPackages { inherit system;
buildToolsVersions = ["30.0.3" aapt2buildToolsVersion]; overlays = [
platformVersions = ["33"]; (final: prev: {
}; fontMin = prev.python311.withPackages (
cypress = prev.cypress.overrideAttrs (cyPrev: rec { ps:
version = "13.2.0"; with ps;
src = prev.fetchzip { [
url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip"; brotli
hash = "sha256-9o0nprGcJhudS1LNm+T7Vf0Dwd1RBauYKI+w1FBQ3ZM="; fonttools
]
++ (with fonttools.optional-dependencies; [ woff ])
);
android = prev.androidenv.composeAndroidPackages {
buildToolsVersions = prev.lib.lists.unique [
"34.0.0"
aapt2buildToolsVersion
];
platformVersions = [ "34" ];
}; };
}); cypress = prev.cypress.overrideAttrs (cyPrev: rec {
}) version = "13.10.0";
]; src = prev.fetchzip {
config = { url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip";
allowUnfree = true; hash = "sha256-wKNXo2lWndsQaouOiul0rsOWah+RRQ6fljzdeC8/KW4=";
android_sdk.accept_license = true; };
});
nodejs = prev.nodejs_22;
})
];
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
}; };
}; androidFhs = pkgs.buildFHSUserEnv {
androidFhs = pkgs.buildFHSUserEnv { name = "android-env";
name = "android-env"; runScript = "bash";
targetPkgs = pkgs: with pkgs; []; profile = ''
runScript = "bash"; export ALLOW_NINJA_ENV=true
profile = '' export USE_CCACHE=1
export ALLOW_NINJA_ENV=true export LD_LIBRARY_PATH=/usr/lib:/usr/lib32
export USE_CCACHE=1 '';
export LD_LIBRARY_PATH=/usr/lib:/usr/lib32 };
''; in
}; {
in { devShell = pkgs.mkShell rec {
devShell = pkgs.mkShell rec { nativeBuildInputs = [ androidFhs ];
nativeBuildInputs = [androidFhs]; buildInputs = with pkgs; [
buildInputs = with pkgs; [ nodejs
nodejs-18_x nodePackages.pnpm
nodePackages.pnpm # tools
# tools curl
curl jq
jq fontMin
fontMin cypress
# browsers # android
firefox jdk17
google-chrome android.androidsdk
epiphany # Safari-ish browser ];
cypress ANDROID_JAVA_HOME = "${pkgs.jdk.home}";
# android ANDROID_SDK_ROOT = "${pkgs.android.androidsdk}/libexec/android-sdk";
jdk17 GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_SDK_ROOT}/build-tools/${aapt2buildToolsVersion}/aapt2";
android.androidsdk CYPRESS_INSTALL_BINARY = "0";
musl CYPRESS_RUN_BINARY = "${pkgs.cypress}/bin/Cypress";
]; # https://github.com/nodejs/node/issues/48444#issuecomment-1591882694
ANDROID_JAVA_HOME = "${pkgs.jdk.home}"; UV_USE_IO_URING = "0";
ANDROID_SDK_ROOT = "${pkgs.android.androidsdk}/libexec/android-sdk"; };
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_SDK_ROOT}/build-tools/${aapt2buildToolsVersion}/aapt2"; }
CYPRESS_INSTALL_BINARY = "0"; );
CYPRESS_RUN_BINARY = "${pkgs.cypress}/bin/Cypress";
};
});
} }

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

@@ -1,5 +1,5 @@
e2e: e2e:
image: registry.gitlab.com/openstapps/openstapps/app-cypress:node-18 image: registry.gitlab.com/openstapps/openstapps/app-cypress:node-22
stage: test stage: test
script: script:
- pnpm --filter=@openstapps/app install - pnpm --filter=@openstapps/app install

View File

@@ -1,5 +1,15 @@
# @openstapps/app # @openstapps/app
## 3.2.0
### Patch Changes
- 689ac68b: pin alpine version to 3.18 and add healthchecks
- Updated dependencies [912ae422]
- @openstapps/core@4.0.0
- @openstapps/api@4.0.0
- @openstapps/collection-utils@3.0.0
## 3.1.2 ## 3.1.2
### 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

@@ -50,11 +50,11 @@ 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 type-safe proxy for referencing 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

@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android { android {
namespace "de.anyschool.app" namespace "de.anyschool.app"
compileSdkVersion rootProject.ext.compileSdkVersion compileSdk rootProject.ext.compileSdkVersion
defaultConfig { defaultConfig {
applicationId "de.anyschool.app" applicationId "de.anyschool.app"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion

View File

@@ -7,8 +7,8 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:8.0.0' classpath 'com.android.tools.build:gradle:8.2.1'
classpath 'com.google.gms:google-services:4.3.15' classpath 'com.google.gms:google-services:4.4.0'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files

View File

@@ -1,51 +1,51 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
include ':capacitor-android' include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../../../node_modules/.pnpm/@capacitor+android@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/android/capacitor') project(':capacitor-android').projectDir = new File('../../../node_modules/.pnpm/@capacitor+android@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/android/capacitor')
include ':capacitor-app' include ':capacitor-app'
project(':capacitor-app').projectDir = new File('../../../node_modules/.pnpm/@capacitor+app@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/app/android') project(':capacitor-app').projectDir = new File('../../../node_modules/.pnpm/@capacitor+app@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/app/android')
include ':capacitor-browser' include ':capacitor-browser'
project(':capacitor-browser').projectDir = new File('../../../node_modules/.pnpm/@capacitor+browser@5.1.0_@capacitor+core@5.5.0/node_modules/@capacitor/browser/android') project(':capacitor-browser').projectDir = new File('../../../node_modules/.pnpm/@capacitor+browser@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/browser/android')
include ':capacitor-clipboard' include ':capacitor-clipboard'
project(':capacitor-clipboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+clipboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/clipboard/android') project(':capacitor-clipboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+clipboard@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/clipboard/android')
include ':capacitor-device' include ':capacitor-device'
project(':capacitor-device').projectDir = new File('../../../node_modules/.pnpm/@capacitor+device@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/device/android') project(':capacitor-device').projectDir = new File('../../../node_modules/.pnpm/@capacitor+device@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/device/android')
include ':capacitor-dialog' include ':capacitor-dialog'
project(':capacitor-dialog').projectDir = new File('../../../node_modules/.pnpm/@capacitor+dialog@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/dialog/android') project(':capacitor-dialog').projectDir = new File('../../../node_modules/.pnpm/@capacitor+dialog@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/dialog/android')
include ':capacitor-filesystem' include ':capacitor-filesystem'
project(':capacitor-filesystem').projectDir = new File('../../../node_modules/.pnpm/@capacitor+filesystem@5.1.4_@capacitor+core@5.5.0/node_modules/@capacitor/filesystem/android') project(':capacitor-filesystem').projectDir = new File('../../../node_modules/.pnpm/@capacitor+filesystem@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/filesystem/android')
include ':capacitor-geolocation' include ':capacitor-geolocation'
project(':capacitor-geolocation').projectDir = new File('../../../node_modules/.pnpm/@capacitor+geolocation@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/geolocation/android') project(':capacitor-geolocation').projectDir = new File('../../../node_modules/.pnpm/@capacitor+geolocation@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/geolocation/android')
include ':capacitor-haptics' include ':capacitor-haptics'
project(':capacitor-haptics').projectDir = new File('../../../node_modules/.pnpm/@capacitor+haptics@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/haptics/android') project(':capacitor-haptics').projectDir = new File('../../../node_modules/.pnpm/@capacitor+haptics@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/haptics/android')
include ':capacitor-keyboard' include ':capacitor-keyboard'
project(':capacitor-keyboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+keyboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/keyboard/android') project(':capacitor-keyboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+keyboard@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/keyboard/android')
include ':capacitor-local-notifications' include ':capacitor-local-notifications'
project(':capacitor-local-notifications').projectDir = new File('../../../node_modules/.pnpm/@capacitor+local-notifications@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/local-notifications/android') project(':capacitor-local-notifications').projectDir = new File('../../../node_modules/.pnpm/@capacitor+local-notifications@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/local-notifications/android')
include ':capacitor-network' include ':capacitor-network'
project(':capacitor-network').projectDir = new File('../../../node_modules/.pnpm/@capacitor+network@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/network/android') project(':capacitor-network').projectDir = new File('../../../node_modules/.pnpm/@capacitor+network@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/network/android')
include ':capacitor-preferences' include ':capacitor-preferences'
project(':capacitor-preferences').projectDir = new File('../../../node_modules/.pnpm/@capacitor+preferences@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/preferences/android') project(':capacitor-preferences').projectDir = new File('../../../node_modules/.pnpm/@capacitor+preferences@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/preferences/android')
include ':capacitor-share' include ':capacitor-share'
project(':capacitor-share').projectDir = new File('../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/share/android') project(':capacitor-share').projectDir = new File('../../../node_modules/.pnpm/@capacitor+share@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/share/android')
include ':capacitor-splash-screen' 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@6.0.0_@capacitor+core@6.0.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@5.1.1_@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@6.0.0_@capacitor+core@6.0.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.9.0_@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.10.0_@capacitor+core@6.0.0/node_modules/capacitor-secure-storage-plugin/android')

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
networkTimeout=10000 networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@@ -1,14 +1,14 @@
ext { ext {
minSdkVersion = 22 minSdkVersion = 22
compileSdkVersion = 33 compileSdkVersion = 34
targetSdkVersion = 33 targetSdkVersion = 34
androidxActivityVersion = '1.7.0' androidxActivityVersion = '1.8.0'
androidxAppCompatVersion = '1.6.1' androidxAppCompatVersion = '1.6.1'
androidxCoordinatorLayoutVersion = '1.2.0' androidxCoordinatorLayoutVersion = '1.2.0'
androidxCoreVersion = '1.10.0' androidxCoreVersion = '1.12.0'
androidxFragmentVersion = '1.5.6' androidxFragmentVersion = '1.6.2'
coreSplashScreenVersion = '1.0.0' coreSplashScreenVersion = '1.0.1'
androidxWebkitVersion = '1.6.1' androidxWebkitVersion = '1.9.0'
junitVersion = '4.13.2' junitVersion = '4.13.2'
androidxJunitVersion = '1.1.5' androidxJunitVersion = '1.1.5'
androidxEspressoCoreVersion = '3.5.1' androidxEspressoCoreVersion = '3.5.1'

View File

@@ -21,10 +21,13 @@
"allowedCommonJsDependencies": [ "allowedCommonJsDependencies": [
"moment", "moment",
"opening_hours", "opening_hours",
"leaflet", "localforage",
"leaflet.markercluster", "i18next",
"localforge", "semver",
"guid-typescript" "suncalc",
"guid-typescript",
"fast-deep-equal",
"maplibre-gl"
], ],
"aot": true, "aot": true,
"assets": [ "assets": [
@@ -32,24 +35,13 @@
"glob": "**/*", "glob": "**/*",
"input": "src/assets", "input": "src/assets",
"output": "assets" "output": "assets"
},
{
"glob": "**/*",
"input": "./node_modules/leaflet/dist/images",
"output": "assets/"
} }
], ],
"styles": [ "styles": [
{
"input": "src/theme/variables.scss",
"inject": true
},
{ {
"input": "src/global.scss", "input": "src/global.scss",
"inject": true "inject": true
}, }
"./node_modules/leaflet/dist/leaflet.css",
"./node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css"
] ]
}, },
"configurations": { "configurations": {
@@ -97,20 +89,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"
@@ -132,11 +124,6 @@
"glob": "**/*", "glob": "**/*",
"input": "src/assets", "input": "src/assets",
"output": "/assets" "output": "/assets"
},
{
"glob": "**/*",
"input": "./node_modules/leaflet/dist/images",
"output": "assets/"
} }
] ]
} }

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

@@ -12,9 +12,9 @@
* 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/>.
*/ */
import type {IconConfig} from './scripts/icon-config';
const config: IconConfig = { /** @type {import('./scripts/icon-config').IconConfig} */
const config = {
inputPath: 'node_modules/material-symbols/material-symbols-rounded.woff2', inputPath: 'node_modules/material-symbols/material-symbols-rounded.woff2',
outputPath: 'src/assets/icons.min.woff2', outputPath: 'src/assets/icons.min.woff2',
htmlGlob: 'src/**/*.html', htmlGlob: 'src/**/*.html',
@@ -38,10 +38,6 @@ const config: IconConfig = {
'work', 'work',
], ],
}, },
codePoints: {
ios_share: 'e6b8',
fact_check: 'f0c5',
},
}; };
export default config; export default config;

View File

@@ -1,11 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
rm coverage/integration-report-junit-*.xml rm coverage/integration-report-junit-*.xml || true
ng e2e --watch=false --headless=true --browser="$BROWSER" ng e2e --watch=false --headless=true --browser="$BROWSER"
exit_code=$? exit_code=$?
jrm coverage/integration-report-junit.xml coverage/integration-report-junit-*.xml jrm coverage/integration-report-junit.xml coverage/integration-report-junit-*.xml || true
rm coverage/integration-report-junit-*.xml rm coverage/integration-report-junit-*.xml || true
exit $exit_code exit $exit_code

View File

@@ -1,4 +1,4 @@
require_relative '../../../../node_modules/.pnpm/@capacitor+ios@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/ios/scripts/pods_helpers' require_relative '../../../../node_modules/.pnpm/@capacitor+ios@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/ios/scripts/pods_helpers'
platform :ios, '13.0' platform :ios, '13.0'
use_frameworks! use_frameworks!
@@ -9,24 +9,24 @@ use_frameworks!
install! 'cocoapods', :disable_input_output_paths => true install! 'cocoapods', :disable_input_output_paths => true
def capacitor_pods def capacitor_pods
pod 'Capacitor', :path => '../../../../node_modules/.pnpm/@capacitor+ios@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/ios' pod 'Capacitor', :path => '../../../../node_modules/.pnpm/@capacitor+ios@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../../../node_modules/.pnpm/@capacitor+ios@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/ios' pod 'CapacitorCordova', :path => '../../../../node_modules/.pnpm/@capacitor+ios@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/ios'
pod 'CapacitorApp', :path => '../../../../node_modules/.pnpm/@capacitor+app@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/app' pod 'CapacitorApp', :path => '../../../../node_modules/.pnpm/@capacitor+app@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/app'
pod 'CapacitorBrowser', :path => '../../../../node_modules/.pnpm/@capacitor+browser@5.1.0_@capacitor+core@5.5.0/node_modules/@capacitor/browser' pod 'CapacitorBrowser', :path => '../../../../node_modules/.pnpm/@capacitor+browser@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/browser'
pod 'CapacitorClipboard', :path => '../../../../node_modules/.pnpm/@capacitor+clipboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/clipboard' pod 'CapacitorClipboard', :path => '../../../../node_modules/.pnpm/@capacitor+clipboard@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/clipboard'
pod 'CapacitorDevice', :path => '../../../../node_modules/.pnpm/@capacitor+device@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/device' pod 'CapacitorDevice', :path => '../../../../node_modules/.pnpm/@capacitor+device@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/device'
pod 'CapacitorDialog', :path => '../../../../node_modules/.pnpm/@capacitor+dialog@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/dialog' pod 'CapacitorDialog', :path => '../../../../node_modules/.pnpm/@capacitor+dialog@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/dialog'
pod 'CapacitorFilesystem', :path => '../../../../node_modules/.pnpm/@capacitor+filesystem@5.1.4_@capacitor+core@5.5.0/node_modules/@capacitor/filesystem' pod 'CapacitorFilesystem', :path => '../../../../node_modules/.pnpm/@capacitor+filesystem@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/filesystem'
pod 'CapacitorGeolocation', :path => '../../../../node_modules/.pnpm/@capacitor+geolocation@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/geolocation' pod 'CapacitorGeolocation', :path => '../../../../node_modules/.pnpm/@capacitor+geolocation@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/geolocation'
pod 'CapacitorHaptics', :path => '../../../../node_modules/.pnpm/@capacitor+haptics@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/haptics' pod 'CapacitorHaptics', :path => '../../../../node_modules/.pnpm/@capacitor+haptics@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/haptics'
pod 'CapacitorKeyboard', :path => '../../../../node_modules/.pnpm/@capacitor+keyboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/keyboard' pod 'CapacitorKeyboard', :path => '../../../../node_modules/.pnpm/@capacitor+keyboard@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/keyboard'
pod 'CapacitorLocalNotifications', :path => '../../../../node_modules/.pnpm/@capacitor+local-notifications@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/local-notifications' pod 'CapacitorLocalNotifications', :path => '../../../../node_modules/.pnpm/@capacitor+local-notifications@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/local-notifications'
pod 'CapacitorNetwork', :path => '../../../../node_modules/.pnpm/@capacitor+network@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/network' pod 'CapacitorNetwork', :path => '../../../../node_modules/.pnpm/@capacitor+network@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/network'
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@6.0.0_@capacitor+core@6.0.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@6.0.0_@capacitor+core@6.0.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@6.0.0_@capacitor+core@6.0.0/node_modules/@capacitor/splash-screen'
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 'TransistorsoftCapacitorBackgroundFetch', :path => '../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.2.0_@capacitor+core@6.0.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@6.0.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

@@ -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.2", "version": "3.2.0",
"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>",
@@ -14,14 +14,12 @@
"Thea Schöbl <dev@theaninova.de>" "Thea Schöbl <dev@theaninova.de>"
], ],
"scripts": { "scripts": {
"analyze": "webpack-bundle-analyzer www/stats.json", "build": "pnpm check-icons && ng build --configuration=production --stats-json",
"build": "pnpm check-icons && ng build --configuration=production --stats-json && webpack-bundle-analyzer www/stats.json --mode static --report www/bundle-info.html --no-open",
"build:analyze": "npm run build:stats && npm run analyze",
"build:android": "ionic capacitor build android --no-open && cd android && ./gradlew clean assemble && cd ..", "build:android": "ionic capacitor build android --no-open && cd android && ./gradlew clean assemble && cd ..",
"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": "node scripts/check-icon-correctness.mjs",
"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",
@@ -35,11 +33,10 @@
"e2e": "ng e2e", "e2e": "ng e2e",
"format": "prettier . -c", "format": "prettier . -c",
"format:fix": "prettier --write .", "format:fix": "prettier --write .",
"licenses": "license-checker --json > src/assets/about/licenses.json && ts-node ./scripts/accumulate-licenses.ts && git add src/assets/about/licenses.json", "licenses": "license-checker --json > src/assets/about/licenses.json && node ./scripts/accumulate-licenses.mjs && git add src/assets/about/licenses.json",
"lint": "ng lint && stylelint \"**/*.scss\"", "lint": "ng lint && stylelint \"**/*.scss\"",
"lint:fix": "eslint --fix -c .eslintrc.json --ignore-path .eslintignore --ext .ts,.html src/ && stylelint --fix \"**/*.scss\"", "lint:fix": "eslint --fix -c .eslintrc.json --ignore-path .eslintignore --ext .ts,.html src/ && stylelint --fix \"**/*.scss\"",
"minify-icons": "ts-node-esm scripts/minify-icon-font.ts", "minify-icons": "node scripts/minify-icon-font.mjs",
"postinstall": "jetify && echo \"skipping jetify in production mode\"",
"preview": "http-server www --p 8101 -o", "preview": "http-server www --p 8101 -o",
"push": "git push && git push origin \"v$npm_package_version\"", "push": "git push && git push origin \"v$npm_package_version\"",
"resources:ios": "capacitor-assets generate --ios --iconBackgroundColor $(grep -oE \"^@include ion-color\\(primary, #[a-fA-F0-9]{3,6}\" src/theme/colors.scss | grep -oE \"#[a-fA-F0-9]{3,6}\") --splashBackgroundColor $(grep -oE \"^@include ion-color\\(primary, #[a-fA-F0-9]{3,6}\" src/theme/colors.scss | grep -oE \"#[a-fA-F0-9]{3,6}\")", "resources:ios": "capacitor-assets generate --ios --iconBackgroundColor $(grep -oE \"^@include ion-color\\(primary, #[a-fA-F0-9]{3,6}\" src/theme/colors.scss | grep -oE \"#[a-fA-F0-9]{3,6}\") --splashBackgroundColor $(grep -oE \"^@include ion-color\\(primary, #[a-fA-F0-9]{3,6}\" src/theme/colors.scss | grep -oE \"#[a-fA-F0-9]{3,6}\")",
@@ -52,139 +49,134 @@
"test:integration": "sh integration-test.sh" "test:integration": "sh integration-test.sh"
}, },
"dependencies": { "dependencies": {
"@angular/animations": "16.1.4", "@angular/animations": "18.0.1",
"@angular/cdk": "16.1.4", "@angular/cdk": "18.0.1",
"@angular/common": "16.1.4", "@angular/common": "18.0.1",
"@angular/core": "16.1.4", "@angular/core": "18.0.1",
"@angular/forms": "16.1.4", "@angular/forms": "18.0.1",
"@angular/platform-browser": "16.1.4", "@angular/platform-browser": "18.0.1",
"@angular/router": "16.1.4", "@angular/router": "18.0.1",
"@asymmetrik/ngx-leaflet": "16.0.1", "@awesome-cordova-plugins/calendar": "6.6.0",
"@asymmetrik/ngx-leaflet-markercluster": "16.0.0", "@awesome-cordova-plugins/core": "6.6.0",
"@awesome-cordova-plugins/calendar": "5.45.0", "@capacitor/app": "6.0.0",
"@awesome-cordova-plugins/core": "5.45.0", "@capacitor/browser": "6.0.0",
"@capacitor/app": "5.0.6", "@capacitor/clipboard": "6.0.0",
"@capacitor/browser": "5.1.0", "@capacitor/core": "6.0.0",
"@capacitor/clipboard": "5.0.6", "@capacitor/device": "6.0.0",
"@capacitor/core": "5.5.0", "@capacitor/dialog": "6.0.0",
"@capacitor/device": "5.0.6", "@capacitor/filesystem": "6.0.0",
"@capacitor/dialog": "5.0.6", "@capacitor/geolocation": "6.0.0",
"@capacitor/filesystem": "5.1.4", "@capacitor/haptics": "6.0.0",
"@capacitor/geolocation": "5.0.6", "@capacitor/keyboard": "6.0.0",
"@capacitor/haptics": "5.0.6", "@capacitor/local-notifications": "6.0.0",
"@capacitor/keyboard": "5.0.6", "@capacitor/network": "6.0.0",
"@capacitor/local-notifications": "5.0.6", "@capacitor/preferences": "6.0.0",
"@capacitor/network": "5.0.6", "@capacitor/share": "6.0.0",
"@capacitor/preferences": "5.0.6", "@capacitor/splash-screen": "6.0.0",
"@capacitor/share": "5.0.6", "@ionic/angular": "8.2.0",
"@capacitor/splash-screen": "5.0.6",
"@ionic-native/core": "5.36.0",
"@ionic/angular": "7.1.3",
"@ionic/storage-angular": "4.0.0", "@ionic/storage-angular": "4.0.0",
"@maplibre/ngx-maplibre-gl": "17.4.1",
"@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",
"@openid/appauth": "1.3.1", "@openid/appauth": "1.3.1",
"@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": "6.0.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.10.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",
"jsonpath-plus": "6.0.1", "jsonpath-plus": "6.0.1",
"leaflet": "1.9.3", "maplibre-gl": "4.0.2",
"leaflet.markercluster": "1.5.3", "material-symbols": "0.17.1",
"material-symbols": "0.10.0", "moment": "2.30.1",
"moment": "2.29.4", "ngx-date-fns": "11.0.0",
"ngx-date-fns": "10.0.1",
"ngx-logger": "5.0.12", "ngx-logger": "5.0.12",
"ngx-markdown": "16.0.0", "ngx-markdown": "18.0.0",
"ngx-moment": "6.0.2", "ngx-moment": "6.0.2",
"opening_hours": "3.8.0", "opening_hours": "3.8.0",
"pmtiles": "3.0.3",
"prettier": "3.1.1",
"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.1800.2",
"@angular-devkit/build-angular": "16.1.4", "@angular-devkit/build-angular": "18.0.2",
"@angular-devkit/core": "16.1.4", "@angular-devkit/core": "18.0.2",
"@angular-devkit/schematics": "16.1.4", "@angular-devkit/schematics": "18.0.2",
"@angular-eslint/builder": "16.1.0", "@angular-eslint/builder": "18.0.1",
"@angular-eslint/eslint-plugin": "16.1.0", "@angular-eslint/eslint-plugin": "18.0.1",
"@angular-eslint/eslint-plugin-template": "16.1.0", "@angular-eslint/eslint-plugin-template": "18.0.1",
"@angular-eslint/schematics": "16.1.0", "@angular-eslint/schematics": "18.0.1",
"@angular-eslint/template-parser": "16.1.0", "@angular-eslint/template-parser": "18.0.1",
"@angular/cli": "16.1.4", "@angular/cli": "18.0.2",
"@angular/compiler": "16.1.4", "@angular/compiler": "18.0.1",
"@angular/compiler-cli": "16.1.4", "@angular/compiler-cli": "18.0.1",
"@angular/language-service": "16.1.4", "@angular/language-server": "17.3.0",
"@angular/platform-browser-dynamic": "16.1.4", "@angular/language-service": "18.0.1",
"@capacitor/android": "5.5.0", "@angular/platform-browser-dynamic": "18.0.1",
"@capacitor/assets": "3.0.1", "@capacitor/android": "6.0.0",
"@capacitor/cli": "5.5.0", "@capacitor/assets": "3.0.4",
"@capacitor/ios": "5.5.0", "@capacitor/cli": "6.0.0",
"@compodoc/compodoc": "1.1.19", "@capacitor/ios": "6.0.0",
"@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.markercluster": "1.5.1",
"@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.10.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", "junit-report-merger": "6.0.3",
"junit-report-merger": "6.0.2", "karma": "6.4.3",
"karma": "6.4.2",
"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.3.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"
}, },
"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

@@ -12,33 +12,34 @@
* 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/>.
*/ */
import fs from 'fs'; import {readFileSync, writeFileSync} from 'fs';
import {omit} from '../src/app/_helpers/collections/omit'; import {omit, pickBy} from '@openstapps/collection-utils';
import {pickBy} from '../src/app/_helpers/collections/pick';
/** /**
* accumulate and transform licenses based on two license files * accumulate and transform licenses based on two license files
* @param {string} path
* @param {string} additionalLicensesPath
*/ */
function accumulateFile(path: string, additionalLicensesPath: string) { function accumulateFile(path, additionalLicensesPath) {
const packageJson = JSON.parse(fs.readFileSync('./package.json').toString()); const packageJson = JSON.parse(readFileSync('./package.json').toString());
const dependencies = packageJson.dependencies; const dependencies = packageJson.dependencies;
console.log(`Accumulating licenses from ${path}`); console.log(`Accumulating licenses from ${path}`);
fs.writeFileSync( writeFileSync(
path, path,
JSON.stringify( JSON.stringify(
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
Object.entries<any>({ Object.entries({
...pickBy(JSON.parse(fs.readFileSync(path).toString()), (_, key: string) => { ...pickBy(JSON.parse(readFileSync(path).toString()), (_, key) => {
const parts = key.split('@'); const parts = /** @type {string} */ (key).split('@');
return dependencies[parts.slice(0, -1).join('@')] === parts[parts.length - 1]; return dependencies[parts.slice(0, -1).join('@')] === parts[parts.length - 1];
}), }),
...JSON.parse(fs.readFileSync(additionalLicensesPath).toString()), ...JSON.parse(readFileSync(additionalLicensesPath).toString()),
}) })
.map(([key, value]) => ({ .map(([key, value]) => ({
licenseText: value.licenseFile && fs.readFileSync(value.licenseFile, 'utf8'), licenseText: value.licenseFile && readFileSync(value.licenseFile, 'utf8'),
name: key, name: key,
...omit(value, 'licenseFile', 'path'), ...omit(value, 'licenseFile', 'path'),
})) }))

View File

@@ -12,18 +12,20 @@
* 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/>.
*/ */
import fontkit, {Font} from 'fontkit'; import {openSync} from 'fontkit';
import config from '../icons.config'; import config from '../icons.config.mjs';
import {existsSync} from 'fs'; import {existsSync} from 'fs';
import {getUsedIconsHtml, getUsedIconsTS} from './gather-used-icons'; import {getUsedIconsHtml, getUsedIconsTS} from './gather-used-icons.mjs';
import {fetchCodePointMap} from './get-code-points.mjs';
const commandName = '"npm run minify-icons"'; const commandName = '"npm run minify-icons"';
const originalFont = fontkit.openSync(config.inputPath);
if (!existsSync(config.outputPath)) { if (!existsSync(config.outputPath)) {
console.error(`Minified font not found. Run ${commandName} first.`); console.error(`Minified font not found. Run ${commandName} first.`);
process.exit(-1); process.exit(-1);
} }
const modifiedFont = fontkit.openSync(config.outputPath);
/** @type {import('fontkit').Font} */
const modifiedFont = openSync(config.outputPath);
let success = true; let success = true;
@@ -48,25 +50,16 @@ async function checkAll() {
} }
/** /**
* * @param {Record<string, string[]>} icons
*/ */
function check(icons: Record<string, string[]>) { async function check(icons) {
for (const [purpose, iconSet] of Object.entries(icons)) { const codePoints = await fetchCodePointMap();
for (const icon of iconSet) {
if (!hasIcon(originalFont, icon)) { for (const icon of Object.values(icons).flat()) {
success = false; const codePoint = codePoints.get(icon);
console.error(`${purpose}: ${icon} does not exist. Typo?`); if (!codePoint) throw new Error(`"${icon}" is not a valid icon`);
} else if (!hasIcon(modifiedFont, icon)) { if (!modifiedFont.getGlyph(Number.parseInt(codePoint, 16))) {
success = false; throw new Error(`"${icon}" (code point ${codePoint}) is missing`);
console.error(`${purpose}: ${icon} not found in minified font. Run ${commandName} to regenerate it.`);
}
} }
} }
} }
/**
*
*/
function hasIcon(font: Font, icon: string) {
return font.layout(icon).glyphs.some(it => it.isLigature);
}

View File

@@ -14,34 +14,39 @@
*/ */
import {glob} from 'glob'; import {glob} from 'glob';
import {readFileSync} from 'fs'; import {readFileSync} from 'fs';
import {matchPropertyContent, matchTagProperties} from '../src/app/util/ion-icon/icon-match'; import {
matchPropertyAccess,
matchPropertyContent,
matchTagProperties,
} from '../src/app/util/ion-icon/icon-match.mjs';
/** /**
* * @returns {Promise<Record<string, string[]>>}
*/ */
export async function getUsedIconsHtml(pattern = 'src/**/*.html'): Promise<Record<string, string[]>> { export async function getUsedIconsHtml(pattern = 'src/**/*.html') {
return Object.fromEntries( return Object.fromEntries(
(await glob(pattern)) (await glob(pattern))
.map(file => [ .map(file => [
file, file,
(readFileSync(file, 'utf8') readFileSync(file, 'utf8')
.match(matchTagProperties('ion-icon')) .match(matchTagProperties('ion-icon'))
?.flatMap(match => { ?.flatMap(match => {
return match.match(matchPropertyContent(['name', 'md', 'ios'])); return match.match(matchPropertyContent(['name', 'md', 'ios']));
}) })
.filter(it => !!it) as string[]) || [], .filter(it => !!it) || [],
]) ])
.filter(([, values]) => values.length > 0), .filter(([, values]) => values && values.length > 0),
); );
} }
/** /**
* * @returns {Promise<Record<string, string[]>>}
*/ */
export async function getUsedIconsTS(pattern = 'src/**/*.ts'): Promise<Record<string, string[]>> { export async function getUsedIconsTS(pattern = 'src/**/*.ts') {
const regex = matchPropertyAccess('SCIcon');
return Object.fromEntries( return Object.fromEntries(
(await glob(pattern)) (await glob(pattern))
.map(file => [file, readFileSync(file, 'utf8').match(/(?<=Icon`)[\w-]+(?=`)/g) || []]) .map(file => [file, readFileSync(file, 'utf8').match(regex) || []])
.filter(([, values]) => values.length > 0), .filter(([, values]) => values && values.length > 0),
); );
} }

View File

@@ -0,0 +1,23 @@
const url =
'https://raw.githubusercontent.com/google/material-design-icons/master/' +
'variablefont/MaterialSymbolsRounded%5BFILL%2CGRAD%2Copsz%2Cwght%5D.codepoints';
export async function fetchCodePointMap() {
const icons = await fetch(url)
.then(it => it.text())
.then(it => new Map(it.split('\n').map(it => /** @type {[string, string]} */ (it.split(' ')))));
if (icons.size < 100) throw new Error(`Code point map is very small, is the URL incorrect? ${url}`);
return icons;
}
/**
* @param {string[]} icons
*/
export async function getCodePoints(icons) {
const codePoints = await fetchCodePointMap();
return icons.map(icon => {
const code = codePoints.get(icon);
if (!code) throw new Error(`Code point for icon ${icon} not found`);
return code;
});
}

View File

@@ -19,5 +19,4 @@ export interface IconConfig {
inputPath: string; inputPath: string;
outputPath: string; outputPath: string;
additionalIcons?: {[purpose: string]: string[]}; additionalIcons?: {[purpose: string]: string[]};
codePoints?: {[name: string]: string};
} }

View File

@@ -14,16 +14,17 @@
*/ */
/* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-non-null-assertion */
import fontkit from 'fontkit';
import {exec} from 'child_process'; import {exec} from 'child_process';
import config from '../icons.config'; import config from '../icons.config.mjs';
import {statSync} from 'fs'; import {statSync} from 'fs';
import {getUsedIconsHtml, getUsedIconsTS} from './gather-used-icons'; import {getUsedIconsHtml, getUsedIconsTS} from './gather-used-icons.mjs';
import {getCodePoints} from './get-code-points.mjs';
/** /**
* * @param {string[] | string} command
* @returns {Promise<string>}
*/ */
async function run(command: string[] | string): Promise<string> { async function run(command) {
const fullCommand = Array.isArray(command) ? command.join(' ') : command; const fullCommand = Array.isArray(command) ? command.join(' ') : command;
console.log(`>> ${fullCommand}`); console.log(`>> ${fullCommand}`);
@@ -44,7 +45,8 @@ async function run(command: string[] | string): Promise<string> {
* *
*/ */
async function minifyIconFont() { async function minifyIconFont() {
const icons = new Set<string>(); /** @type {Set<string>} */
const icons = new Set();
for (const iconSet of [ for (const iconSet of [
...Object.values(config.additionalIcons || []), ...Object.values(config.additionalIcons || []),
@@ -56,35 +58,7 @@ async function minifyIconFont() {
} }
} }
console.log('Icons used:', [...icons.values()].sort()); const glyphs = ['5f-7a', '30-39', ...(await getCodePoints([...icons]))].sort();
const font = fontkit.openSync(config.inputPath);
const glyphs: string[] = ['5f-7a', '30-39'];
for (const icon of icons) {
const iconGlyphs = font.layout(icon).glyphs;
if (iconGlyphs.length === 0) {
console.error(`${icon} not found in font. Typo?`);
process.exit(-1);
}
const codePoints = iconGlyphs
.flatMap(it => font.stringsForGlyph(it.id))
.flatMap(it => [...it])
.map(it => it.codePointAt(0)!.toString(16));
if (codePoints.length === 0) {
if (config.codePoints?.[icon]) {
glyphs.push(config.codePoints[icon]);
} else {
console.log();
console.error(`${icon} code point could not be determined. Add it to config.codePoints.`);
process.exit(-1);
}
}
glyphs.push(...codePoints);
}
glyphs.sort();
console.log( console.log(
await run([ await run([
@@ -114,8 +88,10 @@ minifyIconFont();
/** /**
* Bytes to respective units * Bytes to respective units
* @param {number} value
* @returns {string}
*/ */
function toByteUnit(value: number): string { function toByteUnit(value) {
if (value < 1024) { if (value < 1024) {
return `${value}B`; return `${value}B`;
} else if (value < 1024 * 1024) { } else if (value < 1024 * 1024) {

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

@@ -21,7 +21,7 @@ import {ModalController, Platform} from '@ionic/angular';
import {TranslateService} from '@ngx-translate/core'; import {TranslateService} from '@ngx-translate/core';
import {ThingTranslateService} from './translation/thing-translate.service'; import {ThingTranslateService} from './translation/thing-translate.service';
import {HttpClientTestingModule} from '@angular/common/http/testing'; import {provideHttpClientTesting} from '@angular/common/http/testing';
import {AppComponent} from './app.component'; import {AppComponent} from './app.component';
import {AuthModule} from './modules/auth/auth.module'; import {AuthModule} from './modules/auth/auth.module';
import {ConfigProvider} from './modules/config/config.provider'; import {ConfigProvider} from './modules/config/config.provider';
@@ -32,6 +32,7 @@ import {ScheduleSyncService} from './modules/background/schedule/schedule-sync.s
import {sampleAuthConfiguration} from './_helpers/data/sample-configuration'; import {sampleAuthConfiguration} from './_helpers/data/sample-configuration';
import {StorageProvider} from './modules/storage/storage.provider'; import {StorageProvider} from './modules/storage/storage.provider';
import {SimpleBrowser} from './util/browser.factory'; import {SimpleBrowser} from './util/browser.factory';
import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
describe('AppComponent', () => { describe('AppComponent', () => {
let platformReadySpy: any; let platformReadySpy: any;
@@ -75,8 +76,9 @@ describe('AppComponent', () => {
modalController = jasmine.createSpyObj('ModalController', ['create', 'dismiss', 'getTop']); modalController = jasmine.createSpyObj('ModalController', ['create', 'dismiss', 'getTop']);
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [RouterTestingModule.withRoutes([]), HttpClientTestingModule, AuthModule],
declarations: [AppComponent], declarations: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [RouterTestingModule.withRoutes([]), AuthModule],
providers: [ providers: [
{provide: Platform, useValue: platformSpy}, {provide: Platform, useValue: platformSpy},
{provide: TranslateService, useValue: translateServiceSpy}, {provide: TranslateService, useValue: translateServiceSpy},
@@ -88,8 +90,9 @@ describe('AppComponent', () => {
{provide: StorageProvider, useValue: storageProvider}, {provide: StorageProvider, useValue: storageProvider},
{provide: SimpleBrowser, useValue: simpleBrowser}, {provide: SimpleBrowser, useValue: simpleBrowser},
{provide: ModalController, useValue: modalController}, {provide: ModalController, useValue: modalController},
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
], ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents(); }).compileComponents();
}); });

View File

@@ -13,7 +13,7 @@
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import {CommonModule, LocationStrategy, PathLocationStrategy, registerLocaleData} from '@angular/common'; import {CommonModule, LocationStrategy, PathLocationStrategy, registerLocaleData} from '@angular/common';
import {HTTP_INTERCEPTORS, HttpClient, HttpClientModule} from '@angular/common/http'; import {HTTP_INTERCEPTORS, HttpClient, provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
import localeDe from '@angular/common/locales/de'; import localeDe from '@angular/common/locales/de';
import {APP_INITIALIZER, NgModule} from '@angular/core'; import {APP_INITIALIZER, NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser'; import {BrowserModule} from '@angular/platform-browser';
@@ -30,7 +30,6 @@ 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';
import {CatalogModule} from './modules/catalog/catalog.module'; import {CatalogModule} from './modules/catalog/catalog.module';
import {ConfigModule} from './modules/config/config.module';
import {ConfigProvider} from './modules/config/config.provider'; import {ConfigProvider} from './modules/config/config.provider';
import {DashboardModule} from './modules/dashboard/dashboard.module'; import {DashboardModule} from './modules/dashboard/dashboard.module';
import {DataModule} from './modules/data/data.module'; import {DataModule} from './modules/data/data.module';
@@ -70,7 +69,8 @@ import {setDefaultOptions} from 'date-fns';
import {DateFnsConfigurationService} from 'ngx-date-fns'; import {DateFnsConfigurationService} from 'ngx-date-fns';
import {Capacitor} from '@capacitor/core'; import {Capacitor} from '@capacitor/core';
import {SplashScreen} from '@capacitor/splash-screen'; import {SplashScreen} from '@capacitor/splash-screen';
import {SportCoursesModule} from './modules/sport-courses/sport-courses.module'; import maplibregl from 'maplibre-gl';
import {Protocol} from 'pmtiles';
registerLocaleData(localeDe); registerLocaleData(localeDe);
@@ -92,6 +92,7 @@ export function initializerFactory(
) { ) {
return async () => { return async () => {
try { try {
maplibregl.addProtocol('pmtiles', new Protocol().tile);
initLogger(logger); initLogger(logger);
await storageProvider.init(); await storageProvider.init();
await configProvider.init(); await configProvider.init();
@@ -152,7 +153,6 @@ export function createTranslateLoader(http: HttpClient) {
BrowserAnimationsModule, BrowserAnimationsModule,
CatalogModule, CatalogModule,
CommonModule, CommonModule,
ConfigModule,
DashboardModule, DashboardModule,
DataModule, DataModule,
HebisModule, HebisModule,
@@ -161,7 +161,6 @@ export function createTranslateLoader(http: HttpClient) {
JobModule, JobModule,
FavoritesModule, FavoritesModule,
LibraryModule, LibraryModule,
HttpClientModule,
ProfilePageModule, ProfilePageModule,
FeedbackModule, FeedbackModule,
MapModule, MapModule,
@@ -171,7 +170,6 @@ export function createTranslateLoader(http: HttpClient) {
ScheduleModule, ScheduleModule,
SettingsModule, SettingsModule,
StorageModule, StorageModule,
SportCoursesModule,
ThingTranslateModule.forRoot(), ThingTranslateModule.forRoot(),
TranslateModule.forRoot({ TranslateModule.forRoot({
defaultLanguage: 'en', defaultLanguage: 'en',
@@ -222,6 +220,7 @@ export function createTranslateLoader(http: HttpClient) {
useClass: ServiceHandlerInterceptor, useClass: ServiceHandlerInterceptor,
multi: true, multi: true,
}, },
provideHttpClient(withInterceptorsFromDi()),
], ],
}) })
export class AppModule { export class AppModule {

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,24 @@
</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 [size]="16" [weight]="300" class="supertext-icon" name="open_in_browser"></ion-icon>
<ion-card-header> </ion-card-title>
<ion-card-title> @if (license.authors || license.publisher) {
{{ license.name }} <ion-card-subtitle> {{ license.authors || license.publisher }} </ion-card-subtitle>
<ion-icon [size]="16" [weight]="300" class="supertext-icon" name="open_in_browser"></ion-icon> }
</ion-card-title> </ion-card-header>
<ion-card-content>
<ion-card-subtitle *ngIf="license.authors || license.publisher"> <ion-chip (click)="$event.preventDefault(); viewLicense(license)">
{{ license.authors || license.publisher }} <ion-icon name="copyright"></ion-icon>
</ion-card-subtitle> <ion-label>{{ license.licenses }} License</ion-label>
</ion-card-header> </ion-chip>
<ion-card-content> </ion-card-content>
<ion-chip (click)="$event.preventDefault(); viewLicense(license)"> </ion-card>
<ion-icon name="copyright"></ion-icon> }
<ion-label>{{ license.licenses }} License</ion-label>
</ion-chip>
</ion-card-content>
</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]="$any(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

@@ -19,7 +19,6 @@ import {FormsModule} from '@angular/forms';
import {IonicModule} from '@ionic/angular'; import {IonicModule} from '@ionic/angular';
import {TranslateModule} from '@ngx-translate/core'; import {TranslateModule} from '@ngx-translate/core';
import {ThingTranslateModule} from '../../translation/thing-translate.module'; import {ThingTranslateModule} from '../../translation/thing-translate.module';
import {ConfigProvider} from '../config/config.provider';
import {AboutPageComponent} from './about-page/about-page.component'; import {AboutPageComponent} from './about-page/about-page.component';
import {MarkdownModule} from 'ngx-markdown'; import {MarkdownModule} from 'ngx-markdown';
import {AboutPageContentComponent} from './about-page/about-page-content.component'; import {AboutPageContentComponent} from './about-page/about-page-content.component';
@@ -64,6 +63,5 @@ const settingsRoutes: Routes = [
ScrollingModule, ScrollingModule,
UtilModule, UtilModule,
], ],
providers: [ConfigProvider],
}) })
export class AboutModule {} export class AboutModule {}

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

@@ -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

@@ -22,7 +22,7 @@ import {Requestor, StorageBackend} from '@openid/appauth';
import {TranslateService} from '@ngx-translate/core'; import {TranslateService} from '@ngx-translate/core';
import {PAIAAuthService} from './paia/paia-auth.service'; import {PAIAAuthService} from './paia/paia-auth.service';
import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider'; import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider';
import {HttpClientModule} from '@angular/common/http'; import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
import {SimpleBrowser} from '../../util/browser.factory'; import {SimpleBrowser} from '../../util/browser.factory';
import {LoggerTestingModule} from 'ngx-logger/testing'; import {LoggerTestingModule} from 'ngx-logger/testing';
@@ -54,7 +54,7 @@ describe('AuthHelperService', () => {
beforeEach(() => { beforeEach(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [HttpClientModule, LoggerTestingModule], imports: [LoggerTestingModule],
providers: [ providers: [
StAppsWebHttpClient, StAppsWebHttpClient,
{ {
@@ -88,6 +88,7 @@ describe('AuthHelperService', () => {
provide: SimpleBrowser, provide: SimpleBrowser,
useValue: simpleBrowserMock, useValue: simpleBrowserMock,
}, },
provideHttpClient(withInterceptorsFromDi()),
], ],
}); });
authHelperService = TestBed.inject(AuthHelperService); authHelperService = TestBed.inject(AuthHelperService);

View File

@@ -20,7 +20,7 @@ import {Browser} from 'ionic-appauth';
import {nowInSeconds, Requestor, StorageBackend} from '@openid/appauth'; import {nowInSeconds, Requestor, StorageBackend} from '@openid/appauth';
import {TranslateService} from '@ngx-translate/core'; import {TranslateService} from '@ngx-translate/core';
import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider'; import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider';
import {HttpClientModule} from '@angular/common/http'; import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
import {IonicStorage} from 'ionic-appauth/lib'; import {IonicStorage} from 'ionic-appauth/lib';
import {RouterModule} from '@angular/router'; import {RouterModule} from '@angular/router';
import {LoggerTestingModule} from 'ngx-logger/testing'; import {LoggerTestingModule} from 'ngx-logger/testing';
@@ -35,7 +35,7 @@ describe('AuthService', () => {
storageBackendSpy = jasmine.createSpyObj('StorageBackend', ['getItem']); storageBackendSpy = jasmine.createSpyObj('StorageBackend', ['getItem']);
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [HttpClientModule, LoggerTestingModule, RouterModule.forRoot([])], imports: [LoggerTestingModule, RouterModule.forRoot([])],
providers: [ providers: [
StAppsWebHttpClient, StAppsWebHttpClient,
{ {
@@ -54,6 +54,7 @@ describe('AuthService', () => {
useValue: storageBackendSpy, useValue: storageBackendSpy,
}, },
Requestor, Requestor,
provideHttpClient(withInterceptorsFromDi()),
], ],
}); });
defaultAuthService = TestBed.inject(DefaultAuthService); defaultAuthService = TestBed.inject(DefaultAuthService);

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,34 +22,46 @@
<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">
@@ -57,15 +69,16 @@
{{ 'share' | translate }} {{ 'share' | translate }}
<ion-icon slot="end" md="share" ios="ios_share"></ion-icon> <ion-icon slot="end" md="share" ios="ios_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

@@ -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

@@ -15,7 +15,6 @@
ion-segment-button { ion-segment-button {
max-width: 100%; max-width: 100%;
text-transform: none;
} }
.margin-top { .margin-top {

View File

@@ -1,27 +0,0 @@
/*
* Copyright (C) 2019 StApps
* 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
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {NgModule} from '@angular/core';
import {DataModule} from '../data/data.module';
import {StorageModule} from '../storage/storage.module';
import {ConfigProvider} from './config.provider';
/**
* TODO
*/
@NgModule({
imports: [StorageModule, DataModule],
providers: [ConfigProvider],
})
export class ConfigModule {}

View File

@@ -104,9 +104,9 @@ describe('ConfigProvider', () => {
it('should throw error on wrong config version in storage', async () => { it('should throw error on wrong config version in storage', async () => {
storageProviderSpy.has.and.returnValue(Promise.resolve(true)); storageProviderSpy.has.and.returnValue(Promise.resolve(true));
const wrongConfig = JSON.parse(JSON.stringify(sampleIndexResponse)); const wrongConfig = structuredClone(sampleIndexResponse);
wrongConfig.backend.SCVersion = '0.1.0'; wrongConfig.backend.SCVersion = '0.1.0';
storageProviderSpy.get.and.returnValue(wrongConfig); storageProviderSpy.get.and.returnValue(Promise.resolve(wrongConfig));
spyOn(configProvider.client, 'handshake').and.returnValue(Promise.resolve(sampleIndexResponse)); spyOn(configProvider.client, 'handshake').and.returnValue(Promise.resolve(sampleIndexResponse));
await configProvider.init(); await configProvider.init();

View File

@@ -73,6 +73,7 @@ export class ConfigProvider {
swHttpClient: StAppsWebHttpClient, swHttpClient: StAppsWebHttpClient,
private readonly logger: NGXLogger, private readonly logger: NGXLogger,
) { ) {
console.log('config init');
this.client = new Client(swHttpClient, environment.backend_url, environment.backend_version); this.client = new Client(swHttpClient, environment.backend_url, environment.backend_version);
} }

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,41 @@
<!-- <!--
~ 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-icon slot="icon-only" name="search" [size]="24"></ion-icon>
</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';
/** /**
* *

View File

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

View File

@@ -1,19 +1,25 @@
<!-- <!--
~ 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-locate-action-chip *ngIf="applicable.locate" [item]="item"></stapps-locate-action-chip> @if (applicable.locate) {
<stapps-navigate-action-chip *ngIf="applicable.navigate" [item]="$any(item)"></stapps-navigate-action-chip> <stapps-locate-action-chip [item]="item"></stapps-locate-action-chip>
}
@if (applicable.navigate) {
<stapps-navigate-action-chip [item]="$any(item)"></stapps-navigate-action-chip>
}
<!-- Add Event Chip needs to load data and should be the last --> <!-- Add Event Chip needs to load data and should be the last -->
<stapps-add-event-action-chip *ngIf="applicable.event" [item]="item"></stapps-add-event-action-chip> @if (applicable.event) {
<stapps-add-event-action-chip [item]="item"></stapps-add-event-action-chip>
}

View File

@@ -26,6 +26,7 @@ import {AddEventStates, AddEventStatesMap} from './add-event-action-chip.config'
import {EditEventSelectionComponent} from '../edit-event-selection.component'; import {EditEventSelectionComponent} from '../edit-event-selection.component';
import {AddEventReviewModalComponent} from '../../../calendar/add-event-review-modal.component'; import {AddEventReviewModalComponent} from '../../../calendar/add-event-review-modal.component';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop'; import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {MaterialSymbol} from 'material-symbols';
/** /**
* Shows a horizontal list of action chips * Shows a horizontal list of action chips
@@ -55,7 +56,7 @@ export class AddEventActionChipComponent {
/** /**
* Icon * Icon
*/ */
icon: string; icon: MaterialSymbol;
/** /**
* Current state of icon fill * Current state of icon fill

View File

@@ -24,28 +24,28 @@ export enum AddEventStates {
export const AddEventStatesMap = { export const AddEventStatesMap = {
[AddEventStates.ADDED_ALL]: { [AddEventStates.ADDED_ALL]: {
icon: SCIcon`event_available`, icon: SCIcon.event_available,
fill: true, fill: true,
label: 'data.chips.add_events.ADDED_ALL', label: 'data.chips.add_events.ADDED_ALL',
disabled: false, disabled: false,
color: 'success', color: 'success',
}, },
[AddEventStates.ADDED_SOME]: { [AddEventStates.ADDED_SOME]: {
icon: SCIcon`event`, icon: SCIcon.event,
fill: true, fill: true,
label: 'data.chips.add_events.ADDED_SOME', label: 'data.chips.add_events.ADDED_SOME',
disabled: false, disabled: false,
color: 'success', color: 'success',
}, },
[AddEventStates.REMOVED_ALL]: { [AddEventStates.REMOVED_ALL]: {
icon: SCIcon`calendar_today`, icon: SCIcon.calendar_today,
fill: false, fill: false,
label: 'data.chips.add_events.REMOVED_ALL', label: 'data.chips.add_events.REMOVED_ALL',
disabled: false, disabled: false,
color: 'primary', color: 'primary',
}, },
[AddEventStates.UNAVAILABLE]: { [AddEventStates.UNAVAILABLE]: {
icon: SCIcon`event_busy`, icon: SCIcon.event_busy,
fill: false, fill: false,
label: 'data.chips.add_events.UNAVAILABLE', label: 'data.chips.add_events.UNAVAILABLE',
disabled: true, disabled: true,

View File

@@ -1,57 +1,57 @@
<!-- <!--
~ 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/>.
--> -->
<div class="stack-children"> <div class="stack-children">
<ion-chip @if (associatedDateSeries | async; as associatedDateSeries) {
*ngIf="associatedDateSeries | async as associatedDateSeries; else loading" <ion-chip
@chipTransition @chipTransition
[disabled]="disabled" [disabled]="disabled"
(click)="$event.stopPropagation(); editModal.present()" (click)="$event.stopPropagation(); editModal.present()"
[color]="color" [color]="color"
[outline]="true" [outline]="true"
> >
<ion-icon [name]="icon" [fill]="iconFill"></ion-icon> <ion-icon [name]="icon" [fill]="iconFill"></ion-icon>
<ion-label>{{ label | translate }}</ion-label> <ion-label>{{ label | translate }}</ion-label>
<stapps-edit-modal #editModal (save)="selection.save()"> <stapps-edit-modal #editModal (save)="selection.save()">
<ng-template> <ng-template>
<ion-content parallax [parallaxSize]="160" class="ion-padding modal-content"> <ion-content parallax [parallaxSize]="160" class="ion-padding modal-content">
<stapps-edit-event-selection <stapps-edit-event-selection
#selection #selection
[items]="associatedDateSeries" [items]="associatedDateSeries"
(modified)="editModal.pendingChanges = true" (modified)="editModal.pendingChanges = true"
></stapps-edit-event-selection> ></stapps-edit-event-selection>
</ion-content> </ion-content>
<ion-footer mode="ios"> <ion-footer mode="ios">
<ion-toolbar color="light"> <ion-toolbar color="light">
<ion-button <ion-button
slot="end" slot="end"
fill="clear" fill="clear"
(click)="export()" (click)="export()"
[disabled]="!(selection.selection.indeterminate || selection.selection.checked)" [disabled]="!(selection.selection.indeterminate || selection.selection.checked)"
> >
{{ 'schedule.toCalendar.reviewModal.DOWNLOAD' | translate | titlecase }} {{ 'schedule.toCalendar.reviewModal.DOWNLOAD' | translate | titlecase }}
<ion-icon slot="end" name="download"></ion-icon> <ion-icon slot="end" name="download"></ion-icon>
</ion-button> </ion-button>
</ion-toolbar> </ion-toolbar>
</ion-footer> </ion-footer>
</ng-template> </ng-template>
</stapps-edit-modal> </stapps-edit-modal>
</ion-chip> </ion-chip>
<ng-template #loading> } @else {
<ion-chip @chipSkeletonTransition> <ion-chip @chipSkeletonTransition>
<ion-skeleton-text animated="true"></ion-skeleton-text> <ion-skeleton-text animated="true"></ion-skeleton-text>
</ion-chip> </ion-chip>
</ng-template> }
</div> </div>

View File

@@ -23,8 +23,7 @@
.stack-children { .stack-children {
display: grid; display: grid;
align-items: start; place-items: start start;
justify-items: start;
} }
.stack-children > * { .stack-children > * {

View File

@@ -14,5 +14,5 @@
--> -->
<ion-chip [color]="'primary'" [outline]="true" [geoNavigation]="place"> <ion-chip [color]="'primary'" [outline]="true" [geoNavigation]="place">
<ion-icon name="directions"></ion-icon> <ion-icon name="directions"></ion-icon>
<ion-label>{{'map.directions.TITLE' | translate}}</ion-label> <ion-label>{{ 'map.directions.TITLE' | translate }}</ion-label>
</ion-chip> </ion-chip>

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-item class="list-header" lines="none"> <ion-item class="list-header" lines="none">
<ion-checkbox <ion-checkbox
@@ -22,7 +22,7 @@
<ion-list-header> {{ 'data.chips.add_events.popover.ALL' | translate }} </ion-list-header> <ion-list-header> {{ 'data.chips.add_events.popover.ALL' | translate }} </ion-list-header>
</ion-checkbox> </ion-checkbox>
</ion-item> </ion-item>
<ng-container *ngFor="let frequency of selection.children"> @for (frequency of selection.children; track frequency) {
<ion-list inset="true" lines="full"> <ion-list inset="true" lines="full">
<ion-item lines="none" class="list-header"> <ion-item lines="none" class="list-header">
<ion-checkbox <ion-checkbox
@@ -31,48 +31,55 @@
(ionChange)="modified.emit(); frequency.click()" (ionChange)="modified.emit(); frequency.click()"
> >
<ion-list-header> <ion-list-header>
{{ frequency.children[0].item.repeatFrequency ? (frequency.children[0].item.repeatFrequency | {{
durationLocalized: true | sentencecase) : ('data.chips.add_events.popover.SINGLE' | translate | frequency.children[0].item.repeatFrequency
titlecase) }} ? (frequency.children[0].item.repeatFrequency | durationLocalized: true | sentencecase)
: ('data.chips.add_events.popover.SINGLE' | translate | titlecase)
}}
</ion-list-header> </ion-list-header>
</ion-checkbox> </ion-checkbox>
</ion-item> </ion-item>
<ion-item *ngFor="let date of frequency.children"> @for (date of frequency.children; track date) {
<ion-checkbox <ion-item>
[checked]="date.selected" <ion-checkbox
(ionChange)="modified.emit(); date.selected = !date.selected; frequency.notifyChildChanged()" [checked]="date.selected"
> (ionChange)="modified.emit(); date.selected = !date.selected; frequency.notifyChildChanged()"
<ng-container *ngIf="date.item.dates.length > 1; else single_event"> >
<ion-text> @if (date.item.dates.length > 1) {
{{ date.item.dates[0] | amDateFormat: 'dddd, LT' }} - {{ date.item.dates[0] | amAdd: <ion-text>
date.item.duration | amDateFormat: 'LT' }} {{ date.item.dates[0] | amDateFormat: 'dddd, LT' }} -
</ion-text> {{ date.item.dates[0] | amAdd: date.item.duration | amDateFormat: 'LT' }}
<br />
<ion-text>
{{ date.item.dates[0] | amDateFormat: 'LL' }} - {{ date.item.dates[date.item.dates.length - 1] |
amDateFormat: 'LL' }}
</ion-text>
</ng-container>
<ng-template #single_event>
<ion-text *ngIf="date.item.dates[0] as time; else noDates">
{{ time | amDateFormat: 'LL, LT' }} - {{ time | amAdd: date.item.duration | amDateFormat: 'LT' }}
</ion-text>
<ng-template #noDates>
<ion-text color="danger">{{ 'data.chips.add_events.popover.DATA_ERROR' | translate }}</ion-text>
<br />
<ion-text *ngFor="let id of date.item.identifiers | keyvalue">
{{ id.key }}: {{ id.value }}
</ion-text> </ion-text>
</ng-template> <br />
</ng-template> <ion-text>
<ng-container class="ion-align-items-center" *ngIf="date.item.inPlace"> {{ date.item.dates[0] | amDateFormat: 'LL' }} -
<br /> {{ date.item.dates[date.item.dates.length - 1] | amDateFormat: 'LL' }}
<ion-text color="medium" class="place"> </ion-text>
<ion-icon name="pin_drop"></ion-icon> } @else {
<span> {{ 'inPlace.name' | thingTranslate: date.item }}</span> @if (date.item.dates[0]; as time) {
</ion-text> <ion-text>
</ng-container> {{ time | amDateFormat: 'LL, LT' }} -
</ion-checkbox> {{ time | amAdd: date.item.duration | amDateFormat: 'LT' }}
</ion-item> </ion-text>
} @else {
<ion-text color="danger">{{ 'data.chips.add_events.popover.DATA_ERROR' | translate }}</ion-text>
<br />
@for (id of date.item.identifiers | keyvalue; track id) {
<ion-text> {{ id.key }}: {{ id.value }} </ion-text>
}
}
}
@if (date.item.inPlace) {
<ng-container class="ion-align-items-center">
<br />
<ion-text color="medium" class="place">
<ion-icon name="pin_drop"></ion-icon>
<span> {{ 'inPlace.name' | thingTranslate: date.item }}</span>
</ion-text>
</ng-container>
}
</ion-checkbox>
</ion-item>
}
</ion-list> </ion-list>
</ng-container> }

View File

@@ -1,19 +1,23 @@
<!-- <!--
~ 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-chip *ngIf="displayValue" [class.active]="active" (click)="emitToggle(value)"> @if (displayValue) {
<ion-icon class="ion-color" name="check_circle" [fill]="true" *ngIf="active"></ion-icon> <ion-chip [class.active]="active" (click)="emitToggle(value)">
<ion-label>{{ displayValue }}</ion-label> @if (active) {
</ion-chip> <ion-icon class="ion-color" name="check_circle" [fill]="true"></ion-icon>
}
<ion-label>{{ displayValue }}</ion-label>
</ion-chip>
}

View File

@@ -14,37 +14,38 @@
*/ */
import {SCThingType} from '@openstapps/core'; import {SCThingType} from '@openstapps/core';
import {SCIcon} from '../../util/ion-icon/icon'; import {SCIcon} from '../../util/ion-icon/icon';
import {MaterialSymbol} from 'material-symbols';
export const DataIcons: Record<SCThingType, string> = { export const DataIcons = {
'academic event': SCIcon`school`, 'academic event': SCIcon.school,
'assessment': SCIcon`fact_check`, 'assessment': SCIcon.fact_check,
'article': SCIcon`article`, 'article': SCIcon.article,
'book': SCIcon`book`, 'book': SCIcon.book,
'building': SCIcon`location_city`, 'building': SCIcon.location_city,
'certification': SCIcon`contract`, 'certification': SCIcon.contract,
'catalog': SCIcon`inventory_2`, 'catalog': SCIcon.inventory_2,
'contact point': SCIcon`contact_page`, 'contact point': SCIcon.contact_page,
'course of study': SCIcon`school`, 'course of study': SCIcon.school,
'date series': SCIcon`event`, 'date series': SCIcon.event,
'dish': SCIcon`lunch_dining`, 'dish': SCIcon.lunch_dining,
'favorite': SCIcon`favorite`, 'favorite': SCIcon.favorite,
'floor': SCIcon`foundation`, 'floor': SCIcon.foundation,
'id card': SCIcon`badge`, 'id card': SCIcon.badge,
'message': SCIcon`newspaper`, 'message': SCIcon.newspaper,
'organization': SCIcon`business_center`, 'organization': SCIcon.business_center,
'periodical': SCIcon`feed`, 'periodical': SCIcon.feed,
'person': SCIcon`person`, 'person': SCIcon.person,
'point of interest': SCIcon`pin_drop`, 'point of interest': SCIcon.pin_drop,
'publication event': SCIcon`campaign`, 'publication event': SCIcon.campaign,
'room': SCIcon`meeting_room`, 'room': SCIcon.meeting_room,
'semester': SCIcon`date_range`, 'semester': SCIcon.date_range,
'setting': SCIcon`settings`, 'setting': SCIcon.settings,
'sport course': SCIcon`sports_gymnastics`, 'sport course': SCIcon.sports_soccer,
'study module': SCIcon`view_module`, 'study module': SCIcon.view_module,
'ticket': SCIcon`confirmation_number`, 'ticket': SCIcon.confirmation_number,
'todo': SCIcon`task`, 'todo': SCIcon.task,
'tour': SCIcon`tour`, 'tour': SCIcon.tour,
'video': SCIcon`movie`, 'video': SCIcon.movie,
'diff': SCIcon`difference`, 'diff': SCIcon.difference,
'job posting': SCIcon`work`, 'job posting': SCIcon.work,
}; } satisfies Record<SCThingType, MaterialSymbol>;

View File

@@ -31,7 +31,7 @@ export class DataIconPipe implements PipeTransform {
/** /**
* Provide the icon name from the data type * Provide the icon name from the data type
*/ */
transform(type: SCThingType): string { transform(type: SCThingType) {
return this.typeIconMap[type]; return this.typeIconMap[type];
} }
} }

View File

@@ -14,10 +14,9 @@
*/ */
import {ScrollingModule} from '@angular/cdk/scrolling'; import {ScrollingModule} from '@angular/cdk/scrolling';
import {CommonModule} from '@angular/common'; import {CommonModule} from '@angular/common';
import {HttpClientModule} from '@angular/common/http'; import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
import {NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {LeafletModule} from '@asymmetrik/ngx-leaflet';
import {IonicModule, Platform} from '@ionic/angular'; import {IonicModule, Platform} from '@ionic/angular';
import {TranslateModule} from '@ngx-translate/core'; import {TranslateModule} from '@ngx-translate/core';
import {MarkdownModule} from 'ngx-markdown'; import {MarkdownModule} from 'ngx-markdown';
@@ -30,7 +29,7 @@ import {UtilModule} from '../../util/util.module';
import {CalendarService} from '../calendar/calendar.service'; import {CalendarService} from '../calendar/calendar.service';
import {ScheduleProvider} from '../calendar/schedule.provider'; import {ScheduleProvider} from '../calendar/schedule.provider';
import {GeoNavigationDirective} from '../map/geo-navigation.directive'; import {GeoNavigationDirective} from '../map/geo-navigation.directive';
import {MapWidgetComponent} from '../map/widget/map-widget.component'; import {MapWidgetComponent} from '../map/map-widget.component';
import {MenuModule} from '../menu/menu.module'; import {MenuModule} from '../menu/menu.module';
import {SettingsProvider} from '../settings/settings.provider'; import {SettingsProvider} from '../settings/settings.provider';
import {StorageModule} from '../storage/storage.module'; import {StorageModule} from '../storage/storage.module';
@@ -107,8 +106,6 @@ import {SemesterListItemComponent} from './types/semester/semester-list-item.com
import {VideoDetailContentComponent} from './types/video/video-detail-content.component'; import {VideoDetailContentComponent} from './types/video/video-detail-content.component';
import {VideoListItemComponent} from './types/video/video-list-item.component'; import {VideoListItemComponent} from './types/video/video-list-item.component';
import {ShareButtonComponent} from './elements/share-button.component'; import {ShareButtonComponent} from './elements/share-button.component';
import {SanitizeHtmlPipe} from '../../util/sanitize-html.pipe';
import {BypassTrustUrlPipe} from '../../util/bypass-trust-url.pipe';
/** /**
* Module for handling data * Module for handling data
@@ -144,7 +141,6 @@ import {BypassTrustUrlPipe} from '../../util/bypass-trust-url.pipe';
FoodDataListComponent, FoodDataListComponent,
LocateActionChipComponent, LocateActionChipComponent,
LongInlineTextComponent, LongInlineTextComponent,
MapWidgetComponent,
MessageDetailContentComponent, MessageDetailContentComponent,
MessageListItemComponent, MessageListItemComponent,
JobPostingDetailContentComponent, JobPostingDetailContentComponent,
@@ -185,18 +181,37 @@ import {BypassTrustUrlPipe} from '../../util/bypass-trust-url.pipe';
PeriodicalDetailContentComponent, PeriodicalDetailContentComponent,
ShareButtonComponent, ShareButtonComponent,
], ],
exports: [
DataDetailComponent,
DataDetailContentComponent,
DataIconPipe,
DataListComponent,
DataListItemComponent,
DateSeriesListItemComponent,
PlaceListItemComponent,
SimpleCardComponent,
SkeletonListItemComponent,
SkeletonSimpleCardComponent,
SearchPageComponent,
SimpleDataListComponent,
OriginDetailComponent,
FavoriteButtonComponent,
TreeListComponent,
ExternalLinkComponent,
ArticleDetailContentComponent,
BookDetailContentComponent,
PeriodicalDetailContentComponent,
TitleCardComponent,
],
imports: [ imports: [
CommonModule, CommonModule,
DataRoutingModule, DataRoutingModule,
FormsModule, FormsModule,
HttpClientModule, MapWidgetComponent,
IonicModule.forRoot(), IonicModule.forRoot(),
LeafletModule,
MarkdownModule.forRoot(), MarkdownModule.forRoot(),
MenuModule, MenuModule,
IonIconModule, IonIconModule,
SanitizeHtmlPipe,
BypassTrustUrlPipe,
MomentModule.forRoot({ MomentModule.forRoot({
relativeTimeThresholdOptions: { relativeTimeThresholdOptions: {
m: 59, m: 59,
@@ -224,28 +239,7 @@ import {BypassTrustUrlPipe} from '../../util/bypass-trust-url.pipe';
useFactory: browserFactory, useFactory: browserFactory,
deps: [Platform], deps: [Platform],
}, },
], provideHttpClient(withInterceptorsFromDi()),
exports: [
DataDetailComponent,
DataDetailContentComponent,
DataIconPipe,
DataListComponent,
DataListItemComponent,
DateSeriesListItemComponent,
PlaceListItemComponent,
SimpleCardComponent,
SkeletonListItemComponent,
SkeletonSimpleCardComponent,
SearchPageComponent,
SimpleDataListComponent,
OriginDetailComponent,
FavoriteButtonComponent,
TreeListComponent,
ExternalLinkComponent,
ArticleDetailContentComponent,
BookDetailContentComponent,
PeriodicalDetailContentComponent,
TitleCardComponent,
], ],
}) })
export class DataModule {} export class DataModule {}

View File

@@ -1,105 +1,112 @@
<!-- <!--
~ 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 *ngIf="showModalHeader" translucent> @if (showModalHeader) {
<ion-toolbar color="primary" mode="ios"> <ion-header translucent>
<ion-title>{{ 'name' | thingTranslate : item }}</ion-title> <ion-toolbar color="primary" mode="ios">
<ion-buttons slot="end"> <ion-title>{{ 'name' | thingTranslate: item }}</ion-title>
<ion-button (click)="modalController.dismiss()">{{ 'app.ui.CLOSE' | translate }}</ion-button> <ion-buttons slot="end">
</ion-buttons> <ion-button (click)="modalController.dismiss()">{{ 'app.ui.CLOSE' | translate }}</ion-button>
</ion-toolbar> </ion-buttons>
</ion-header> </ion-toolbar>
</ion-header>
<stapps-title-card *ngIf="!showModalHeader" [item]="item"> </stapps-title-card> }
@if (!showModalHeader) {
<stapps-title-card [item]="item"> </stapps-title-card>
}
<ng-container *ngTemplateOutlet="contentTemplateRef || defaultContent; context: {$implicit: item}"> <ng-container *ngTemplateOutlet="contentTemplateRef || defaultContent; context: {$implicit: item}">
</ng-container> </ng-container>
<stapps-origin-detail [origin]="item.origin"></stapps-origin-detail> <stapps-origin-detail [origin]="item.origin"></stapps-origin-detail>
<ng-template #defaultContent> <ng-template #defaultContent>
<div [ngSwitch]="item.type" class="content-switch"> <div class="content-switch">
<stapps-article-detail-content @switch (item.type) {
[item]="$any(item)" @case ('article') {
*ngSwitchCase="'article'" <stapps-article-detail-content [item]="$any(item)"></stapps-article-detail-content>
></stapps-article-detail-content> }
<stapps-catalog-detail-content @case ('catalog') {
[item]="$any(item)" <stapps-catalog-detail-content [item]="$any(item)"></stapps-catalog-detail-content>
*ngSwitchCase="'catalog'" }
></stapps-catalog-detail-content> @case ('date series') {
<stapps-date-series-detail-content <stapps-date-series-detail-content [item]="$any(item)"></stapps-date-series-detail-content>
[item]="$any(item)" }
*ngSwitchCase="'date series'" @case ('dish') {
></stapps-date-series-detail-content> <stapps-dish-detail-content [item]="$any(item)"></stapps-dish-detail-content>
<stapps-dish-detail-content [item]="$any(item)" *ngSwitchCase="'dish'"></stapps-dish-detail-content> }
<stapps-event-detail-content @case ('academic event') {
[item]="$any(item)" <stapps-event-detail-content [item]="$any(item)"></stapps-event-detail-content>
*ngSwitchCase="'academic event'" }
></stapps-event-detail-content> @case ('sport course') {
<stapps-event-detail-content <stapps-event-detail-content [item]="$any(item)"></stapps-event-detail-content>
[item]="$any(item)" }
*ngSwitchCase="'sport course'" @case ('favorite') {
></stapps-event-detail-content> <stapps-favorite-detail-content [item]="$any(item)"></stapps-favorite-detail-content>
<stapps-favorite-detail-content }
[item]="$any(item)" @case ('message') {
*ngSwitchCase="'favorite'" <stapps-message-detail-content [item]="$any(item)"></stapps-message-detail-content>
></stapps-favorite-detail-content> }
<stapps-message-detail-content @case ('job posting') {
[item]="$any(item)" <stapps-job-posting-detail-content [item]="$any(item)"></stapps-job-posting-detail-content>
*ngSwitchCase="'message'" }
></stapps-message-detail-content> @case ('person') {
<stapps-job-posting-detail-content <stapps-person-detail-content [item]="$any(item)"></stapps-person-detail-content>
[item]="$any(item)" }
*ngSwitchCase="'job posting'" @case ('building') {
></stapps-job-posting-detail-content> <stapps-place-detail-content [item]="$any(item)"></stapps-place-detail-content>
<stapps-person-detail-content [item]="$any(item)" *ngSwitchCase="'person'"></stapps-person-detail-content> }
<stapps-place-detail-content [item]="$any(item)" *ngSwitchCase="'building'"></stapps-place-detail-content> @case ('floor') {
<stapps-place-detail-content [item]="$any(item)" *ngSwitchCase="'floor'"></stapps-place-detail-content> <stapps-place-detail-content [item]="$any(item)"></stapps-place-detail-content>
<stapps-place-detail-content }
[item]="$any(item)" @case ('point of interest') {
*ngSwitchCase="'point of interest'" <stapps-place-detail-content [item]="$any(item)"></stapps-place-detail-content>
></stapps-place-detail-content> }
<stapps-place-detail-content @case ('room') {
[item]="$any(item)" <stapps-place-detail-content
[openAsModal]="openAsModal" [item]="$any(item)"
*ngSwitchCase="'room'" [openAsModal]="openAsModal"
></stapps-place-detail-content> ></stapps-place-detail-content>
<stapps-semester-detail-content }
[item]="$any(item)" @case ('semester') {
*ngSwitchCase="'semester'" <stapps-semester-detail-content [item]="$any(item)"></stapps-semester-detail-content>
></stapps-semester-detail-content> }
<stapps-video-detail-content [item]="$any(item)" *ngSwitchCase="'video'"></stapps-video-detail-content> @case ('video') {
<ng-container *ngSwitchDefault> <stapps-video-detail-content [item]="$any(item)"></stapps-video-detail-content>
<ion-item class="ion-text-wrap" lines="inset"> }
<ion-thumbnail slot="start" class="ion-margin-end"> @default {
<ion-icon [name]="item.type | dataIcon"></ion-icon> <ion-item class="ion-text-wrap" lines="inset">
</ion-thumbnail> <ion-thumbnail slot="start" class="ion-margin-end">
<ion-grid> <ion-icon [name]="item.type | dataIcon"></ion-icon>
<ion-row> </ion-thumbnail>
<ion-col> <ion-grid>
<div class="ion-text-wrap"> <ion-row>
<h2 class="name">{{ item.name }}</h2> <ion-col>
<ion-note>{{ item.type }}</ion-note> <div class="ion-text-wrap">
</div> <h2 class="name">{{ item.name }}</h2>
</ion-col> <ion-note>{{ item.type }}</ion-note>
</ion-row> </div>
</ion-grid> </ion-col>
</ion-item> </ion-row>
<stapps-simple-card </ion-grid>
*ngIf="item.description" </ion-item>
[title]="$any('description' | propertyNameTranslate : item) | titlecase" @if (item.description) {
[content]="'description' | thingTranslate : item" <stapps-simple-card
></stapps-simple-card> [title]="$any('description' | propertyNameTranslate: item) | titlecase"
</ng-container> [content]="'description' | thingTranslate: item"
></stapps-simple-card>
}
}
}
</div> </div>
</ng-template> </ng-template>

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