Compare commits

...

9 Commits

145 changed files with 3020 additions and 894 deletions

View File

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

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': minor
---
Detail views now won't load data again if it is being navigated to from a list item

View File

@@ -1,11 +0,0 @@
---
'@openstapps/app': patch
---
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

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,5 +0,0 @@
---
'@openstapps/app': patch
---
Use observable chains instead of change detection in the rating component

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,5 +0,0 @@
---
'@openstapps/app': minor
---
Added the ability to remove and add date series from their detail page

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': patch
---
Add a way to hide action chips on list items

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,5 +0,0 @@
---
'@openstapps/app': minor
---
Add directions to inPlace and place list items

View File

@@ -1,9 +0,0 @@
---
'@openstapps/app': minor
---
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

View File

@@ -1,68 +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/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",
"@openstapps/app-builder-image": "3.0.0-next.3",
"@openstapps/node-base": "3.0.0-next.3",
"@openstapps/node-builder": "3.0.0-next.3"
},
"changesets": [
"bright-dryers-act",
"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",
"pretty-timers-complain",
"proud-wolves-end",
"quick-houses-count",
"rare-squids-bake",
"serious-meals-sin",
"silent-maps-float",
"silly-news-punch",
"smart-ghosts-shout",
"soft-donuts-fail",
"sour-coins-visit",
"spicy-snails-sort",
"stale-garlics-share",
"strange-hounds-repair",
"tall-ducks-dream",
"tame-mayflies-hug",
"tame-rings-dream",
"tasty-islands-smell",
"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,13 +0,0 @@
---
'@openstapps/app': minor
---
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.

View File

@@ -1,8 +0,0 @@
---
'@openstapps/app': minor
---
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

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,29 +0,0 @@
---
'@openstapps/projectmanagement': patch
'@openstapps/prettier-config': 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,5 +0,0 @@
---
'@openstapps/app': patch
---
Fixed an issue that caused double and triple loading of data detail items through the route stack service

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/app': minor
---
Map items are now native list items

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

@@ -1,5 +0,0 @@
---
'@openstapps/app': minor
---
Replaced simple links with list items in date-series detail

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': minor
---
Use event title for date series instead of the generic date series title

View File

@@ -1,5 +1,158 @@
# @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

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.4",
"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

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

View File

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

View File

@@ -1,5 +1,101 @@
# @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

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.4",
"version": "3.0.0",
"private": true,
"type": "module",
"license": "AGPL-3.0-only",

View File

@@ -1,5 +1,74 @@
# @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

View File

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

View File

@@ -1,5 +1,91 @@
# @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

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.4",
"version": "3.0.0",
"type": "commonjs",
"license": "GPL-3.0-only",
"repository": "git@gitlab.com:openstapps/eslint-config.git",

View File

@@ -1,5 +1,84 @@
# @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

View File

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

View File

@@ -1,5 +1,126 @@
# @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

View File

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

View File

@@ -1,5 +1,74 @@
# @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

View File

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

View File

@@ -1,5 +1,123 @@
# @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

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.4",
"version": "3.0.0",
"private": true,
"type": "module",
"license": "GPL-3.0-only",

View File

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

View File

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

View File

@@ -1,5 +1,129 @@
# @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

View File

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

View File

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

View File

@@ -1,5 +1,145 @@
# @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

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

@@ -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.4",
"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\"",
@@ -92,7 +93,6 @@
"capacitor-secure-storage-plugin": "0.8.1",
"cordova-plugin-calendar": "5.1.6",
"date-fns": "2.30.0",
"ngx-date-fns": "10.0.1",
"deepmerge": "4.3.1",
"form-data": "4.0.0",
"geojson": "0.5.0",
@@ -102,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",

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;
@@ -135,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

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

@@ -93,6 +93,11 @@ export class DataDetailComponent implements OnInit {
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;

View File

@@ -228,10 +228,6 @@ export class SearchPageComponent implements OnInit {
this.updateContextFilter(result.facets);
this.items = Promise.resolve(result.data);
}
this.items.then(it => {
if (it.length === result.pagination.total) console.log('final page loaded');
});
} catch (error) {
this.logger.error(error);
} finally {

View File

@@ -12,10 +12,11 @@
* 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 {ChangeDetectionStrategy, Component, Input} from '@angular/core';
import {PositionService} from '../../../map/position.service';
import {interval, Subscription} from 'rxjs';
import {Observable, timer} from 'rxjs';
import {hasValidLocation, isSCFloor, PlaceTypes, PlaceTypesWithDistance} from './place-types';
import {map} from 'rxjs/operators';
/**
* Shows a place as a list item
@@ -24,14 +25,10 @@ import {hasValidLocation, isSCFloor, PlaceTypes, PlaceTypesWithDistance} from '.
selector: 'stapps-place-list-item',
templateUrl: 'place-list-item.html',
styleUrls: ['place-list-item.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class PlaceListItemComponent {
/**
* Item getter
*/
get item(): PlaceTypesWithDistance {
return this._item;
}
_item: PlaceTypesWithDistance;
/**
* An item to show (setter is used as there were issues assigning the distance to the right place in a list)
@@ -39,24 +36,14 @@ export class PlaceListItemComponent {
@Input() set item(item: PlaceTypes) {
this._item = item;
if (!isSCFloor(item) && hasValidLocation(item)) {
this.distance = this.positionService.getDistance(item.geo.point);
this.distanceSubscription = interval(10_000).subscribe(_ => {
this.distance = this.positionService.getDistance(item.geo.point);
});
this.distance = timer(0, 10_000).pipe(map(() => this.positionService.getDistance(item.geo.point)));
}
}
/**
* An item to show
*/
private _item: PlaceTypesWithDistance;
/**
* Distance in meters
*/
distance?: number;
distanceSubscription?: Subscription;
distance?: Observable<number | undefined>;
constructor(private positionService: PositionService) {}
}

View File

@@ -17,17 +17,17 @@
<ion-row>
<ion-col>
<div class="ion-text-wrap">
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
<ng-container *ngIf="item.type !== 'floor'">
<p class="title-sub" *ngIf="item.openingHours">
<ion-label class="title">{{ 'name' | thingTranslate: _item }}</ion-label>
<ng-container *ngIf="_item.type !== 'floor'">
<p class="title-sub" *ngIf="_item.openingHours">
<span>
<stapps-opening-hours [openingHours]="item.openingHours"></stapps-opening-hours>
<stapps-opening-hours [openingHours]="_item.openingHours"></stapps-opening-hours>
</span>
</p>
<p>
<ion-note *ngIf="item.categories && item.type !== 'building'; else onlyType">
<ion-label> {{ 'categories' | thingTranslate: item | join: ', ' | titlecase }} </ion-label>
<ion-label *ngIf="distance" class="distance">
<ion-note *ngIf="_item.categories && _item.type !== 'building'; else onlyType">
<ion-label> {{ 'categories' | thingTranslate: _item | join: ', ' | titlecase }} </ion-label>
<ion-label *ngIf="distance | async as distance" class="distance">
<ion-icon name="directions_walk"></ion-icon>
{{ distance | metersLocalized }}
</ion-label>
@@ -35,21 +35,21 @@
</p>
<ng-template #onlyType>
<ion-note>
<ion-label> {{ 'type' | thingTranslate: item | titlecase }} </ion-label>
<ion-label *ngIf="distance" class="distance">
<ion-label> {{ 'type' | thingTranslate: _item | titlecase }} </ion-label>
<ion-label *ngIf="distance | async as distance" class="distance">
<ion-icon name="directions_walk"></ion-icon>
{{ distance | metersLocalized }}
</ion-label>
</ion-note>
</ng-template>
</ng-container>
<p *ngIf="item.description">{{ 'description' | thingTranslate: item }}</p>
<p *ngIf="_item.description">{{ 'description' | thingTranslate: _item }}</p>
</div>
</ion-col>
<ng-container *ngIf="item.type !== 'building'">
<ion-col size="auto" class="in-place" *ngIf="item.inPlace">
<ng-container *ngIf="_item.type !== 'building'">
<ion-col size="auto" class="in-place" *ngIf="_item.inPlace">
<ion-icon name="pin_drop"></ion-icon
><ion-label>{{ 'name' | thingTranslate: item.inPlace }}</ion-label>
><ion-label>{{ 'name' | thingTranslate: _item.inPlace }}</ion-label>
</ion-col>
</ng-container>
</ion-row>

View File

@@ -105,11 +105,9 @@ export class PositionService {
subscriber.next(this.position);
}
});
watcherID.then(console.log);
return {
unsubscribe() {
watcherID.then(id => {
console.log(id);
void Geolocation.clearWatch({id});
});
},

View File

@@ -0,0 +1,29 @@
import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
import {SCIdCard} from '@openstapps/core';
import {FullScreenImageDirective} from '../../util/full-screen-image.directive';
import {ThingTranslateModule} from '../../translation/thing-translate.module';
import {AsyncPipe, NgIf, TitleCasePipe} from '@angular/common';
import {InRangeNowPipe, ToDateRangePipe} from '../../util/in-range.pipe';
import {TranslateModule} from '@ngx-translate/core';
@Component({
selector: 'stapps-id-card',
templateUrl: 'id-card.html',
styleUrls: ['id-card.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
hostDirectives: [FullScreenImageDirective],
imports: [
FullScreenImageDirective,
ThingTranslateModule,
NgIf,
InRangeNowPipe,
ToDateRangePipe,
AsyncPipe,
TranslateModule,
TitleCasePipe,
],
})
export class IdCardComponent {
@Input({required: true}) item: SCIdCard;
}

View File

@@ -0,0 +1,4 @@
<img [src]="item.image" [alt]="'name' | thingTranslate : item" draggable="false" />
<div *ngIf="item.validity && (item.validity | toDateRange | isInRangeNow | async) === false" class="expired">
{{ 'profile.userInfo.expired' | translate | titlecase }}
</div>

View File

@@ -0,0 +1,34 @@
:host {
position: relative;
overflow: hidden;
}
:host:fullscreen {
margin: 0;
padding: 0;
}
img {
border-radius: 3mm;
}
.expired {
position: absolute;
top: 48px;
left: 48px;
transform-origin: center;
translate: -50% -50%;
rotate: -45deg;
display: flex;
align-items: center;
justify-content: center;
width: 256px;
padding: var(--spacing-xs);
font-weight: bold;
color: var(--ion-color-danger-contrast);
background: var(--ion-color-danger);
}

View File

@@ -0,0 +1,51 @@
/*
* 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 {ChangeDetectionStrategy, Component} from '@angular/core';
import {IdCardsProvider} from './id-cards.provider';
import {SCIdCard} from '@openstapps/core';
import {IonicModule} from '@ionic/angular';
import {AsyncPipe, NgForOf, NgIf, TitleCasePipe} from '@angular/common';
import {ThingTranslateModule} from '../../translation/thing-translate.module';
import {UtilModule} from '../../util/util.module';
import {FullScreenImageDirective} from '../../util/full-screen-image.directive';
import {IdCardComponent} from './id-card.component';
import {TranslateModule} from '@ngx-translate/core';
import {Observable} from 'rxjs';
@Component({
selector: 'stapps-id-cards',
templateUrl: 'id-cards.html',
styleUrls: ['id-cards.scss'],
providers: [IdCardsProvider],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
IonicModule,
NgForOf,
NgIf,
AsyncPipe,
ThingTranslateModule,
UtilModule,
FullScreenImageDirective,
IdCardComponent,
TranslateModule,
TitleCasePipe,
],
})
export class IdCardsComponent {
idCards: Observable<SCIdCard[]> = this.idCardsProvider.getIdCards();
constructor(readonly idCardsProvider: IdCardsProvider) {}
}

View File

@@ -0,0 +1,25 @@
<!--
~ 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/>.
-->
<stapps-section buttonColor="primary-contrast">
<simple-swiper *ngIf="idCards | async as idCards">
<div *ngIf="idCards.length === 0">
<div class="log-in">
{{'profile.userInfo.logInPrompt' | translate | sentencecase}}
<ion-icon name="person" fill="true"></ion-icon>
</div>
</div>
<stapps-id-card *ngFor="let idCard of idCards" [item]="idCard"></stapps-id-card>
</simple-swiper>
</stapps-section>

View File

@@ -0,0 +1,74 @@
import {Injectable} from '@angular/core';
import {SCIdCard, SCThingOriginType, SCThingType, SCUserConfiguration} from '@openstapps/core';
import {from, Observable, of} from 'rxjs';
import {AuthHelperService} from '../auth/auth-helper.service';
import {mergeMap, filter, map, startWith} from 'rxjs/operators';
import {ConfigProvider} from '../config/config.provider';
import {HttpClient} from '@angular/common/http';
@Injectable({providedIn: 'root'})
export class IdCardsProvider {
constructor(
private authHelper: AuthHelperService,
private config: ConfigProvider,
private httpClient: HttpClient,
) {}
getIdCards(): Observable<SCIdCard[]> {
const feature = this.config.config.app.features.extern?.['idCards'];
const auth = this.authHelper.getProvider(feature?.authProvider ?? 'default');
return auth.isAuthenticated$.pipe(
mergeMap(isAuthenticated =>
isAuthenticated
? feature
? from(auth.getValidToken()).pipe(
mergeMap(token => this.fetchIdCards(feature.url, token.accessToken)),
)
: auth.user$.pipe(
filter(user => user !== undefined),
map(userInfo => this.authHelper.getUserFromUserInfo(userInfo as object)),
mergeMap(user => this.fetchFallbackIdCards(user)),
startWith([]),
)
: // TODO: find a better solution here (async pipe stuff...)
of([]),
),
);
}
private fetchIdCards(url: string, token: string): Observable<SCIdCard[]> {
// eslint-disable-next-line unicorn/no-null
return this.httpClient.post(url, null, {
headers: {
Authorization: `Bearer: ${token}`,
},
responseType: 'json',
}) as Observable<SCIdCard[]>;
}
private fetchFallbackIdCards(user: SCUserConfiguration): Observable<SCIdCard[]> {
return this.httpClient.get('/assets/examples/student-id.sample.svg', {responseType: 'text'}).pipe(
map(svg => {
let result = svg;
for (const key in user) {
result = result.replaceAll(`{{${key}}}`, (user as unknown as Record<string, string>)[key]);
}
return `data:image/svg+xml;utf8,${encodeURIComponent(result)}`;
}),
map(image => [
{
name: 'Student ID',
image,
type: SCThingType.IdCard,
uid: '1234',
origin: {
name: 'Sample Origin',
type: SCThingOriginType.Remote,
indexed: new Date().toISOString(),
},
},
]),
);
}
}

View File

@@ -0,0 +1,52 @@
/*
* 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/>.
*/
:host {
display: contents;
}
simple-swiper {
--swiper-slide-width: calc(min(90cqw, 12cm));
filter: drop-shadow(0 0 16px rgba(0 0 0 / 10%));
}
.log-in {
position: relative;
display: flex;
align-items: flex-end;
justify-content: center;
height: calc(min(90cqw, 12cm) * (53.98 / 85.6));
padding: var(--spacing-xxl);
color: var(--ion-color-medium);
background: var(--ion-color-light);
border-radius: 3mm;
outline: 1px dashed var(--ion-color-medium);
outline-offset: calc(-1 * var(--spacing-sm));
> ion-icon {
position: absolute;
top: 0;
left: 0;
font-size: calc(min(90cqw, 12cm) / 2);
opacity: 0.1;
}
}

View File

@@ -0,0 +1,65 @@
import {ConfigProvider} from '../config/config.provider';
import {IdCardsProvider} from './id-cards.provider';
import {HttpClient} from '@angular/common/http';
import {AuthHelperService} from '../auth/auth-helper.service';
import {BehaviorSubject, firstValueFrom, of} from 'rxjs';
import {SCAuthorizationProviderType} from '@openstapps/core';
class FakeAuth {
isAuthenticated$ = new BehaviorSubject(false);
// eslint-disable-next-line @typescript-eslint/no-empty-function
getValidToken() {}
}
describe('IdCards', () => {
let configProvider: ConfigProvider;
let httpClient: HttpClient;
let authHelper: AuthHelperService;
let fakeAuth: FakeAuth;
beforeEach(() => {
configProvider = jasmine.createSpyObj('ConfigProvider', ['config']);
configProvider.config = {
app: {features: {extern: {idCards: {url: 'http://id-cards.local', authProvider: 'fakeAuth'}}}},
} as never;
httpClient = jasmine.createSpyObj('HttpClient', ['post']);
fakeAuth = new FakeAuth();
authHelper = jasmine.createSpyObj('AuthHelperService', ['getProvider']);
authHelper.getProvider = jasmine.createSpy().and.returnValue(fakeAuth);
});
it('should emit undefined if not logged in', async () => {
const provider = new IdCardsProvider(authHelper, configProvider, httpClient);
expect(await firstValueFrom(provider.getIdCards())).toEqual([]);
expect(authHelper.getProvider).toHaveBeenCalledOnceWith('fakeAuth' as SCAuthorizationProviderType);
});
it('should emit network result when logged in', async () => {
fakeAuth.isAuthenticated$.next(true);
httpClient.post = jasmine.createSpy().and.returnValue(of(['abc']));
fakeAuth.getValidToken = jasmine.createSpy().and.resolveTo({accessToken: 'fake-token'});
const provider = new IdCardsProvider(authHelper, configProvider, httpClient);
expect(await firstValueFrom(provider.getIdCards())).toEqual(['abc' as never]);
expect(authHelper.getProvider).toHaveBeenCalledOnceWith('fakeAuth' as SCAuthorizationProviderType);
// eslint-disable-next-line unicorn/no-null
expect(httpClient.post).toHaveBeenCalledOnceWith('http://id-cards.local', null, {
headers: {
Authorization: 'Bearer: fake-token',
},
responseType: 'json',
});
});
it('should react to logins', async () => {
const provider = new IdCardsProvider(authHelper, configProvider, httpClient);
const observable = provider.getIdCards();
expect(await firstValueFrom(observable)).toEqual([]);
httpClient.post = jasmine.createSpy().and.returnValue(of(['abc']));
fakeAuth.getValidToken = jasmine.createSpy().and.resolveTo({accessToken: 'fake-token'});
fakeAuth.isAuthenticated$.next(true);
// this is counter-intuitive, but because we unsubscribed above the first value
// will now contain the network result.
expect(await firstValueFrom(observable)).toEqual(['abc' as never]);
});
});

View File

@@ -1,3 +1,17 @@
<!--
~ 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/>.
-->
<ion-accordion-group *ngIf="myCourses | async as myCourses" [value]="myCourses[0][0]">
<ion-accordion
*ngFor="let myCoursesDay of myCourses"

View File

@@ -14,11 +14,10 @@
*/
import {Component} from '@angular/core';
import {AuthHelperService} from '../../auth/auth-helper.service';
import {SCAuthorizationProviderType, SCUserConfiguration} from '@openstapps/core';
import {SCAuthorizationProviderType} from '@openstapps/core';
import {ActivatedRoute} from '@angular/router';
import {ScheduleProvider} from '../../calendar/schedule.provider';
import {profilePageSections} from '../../../../config/profile-page-sections';
import {filter, map} from 'rxjs/operators';
@Component({
selector: 'app-home',
@@ -26,19 +25,8 @@ import {filter, map} from 'rxjs/operators';
styleUrls: ['profile-page.scss'],
})
export class ProfilePageComponent {
user$ = this.authHelper.getProvider('default').user$.pipe(
filter(user => user !== undefined),
map(userInfo => {
return this.authHelper.getUserFromUserInfo(userInfo as object);
}),
);
sections = profilePageSections;
logins: SCAuthorizationProviderType[] = [];
userInfo?: SCUserConfiguration;
constructor(
readonly authHelper: AuthHelperService,
readonly activatedRoute: ActivatedRoute,
@@ -53,7 +41,6 @@ export class ProfilePageComponent {
async signOut(providerType: SCAuthorizationProviderType) {
await this.authHelper.getProvider(providerType).signOut();
this.userInfo = undefined;
}
ionViewWillEnter() {

View File

@@ -23,48 +23,7 @@
</ion-header>
<ion-content color="light" parallax [parallaxSize]="130">
<ion-card class="user-card">
<ion-card-header>
<ion-img src="assets/imgs/header.svg"></ion-img>
<span *ngIf="user$ | async as userInfo">
{{ userInfo.role ? (userInfo?.role | titlecase) : ('profile.role_guest' | translate | titlecase) }}
</span>
</ion-card-header>
<ion-card-content>
<ion-img class="profile-card-img" src="assets/imgs/profile-card-head.svg"></ion-img>
<ion-grid>
<ion-row>
<ion-col size="3"></ion-col>
<ion-col
*ngIf="authHelper.getProvider('default').isAuthenticated$ | async as loggedIn; else logInPrompt"
size="9"
class="main-info"
>
<ng-container *ngIf="user$ | async as userInfo">
<ion-text class="full-name"> {{ userInfo?.name }} </ion-text>
<div class="matriculation-number">
<ion-label> {{ 'profile.userInfo.studentId' | translate | uppercase }} </ion-label>
<ion-text> {{ userInfo?.studentId }} </ion-text>
</div>
<div class="user-name">
<ion-label> {{ 'profile.userInfo.username' | translate | uppercase }} </ion-label>
<ion-text>{{ userInfo?.id }}</ion-text>
</div>
<div class="email">
<ion-label> {{ 'profile.userInfo.email' | translate | uppercase }} </ion-label>
<ion-text> {{ userInfo?.email }} </ion-text>
</div>
</ng-container>
</ion-col>
<ng-template #logInPrompt>
<ion-col size="9">
<ion-text class="log-in-prompt"> {{ 'profile.userInfo.logInPrompt' | translate }} </ion-text>
</ion-col>
</ng-template>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
<stapps-id-cards></stapps-id-cards>
<stapps-profile-page-section
*ngFor="let section of sections"
[item]="section"

View File

@@ -12,106 +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/>.
*/
// TODO: clean up this mess
.user-card {
position: relative;
max-width: 400px;
margin: var(--spacing-xl);
border-radius: var(--border-radius-default);
box-shadow: var(--shadow-profile-card);
ion-card-header {
--background: var(--ion-color-tertiary);
display: flex;
align-items: center;
padding-top: var(--spacing-sm);
padding-bottom: var(--spacing-sm);
ion-img {
display: block;
height: 36px;
margin-right: auto;
object-position: left 50%;
}
span {
padding-top: 3px;
font-size: var(--font-size-lg);
font-weight: var(--font-weight-bold);
line-height: 1;
color: var(--ion-color-light);
}
}
ion-card-content {
min-height: 15vh;
.profile-card-img {
position: absolute;
width: 50%;
height: 100%;
margin-left: calc(var(--spacing-md) * -4);
opacity: 0.13;
object-position: left bottom;
}
.main-info {
display: grid;
grid-template-areas:
'fullName fullName'
'matriculationNumber userName'
'email email';
ion-label {
display: block;
font-size: var(--font-size-sm);
font-weight: var(--font-weight-bold);
color: var(--ion-color-medium-shade);
}
ion-text {
display: block;
font-size: var(--font-size-md);
font-weight: var(--font-weight-bold);
color: var(--ion-color-text);
}
.full-name {
display: block;
grid-area: fullName;
margin-bottom: var(--spacing-sm);
font-size: var(--font-size-lg);
font-weight: var(--font-weight-bold);
}
.matriculation-number {
grid-area: matriculationNumber;
margin-bottom: var(--spacing-sm);
}
.user-name {
grid-area: userName;
margin-bottom: var(--spacing-sm);
}
.email {
grid-area: email;
}
}
.log-in-prompt {
margin: auto 0;
font-size: var(--font-size-lg);
font-weight: var(--font-weight-semi-bold);
color: var(--ion-color-text);
}
}
}

View File

@@ -27,6 +27,7 @@ import {ThingTranslateModule} from '../../translation/thing-translate.module';
import {DataModule} from '../data/data.module';
import {MyCoursesComponent} from './page/my-courses.component';
import {MomentModule} from 'ngx-moment';
import {IdCardsComponent} from './id-cards.component';
const routes: Routes = [
{
@@ -49,6 +50,7 @@ const routes: Routes = [
ThingTranslateModule,
DataModule,
MomentModule,
IdCardsComponent,
],
})
export class ProfilePageModule {}

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