Commit 3f9d1252 authored by Andres Käver's avatar Andres Käver

filter

parent bc67da58
Pipeline #840 passed with stages
in 1 minute and 24 seconds
...@@ -411,6 +411,12 @@ ...@@ -411,6 +411,12 @@
"integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==", "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==",
"dev": true "dev": true
}, },
"@types/jwt-decode": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@types/jwt-decode/-/jwt-decode-2.2.1.tgz",
"integrity": "sha512-aWw2YTtAdT7CskFyxEX2K21/zSDStuf/ikI3yBqmwpwJF0pS+/IX5DWv+1UFffZIbruP6cnT9/LAJV1gFwAT1A==",
"dev": true
},
"@types/leaflet": { "@types/leaflet": {
"version": "1.5.12", "version": "1.5.12",
"resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.5.12.tgz", "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.5.12.tgz",
...@@ -7022,6 +7028,11 @@ ...@@ -7022,6 +7028,11 @@
"integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=", "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=",
"dev": true "dev": true
}, },
"jwt-decode": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-2.2.0.tgz",
"integrity": "sha1-fYa9VmefWM5qhHBKZX3TkruoGnk="
},
"killable": { "killable": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz",
......
export interface ILoginRequest {
email: string;
password: string;
}
export interface IRegisterRequest {
firstName: string;
lastName: string;
email: string;
password: string;
}
export interface ILoginResponse {
token: string;
status: string;
firstName: string;
lastName: string;
}
export interface ICulture {
code: string;
name: string;
}
export interface IGpsSession {
id: string;
name: string;
description: string;
recordedAt: string;
duration: number;
speed: number;
distance: number;
climb: number;
descent: number;
paceMin: number;
paceMax: number;
}
export interface IGpsSessionModify extends IGpsSession {
gpsSessionTypeId: string;
appUserId: string;
}
export interface IGpsSessionData extends IGpsSession {
gpsSessionType: string;
gpsLocationsCount: number;
userFirstLastName: string;
userId: string;
}
export interface IGpsSessionType {
id: string;
nameId: string;
name: string;
descriptionId: string;
description: string;
paceMin: number;
paceMax: number;
}
export interface IGpsLocation {
id: string;
recordedAt: string;
latitude: number;
longitude: number;
accuracy: number;
altitude: number;
verticalAccuracy: number;
appUserId: string;
gpsSessionId: string;
gpsLocationTypeId: string;
}
export interface IGpsLocationType {
id: string;
nameId: string;
name: string;
descriptionId: string;
description: string;
}
export interface ITrackPoint {
id: string;
nameId: string;
name: string;
descriptionId: string;
description: string;
mapFile: string;
appUserId: string;
}
export interface ITrack {
id: string;
nameId: string;
name: string;
descriptionId: string;
description: string;
mapFile: string;
appUserId: string;
}
<template bindable="message">
<div show.bind="message" class="alert alert-danger alert-dismissible fade show" role="alert">
${message}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
</template>
import { autoinject } from 'aurelia-framework';
import { AppState } from "state/app-state";
interface ILangStrings {
name: string;
description: string;
language: string;
login: string;
logout: string;
register: string;
gpsSessions: string;
choose: string;
location: string;
locations: string;
trackLen: string;
createNew: string;
from: string;
to: string;
filter: string;
minLocationsCount: string;
minDuration: string;
minDistance: string;
sessionType: string;
recordedAt: string;
duration: string;
distance: string;
climb: string;
descent: string;
pace: string;
speed: string;
viewOnMap: string;
edit: string;
save: string;
delete: string;
backToList: string;
showHideFilter: string;
}
interface ILangResources {
'en-GB': ILangStrings;
'et-EE': ILangStrings;
'ru-RU': ILangStrings;
[propName: string]: ILangStrings;
}
const LangResources: ILangResources = {
'en-GB': {
name: 'Name',
description: 'Description',
language: 'Language',
login: 'Login',
logout: 'Logout',
register: 'Register',
gpsSessions: 'GPS Sessions',
choose: 'Choose',
location: 'Location',
locations: 'Locations',
trackLen: 'Track length',
createNew: 'Create New',
from: 'From',
to: 'To',
minLocationsCount: 'Min locations count',
minDuration: 'Min duration',
minDistance: 'Min distance',
filter: 'Filter',
sessionType: 'Session type',
recordedAt: 'Recorded at',
duration: 'Duration',
distance: 'Distance',
climb: 'Climb',
descent: 'Descent',
pace: 'Pace',
speed: 'Speed',
viewOnMap: 'View on map',
edit: 'Edit',
save: 'Save',
delete: 'Delete',
backToList: 'Back to List',
showHideFilter: 'Show/hide filter',
},
'et-EE': {
name: 'Nimi',
description: 'Kirjeldus',
language: 'Keel',
login: 'Logi sisse',
logout: 'Logi välja',
register: 'Registreeri',
gpsSessions: 'Treeningud',
choose: 'Vali',
location: 'Asukoht',
locations: 'Asukohad',
trackLen: 'Raja pikkus',
createNew: 'Loo uus',
from: 'Alates',
to: 'Kuni',
minLocationsCount: 'Min asukohtate summa',
minDuration: 'Min kestvus',
minDistance: 'Min distants',
filter: 'Filtreeri',
sessionType: 'Sessiooni tüüp',
recordedAt: 'Salvestatud kuupäeval',
duration: 'Kestvus',
distance: 'Distants',
climb: 'Tõus',
descent: 'Langus',
pace: 'Tempo',
speed: 'Kiirus',
viewOnMap: 'Näita kaardil',
edit: 'Muuda',
save: 'Salvesta',
delete: 'Kustuta',
backToList: 'Tagasi nimekirja',
showHideFilter: 'Näita/peida filter',
},
'ru-RU': {
name: 'Name',
description: 'Description',
language: 'Jazyk',
login: 'Login',
logout: 'Logout',
register: 'Register',
gpsSessions: 'GPS-сессии',
choose: 'Choose',
location: 'Location',
locations: 'Locations',
trackLen: 'Track length',
createNew: 'Create New',
from: 'From',
to: 'To',
minLocationsCount: 'Min locations count',
minDuration: 'Min duration',
minDistance: 'Min distance',
filter: 'Filter',
sessionType: 'Session type',
recordedAt: 'Recorded at',
duration: 'Duration',
distance: 'Distance',
climb: 'Climb',
descent: 'Descent',
pace: 'Pace',
speed: 'Speed',
viewOnMap: 'View on map',
edit: 'Edit',
save: 'Save',
delete: 'Delete',
backToList: 'Back to List',
showHideFilter: 'Show/hide filter',
}
}
@autoinject
export default class LangStrings {
/*
selected: ILangStrings;
constructor(private appState: AppState) {
this.selected = LangResources[this.appState.culture?.code || 'en-GB'];
}
setLang(lang = 'en-GB'): void {
this.selected = LangResources[lang];
}
*/
}
import { ILoginResponse, ICulture } from "domain/Interfaces";
import * as JwtDecode from "jwt-decode";
export class AppState {
public readonly baseUrl = 'https://sportmap.akaver.com/api/v1/';
public readonly mapUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png';
/*
get culture(): ICulture | null {
return this.getValue('culture');
}
set culture(value: ICulture | null) {
this.setValue('culture', value);
}
get token(): string | null {
return this.getValue('token');
}
set token(value: string | null) {
this.setValue('token', value);
let userId = null;
if (value !== null) {
const decoded = JwtDecode<Record<string, string>>(value.token);
userId = decoded['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier'];
}
this.setValue('userId', userId);
}
get userId(): string | null {
return this.getValue('userId');
}
private getValue(key: string): string {
const token = localStorage.getItem(key);
return token === null ? token : JSON.parse(token);
}
private setValue(key: string, value: Record<string, string> | null): void {
if (value) {
localStorage.setItem(key, JSON.stringify(value));
} else {
localStorage.removeItem(key);
}
}
*/
}
...@@ -38,9 +38,9 @@ export class HomeIndex { ...@@ -38,9 +38,9 @@ export class HomeIndex {
selectedGpsSession: IGpsSession | null = null; selectedGpsSession: IGpsSession | null = null;
showCp = true; showCp = true;
showWp = true; showWp = true;
minLocations = 10; minLocations = 0;
minDistance = 10; minDistance = 0;
minDuration = 60; minDuration = 0;
trackLength = 0; trackLength = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment