Compare commits

...

3 Commits

Author SHA1 Message Date
Rainer Killinger
622481a3c9 docs: update changelogs for release\n\nci: publish release 2024-03-28 14:27:56 +01:00
Thea Schöbl
1ab5c0c355 fix: inPlace in list items is placed weird 2024-03-27 13:45:22 +00:00
Rainer Killinger
b0f6ffb21c refactor: ajdust app environment to backend version >= v3.1.0 2024-03-27 10:11:32 +01:00
52 changed files with 387 additions and 419 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,14 @@
# @openstapps/minimal-connector
## 3.2.0
### Patch Changes
- Updated dependencies [912ae422]
- @openstapps/core@4.0.0
- @openstapps/api@4.0.0
- @openstapps/logger@3.0.0
## 3.1.1
### 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.1.1",
"version": "3.2.0",
"private": true,
"type": "module",
"license": "GPL-3.0-only",

View File

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

View File

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

View File

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

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.1.2",
"version": "3.2.0",
"private": true,
"license": "GPL-3.0-only",
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",

View File

@@ -12,109 +12,94 @@
* 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, OnInit} from '@angular/core';
import {MapPosition} from '../../map/position.service';
import {SearchPageComponent} from './search-page.component';
import {Component} from '@angular/core';
import {PositionService} from '../../map/position.service';
import {Geolocation} from '@capacitor/geolocation';
import {BehaviorSubject} from 'rxjs';
import {BehaviorSubject, catchError} from 'rxjs';
import {pauseWhen} from '../../../util/rxjs/pause-when';
import {SCSearchFilter} from '@openstapps/core';
import {ContextMenuService} from '../../menu/context/context-menu.service';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
/**
* Presents a list of places for eating/drinking
*/
@Component({
templateUrl: 'search-page.html',
styleUrls: ['../../data/list/search-page.scss'],
templateUrl: 'food-data-list.html',
})
export class FoodDataListComponent extends SearchPageComponent implements OnInit {
title = 'canteens.title';
showNavigation = false;
export class FoodDataListComponent {
isNotInView$ = new BehaviorSubject(true);
/**
* Sets the forced filter to present only places for eating/drinking
*/
ngOnInit() {
this.positionService
.watchCurrentLocation({enableHighAccuracy: false, maximumAge: 1000})
.pipe(pauseWhen(this.isNotInView$), takeUntilDestroyed(this.destroy$))
.subscribe({
next: (position: MapPosition) => {
this.positionService.position = position;
forcedFilter: SCSearchFilter = {
arguments: {
filters: [
{
arguments: {
field: 'categories',
value: 'canteen',
},
type: 'value',
},
error: async _error => {
this.positionService.position = undefined;
{
arguments: {
field: 'categories',
value: 'student canteen',
},
type: 'value',
},
{
arguments: {
field: 'categories',
value: 'cafe',
},
type: 'value',
},
{
arguments: {
field: 'categories',
value: 'restaurant',
},
type: 'value',
},
],
operation: 'or',
},
type: 'boolean',
};
constructor(positionService: PositionService, contextMenuService: ContextMenuService) {
positionService
.watchCurrentLocation({enableHighAccuracy: false, maximumAge: 1000})
.pipe(
pauseWhen(this.isNotInView$),
takeUntilDestroyed(),
catchError(async _error => {
await Geolocation.checkPermissions();
}),
)
.subscribe({
next(position) {
if (!position) return;
positionService.position = position;
contextMenuService.sortQuery.next([
{
type: 'distance',
order: 'asc',
arguments: {
field: 'geo',
position: [position.longitude, position.latitude],
},
},
]);
},
async error() {
positionService.position = undefined;
await Geolocation.checkPermissions();
},
});
this.showDefaultData = true;
this.sortQuery = [
{
arguments: {field: 'name'},
order: 'asc',
type: 'ducet',
},
];
this.forcedFilter = {
arguments: {
filters: [
{
arguments: {
field: 'categories',
value: 'canteen',
},
type: 'value',
},
{
arguments: {
field: 'categories',
value: 'student canteen',
},
type: 'value',
},
{
arguments: {
field: 'categories',
value: 'cafe',
},
type: 'value',
},
{
arguments: {
field: 'categories',
value: 'restaurant',
},
type: 'value',
},
],
operation: 'or',
},
type: 'boolean',
};
if (this.positionService.position) {
this.sortQuery = [
{
type: 'distance',
order: 'asc',
arguments: {
field: 'geo',
position: [this.positionService.position.longitude, this.positionService.position.latitude],
},
},
];
}
super.ngOnInit();
}
async ionViewWillEnter() {
await super.ionViewWillEnter();
ionViewWillEnter() {
this.isNotInView$.next(false);
}

View File

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

View File

@@ -55,17 +55,18 @@ export class SearchPageComponent implements OnInit {
@Input() backUrl?: string;
isHebisAvailable = false;
/**
* Signalizes that the data is being loaded
*/
loading = false;
/**
* Display the navigation between default and library search
* Navigation elements between search pages
*/
@Input() showNavigation = true;
@Input() navigation: Array<{label: string; routerLink?: string[]}> = [
{label: 'search.type'},
{label: 'hebisSearch.type', routerLink: ['/hebis-search']},
];
/**
* Show default data (e.g. when there is user interaction)
@@ -82,6 +83,8 @@ export class SearchPageComponent implements OnInit {
*/
@Input() showTopToolbar = true;
@Input() showContextMenu = true;
/**
* Api query filter
*/
@@ -110,7 +113,7 @@ export class SearchPageComponent implements OnInit {
/**
* Page size of queries
*/
pageSize = 30;
@Input() pageSize = 30;
/**
* Search value from search bar
@@ -343,8 +346,13 @@ export class SearchPageComponent implements OnInit {
});
}
try {
const features = this.configProvider.getValue('features') as SCFeatureConfiguration;
this.isHebisAvailable = !!features.plugins?.['hebis-plugin']?.urlPath;
// TODO: make this hack more generic
if (this.navigation[1]?.routerLink?.[0] === '/hebis-search') {
const features = this.configProvider.getValue('features') as SCFeatureConfiguration;
if (features.plugins?.['hebis-plugin']?.urlPath === undefined) {
this.navigation = [];
}
}
} catch (error) {
this.logger.error(error);
}

View File

@@ -13,7 +13,9 @@
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<stapps-context contentId="data-list"></stapps-context>
@if (showContextMenu) {
<stapps-context contentId="data-list"></stapps-context>
}
<ion-header>
@if (showDrawer && showTopToolbar) {
<ion-toolbar color="primary" mode="ios">
@@ -37,23 +39,30 @@
class="filterable"
[autofocus]="!showDefaultData"
>
<ion-menu-button menu="context" auto-hide="false">
<ion-icon name="tune"></ion-icon>
</ion-menu-button>
@if (showContextMenu) {
<ion-menu-button menu="context" auto-hide="false">
<ion-icon name="tune"></ion-icon>
</ion-menu-button>
}
</ion-searchbar>
</ion-toolbar>
@if (showNavigation && isHebisAvailable) {
@if (navigation.length > 0) {
<ion-toolbar color="primary" class="category-tab">
<ion-buttons class="ion-justify-content-between">
<ion-button class="button-active" size="large">{{ 'search.type' | translate }}</ion-button>
<ion-button
[routerLink]="['/hebis-search']"
queryParamsHandling="merge"
[routerAnimation]="routeAnimation"
fill="outline"
size="large"
>{{ 'hebisSearch.type' | translate }}
</ion-button>
@for (target of navigation; track target) {
@if (target.routerLink) {
<ion-button
[routerLink]="target.routerLink"
queryParamsHandling="merge"
[routerAnimation]="routeAnimation"
fill="outline"
size="large"
>{{ target.label | translate }}
</ion-button>
} @else {
<ion-button class="button-active" size="large">{{ target.label | translate }}</ion-button>
}
}
</ion-buttons>
</ion-toolbar>
}

View File

@@ -22,6 +22,9 @@
ion-toolbar {
--ion-color-base: none !important;
// account for back button
min-height: 42px;
}
ion-toolbar:first-of-type {

View File

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

View File

@@ -13,26 +13,20 @@
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
<ion-row>
<ion-col>
<h2 class="name">{{ 'name' | thingTranslate: item }}</h2>
<p>
@for (author of item.authors; track author) {
{{ 'name' | thingTranslate: author }}
}
@if (item.authors && item.authors && item.firstPublished) {
,&nbsp;
}
@if (item.firstPublished && !item.lastPublished) {
{{ item.firstPublished }}
} @else {
@if (item.firstPublished && item.lastPublished) {
{{ [item.firstPublished, item.lastPublished] | join: ' - ' }}
}
}
</p>
<ion-note> {{ 'categories' | thingTranslate: item }} </ion-note>
</ion-col>
</ion-row>
</ion-grid>
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
<p class="title-sub">
@for (author of item.authors; track author) {
{{ 'name' | thingTranslate: author }}
}
@if (item.authors && item.authors && item.firstPublished) {
,&nbsp;
}
@if (item.firstPublished && !item.lastPublished) {
{{ item.firstPublished }}
} @else {
@if (item.firstPublished && item.lastPublished) {
{{ [item.firstPublished, item.lastPublished] | join: ' - ' }}
}
}
</p>
<ion-note> {{ 'categories' | thingTranslate: item }} </ion-note>

View File

@@ -0,0 +1,3 @@
p.title-sub {
white-space: unset;
}

View File

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

View File

@@ -13,26 +13,20 @@
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
<ion-row>
<ion-col>
<h2 class="name">{{ 'name' | thingTranslate: item }}</h2>
<p>
@for (author of item.authors; track author) {
{{ 'name' | thingTranslate: author }}
}
@if (item.authors && item.authors && item.firstPublished) {
,&nbsp;
}
@if (item.firstPublished && !item.lastPublished) {
{{ item.firstPublished }}
} @else {
@if (item.firstPublished && item.lastPublished) {
{{ [item.firstPublished, item.lastPublished] | join: ' - ' }}
}
}
</p>
<ion-note> {{ 'categories' | thingTranslate: item }} </ion-note>
</ion-col>
</ion-row>
</ion-grid>
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
<p class="title-sub">
@for (author of item.authors; track author) {
{{ 'name' | thingTranslate: author }}
}
@if (item.authors && item.authors && item.firstPublished) {
,&nbsp;
}
@if (item.firstPublished && !item.lastPublished) {
{{ item.firstPublished }}
} @else {
@if (item.firstPublished && item.lastPublished) {
{{ [item.firstPublished, item.lastPublished] | join: ' - ' }}
}
}
</p>
<ion-note> {{ 'categories' | thingTranslate: item }} </ion-note>

View File

@@ -0,0 +1,3 @@
p.title-sub {
white-space: unset;
}

View File

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

View File

@@ -13,26 +13,20 @@
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
<ion-row>
<ion-col>
<h2 class="name">{{ 'name' | thingTranslate: item }}</h2>
<p>
@for (author of item.authors; track author) {
{{ 'name' | thingTranslate: author }}
}
@if (item.authors && item.authors && item.firstPublished) {
,&nbsp;
}
@if (item.firstPublished && !item.lastPublished) {
{{ item.firstPublished }}
} @else {
@if (item.firstPublished && item.lastPublished) {
{{ [item.firstPublished, item.lastPublished] | join: ' - ' }}
}
}
</p>
<ion-note> {{ 'categories' | thingTranslate: item }} </ion-note>
</ion-col>
</ion-row>
</ion-grid>
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
<p class="title-sub">
@for (author of item.authors; track author) {
{{ 'name' | thingTranslate: author }}
}
@if (item.authors && item.authors && item.firstPublished) {
,&nbsp;
}
@if (item.firstPublished && !item.lastPublished) {
{{ item.firstPublished }}
} @else {
@if (item.firstPublished && item.lastPublished) {
{{ [item.firstPublished, item.lastPublished] | join: ' - ' }}
}
}
</p>
<ion-note> {{ 'categories' | thingTranslate: item }} </ion-note>

View File

@@ -0,0 +1,3 @@
p.title-sub {
white-space: unset;
}

View File

@@ -12,36 +12,29 @@
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ng-template #distanceView>
@if (distance | async; as distance) {
<ion-label class="distance" @fade>
<ion-icon name="directions_walk"></ion-icon>
{{ distance | metersLocalized }}
</ion-label>
}
</ng-template>
<ion-label class="title">{{ 'name' | thingTranslate: _item }}</ion-label>
@if (_item.type !== 'floor') {
<stapps-opening-hours [openingHours]="_item.openingHours"></stapps-opening-hours>
@if (_item.categories && _item.type !== 'building') {
<ion-note>
<p class="title-sub">
<stapps-opening-hours [openingHours]="_item.openingHours"></stapps-opening-hours>
@if (_item.type !== 'building' && _item.inPlace) {
<ion-icon name="pin_drop"></ion-icon>
<ion-label>{{ 'name' | thingTranslate: _item.inPlace }}</ion-label>
}
</p>
<ion-note>
@if (_item.categories && _item.type !== 'building') {
<ion-label> {{ 'categories' | thingTranslate: _item | join: ', ' | titlecase }} </ion-label>
<ng-container *ngTemplateOutlet="distanceView"></ng-container>
</ion-note>
} @else {
<ion-note>
} @else {
<ion-label> {{ 'type' | thingTranslate: _item | titlecase }} </ion-label>
<ng-container *ngTemplateOutlet="distanceView"></ng-container>
</ion-note>
}
}
@if (distance | async; as distance) {
<ion-label @fade>
<ion-icon name="directions_walk"></ion-icon>
{{ distance | metersLocalized }}
</ion-label>
}
</ion-note>
}
@if (_item.description) {
<p>{{ 'description' | thingTranslate: _item }}</p>
}
@if (_item.type !== 'building') {
@if (_item.inPlace) {
<ion-col size="auto" class="in-place">
<ion-icon name="pin_drop"></ion-icon><ion-label>{{ 'name' | thingTranslate: _item.inPlace }}</ion-label>
</ion-col>
}
}

View File

@@ -15,6 +15,8 @@
ion-note {
display: flex;
align-items: center;
justify-content: flex-start;
> ion-label {
display: inline-flex;
@@ -23,15 +25,14 @@ ion-note {
}
}
ion-label + ion-label.distance::before {
content: '';
margin-inline: var(--spacing-xs);
}
.in-place {
p.title-sub {
display: flex;
align-items: center;
justify-content: flex-end;
}
ion-label + ion-label::before {
content: '';
margin-inline: var(--spacing-xs);
}
stapps-opening-hours ::ng-deep div {

View File

@@ -21,6 +21,7 @@ import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider';
import {HttpClient} from '@angular/common/http';
import {DataProvider} from '../data/data.provider';
import {SCHebisSearchRoute} from './protocol/route';
import {SCSearchRequest, SCSearchResponse} from '@openstapps/core';
const HEBIS_PREFIX = 'HEB';
@@ -46,12 +47,6 @@ export class HebisDataProvider extends DataProvider {
*/
private readonly hebisSearchRoute = new SCHebisSearchRoute();
/**
* TODO
* @param stAppsWebHttpClient TODO
* @param storageProvider TODO
* @param httpClient TODO
*/
constructor(
stAppsWebHttpClient: StAppsWebHttpClient,
storageProvider: StorageProvider,
@@ -63,6 +58,23 @@ export class HebisDataProvider extends DataProvider {
this.client = new Client(stAppsWebHttpClient, this.backendUrl, this.appVersion);
}
override async search(query: SCSearchRequest): Promise<SCSearchResponse> {
const response = await this.hebisSearch({
query: query.query ?? '',
page: query.from,
});
console.log(response.pagination);
return {
data: response.data,
facets: [],
pagination: response.pagination,
stats: {
time: Number.NaN,
},
};
}
/**
* Send a search request to the backend
*

View File

@@ -12,13 +12,12 @@
* 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, OnInit} from '@angular/core';
import {combineLatest} from 'rxjs';
import {debounceTime, distinctUntilChanged, startWith} from 'rxjs/operators';
import {SearchPageComponent} from '../../data/list/search-page.component';
import {Component} from '@angular/core';
import {HebisDataProvider} from '../hebis-data.provider';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {DataProvider} from '../../data/data.provider';
import {DataRoutingService} from '../../data/data-routing.service';
import {Router} from '@angular/router';
/**
* HebisSearchPageComponent queries things and shows list of things as search results and filter as context menu
@@ -29,111 +28,16 @@ import {DataProvider} from '../../data/data.provider';
styleUrls: ['../../data/list/search-page.scss'],
providers: [{provide: DataProvider, useClass: HebisDataProvider}],
})
export class HebisSearchPageComponent extends SearchPageComponent implements OnInit {
/**
* If routing should be done if the user clicks on an item
*/
@Input() itemRouting? = true;
/**
* Current page to start query
*/
page = 0;
/**
* Fetches items with set query configuration
* @param append If true fetched data gets appended to existing, override otherwise (default false)
*/
protected async fetchAndUpdateItems(append = false): Promise<void> {
// build query search options
const searchOptions: {page: number; query: string} = {
page: this.page,
query: '',
};
if (this.queryText && this.queryText.length > 0) {
// add query string
searchOptions.query = this.queryText;
}
return (this.dataProvider as HebisDataProvider).hebisSearch(searchOptions).then(
async result => {
/*this.singleTypeResponse =
result.facets.find(facet => facet.field === 'type')?.buckets
.length === 1;*/
if (append) {
let items = await this.items;
// append results
items = [...items, ...result.data];
this.items = (async () => items)();
} else {
// override items with results
this.items = (async () => {
return result.data;
})();
}
},
async error => {
const alert: HTMLIonAlertElement = await this.alertController.create({
buttons: ['Dismiss'],
header: 'Error',
subHeader: error.message,
});
await alert.present();
},
);
}
/**
* Loads next page of things
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async loadMore(): Promise<void> {
this.page += 1;
await this.fetchAndUpdateItems(true);
}
ngOnInit() {
//this.fetchAndUpdateItems();
this.initialize();
combineLatest([
this.queryTextChanged.pipe(
debounceTime(this.searchQueryDueTime),
distinctUntilChanged(),
startWith(this.queryText),
),
])
.pipe(takeUntilDestroyed(this.destroy$))
.subscribe(async query => {
this.queryText = query[0];
this.page = 0;
if (this.queryText?.length > 0 || this.showDefaultData) {
await this.fetchAndUpdateItems();
this.queryChanged.next();
}
});
this.settingsProvider.settingsActionChanged$
.pipe(takeUntilDestroyed(this.destroy$))
.subscribe(({type, payload}) => {
if (type === 'stapps.settings.changed') {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const {category, name, value} = payload!;
this.logger.log(`received event "settings.changed" with category:
${category}, name: ${name}, value: ${JSON.stringify(value)}`);
}
});
this.dataRoutingService
export class HebisSearchPageComponent {
constructor(dataRoutingService: DataRoutingService, router: Router) {
dataRoutingService
.itemSelectListener()
.pipe(takeUntilDestroyed(this.destroy$))
.pipe(takeUntilDestroyed())
.subscribe(async item => {
if (this.itemRouting) {
void this.router.navigate(
['hebis-detail', (item.origin && 'originalId' in item.origin && item.origin['originalId']) || ''],
{state: {item}},
);
}
void router.navigate(
['hebis-detail', (item.origin && 'originalId' in item.origin && item.origin['originalId']) || ''],
{state: {item}},
);
});
}
}

View File

@@ -13,52 +13,13 @@
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-header>
<ion-toolbar color="primary" mode="ios">
<ion-buttons slot="start">
<ion-back-button></ion-back-button>
</ion-buttons>
<ion-title>{{ 'hebisSearch.title' | translate }}</ion-title>
</ion-toolbar>
<ion-toolbar color="primary" mode="ios">
<ion-searchbar
(ngModelChange)="searchStringChanged($event)"
(keyup.enter)="hideKeyboard()"
(search)="hideKeyboard()"
[(ngModel)]="queryText"
mode="md"
placeholder="{{ 'hebisSearch.search_bar.placeholder' | translate }}"
showClearButton="always"
type="search"
enterkeyhint="search"
>
</ion-searchbar>
</ion-toolbar>
<ion-toolbar color="primary" class="category-tab">
<ion-buttons class="ion-justify-content-between">
<ion-button
[routerLink]="['/search']"
queryParamsHandling="preserve"
[routerAnimation]="routeAnimation"
fill="outline"
size="large"
>{{ 'search.type' | translate }}
</ion-button>
<ion-button class="button-active" size="large">{{ 'hebisSearch.type' | translate }}</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content>
<div [style.display]="!showDefaultData && !items && !loading ? 'block' : 'none'">
<ion-label class="centered-message-container"> {{ 'hebisSearch.instruction' | translate }} </ion-label>
</div>
<stapps-data-list
id="data-list"
[items]="items | async"
[singleType]="singleTypeResponse"
(loadmore)="loadMore()"
[resetToTop]="queryChanged.asObservable()"
[loading]="loading"
></stapps-data-list>
</ion-content>
<stapps-search-page
[placeholder]="'hebisSearch.search_bar.placeholder' | translate"
[title]="'hebisSearch.title' | translate"
[searchInstruction]="'hebisSearch.instruction' | translate"
[itemRouting]="false"
[showContextMenu]="false"
[pageSize]="1"
[navigation]="[{label: 'search.type', routerLink: ['/search']}, {label: 'hebisSearch.type'}]"
>
</stapps-search-page>

View File

@@ -2,7 +2,7 @@
[title]="'jobs.title' | translate"
[placeholder]="'jobs.placeholder' | translate"
[showDefaultData]="true"
[showNavigation]="false"
[navigation]="[]"
[forcedFilter]="forcedFilter"
[backUrl]="'/'"
></stapps-search-page>

View File

@@ -13,7 +13,7 @@
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<stapps-search-page
[showNavigation]="false"
[navigation]="[]"
[showDefaultData]="false"
[forcedFilter]="forcedFilter"
[backUrl]="'..'"

View File

@@ -21,7 +21,7 @@ export const environment = {
backend_url: 'https://mobile.server.uni-frankfurt.de',
app_host: 'mobile.app.uni-frankfurt.de',
custom_url_scheme: 'de.anyschool.app',
backend_version: '4.1.0',
backend_version: '3.1.0',
production: true,
};

View File

@@ -21,7 +21,7 @@ export const environment = {
backend_url: 'https://mobile.server.uni-frankfurt.de',
app_host: 'mobile.app.uni-frankfurt.de',
custom_url_scheme: 'de.anyschool.app',
backend_version: '4.1.0',
backend_version: '3.1.0',
production: false,
};

View File

@@ -13,6 +13,10 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
.can-go-back ion-header ion-back-button {
display: block;
}
app-root {
.button {
--padding-top: var(--spacing-sm);

View File

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

View File

@@ -1,6 +1,6 @@
{
"name": "@openstapps/node-base",
"version": "3.0.0",
"version": "3.2.0",
"private": true,
"type": "module",
"license": "GPL-3.0-only",

View File

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

View File

@@ -1,6 +1,6 @@
{
"name": "@openstapps/node-builder",
"version": "3.0.0",
"version": "3.2.0",
"private": true,
"type": "module",
"license": "GPL-3.0-only",

View File

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

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/api-cli",
"description": "CLI client for @openstapps/api",
"version": "3.1.1",
"version": "3.2.0",
"type": "module",
"license": "GPL-3.0-only",
"repository": "git@gitlab.com:openstapps/api.git",

View File

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

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/api-plugin",
"description": "Node.js library to interact with the StApps backend service",
"version": "3.1.1",
"version": "3.2.0",
"type": "module",
"license": "GPL-3.0-only",
"repository": "git@gitlab.com:openstapps/api.git",

View File

@@ -1,5 +1,12 @@
# @openstapps/api
## 3.2.0
### Patch Changes
- Updated dependencies [912ae422]
- @openstapps/core@4.0.0
## 3.1.1
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/api",
"description": "Node.js library to interact with the StApps backend service",
"version": "3.1.1",
"version": "3.2.0",
"type": "module",
"license": "GPL-3.0-only",
"repository": "git@gitlab.com:openstapps/api.git",

View File

@@ -1,5 +1,15 @@
# @openstapps/core
## 3.2.0
### Minor Changes
- 912ae422: Add the ability to filter by existence of a field
### Patch Changes
- @openstapps/core-tools@3.0.0
## 3.1.1
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/core",
"description": "StAppsCore - Generalized model of data",
"version": "3.1.1",
"version": "3.2.0",
"type": "module",
"license": "GPL-3.0-only",
"repository": "git@gitlab.com:openstapps/core.git",