refactor: adjust to changes in core definitions

This commit is contained in:
Rainer Killinger
2022-01-25 15:24:01 +01:00
parent c0d0b1bd99
commit d86a7353dd
8 changed files with 2436 additions and 2149 deletions

4542
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -72,9 +72,9 @@
"@ionic/storage-angular": "3.0.6", "@ionic/storage-angular": "3.0.6",
"@ngx-translate/core": "13.0.0", "@ngx-translate/core": "13.0.0",
"@ngx-translate/http-loader": "6.0.0", "@ngx-translate/http-loader": "6.0.0",
"@openstapps/api": "0.35.0", "@openstapps/api": "0.38.0",
"@openstapps/configuration": "0.28.1", "@openstapps/configuration": "0.29.0",
"@openstapps/core": "0.53.0", "@openstapps/core": "0.63.0",
"capacitor-secure-storage-plugin": "0.6.2", "capacitor-secure-storage-plugin": "0.6.2",
"cordova-plugin-device": "2.0.3", "cordova-plugin-device": "2.0.3",
"cordova-plugin-dialogs": "2.0.2", "cordova-plugin-dialogs": "2.0.2",
@@ -133,7 +133,7 @@
"@typescript-eslint/eslint-plugin": "4.32.0", "@typescript-eslint/eslint-plugin": "4.32.0",
"@typescript-eslint/parser": "4.32.0", "@typescript-eslint/parser": "4.32.0",
"conventional-changelog-cli": "2.1.1", "conventional-changelog-cli": "2.1.1",
"cordova-res": "0.15.3", "cordova-res": "0.15.4",
"eslint": "7.32.0", "eslint": "7.32.0",
"eslint-config-prettier": "8.3.0", "eslint-config-prettier": "8.3.0",
"eslint-plugin-jsdoc": "36.1.0", "eslint-plugin-jsdoc": "36.1.0",
@@ -152,7 +152,7 @@
"license-checker": "25.0.1", "license-checker": "25.0.1",
"prettier": "2.4.0", "prettier": "2.4.0",
"protractor": "7.0.0", "protractor": "7.0.0",
"surge": "0.23.0", "surge": "0.23.1",
"ts-node": "8.0.3", "ts-node": "8.0.3",
"typescript": "4.3.5" "typescript": "4.3.5"
}, },

View File

@@ -67,7 +67,6 @@ export const sampleIndexResponse: SCIndexResponse = {
type: 'Polygon', type: 'Polygon',
}, },
features: { features: {
widgets: true,
}, },
menus: [ menus: [
{ {
@@ -244,6 +243,7 @@ export const sampleIndexResponse: SCIndexResponse = {
}, },
], ],
}, },
auth: {},
backend: { backend: {
SCVersion: packageJson.dependencies['@openstapps/core'], SCVersion: packageJson.dependencies['@openstapps/core'],
externalRequestTimeout: 5000, externalRequestTimeout: 5000,

View File

@@ -246,9 +246,7 @@ const sampleIndexResponse: SCIndexResponse = {
coordinates: [[[1, 2]], [[1, 2]]], coordinates: [[[1, 2]], [[1, 2]]],
type: 'Polygon', type: 'Polygon',
}, },
features: { features: {},
widgets: false,
},
menus: [ menus: [
{ {
icon: 'icon', icon: 'icon',
@@ -306,6 +304,7 @@ const sampleIndexResponse: SCIndexResponse = {
}, },
], ],
}, },
auth: {},
backend: { backend: {
SCVersion: scVersion, SCVersion: scVersion,
externalRequestTimeout: 5000, externalRequestTimeout: 5000,

View File

@@ -30,12 +30,13 @@ export class DataIconPipe implements PipeTransform {
constructor() { constructor() {
this.typeIconMap = { this.typeIconMap = {
'academic event': 'school', 'academic event': 'school',
'assessment': 'document-text',
'article': 'document', 'article': 'document',
'book': 'book', 'book': 'book',
'building': 'location', 'building': 'location',
'catalog': 'folder', 'catalog': 'folder',
'contact point': 'call', 'contact point': 'call',
'course of studies': 'school', 'course of study': 'school',
'date series': 'calendar', 'date series': 'calendar',
'dish': 'restaurant', 'dish': 'restaurant',
'favorite': 'heart', 'favorite': 'heart',

View File

@@ -29,6 +29,7 @@ import {
SCThingType, SCThingType,
SCSaveableThing, SCSaveableThing,
SCFeedbackRequest, SCFeedbackRequest,
SCFeedbackResponse,
} from '@openstapps/core'; } from '@openstapps/core';
import {chunk, fromPairs, toPairs} from 'lodash-es'; import {chunk, fromPairs, toPairs} from 'lodash-es';
import {environment} from '../../../environments/environment'; import {environment} from '../../../environments/environment';
@@ -299,7 +300,11 @@ export class DataProvider {
* @param feedback Feedback message to be sent to the backend * @param feedback Feedback message to be sent to the backend
*/ */
async sendFeedback(feedback: SCFeedbackRequest) { async sendFeedback(feedback: SCFeedbackRequest) {
return this.client.feedback(feedback); return this.client.invokePlugin<SCFeedbackResponse>(
'feedback',
undefined,
feedback,
);
} }
/** /**

View File

@@ -1,5 +1,5 @@
<div> <div>
<h2> <h2 *ngIf="offers[0].prices">
{{ offers[0].prices.default | currency: 'EUR':'symbol':undefined:'de' }} {{ offers[0].prices.default | currency: 'EUR':'symbol':undefined:'de' }}
</h2> </h2>
<p *ngIf="offers[0].inPlace"> <p *ngIf="offers[0].inPlace">

View File

@@ -21,20 +21,6 @@ export class NavigationService {
} catch (error) { } catch (error) {
this.logger.error(`error from loading menu entries: ${error}`); this.logger.error(`error from loading menu entries: ${error}`);
} }
// TODO: Load if from the backend (config)
menu[1].items.unshift({
icon: 'person',
route: '/profile',
title: 'profile',
translations: {
de: {
title: 'Profil',
},
en: {
title: 'profile',
},
},
});
return menu; return menu;
} }
} }