Compare commits

...

23 Commits

Author SHA1 Message Date
Rainer Killinger
a3a416d580 docs: update changelogs for release
ci: publish release
2023-10-13 17:49:16 +02:00
e7607360e2 feat: section dynamic slide buttons 2023-10-12 11:47:59 +02:00
1f62b5c5b0 feat: backend-supplied id cards on profile page
feat: SCIdCard thing
2023-10-12 11:47:59 +02:00
905ebf8c59 refactor: update capacitor build files 2023-10-12 11:14:28 +02:00
b210e0d9c3 fix: change leaflet tiles to be inverted as a whole 2023-10-12 10:18:18 +02:00
3a79d57c8d fix: detail view should not reuse things without references 2023-10-09 08:53:28 +00:00
9e6d4fe054 fix: week overview button broken on webkit 2023-10-06 17:57:02 +02:00
7b96500a75 fix: backend tests failing since the start of this semester 2023-10-06 15:36:00 +02:00
e0b7e616b3 fix: live update distance in list items 2023-09-21 09:38:52 +00:00
38fb7a398d fix: long branch names prevent review deployment 2023-09-21 09:55:35 +02:00
a99e08cd68 refactor: change opening hours handling
fix: opening hours not updating
feat: lazy-load opening hours module
feat: add e2e tests for opening hours
refactor: migrate opening hours to on-push change detection
feat: show exact minutes in opening hours starting one hour before next change
2023-09-21 09:55:35 +02:00
a5c9d22016 feat: add external directions referral
feat: change map page
feat: add error handling and timeout to location fetching in directions

resolves #124
resolves #122
2023-09-15 18:52:28 +00:00
3c49c4cf6d fix: route stack service causes needless network traffic 2023-09-06 15:29:47 +02:00
f2c4ee308f feat: share loaded data to detail views across routes 2023-09-06 14:52:02 +02:00
bd09b36620 refactor: use observable chains in rating component 2023-08-29 10:20:35 +00:00
ca146b7761 refactor: separate dashboard schedule nav e2e tests 2023-08-28 13:48:34 +02:00
Thea Schöbl
001f978bf9 feat: cleanup profile page 2023-08-25 14:43:25 +00:00
Thea Schöbl
57a5b6061b fix: type errors in easy-ast when generating docs 2023-08-23 08:45:47 +00:00
Rainer Killinger
4fb5941c56 ci: prepare e2e jobs for non nonexistent cache 2023-08-22 17:09:14 +02:00
Rainer Killinger
314e6a6e86 ci: move most pipelines to GitLab OSS large runner 2023-08-08 17:31:14 +02:00
Thea Schöbl
e1cc33bba2 refactor: rename "recurring" to "week overview"
refactor: replace dashboard calendar icon
resolves #128

refactor: route dashboard "next unit" to date series instead of events
resolves #126
2023-08-07 15:51:23 +00:00
Rainer Killinger
9abd397578 refactor: update changelog
ci: publish release
2023-08-03 16:30:40 +02:00
Rainer Killinger
69fe8c6ac8 ci: polish publishing via ci pipelines 2023-08-03 16:30:35 +02:00
227 changed files with 4702 additions and 2047 deletions

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': major
---
Update to Angular 16.1

View File

@@ -1,8 +0,0 @@
---
'@openstapps/core-tools': major
---
Removed pack tool
Use a bundler like `tsup` in conjunction with an
`index.ts` that aggregates all exports instead.

View File

@@ -1,11 +0,0 @@
---
'@openstapps/api-plugin': major
'@openstapps/api-cli': major
'@openstapps/api': major
---
Split API into API, API-CLI and API-Plugin
Plugins are now required to use `api-plugin`.
Consumers of `api` can benefit from a slimmer package with
no NodeJS dependencies.

View File

@@ -1,31 +0,0 @@
---
'@openstapps/backend': major
---
Migrate config system to cosmiconfig
Configs are now written using type-checked JavaScript
```js
// @ts-check
// This file is now type-safe just like TypeScript, but
// without the compilation step
/** @type {import('@openstapps/package').Type} */
const foo = {};
```
You can write config files in JavaScript, JSON, or other
cosmiconfig-supported formats.
The config files now are
- `backendrc.{js,json,...}`
- `elasticsearchrc.{js,json,...}`
- `prometheusrc.{js,json,...}`
You can also split them into multiple files,
as well as using the `markdown.js` helper in
`config/default/tools` to include markdown files
as text (see `config/f-u/about-pages`)

View File

@@ -1,51 +0,0 @@
---
'@openstapps/projectmanagement': major
'@openstapps/prettier-config': major
'@openstapps/es-mapping-generator': major
'@openstapps/backend-config': major
'@openstapps/eslint-config': major
'@openstapps/minimal-connector': major
'@openstapps/collection-utils': major
'@openstapps/minimal-plugin': major
'@openstapps/tsconfig': major
'@openstapps/api-plugin': major
'@openstapps/core-tools': major
'@openstapps/gitlab-api': major
'@openstapps/easy-ast': major
'@openstapps/api-cli': major
'@openstapps/backend': major
'@openstapps/logger': major
'@openstapps/proxy': major
'@openstapps/core': major
'@openstapps/app': major
'@openstapps/api': major
---
Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```

View File

@@ -1,13 +0,0 @@
---
'@openstapps/core': major
---
Migrate away from [ts-optchain](https://www.npmjs.com/package/ts-optchain)
The package has been deprecated with the last releast being 4 years ago.
TypeScript as well as ECMAScript have native support for optional
chaining with the `?.` operator now.
You will need to update any packages that rely on the translator
module.

View File

@@ -1,25 +0,0 @@
---
'@openstapps/projectmanagement': patch
'@openstapps/prettier-config': patch
'@openstapps/es-mapping-generator': patch
'@openstapps/eslint-config': patch
'@openstapps/minimal-connector': patch
'@openstapps/minimal-plugin': patch
'@openstapps/core-tools': patch
'@openstapps/gitlab-api': patch
'@openstapps/backend': patch
'@openstapps/logger': patch
'@openstapps/proxy': patch
'@openstapps/core': patch
'@openstapps/api': patch
---
Migrated changelogs to changeset format
```js
import fs from 'fs';
const path = 'packages/logger/CHANGELOG.md';
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
```

View File

@@ -1,8 +0,0 @@
---
'@openstapps/backend': minor
'@openstapps/api-cli': major
---
Migrate integration tests from docker-compose solution to a shell script
`api-cli` no longer builds as a Docker container as a result.

View File

@@ -1,34 +0,0 @@
---
'@openstapps/projectmanagement': major
'@openstapps/prettier-config': major
'@openstapps/es-mapping-generator': major
'@openstapps/backend-config': major
'@openstapps/eslint-config': major
'@openstapps/minimal-connector': major
'@openstapps/collection-utils': major
'@openstapps/minimal-plugin': major
'@openstapps/tsconfig': major
'@openstapps/api-plugin': major
'@openstapps/core-tools': major
'@openstapps/gitlab-api': major
'@openstapps/easy-ast': major
'@openstapps/api-cli': major
'@openstapps/backend': major
'@openstapps/logger': major
'@openstapps/proxy': major
'@openstapps/core': major
'@openstapps/app': major
'@openstapps/api': major
---
Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```

View File

@@ -1,30 +0,0 @@
---
'@openstapps/projectmanagement': major
'@openstapps/prettier-config': major
'@openstapps/es-mapping-generator': major
'@openstapps/backend-config': major
'@openstapps/eslint-config': major
'@openstapps/minimal-connector': major
'@openstapps/collection-utils': major
'@openstapps/minimal-plugin': major
'@openstapps/tsconfig': major
'@openstapps/api-plugin': major
'@openstapps/core-tools': major
'@openstapps/gitlab-api': major
'@openstapps/easy-ast': major
'@openstapps/api-cli': major
'@openstapps/backend': major
'@openstapps/logger': major
'@openstapps/proxy': major
'@openstapps/core': major
'@openstapps/app': major
'@openstapps/api': major
---
Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now

View File

@@ -1,5 +0,0 @@
---
'@openstapps/gitlab-api': minor
---
Migrate from request-promise-native to got

View File

@@ -1,5 +0,0 @@
---
'@openstapps/projectmanagement': patch
---
Moved project-docs to the [GitLab Wiki](https://gitlab.com/openstapps/openstapps/-/wikis/home) repo.

View File

@@ -1,31 +0,0 @@
---
'@openstapps/projectmanagement': minor
'@openstapps/prettier-config': minor
'@openstapps/es-mapping-generator': minor
'@openstapps/backend-config': minor
'@openstapps/eslint-config': minor
'@openstapps/minimal-connector': minor
'@openstapps/collection-utils': minor
'@openstapps/minimal-plugin': minor
'@openstapps/tsconfig': minor
'@openstapps/api-plugin': minor
'@openstapps/core-tools': minor
'@openstapps/gitlab-api': minor
'@openstapps/easy-ast': minor
'@openstapps/api-cli': minor
'@openstapps/backend': minor
'@openstapps/logger': minor
'@openstapps/proxy': minor
'@openstapps/core': minor
'@openstapps/app': minor
'@openstapps/api': minor
---
Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool

View File

@@ -1,5 +0,0 @@
---
'@openstapps/es-mapping-generator': patch
---
Remove @openstapps/logger dependency

View File

@@ -1,59 +0,0 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@openstapps/backend": "2.0.0",
"@openstapps/database": "2.0.0",
"@openstapps/proxy": "2.0.0",
"@openstapps/backend-config": "2.0.0",
"@openstapps/eslint-config": "2.0.0",
"@openstapps/prettier-config": "2.0.0",
"@openstapps/projectmanagement": "2.0.0",
"@openstapps/tsconfig": "2.0.0",
"@openstapps/minimal-connector": "2.0.0",
"@openstapps/minimal-deployment": "2.0.0",
"@openstapps/minimal-plugin": "2.0.0",
"@openstapps/app": "2.0.0",
"@openstapps/app-release-template": "2.0.0",
"@openstapps/api": "2.0.0",
"@openstapps/api-cli": "2.0.0",
"@openstapps/api-plugin": "2.0.0",
"@openstapps/collection-utils": "2.0.0",
"@openstapps/core": "2.0.0",
"@openstapps/core-tools": "2.0.0",
"@openstapps/easy-ast": "2.0.0",
"@openstapps/es-mapping-generator": "2.0.0",
"@openstapps/gitlab-api": "2.0.0",
"@openstapps/logger": "2.0.0"
},
"changesets": [
"cool-jars-kiss",
"cuddly-bobcats-roll",
"dull-news-appear",
"five-ears-wash",
"fuzzy-walls-greet",
"giant-crabs-cheer",
"gorgeous-flowers-reflect",
"healthy-steaks-shop",
"honest-sheep-train",
"late-zoos-breathe",
"moody-parrots-develop",
"neat-hats-trade",
"new-pianos-joke",
"proud-wolves-end",
"quick-houses-count",
"rare-squids-bake",
"soft-donuts-fail",
"sour-coins-visit",
"spicy-snails-sort",
"stale-garlics-share",
"strange-hounds-repair",
"tall-ducks-dream",
"tame-mayflies-hug",
"tame-rings-dream",
"thick-weeks-compete",
"thin-camels-give",
"tidy-buses-reflect",
"tough-hairs-provide"
]
}

View File

@@ -1,8 +0,0 @@
---
'@openstapps/projectmanagement': major
'@openstapps/node-base': major
---
Move images to separate packages
Removed builder image due to migration to Kaniko

View File

@@ -1,9 +0,0 @@
---
'@openstapps/eslint-config': minor
---
Update rules
- `unicorn/no-array-reduce` is now off
- `unicorn/no-non-null-assertion` is now off
- Removed prettier rules (use prettier formatting instead)

View File

@@ -1,7 +0,0 @@
---
'@openstapps/es-mapping-generator': major
---
Remove put-es-templates
The `put-es-templates` functionality has been removed.

View File

@@ -1,24 +0,0 @@
---
'@openstapps/projectmanagement': patch
'@openstapps/prettier-config': patch
'@openstapps/es-mapping-generator': patch
'@openstapps/backend-config': patch
'@openstapps/eslint-config': patch
'@openstapps/minimal-connector': patch
'@openstapps/collection-utils': patch
'@openstapps/minimal-plugin': patch
'@openstapps/tsconfig': patch
'@openstapps/api-plugin': patch
'@openstapps/core-tools': patch
'@openstapps/gitlab-api': patch
'@openstapps/easy-ast': patch
'@openstapps/api-cli': patch
'@openstapps/backend': patch
'@openstapps/logger': patch
'@openstapps/proxy': patch
'@openstapps/core': patch
'@openstapps/app': patch
'@openstapps/api': patch
---
Migrate away from @openstapps/configuration

View File

@@ -1,5 +0,0 @@
---
'@openstapps/projectmanagement': patch
---
Update release configs

View File

@@ -1,30 +0,0 @@
---
'@openstapps/projectmanagement': patch
'@openstapps/prettier-config': patch
'@openstapps/app-release-template': patch
'@openstapps/es-mapping-generator': patch
'@openstapps/backend-config': patch
'@openstapps/eslint-config': patch
'@openstapps/minimal-deployment': patch
'@openstapps/minimal-connector': patch
'@openstapps/collection-utils': patch
'@openstapps/minimal-plugin': patch
'@openstapps/tsconfig': patch
'@openstapps/node-builder': patch
'@openstapps/api-plugin': patch
'@openstapps/core-tools': patch
'@openstapps/gitlab-api': patch
'@openstapps/app-builder-image': patch
'@openstapps/easy-ast': patch
'@openstapps/database': patch
'@openstapps/node-base': patch
'@openstapps/api-cli': patch
'@openstapps/backend': patch
'@openstapps/logger': patch
'@openstapps/proxy': patch
'@openstapps/core': patch
'@openstapps/app': patch
'@openstapps/api': patch
---
Update to TypeScript 5.1.6

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': patch
---
Migrate collection helpers to use @openstapps/collection-utils

View File

@@ -1,8 +0,0 @@
---
'@openstapps/app': minor
---
Migrate to Ionic 7
- Migrate uses of `<ion-label>` with inputs to new syntax
- Fix infinite loop in schedule date picker (`datetime.confirm()` to `datetime.cancel()`)

View File

@@ -1,7 +0,0 @@
---
'@openstapps/api': minor
---
Migrate HttpClient to Node 18's native `fetch` API
HttpClient can now be used both in NodeJS and browsers.

View File

@@ -1,7 +0,0 @@
---
'@openstapps/es-mapping-generator': major
'@openstapps/backend': major
'@openstapps/core': major
---
Migrate es mapping types from es-mapping-generator to .d.ts next to generated mappings

View File

@@ -1,5 +0,0 @@
---
'@openstapps/eslint-config': patch
---
Add license header enforcement rule (unfinished)

View File

@@ -1,5 +0,0 @@
---
'@openstapps/core': minor
---
Include openapi.json in built package

View File

@@ -1,26 +0,0 @@
---
'@openstapps/projectmanagement': minor
'@openstapps/minimal-connector': minor
'@openstapps/minimal-plugin': minor
'@openstapps/collection-utils': minor
'@openstapps/core-tools': minor
'@openstapps/gitlab-api': minor
'@openstapps/backend': minor
'@openstapps/logger': minor
'@openstapps/core': minor
'@openstapps/api': minor
---
Migrate away from `@krlwlfrt/async-pool`
```ts
import {mapAsyncLimit} from '@openstapps/collection-utils';
await mapAsyncLimit(
[1, 2, 3],
async it => {
await someNetworkRequest(it);
},
5,
);
```

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': minor
---
Migrate away from JIT compilation

View File

@@ -1,5 +0,0 @@
---
'@openstapps/logger': patch
---
Fix an issue with chalk terminal colors in tests

View File

@@ -1,9 +0,0 @@
---
'@openstapps/core-tools': major
---
Migrate openapi generation to output single file
The OpenAPI generator now outputs a single file instead
of a directory with the `openapi.json` and copied schema
files.

View File

@@ -1,6 +0,0 @@
---
'@openstapps/app': patch
---
Migrate unit tests to karma-coverage and junit reports.
Fixes an issue where coverage reports would not be generated.

View File

@@ -1,5 +0,0 @@
---
'@openstapps/projectmanagement': minor
---
Migrate moment.js to date-fns

View File

@@ -1,23 +0,0 @@
---
'@openstapps/projectmanagement': major
'@openstapps/es-mapping-generator': major
'@openstapps/minimal-connector': major
'@openstapps/collection-utils': major
'@openstapps/minimal-plugin': major
'@openstapps/api-plugin': major
'@openstapps/core-tools': major
'@openstapps/gitlab-api': major
'@openstapps/easy-ast': major
'@openstapps/api-cli': major
'@openstapps/backend': major
'@openstapps/logger': major
'@openstapps/proxy': major
'@openstapps/core': major
'@openstapps/api': major
---
Migrate build system to `tsup`
All packages now use an `index.ts` file to expose contents.
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`

View File

@@ -1,9 +0,0 @@
---
'@openstapps/core-tools': major
'@openstapps/easy-ast': major
---
Migrate easy-ast to separate package
The `easy-ast` part of `core-tools` has been moved to its own package.
For migration, simply use the new package.

View File

@@ -1,5 +0,0 @@
---
'@openstapps/core-tools': patch
---
Migrate from away from lodash

View File

@@ -7,14 +7,18 @@
# ```
# To your pipeline.
# https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#use-rules-to-add-jobs
.limit_pipelines:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'main' || $CI_COMMIT_BRANCH == 'develop'
when: on_success
- when: never
include:
- local: /backend/backend/.gitlab-ci.yml
- local: /frontend/app/.gitlab-ci.yml
- local: /.gitlab/schedules.gitlab-ci.yml
- local: /.gitlab/publishing.gitlab-ci.yml
rules:
- if: '$CI_COMMIT_MESSAGE =~ /ci: publish release$/'
when: always
variables:
TURBO_CACHE_BYPASS:
@@ -28,7 +32,7 @@ variables:
default:
image: registry.gitlab.com/openstapps/openstapps/node-builder
tags:
- performance
- saas-linux-xlarge-amd64
interruptible: true
before_script:
- corepack enable
@@ -76,13 +80,14 @@ build:
rules: &deploy-rules
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
variables:
DEPLOY_ID: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
DEPLOY_ID: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_BRANCH == 'main'
variables:
DEPLOY_ID: production
- if: $CI_COMMIT_BRANCH == 'develop'
variables:
DEPLOY_ID: staging
- !reference [.limit_pipelines, rules]
stop review:
stage: build
@@ -121,15 +126,15 @@ unit:
coverage_format: cobertura
path: coverage.xml
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'main' || $CI_COMMIT_BRANCH == 'develop'
- !reference [.limit_pipelines, rules]
audit:
stage: audit
allow_failure: true
needs: []
script:
- pnpm audit --prod
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'develop'
allow_failure: true
- if: $CI_COMMIT_BRANCH == 'main'
allow_failure: false
- !reference [.limit_pipelines, rules]

View File

@@ -1,6 +1,6 @@
.limit_publishing:
- if: $CI_PIPELINE_SOURCE != "schedule"
when: on_success
.limit_publish_pipelines:
rules:
- if: '($CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "develop") && $CI_COMMIT_MESSAGE =~ /ci: publish release/ && $CI_PIPELINE_SOURCE != "schedule"'
deploy:
stage: publish
@@ -12,7 +12,8 @@ deploy:
paths:
- ./.deploy
- ./frontend/app/www
rules: !reference [.limit_publishing]
rules:
- !reference [.limit_publish_pipelines, rules]
publish image:
stage: publish
@@ -23,14 +24,15 @@ publish image:
image:
name: gcr.io/kaniko-project/executor:v1.12.1-debug
entrypoint: [""]
variables:
PUBLISH_TAG: next
script:
- >
/kaniko/executor
--context "${CI_PROJECT_DIR}/${DEPLOY_DIR}"
--dockerfile "${CI_PROJECT_DIR}/${DEPLOY_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:$(grep -o '"version": "[^"]*' "${DEPLOY_DIR}/package.json" | cut -d'"' -f4)"
--destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:latest"
rules: !reference [.limit_publishing]
--destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${PUBLISH_TAG}"
parallel:
matrix:
- IMAGE_NAME: database
@@ -47,6 +49,11 @@ publish image:
DEPLOY_DIR: .deploy/minimal-plugin
- IMAGE_NAME: app
DEPLOY_DIR: frontend/app
rules:
- if: $CI_COMMIT_BRANCH == 'main'
variables:
PUBLISH_TAG: latest
- !reference [.limit_publish_pipelines, rules]
publish packages:
stage: publish
@@ -54,18 +61,17 @@ publish packages:
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
PUBLISH_TAG: next
script:
- pnpm install
- pnpm build
- pnpm publish -r --publish-branch ${PUBLISH_BRANCH} --tag ${PUBLISH_TAG} --no-git-checks # TODO: Git checks...
- pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_AUTH_TOKEN}"
- pnpm publish -r --publish-branch ${CI_COMMIT_BRANCH} --tag ${PUBLISH_TAG} --no-git-checks # TODO: Git checks...
rules:
- if: $CI_COMMIT_BRANCH == 'main'
variables:
PUBLISH_BRANCH: main
PUBLISH_TAG: latest
- variables:
PUBLISH_BRANCH: $CI_COMMIT_BRANCH
PUBLISH_TAG: next
- !reference [.limit_publish_pipelines, rules]
publish docs:
stage: publish
@@ -77,3 +83,6 @@ publish docs:
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == 'main'
- !reference [.limit_publish_pipelines, rules]

View File

@@ -1,6 +1,6 @@
.limit_base_image_publishing:
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == 'main'
when: always
.limit_scheduled_pipelines:
rules:
- if: $CI_COMMIT_BRANCH == 'main' && $CI_PIPELINE_SOURCE == "schedule"
base image:
image: docker
@@ -18,10 +18,9 @@ base image:
docker build
-t "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:$(grep -o '"version": "[^"]*' "${DEPLOY_DIR}/package.json" | cut -d'"' -f4)"
-t "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:latest" "${CI_PROJECT_DIR}/${DEPLOY_DIR}" &&
docker push "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}"
docker push "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}" --all-tags
cache: {} # disable irrelevant cache for this job
before_script: [] # do not run irrelevant before script for this job
rules: !reference [.limit_base_image_publishing]
parallel:
matrix:
- IMAGE_NAME: node-base
@@ -30,4 +29,7 @@ base image:
DEPLOY_DIR: images/node-builder
- IMAGE_NAME: app-builder
DEPLOY_DIR: images/app-builder
- IMAGE_NAME: app-cypress
DEPLOY_DIR: images/app-cypress
rules:
- !reference [.limit_scheduled_pipelines, rules]

View File

@@ -19,4 +19,4 @@ integration:
junit:
- backend/backend/coverage/integration-report-junit.xml
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'main' || $CI_COMMIT_BRANCH == 'develop'
- !reference [.limit_pipelines, rules]

View File

@@ -1,5 +1,168 @@
# @openstapps/backend
## 3.0.0
### Major Changes
- 64caebaf: Migrate config system to cosmiconfig
Configs are now written using type-checked JavaScript
```js
// @ts-check
// This file is now type-safe just like TypeScript, but
// without the compilation step
/** @type {import('@openstapps/package').Type} */
const foo = {};
```
You can write config files in JavaScript, JSON, or other
cosmiconfig-supported formats.
The config files now are
- `backendrc.{js,json,...}`
- `elasticsearchrc.{js,json,...}`
- `prometheusrc.{js,json,...}`
You can also split them into multiple files,
as well as using the `markdown.js` helper in
`config/default/tools` to include markdown files
as text (see `config/f-u/about-pages`)
- 64caebaf: Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```
- 64caebaf: Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```
- 64caebaf: Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now
- 0a7e6af1: Migrate es mapping types from es-mapping-generator to .d.ts next to generated mappings
- 64caebaf: Migrate build system to `tsup`
All packages now use an `index.ts` file to expose contents.
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`
### Minor Changes
- 64caebaf: Migrate integration tests from docker-compose solution to a shell script
`api-cli` no longer builds as a Docker container as a result.
- 64caebaf: Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool
- 64caebaf: Migrate away from `@krlwlfrt/async-pool`
```ts
import {mapAsyncLimit} from '@openstapps/collection-utils';
await mapAsyncLimit(
[1, 2, 3],
async it => {
await someNetworkRequest(it);
},
5,
);
```
### Patch Changes
- 64caebaf: Migrated changelogs to changeset format
```js
import fs from 'fs';
const path = 'packages/logger/CHANGELOG.md';
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
```
- 98546a97: Migrate away from @openstapps/configuration
- 23481d0d: Update to TypeScript 5.1.6
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [1f62b5c5]
- Updated dependencies [98546a97]
- Updated dependencies [23481d0d]
- Updated dependencies [0a7e6af1]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- @openstapps/core-tools@3.0.0
- @openstapps/logger@3.0.0
- @openstapps/core@3.0.0
## 3.0.0-next.4
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6
- Updated dependencies [23481d0d]
- @openstapps/core-tools@3.0.0-next.4
- @openstapps/logger@3.0.0-next.4
- @openstapps/core@3.0.0-next.4
## 3.0.0-next.0
### Major Changes

View File

@@ -70,6 +70,10 @@ const config = {
authProvider: 'paia',
url: 'https://hds.hebis.de/paia/core',
},
/** TODO: idCards: {
authProvider: 'default',
url: 'TODO',
} */
},
},
aboutPages,

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/backend",
"description": "A reference implementation for a StApps backend",
"version": "3.0.0-next.0",
"version": "3.0.0",
"private": true,
"type": "module",
"license": "AGPL-3.0-only",

View File

@@ -29,7 +29,7 @@ export const query: QueryDslQueryContainer = {
should: [],
},
},
weight: 1.1,
weight: 1.05,
},
{
filter: {
@@ -42,14 +42,14 @@ export const query: QueryDslQueryContainer = {
},
{
term: {
'academicTerms.acronym.raw': 'WS 2022/23',
'academicTerms.acronym.raw': 'WS 2023/24',
},
},
],
should: [],
},
},
weight: 1.05,
weight: 1.1,
},
{
filter: {
@@ -69,7 +69,7 @@ export const query: QueryDslQueryContainer = {
should: [],
},
},
weight: 1.1,
weight: 1.05,
},
{
filter: {
@@ -82,14 +82,14 @@ export const query: QueryDslQueryContainer = {
},
{
term: {
'academicTerms.acronym.raw': 'WiSe 2022/23',
'academicTerms.acronym.raw': 'WiSe 2023/24',
},
},
],
should: [],
},
},
weight: 1.05,
weight: 1.1,
},
{
filter: {

View File

@@ -0,0 +1,13 @@
# @openstapps/database
## 3.0.0
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6
## 3.0.0-next.4
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6

View File

@@ -1,6 +1,6 @@
{
"name": "@openstapps/database",
"version": "2.0.0",
"version": "3.0.0",
"private": true,
"files": [
"config",

View File

@@ -1,5 +1,109 @@
# @openstapps/proxy
## 3.0.0
### Major Changes
- 64caebaf: Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```
- 64caebaf: Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```
- 64caebaf: Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now
- 64caebaf: Migrate build system to `tsup`
All packages now use an `index.ts` file to expose contents.
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`
### Minor Changes
- 64caebaf: Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool
### Patch Changes
- 64caebaf: Migrated changelogs to changeset format
```js
import fs from 'fs';
const path = 'packages/logger/CHANGELOG.md';
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
```
- 98546a97: Migrate away from @openstapps/configuration
- 23481d0d: Update to TypeScript 5.1.6
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [23481d0d]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- @openstapps/logger@3.0.0
## 3.0.0-next.4
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6
- Updated dependencies [23481d0d]
- @openstapps/logger@3.0.0-next.4
## 3.0.0-next.0
### Major Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/proxy",
"description": "NGINX proxy that is dynamically configured by a Node.js script",
"version": "3.0.0-next.0",
"version": "3.0.0",
"private": true,
"type": "module",
"license": "AGPL-3.0-only",

View File

@@ -1,5 +1,80 @@
# @openstapps/backend-config
## 3.0.0
### Major Changes
- 64caebaf: Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```
- 64caebaf: Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```
- 64caebaf: Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now
### Minor Changes
- 64caebaf: Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool
### Patch Changes
- 98546a97: Migrate away from @openstapps/configuration
- 23481d0d: Update to TypeScript 5.1.6
## 3.0.0-next.4
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6
## 3.0.0-next.0
### Major Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/backend-config",
"description": "Backend Configuration for OpenStApps",
"version": "3.0.0-next.0",
"version": "3.0.0",
"private": true,
"type": "module",
"license": "GPL-3.0-only",

View File

@@ -1,5 +1,97 @@
# @openstapps/eslint-config
## 3.0.0
### Major Changes
- 64caebaf: Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```
- 64caebaf: Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```
- 64caebaf: Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now
### Minor Changes
- 64caebaf: Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool
- 64caebaf: Update rules
- `unicorn/no-array-reduce` is now off
- `unicorn/no-non-null-assertion` is now off
- Removed prettier rules (use prettier formatting instead)
### Patch Changes
- 64caebaf: Migrated changelogs to changeset format
```js
import fs from 'fs';
const path = 'packages/logger/CHANGELOG.md';
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
```
- 98546a97: Migrate away from @openstapps/configuration
- 23481d0d: Update to TypeScript 5.1.6
- 64caebaf: Add license header enforcement rule (unfinished)
## 3.0.0-next.4
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6
## 3.0.0-next.0
### Major Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/eslint-config",
"description": "A collection of configuration base files for StApps projects. Just an (unused) experiment for now.",
"version": "3.0.0-next.0",
"version": "3.0.0",
"type": "commonjs",
"license": "GPL-3.0-only",
"repository": "git@gitlab.com:openstapps/eslint-config.git",

View File

@@ -1,5 +1,90 @@
# @openstapps/prettier-config
## 3.0.0
### Major Changes
- 64caebaf: Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```
- 64caebaf: Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```
- 64caebaf: Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now
### Minor Changes
- 64caebaf: Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool
### Patch Changes
- 64caebaf: Migrated changelogs to changeset format
```js
import fs from 'fs';
const path = 'packages/logger/CHANGELOG.md';
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
```
- 98546a97: Migrate away from @openstapps/configuration
- 23481d0d: Update to TypeScript 5.1.6
## 3.0.0-next.4
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6
## 3.0.0-next.0
### Major Changes

View File

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

View File

@@ -1,5 +1,143 @@
# @openstapps/projectmanagement
## 3.0.0
### Major Changes
- 64caebaf: Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```
- 64caebaf: Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```
- 64caebaf: Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now
- 11c9d742: Move images to separate packages
Removed builder image due to migration to Kaniko
- 64caebaf: Migrate build system to `tsup`
All packages now use an `index.ts` file to expose contents.
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`
### Minor Changes
- 64caebaf: Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool
- 64caebaf: Migrate away from `@krlwlfrt/async-pool`
```ts
import {mapAsyncLimit} from '@openstapps/collection-utils';
await mapAsyncLimit(
[1, 2, 3],
async it => {
await someNetworkRequest(it);
},
5,
);
```
- 64caebaf: Migrate moment.js to date-fns
### Patch Changes
- 64caebaf: Migrated changelogs to changeset format
```js
import fs from 'fs';
const path = 'packages/logger/CHANGELOG.md';
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
```
- 64caebaf: Moved project-docs to the [GitLab Wiki](https://gitlab.com/openstapps/openstapps/-/wikis/home) repo.
- 98546a97: Migrate away from @openstapps/configuration
- 4e4c7b5c: Update release configs
- 23481d0d: Update to TypeScript 5.1.6
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [23481d0d]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- @openstapps/collection-utils@3.0.0
- @openstapps/gitlab-api@3.0.0
- @openstapps/logger@3.0.0
## 3.0.0-next.4
### Major Changes
- 11c9d742: Move images to separate packages
Removed builder image due to migration to Kaniko
### Patch Changes
- 4e4c7b5c: Update release configs
- 23481d0d: Update to TypeScript 5.1.6
- Updated dependencies [23481d0d]
- @openstapps/collection-utils@3.0.0-next.4
- @openstapps/gitlab-api@3.0.0-next.4
- @openstapps/logger@3.0.0-next.4
## 3.0.0-next.3
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/projectmanagement",
"description": "Main documentation and scripts for maintenance.",
"version": "3.0.0-next.3",
"version": "3.0.0",
"private": true,
"type": "module",
"license": "GPL-3.0-only",

View File

@@ -1,5 +1,80 @@
# @openstapps/tsconfig
## 3.0.0
### Major Changes
- 64caebaf: Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```
- 64caebaf: Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```
- 64caebaf: Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now
### Minor Changes
- 64caebaf: Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool
### Patch Changes
- 98546a97: Migrate away from @openstapps/configuration
- 23481d0d: Update to TypeScript 5.1.6
## 3.0.0-next.4
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6
## 3.0.0-next.0
### Major Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/tsconfig",
"description": "The tsconfig for the openstapps project",
"version": "3.0.0-next.0",
"version": "3.0.0",
"type": "commonjs",
"license": "GPL-3.0-only",
"repository": "git@gitlab.com:openstapps/eslint-config.git",

View File

@@ -1,5 +1,133 @@
# @openstapps/minimal-connector
## 3.0.0
### Major Changes
- 64caebaf: Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```
- 64caebaf: Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```
- 64caebaf: Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now
- 64caebaf: Migrate build system to `tsup`
All packages now use an `index.ts` file to expose contents.
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`
### Minor Changes
- 64caebaf: Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool
- 64caebaf: Migrate away from `@krlwlfrt/async-pool`
```ts
import {mapAsyncLimit} from '@openstapps/collection-utils';
await mapAsyncLimit(
[1, 2, 3],
async it => {
await someNetworkRequest(it);
},
5,
);
```
### Patch Changes
- 64caebaf: Migrated changelogs to changeset format
```js
import fs from 'fs';
const path = 'packages/logger/CHANGELOG.md';
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
```
- 98546a97: Migrate away from @openstapps/configuration
- 23481d0d: Update to TypeScript 5.1.6
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [1f62b5c5]
- Updated dependencies [98546a97]
- Updated dependencies [23481d0d]
- Updated dependencies [64caebaf]
- Updated dependencies [0a7e6af1]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- @openstapps/api@3.0.0
- @openstapps/logger@3.0.0
- @openstapps/core@3.0.0
## 3.0.0-next.4
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6
- Updated dependencies [23481d0d]
- @openstapps/logger@3.0.0-next.4
- @openstapps/core@3.0.0-next.4
- @openstapps/api@3.0.0-next.4
## 3.0.0-next.0
### Major Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/minimal-connector",
"description": "This is a minimal connector which serves as an example",
"version": "3.0.0-next.0",
"version": "3.0.0",
"private": true,
"type": "module",
"license": "GPL-3.0-only",

View File

@@ -0,0 +1,13 @@
# @openstapps/minimal-deployment
## 3.0.0
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6
## 3.0.0-next.4
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6

View File

@@ -1,6 +1,6 @@
{
"name": "@openstapps/minimal-deployment",
"version": "2.0.0",
"version": "3.0.0",
"private": true,
"files": [
"database",

View File

@@ -1,5 +1,141 @@
# @openstapps/minimal-plugin
## 3.0.0
### Major Changes
- 64caebaf: Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```
- 64caebaf: Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```
- 64caebaf: Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now
- 64caebaf: Migrate build system to `tsup`
All packages now use an `index.ts` file to expose contents.
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`
### Minor Changes
- 64caebaf: Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool
- 64caebaf: Migrate away from `@krlwlfrt/async-pool`
```ts
import {mapAsyncLimit} from '@openstapps/collection-utils';
await mapAsyncLimit(
[1, 2, 3],
async it => {
await someNetworkRequest(it);
},
5,
);
```
### Patch Changes
- 64caebaf: Migrated changelogs to changeset format
```js
import fs from 'fs';
const path = 'packages/logger/CHANGELOG.md';
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
```
- 98546a97: Migrate away from @openstapps/configuration
- 23481d0d: Update to TypeScript 5.1.6
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [1f62b5c5]
- Updated dependencies [98546a97]
- Updated dependencies [23481d0d]
- Updated dependencies [64caebaf]
- Updated dependencies [0a7e6af1]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- @openstapps/core-tools@3.0.0
- @openstapps/api-plugin@3.0.0
- @openstapps/api@3.0.0
- @openstapps/logger@3.0.0
- @openstapps/core@3.0.0
## 3.0.0-next.4
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6
- Updated dependencies [23481d0d]
- @openstapps/api-plugin@3.0.0-next.4
- @openstapps/core-tools@3.0.0-next.4
- @openstapps/logger@3.0.0-next.4
- @openstapps/core@3.0.0-next.4
- @openstapps/api@3.0.0-next.4
## 3.0.0-next.0
### Major Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/minimal-plugin",
"description": "Minimal Plugin",
"version": "3.0.0-next.0",
"version": "3.0.0",
"private": true,
"type": "module",
"license": "GPL-3.0-only",

View File

@@ -15,8 +15,12 @@
buildToolsVersions = [ "${buildToolsVersion}" ];
platformVersions = [ "32" ];
};
cypress = prev.cypress.overrideAttrs(prev: {
version = "12.17.1";
cypress = prev.cypress.overrideAttrs(cyPrev: rec {
version = "13.2.0";
src = prev.fetchzip {
url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip";
hash = "sha256-9o0nprGcJhudS1LNm+T7Vf0Dwd1RBauYKI+w1FBQ3ZM=";
};
});
})
];

View File

@@ -8,7 +8,7 @@
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"project": ["tsconfig.json", "tsconfig.spec.json", "e2e/tsconfig.e2e.json"],
"project": ["tsconfig.json", "tsconfig.spec.json", "cypress/tsconfig.json"],
"createDefaultProgram": true
},
"extends": [

View File

@@ -44,3 +44,5 @@ UserInterfaceState.xcuserstate
docs
bundle-info.html
.browser-data/

View File

@@ -1,9 +1,12 @@
e2e:
image: cypress/browsers:latest # https://hub.docker.com/r/cypress/browsers/tags/
image: registry.gitlab.com/openstapps/openstapps/app-cypress:node-18
stage: test
script:
- pnpm --filter=@openstapps/app install
- pnpm --filter=@openstapps/app exec cypress install
- cd node_modules/.pnpm/re2*/node_modules/re2
- npm run install
- cd $CI_PROJECT_DIR
- pnpm test:integration:app
artifacts:
when: on_failure
@@ -19,4 +22,4 @@ e2e:
- BROWSER: chrome
- BROWSER: firefox
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'main' || $CI_COMMIT_BRANCH == 'develop'
- !reference [.limit_pipelines, rules]

View File

@@ -1,5 +1,169 @@
# @openstapps/app
## 3.0.0
### Major Changes
- 23481d0d: Update to Angular 16.1
- 64caebaf: Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```
- 64caebaf: Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```
- 64caebaf: Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now
### Minor Changes
- f2c4ee30: Detail views now won't load data again if it is being navigated to from a list item
- e1cc33bb: Added the ability to remove and add date series from their detail page
- 64caebaf: Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool
- 1f62b5c5: Add support for web-service-provided id cards on the profile page
- a5c9d220: Add directions to inPlace and place list items
- e1cc33bb: Improved calendar descriptions
- The dashboard quick link now has a more intuitive icon
- "Recurring" has been renamed to "Week Overview"
- Long words in calendar tabs will now break instead of overflowing
- 001f978b: Revamp "My Courses" section on profile page
The "My Courses" section on the profile page has been improved
- It will now show the upcoming courses for the next five days
- The section header is now consistent with the other sections
- The section now uses standard list items instead of the custom solution
Additionally, the profile page component has been cleaned up.
- a5c9d220: Adjust map button and item behavior on different screen sizes
- Small screens will show the item without margins below the map actions
- Large screens will show the list item on the left side
- 23481d0d: Migrate to Ionic 7
- Migrate uses of `<ion-label>` with inputs to new syntax
- Fix infinite loop in schedule date picker (`datetime.confirm()` to `datetime.cancel()`)
- 64caebaf: Migrate away from JIT compilation
- a5c9d220: Map items are now native list items
- e1cc33bb: Replaced simple links with list items in date-series detail
- 001f978b: Use event title for date series instead of the generic date series title
### Patch Changes
- a99e08cd: Refactored Opening Hours
- Migrated Opening Hours to use OnPush change detection
- Fixed a bug where opening hours would not update correctly
- Lazy-load opening hours module to keep it out of the main bundle
- Added e2e tests to verify functionality
- Changed live update status to show exact minutes starting one hour before the next change
- bd09b366: Use observable chains instead of change detection in the rating component
- 001f978b: Add a way to hide action chips on list items
- e0b7e616: Fixed distance not updating in list items
- b210e0d9: Change leaflet tiles to be inverted as a whole
- 98546a97: Migrate away from @openstapps/configuration
- 23481d0d: Update to TypeScript 5.1.6
- bebee6b4: Migrate collection helpers to use @openstapps/collection-utils
- 3c49c4cf: Fixed an issue that caused double and triple loading of data detail items through the route stack service
- 107a7c5e: Migrate unit tests to karma-coverage and junit reports.
Fixes an issue where coverage reports would not be generated.
- 1f62b5c5: Make section swiper buttons reactive
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [1f62b5c5]
- Updated dependencies [98546a97]
- Updated dependencies [23481d0d]
- Updated dependencies [64caebaf]
- Updated dependencies [0a7e6af1]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- @openstapps/api@3.0.0
- @openstapps/collection-utils@3.0.0
- @openstapps/core@3.0.0
## 3.0.0-next.4
### Major Changes
- 23481d0d: Update to Angular 16.1
### Minor Changes
- 23481d0d: Migrate to Ionic 7
- Migrate uses of `<ion-label>` with inputs to new syntax
- Fix infinite loop in schedule date picker (`datetime.confirm()` to `datetime.cancel()`)
### Patch Changes
- 23481d0d: Update to TypeScript 5.1.6
- bebee6b4: Migrate collection helpers to use @openstapps/collection-utils
- 107a7c5e: Migrate unit tests to karma-coverage and junit reports.
Fixes an issue where coverage reports would not be generated.
- Updated dependencies [23481d0d]
- @openstapps/collection-utils@3.0.0-next.4
- @openstapps/core@3.0.0-next.4
- @openstapps/api@3.0.0-next.4
## 3.0.0-next.0
### Major Changes

View File

@@ -42,3 +42,23 @@ The command `ionic cordova run ios` runs into the error `/platforms/ios/build/em
- Either use the command: `ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"`
- Or open the iOS project in Xcode and change build system in workspace settings to `Lagacy Build System`. Then the normal run command works also.
## Cypress
#### Problem
The browser doesn't open or the tests don't connect to a browser
#### Cause
Cypress was installed to a read-only location, see
[this issue](https://github.com/cypress-io/cypress/issues/18893).
This can be the case if you use NixOS.
#### Solution
Make sure the cypress folder is writable before each launch
```shell
chmod -R +rw ~/.config/Cypress
```

View File

@@ -52,6 +52,44 @@ All the npm scripts are defined in `package.json` [file](package.json). It is re
## Most useful commands
## Editing the Ionic Database from the browser
Add the following function using the browser console
```js
function addToIonicDB(key, value) {
indexedDB.open('_ionicstorage').onsuccess = event => {
const db = event.target.result;
db.transaction('_ionickv', 'readwrite').objectStore('_ionickv').put(value, key);
};
}
```
You can then call the function in the browser to add values to the
ionic database in the IndexedDB.
For example, you can add a stored authorization like this:
```js
addToIonicDB(
'token_response',
JSON.stringify({
access_token: 'AT-123-abcdefghi',
refresh_token: 'RT-123-jklmnopqrs',
scope: '',
token_type: 'bearer',
issued_at: 1696852785,
expires_in: '28800',
}),
);
```
You'll need to run _Chromium_ using
```shell
pnpm chromium:no-cors
```
### Running the app
Install the npm packages needed for running the app (as for any other node project which uses npm):

View File

@@ -11,6 +11,7 @@ apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-app')
implementation project(':capacitor-browser')
implementation project(':capacitor-clipboard')
implementation project(':capacitor-device')
implementation project(':capacitor-dialog')
implementation project(':capacitor-filesystem')

View File

@@ -7,6 +7,10 @@
"pkg": "@capacitor/browser",
"classpath": "com.capacitorjs.plugins.browser.BrowserPlugin"
},
{
"pkg": "@capacitor/clipboard",
"classpath": "com.capacitorjs.plugins.clipboard.ClipboardPlugin"
},
{
"pkg": "@capacitor/device",
"classpath": "com.capacitorjs.plugins.device.DevicePlugin"

View File

@@ -8,6 +8,9 @@ project(':capacitor-app').projectDir = new File('../../../node_modules/.pnpm/@ca
include ':capacitor-browser'
project(':capacitor-browser').projectDir = new File('../../../node_modules/.pnpm/@capacitor+browser@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/browser/android')
include ':capacitor-clipboard'
project(':capacitor-clipboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+clipboard@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/clipboard/android')
include ':capacitor-device'
project(':capacitor-device').projectDir = new File('../../../node_modules/.pnpm/@capacitor+device@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/device/android')

View File

@@ -182,6 +182,7 @@
"builder": "@cypress/schematic:cypress",
"options": {
"devServerTarget": "app:serve",
"liveReload": false,
"watch": true,
"headless": false
},

View File

@@ -18,14 +18,18 @@
describe('dashboard', async function () {
describe('schedule section', function () {
it('should lead to the schedule', function () {
it('should lead to the week overview', function () {
cy.visit('/overview');
cy.get('.schedule').contains('a', 'Stundenplan').click();
cy.url().should('include', '/schedule/recurring');
cy.get('.schedule')
.contains('a', /Wochen.*übersicht/)
.click();
cy.url().should('include', '/schedule/week-overview');
});
it('should lead to the calendar', function () {
cy.visit('/overview');
cy.get('.schedule').contains('a', 'Kein Eintrag gefunden').click();
cy.url().should('include', '/schedule/recurring');
cy.url().should('include', '/schedule/calendar');
});
// TODO: Reenable and stabilize tests

View File

@@ -0,0 +1,141 @@
describe('opening hours', () => {
beforeEach(function () {
cy.intercept('POST', 'https://mobile.server.uni-frankfurt.de/search', {
fixture: 'search/types/canteen/canteen-search-result.json',
}).as('search');
});
it('should specify relative closing time', () => {
cy.clock(new Date(2023, 9, 16, 15, 29), ['Date']);
cy.visit('/canteen');
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geöffnet')
.should('contain', 'Schließt heute um 22:00');
});
it('should specify relative opening time', () => {
cy.clock(new Date(2023, 9, 16, 6, 29), ['Date']);
cy.visit('/canteen');
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geschlossen')
.should('contain', 'Öffnet heute um 08:30');
});
it('should specify soon opening time', () => {
cy.clock(new Date(2023, 9, 16, 8, 0), ['Date']);
cy.visit('/canteen');
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geschlossen')
.should('contain', 'Öffnet in 30 Minuten');
});
it('should specify soon closing time', () => {
cy.clock(new Date(2023, 9, 16, 21, 30), ['Date']);
cy.visit('/canteen');
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geöffnet')
.should('contain', 'Schließt in 30 Minuten');
});
it('should update the soon closing time every minute', () => {
cy.clock(new Date(2023, 9, 16, 21, 30));
cy.visit('/canteen');
cy.tick(500);
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geöffnet')
.should('contain', 'Schließt in 30 Minuten');
cy.tick(60_000);
cy.tick(50);
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geöffnet')
.should('contain', 'Schließt in 29 Minuten');
});
it('should update the status when it changes', () => {
cy.clock(new Date(2023, 9, 16, 21, 59));
cy.visit('/canteen');
cy.tick(500);
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geöffnet')
.should('contain', 'Schließt in 1 Minute');
cy.tick(60_000);
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geschlossen')
.should('contain', 'Öffnet morgen um 08:30');
});
// This one takes long to execute!
it('should update as expected', () => {
cy.clock(new Date(2023, 9, 16, 20, 59));
cy.visit('/canteen');
cy.tick(500);
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geöffnet')
.should('contain', 'Schließt heute um 22:00');
cy.tick(60_000);
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geöffnet')
.should('contain', 'Schließt in 60 Minuten');
cy.tick(30 * 60_000);
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geöffnet')
.should('contain', 'Schließt in 30 Minuten');
cy.tick(30 * 60_000);
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geschlossen')
.should('contain', 'Öffnet morgen um 08:30');
cy.tick(9.5 * 60 * 60_000);
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geschlossen')
.should('contain', 'Öffnet in 60 Minuten');
cy.tick(30 * 60_000);
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geschlossen')
.should('contain', 'Öffnet in 30 Minuten');
cy.tick(30 * 60_000);
cy.get('stapps-opening-hours')
.first()
.should('contain', 'Geöffnet')
.should('contain', 'Schließt heute um 22:00');
// Long tick warps will cause network requests to time out
cy.get('@consoleError').invoke('resetHistory');
});
});

View File

@@ -31,36 +31,24 @@
// When a command from ./commands is ready to use, import with `import './commands'` syntax
// import './commands';
beforeEach(async function () {
let databases: string[];
if (window.indexedDB.databases) {
databases = (await window.indexedDB.databases()).map(it => it.name);
console.log('Trying to clear all databases');
} else {
console.log("Browser doesn't support database enumeration, deleting just ionic storage");
databases = ['_ionicstorage'];
}
for (const database of databases) {
if (database) {
console.log(`Deleting database ${database}`);
await new Promise(resolve => (window.indexedDB.deleteDatabase(database).onsuccess = resolve));
console.log(`Deleted database ${database}`);
}
}
beforeEach(function () {
cy.wrap(
new Promise(resolve => {
window.indexedDB.deleteDatabase('_ionicstorage').onsuccess = resolve;
}),
);
});
Cypress.on('window:before:load', window => {
// Fake that user is using its browser in german language
// Fake that user is using its browser in German
Object.defineProperty(window.navigator, 'language', {value: 'de-DE'});
Object.defineProperty(window.navigator, 'languages', [{value: 'de-DE'}]);
// Fail tests on console error
cy.stub(window.console, 'error').callsFake(message => {
// log out to the terminal
cy.now('task', 'error', message);
// log to Command Log and fail the test
throw new Error(message);
});
cy.spy(window.console, 'error').as('consoleError');
});
afterEach(function () {
cy.get('@consoleError').should('not.have.been.called');
});
Cypress.on('uncaught:exception', error => {

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/app",
"description": "The generic app tailored to fulfill needs of German universities, written using Ionic Framework.",
"version": "3.0.0-next.0",
"version": "3.0.0",
"private": true,
"license": "GPL-3.0-only",
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
@@ -22,6 +22,7 @@
"build:stats": "ng build --configuration=production --stats-json",
"changelog": "conventional-changelog -p angular -i src/assets/about/CHANGELOG.md -s -r 0",
"check-icons": "ts-node-esm scripts/check-icon-correctness.ts",
"chromium:no-cors": "chromium --disable-web-security --user-data-dir=\".browser-data/chromium\"",
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"docker:build": "sudo docker run -p 8100:8100 -p 35729:35729 -p 53703:53703 -v $PWD:/app -it registry.gitlab.com/openstapps/app bash -c \"npm install && npm run build\"",
@@ -63,6 +64,7 @@
"@awesome-cordova-plugins/core": "5.45.0",
"@capacitor/app": "4.1.1",
"@capacitor/browser": "4.1.0",
"@capacitor/clipboard": "4.1.0",
"@capacitor/core": "4.6.1",
"@capacitor/device": "4.1.0",
"@capacitor/dialog": "4.1.0",
@@ -84,11 +86,13 @@
"@ngx-translate/http-loader": "8.0.0",
"@openid/appauth": "1.3.1",
"@openstapps/api": "workspace:*",
"@openstapps/core": "workspace:*",
"@openstapps/collection-utils": "workspace:*",
"@openstapps/core": "workspace:*",
"@transistorsoft/capacitor-background-fetch": "1.0.2",
"@types/dom-view-transitions": "1.0.1",
"capacitor-secure-storage-plugin": "0.8.1",
"cordova-plugin-calendar": "5.1.6",
"date-fns": "2.30.0",
"deepmerge": "4.3.1",
"form-data": "4.0.0",
"geojson": "0.5.0",
@@ -98,6 +102,7 @@
"leaflet.markercluster": "1.5.3",
"material-symbols": "0.10.0",
"moment": "2.29.4",
"ngx-date-fns": "10.0.1",
"ngx-logger": "5.0.12",
"ngx-markdown": "16.0.0",
"ngx-moment": "6.0.2",
@@ -146,7 +151,7 @@
"@typescript-eslint/eslint-plugin": "5.60.1",
"@typescript-eslint/parser": "5.60.1",
"cordova-res": "0.15.4",
"cypress": "12.17.1",
"cypress": "13.2.0",
"eslint": "8.43.0",
"eslint-plugin-jsdoc": "46.4.2",
"eslint-plugin-prettier": "4.2.1",

View File

@@ -58,12 +58,15 @@ import {StorageProvider} from './modules/storage/storage.provider';
import {AssessmentsModule} from './modules/assessments/assessments.module';
import {ServiceHandlerInterceptor} from './_helpers/service-handler.interceptor';
import {RoutingStackService} from './util/routing-stack.service';
import {SCSettingValue} from '@openstapps/core';
import {SCLanguageCode, SCSettingValue} from '@openstapps/core';
import {DefaultAuthService} from './modules/auth/default-auth.service';
import {PAIAAuthService} from './modules/auth/paia/paia-auth.service';
import {IonIconModule} from './util/ion-icon/ion-icon.module';
import {NavigationModule} from './modules/menu/navigation/navigation.module';
import {browserFactory, SimpleBrowser} from './util/browser.factory';
import {getDateFnsLocale} from './translation/dfns-locale';
import {setDefaultOptions} from 'date-fns';
import {DateFnsConfigurationService} from 'ngx-date-fns';
registerLocaleData(localeDe);
@@ -71,12 +74,6 @@ SwiperCore.use([FreeMode, Navigation]);
/**
* Initializes data needed on startup
* @param storageProvider provider of the saved data (using framework's storage)
* @param logger TODO
* @param settingsProvider provider of settings (e.g. language that has been set)
* @param configProvider TODO
* @param translateService TODO
* @param _routingStackService Just for init and to track the stack from the get go
*/
export function initializerFactory(
storageProvider: StorageProvider,
@@ -87,6 +84,7 @@ export function initializerFactory(
_routingStackService: RoutingStackService,
defaultAuthService: DefaultAuthService,
paiaAuthService: PAIAAuthService,
dateFnsConfigurationService: DateFnsConfigurationService,
) {
return async () => {
initLogger(logger);
@@ -107,6 +105,10 @@ export function initializerFactory(
translateService.setDefaultLang('en');
translateService.use(languageCode);
moment.locale(languageCode);
const dateFnsLocale = await getDateFnsLocale(languageCode as SCLanguageCode);
setDefaultOptions({locale: dateFnsLocale});
dateFnsConfigurationService.setLocale(dateFnsLocale);
await defaultAuthService.init();
await paiaAuthService.init();
} catch (error) {
@@ -198,6 +200,7 @@ export function createTranslateLoader(http: HttpClient) {
RoutingStackService,
DefaultAuthService,
PAIAAuthService,
DateFnsConfigurationService,
],
useFactory: initializerFactory,
},

View File

@@ -17,7 +17,7 @@ import {Component, DestroyRef, inject, Input, OnInit, ViewChild} from '@angular/
import {ActivatedRoute} from '@angular/router';
import {AssessmentsProvider} from '../assessments.provider';
import {DataDetailComponent, ExternalDataLoadEvent} from '../../data/detail/data-detail.component';
import {NavController, ViewWillEnter} from '@ionic/angular';
import {NavController} from '@ionic/angular';
import {DataRoutingService} from '../../data/data-routing.service';
import {SCAssessment} from '@openstapps/core';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
@@ -27,7 +27,7 @@ import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
templateUrl: 'assessments-detail.html',
styleUrls: ['assessments-detail.scss'],
})
export class AssessmentsDetailComponent implements ViewWillEnter, OnInit {
export class AssessmentsDetailComponent implements OnInit {
destroy$ = inject(DestroyRef);
constructor(
@@ -67,8 +67,4 @@ export class AssessmentsDetailComponent implements ViewWillEnter, OnInit {
event.resolve(this.item);
});
}
async ionViewWillEnter() {
await this.detailComponent.ionViewWillEnter();
}
}

View File

@@ -61,6 +61,7 @@ export class AssessmentsSimpleDataListComponent implements OnInit {
queryParams: {
token: this.activatedRoute.snapshot.queryParamMap.get('token'),
},
state: {item: thing},
});
});
}

View File

@@ -71,6 +71,7 @@ export class AssessmentsPageComponent implements OnInit, AfterViewInit {
queryParams: {
token: this.activatedRoute.snapshot.queryParamMap.get('token'),
},
state: {item: thing},
});
});

View File

@@ -65,7 +65,7 @@ export class CatalogComponent implements OnInit {
.itemSelectListener()
.pipe(takeUntilDestroyed())
.subscribe(item => {
void this.router.navigate(['data-detail', item.uid]);
void this.router.navigate(['data-detail', item.uid], {state: {item}});
});
}

View File

@@ -19,19 +19,20 @@
</ion-toolbar>
</ion-header>
<div #schedule class="schedule">
<a [routerLink]="['/schedule/recurring']">
<ion-icon size="40" weight="300" name="grid_view"></ion-icon>
<ion-label>{{ 'schedule.recurring' | translate }}</ion-label>
<a [routerLink]="['/schedule/week-overview']">
<ion-icon size="36" weight="300" name="calendar_month"></ion-icon>
<ion-label [innerHTML]="'schedule.recurring' | translate"></ion-label>
</a>
<!-- Avoid structural directives here, they might interfere with the collapse animation -->
<a
[routerLink]="nextEvent?.event ? ['/data-detail', nextEvent!.event.uid] : ['/schedule/recurring']"
[routerLink]="nextEvent ? ['/data-detail', nextEvent!.uid] : ['/schedule/calendar']"
[state]="{item: nextEvent}"
class="schedule-item-button"
>
<ion-label>{{ 'dashboard.schedule.title' | translate }}</ion-label>
<ion-label>
{{
nextEvent?.event
nextEvent
? (nextEvent!.dates | nextDateInList | amDateFormat : 'll, HH:mm')
: ('dashboard.schedule.noEvent' | translate)
}}

View File

@@ -87,7 +87,8 @@ ion-content {
flex-direction: column;
height: auto;
padding: var(--spacing-lg);
min-height: 80px;
padding: var(--spacing-sm);
color: var(--ion-color-primary-contrast);
text-decoration: none;
@@ -104,11 +105,9 @@ ion-content {
flex: 0 0 auto;
gap: var(--spacing-sm);
align-items: center;
justify-content: space-around;
justify-content: center;
box-sizing: content-box;
aspect-ratio: 1;
max-height: 60px;
height: 100%;
text-align: center;
@@ -117,6 +116,7 @@ ion-content {
ion-label {
font-size: var(--font-size-xxs);
font-weight: var(--font-weight-semi-bold);
word-break: break-word;
}
&:hover ::ng-deep stapps-icon {
@@ -134,8 +134,12 @@ ion-content {
}
z-index: 1;
flex: 1 1 65%;
justify-content: center;
padding-inline: var(--spacing-lg);
background: var(--linear-gradient);
ion-label {

View File

@@ -76,7 +76,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
.itemSelectListener()
.pipe(takeUntilDestroyed())
.subscribe(item => {
void this.router.navigate(['data-detail', item.uid]);
void this.router.navigate(['data-detail', item.uid], {state: {item}});
});
}

View File

@@ -18,7 +18,6 @@
<stapps-data-list-item
*ngFor="let dish of dishes"
[hideThumbnail]="true"
[favoriteButton]="false"
[item]="dish"
appearance="square"
></stapps-data-list-item>

View File

@@ -42,6 +42,7 @@ export class ActionChipListComponent {
event:
item.type === SCThingType.AcademicEvent ||
(item.type === SCThingType.DateSeries && (item as SCDateSeries).dates.length > 0),
navigate: ('inPlace' in item && item.inPlace && 'geo' in item.inPlace) || 'geo' in item,
};
}

View File

@@ -14,5 +14,6 @@
-->
<stapps-locate-action-chip *ngIf="applicable.locate" [item]="item"></stapps-locate-action-chip>
<stapps-navigate-action-chip *ngIf="applicable.navigate" [item]="$any(item)"></stapps-navigate-action-chip>
<!-- 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>

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) 2023 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 {Component, Input} from '@angular/core';
import {SCPlaceWithoutReferences, SCThings} from '@openstapps/core';
@Component({
selector: 'stapps-navigate-action-chip',
templateUrl: 'navigate-action-chip.html',
styleUrls: ['navigate-action-chip.scss'],
})
export class NavigateActionChipComponent {
place: SCPlaceWithoutReferences;
@Input({required: true}) set item(value: SCThings) {
if ('geo' in value) {
this.place = value;
} else if ('inPlace' in value && value.inPlace && 'geo' in value.inPlace) {
this.place = value.inPlace;
} else {
console.error('Invalid place', value);
}
}
}

View File

@@ -1,5 +1,5 @@
<!--
~ Copyright (C) 2022 StApps
~ Copyright (C) 2023 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.
@@ -12,15 +12,7 @@
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-header translucent>
<ion-toolbar color="primary" mode="ios">
<ion-title>{{ 'map.modals.single.TITLE' | translate }}</ion-title>
<ion-buttons slot="end">
<ion-button (click)="modalController.dismiss()">{{ 'app.ui.CLOSE' | translate }}</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content>
<stapps-data-detail-content [item]="$any(item)" [openAsModal]="true"></stapps-data-detail-content>
</ion-content>
<ion-chip [color]="'primary'" [outline]="true" [geoNavigation]="place">
<ion-icon name="directions"></ion-icon>
<ion-label>{{'map.directions.TITLE' | translate}}</ion-label>
</ion-chip>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 StApps
/*!
* Copyright (C) 2023 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.
@@ -12,20 +12,3 @@
* 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 {Component, Input} from '@angular/core';
import {SCPlace} from '@openstapps/core';
import {ModalController} from '@ionic/angular';
@Component({
selector: 'app-map-single-modal',
templateUrl: './map-single.html',
styleUrls: ['./map-single.scss'],
})
export class MapSingleModalComponent {
/**
* The item to be shown
*/
@Input() item: SCPlace;
constructor(readonly modalController: ModalController) {}
}

View File

@@ -29,6 +29,7 @@ export const DataIcons: Record<SCThingType, string> = {
'dish': SCIcon`lunch_dining`,
'favorite': SCIcon`favorite`,
'floor': SCIcon`foundation`,
'id card': SCIcon`badge`,
'message': SCIcon`newspaper`,
'organization': SCIcon`business_center`,
'periodical': SCIcon`feed`,

View File

@@ -102,6 +102,8 @@ import {StappsRatingComponent} from './elements/rating.component';
import {DishCharacteristicsComponent} from './types/dish/dish-characteristics.component';
import {SkeletonListComponent} from './list/skeleton-list.component';
import {CertificationsInDetailComponent} from './elements/certifications-in-detail.component';
import {GeoNavigationDirective} from '../map/geo-navigation.directive';
import {NavigateActionChipComponent} from './chips/data/navigate-action-chip.component';
/**
* Module for handling data
@@ -110,6 +112,7 @@ import {CertificationsInDetailComponent} from './elements/certifications-in-deta
declarations: [
ActionChipListComponent,
AddEventActionChipComponent,
NavigateActionChipComponent,
EditEventSelectionComponent,
AddressDetailComponent,
CatalogDetailContentComponent,
@@ -194,6 +197,7 @@ import {CertificationsInDetailComponent} from './elements/certifications-in-deta
TranslateModule.forChild(),
ThingTranslateModule.forChild(),
UtilModule,
GeoNavigationDirective,
],
providers: [
CoordinatedSearchProvider,

View File

@@ -111,8 +111,8 @@ describe('DataDetailComponent', () => {
expect(DataDetailComponent.prototype.getItem).toHaveBeenCalledWith(sampleThing.uid, false);
});
it('should get a data item when the view is entered', () => {
comp.ionViewWillEnter();
it('should get a data item when initialized', () => {
comp.ngOnInit();
expect(DataDetailComponent.prototype.getItem).toHaveBeenCalledWith(sampleThing.uid, false);
});
});

View File

@@ -12,9 +12,9 @@
* 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 {Component, ContentChild, EventEmitter, Input, Output, TemplateRef} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {ModalController, ViewWillEnter} from '@ionic/angular';
import {Component, ContentChild, EventEmitter, Input, OnInit, Output, TemplateRef} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {ModalController} from '@ionic/angular';
import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
import {SCLanguageCode, SCSaveableThing, SCThings, SCUuid} from '@openstapps/core';
import {DataProvider, DataScope} from '../data.provider';
@@ -37,7 +37,7 @@ export interface ExternalDataLoadEvent {
styleUrls: ['data-detail.scss'],
templateUrl: 'data-detail.html',
})
export class DataDetailComponent implements ViewWillEnter {
export class DataDetailComponent implements OnInit {
/**
* The associated item
*
@@ -84,21 +84,20 @@ export class DataDetailComponent implements ViewWillEnter {
return (thing as SCSaveableThing).data !== undefined;
}
/**
*
* @param route the route the page was accessed from
* @param dataProvider the data provider
* @param favoritesService the favorites provider
* @param modalController the modal controller
* @param translateService he translate provider
*/
constructor(
protected readonly route: ActivatedRoute,
router: Router,
private readonly dataProvider: DataProvider,
private readonly favoritesService: FavoritesService,
readonly modalController: ModalController,
translateService: TranslateService,
) {
this.inputItem = router.getCurrentNavigation()?.extras.state?.item;
if (!this.inputItem?.origin) {
// We received a ThingWithoutReferences.
// This can happen, for example, when detail views use `inPlace` list items
delete this.inputItem;
}
this.language = translateService.currentLang as SCLanguageCode;
translateService.onLangChange.subscribe((event: LangChangeEvent) => {
this.language = event.lang as SCLanguageCode;
@@ -138,10 +137,7 @@ export class DataDetailComponent implements ViewWillEnter {
}
}
/**
* Initialize
*/
async ionViewWillEnter() {
async ngOnInit() {
const uid = this.route.snapshot.paramMap.get('uid') || '';
await this.getItem(uid ?? '', false);
// fallback to the saved item (from favorites)

View File

@@ -37,32 +37,22 @@ export class DataPathComponent implements OnInit {
@Input() maxItems = 2;
@Input() set item(item: SCThings) {
// eslint-disable-next-line unicorn/prefer-ternary
if (item.type === SCThingType.Catalog && item.superCatalogs) {
this.path = new Promise(resolve =>
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
resolve([...item.superCatalogs!, item]),
);
this.path = Promise.resolve([...item.superCatalogs!, item]);
} else if (item.type === SCThingType.Assessment && item.superAssessments) {
this.path = new Promise(resolve =>
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
resolve([...item.superAssessments!, item]),
);
this.path = Promise.resolve([...item.superAssessments!, item]);
} else if (
item.type === SCThingType.AcademicEvent &&
item.catalogs &&
(item.catalogs.length === 1 || this.routeStack.lastDataDetail)
) {
const catalogWithoutReferences = item.catalogs[0];
const catalogPromise = (
item.catalogs.length === 1
? this.dataProvider.get(catalogWithoutReferences.uid, DataScope.Remote)
: this.routeStack.lastDataDetail
) as Promise<SCCatalog>;
this.path = new Promise(async resolve => {
const catalog = await catalogPromise;
const superCatalogs = catalog.superCatalogs;
const catalogWithoutReferences = item.catalogs![0];
const catalog =
item.catalogs!.length === 1
? await this.dataProvider.get(catalogWithoutReferences.uid, DataScope.Remote)
: this.routeStack.lastDataDetail;
const superCatalogs = (catalog as SCCatalog).superCatalogs;
resolve(
superCatalogs

View File

@@ -1,3 +1,4 @@
/* eslint-disable unicorn/no-useless-undefined */
/*
* Copyright (C) 2023 StApps
* This program is free software: you can redistribute it and/or modify it
@@ -12,60 +13,51 @@
* 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 {Component, ElementRef, HostListener, Input} from '@angular/core';
import {SCDish, SCRatingRequest, SCUuid} from '@openstapps/core';
import {ChangeDetectionStrategy, Component, ElementRef, HostListener, Input} from '@angular/core';
import {SCDish, SCRatingRequest} from '@openstapps/core';
import {RatingProvider} from '../rating.provider';
import {ratingAnimation} from './rating.animation';
import {BehaviorSubject, filter, merge, mergeMap, of, ReplaySubject, withLatestFrom} from 'rxjs';
import {catchError, map} from 'rxjs/operators';
@Component({
selector: 'stapps-rating',
templateUrl: 'rating.html',
styleUrls: ['rating.scss'],
animations: [ratingAnimation],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class StappsRatingComponent {
rate = false;
performRating = new BehaviorSubject(false);
rated = false;
userRating = new BehaviorSubject<number | undefined>(undefined);
canBeRated = false;
dish = new ReplaySubject<SCDish>(1);
uid: SCUuid;
wasAlreadyRated = merge(
this.dish.pipe(mergeMap(({uid}) => this.ratingProvider.hasRated(uid))),
this.userRating.pipe(
filter(it => it !== undefined),
withLatestFrom(this.dish),
mergeMap(([rating, {uid}]) => this.ratingProvider.rate(uid, rating as SCRatingRequest['rating'])),
map(() => true),
catchError(() => of(false)),
),
);
rating?: number;
canBeRated = this.dish.pipe(mergeMap(dish => this.ratingProvider.canRate(dish)));
@Input() set item(value: SCDish) {
this.uid = value.uid;
Promise.all([this.ratingProvider.canRate(value), this.ratingProvider.hasRated(this.uid)] as const).then(
([canRate, hasRated]) => {
this.canBeRated = canRate;
this.rated = hasRated;
},
);
@Input({required: true}) set item(value: SCDish) {
this.dish.next(value);
}
constructor(readonly elementRef: ElementRef, readonly ratingProvider: RatingProvider) {}
async submitRating(rating: number) {
this.rating = rating;
try {
await this.ratingProvider.rate(this.uid, rating as SCRatingRequest['rating']);
this.rated = true;
} catch {
this.rating = undefined;
// allow change detection to catch up first
setTimeout(() => {
this.rate = false;
});
}
}
@HostListener('document:mousedown', ['$event'])
clickOutside(event: MouseEvent) {
if (this.rating) return;
if (this.userRating.value) return;
if (!this.elementRef.nativeElement.contains(event.target)) {
this.rate = false;
this.performRating.next(false);
}
}
}

View File

@@ -14,19 +14,23 @@
-->
<ion-button
*ngIf="canBeRated"
*ngIf="canBeRated | async"
fill="clear"
(click)="$event.stopPropagation(); rate = true"
[disabled]="rated"
(click)="$event.stopPropagation(); performRating.next(true)"
[disabled]="wasAlreadyRated | async"
>
<ion-icon slot="icon-only" color="medium" name="thumbs_up_down"></ion-icon>
</ion-button>
<div class="rating-stars" *ngIf="rate && !rated" [@rating]="rating ? 'rated' : 'abandoned'">
<div
class="rating-stars"
*ngIf="(performRating | async) && (wasAlreadyRated | async) !== true"
[@rating]="(userRating | async) === undefined ? 'abandoned' : 'rated'"
>
<ion-icon
[class.rated-value]="rating === i"
[class.rated-value]="(userRating | async) === i"
*ngFor="let i of [5, 4, 3, 2, 1]"
(click)="$event.stopPropagation(); submitRating(i)"
(click)="$event.stopPropagation(); userRating.next(i)"
slot="icon-only"
size="32"
color="medium"

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