incyclist-services 1.3.24 → 1.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/activities/base/repo/db.d.ts +1 -1
- package/lib/activities/base/repo/db.js +1 -1
- package/lib/activities/ride/service.d.ts +2 -2
- package/lib/activities/ride/service.js +7 -5
- package/lib/activities/ride/types.d.ts +8 -0
- package/lib/routes/list/cards/types.js +2 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { JsonRepository } from "../../../api";
|
|
|
3
3
|
import { Observer, PromiseObserver } from "../../../base/types/observer";
|
|
4
4
|
import { ActivityDetails, ActivityInfo } from "../model";
|
|
5
5
|
import { ActivitySearchCriteria } from "./types";
|
|
6
|
-
export declare const DB_VERSION = "
|
|
6
|
+
export declare const DB_VERSION = "2";
|
|
7
7
|
export declare const DB_NAME = "db";
|
|
8
8
|
export declare class ActivitiesRepository {
|
|
9
9
|
protected repo: JsonRepository;
|
|
@@ -54,7 +54,7 @@ const types_1 = require("../../../base/types");
|
|
|
54
54
|
const observer_1 = require("../../../base/types/observer");
|
|
55
55
|
const utils_1 = require("../../../utils");
|
|
56
56
|
const utils_2 = require("../utils");
|
|
57
|
-
exports.DB_VERSION = '
|
|
57
|
+
exports.DB_VERSION = '2';
|
|
58
58
|
exports.DB_NAME = 'db';
|
|
59
59
|
let ActivitiesRepository = (() => {
|
|
60
60
|
let _classDecorators = [types_1.Singleton];
|
|
@@ -7,7 +7,7 @@ import { ActivitiesRepository, ActivityConverterFactory, ActivityDetails, Activi
|
|
|
7
7
|
import { FreeRideStartSettings } from "../../routes/list/types";
|
|
8
8
|
import { RouteSettings } from "../../routes/list/cards/RouteCard";
|
|
9
9
|
import { RoutePoint } from "../../routes/base/types";
|
|
10
|
-
import { ActivityState } from "./types";
|
|
10
|
+
import { ActivityState, ActivitySummaryDisplayProperties } from "./types";
|
|
11
11
|
import { Route } from "../../routes/base/model/route";
|
|
12
12
|
import { ActivityStatsCalculator } from "./stats";
|
|
13
13
|
import { ActivityDuration } from "./duration";
|
|
@@ -60,7 +60,7 @@ export declare class ActivityRideService extends IncyclistService {
|
|
|
60
60
|
resume(requester?: 'user' | 'system'): void;
|
|
61
61
|
ignoreEndPos(): void;
|
|
62
62
|
getDashboardDisplayProperties(): any[];
|
|
63
|
-
getActivitySummaryDisplayProperties():
|
|
63
|
+
getActivitySummaryDisplayProperties(): ActivitySummaryDisplayProperties;
|
|
64
64
|
getActivity(): ActivityDetails;
|
|
65
65
|
setTitle(title: string): void;
|
|
66
66
|
delete(): Promise<void>;
|
|
@@ -216,7 +216,7 @@ let ActivityRideService = (() => {
|
|
|
216
216
|
powerDetails = { value: (0, utils_1.formatNumber)((_s = stats === null || stats === void 0 ? void 0 : stats.power) === null || _s === void 0 ? void 0 : _s.avg, 0), label: 'avg' };
|
|
217
217
|
heartrateDetails = { value: (0, utils_1.formatNumber)((_t = stats === null || stats === void 0 ? void 0 : stats.hrm) === null || _t === void 0 ? void 0 : _t.avg, 0), label: 'avg' };
|
|
218
218
|
cadenceDetails = { value: (0, utils_1.formatNumber)((_u = stats === null || stats === void 0 ? void 0 : stats.cadence) === null || _u === void 0 ? void 0 : _u.avg, 0), label: 'avg' };
|
|
219
|
-
let elevationGainRemaining =
|
|
219
|
+
let elevationGainRemaining = this.getTotalElevation() - ((_v = this.current.elevationGainDisplay) !== null && _v !== void 0 ? _v : 0);
|
|
220
220
|
if (isNaN(elevationGainRemaining))
|
|
221
221
|
elevationGainRemaining = undefined;
|
|
222
222
|
if (elevationGainRemaining < 0)
|
|
@@ -251,10 +251,12 @@ let ActivityRideService = (() => {
|
|
|
251
251
|
getActivitySummaryDisplayProperties() {
|
|
252
252
|
var _a, _b;
|
|
253
253
|
try {
|
|
254
|
-
const route =
|
|
254
|
+
const route = this.getRouteList().getSelected();
|
|
255
|
+
const startSettings = this.getRouteList().getStartSettings();
|
|
256
|
+
const isFreeRide = (startSettings === null || startSettings === void 0 ? void 0 : startSettings.type) === 'Free-Ride';
|
|
255
257
|
const showSave = this.activity !== undefined && !this.isSaveDone;
|
|
256
258
|
const showContinue = this.state !== 'completed';
|
|
257
|
-
const showMap = (_a = route === null || route === void 0 ? void 0 : route.description) === null || _a === void 0 ? void 0 : _a.hasGpx;
|
|
259
|
+
const showMap = isFreeRide || ((_a = route === null || route === void 0 ? void 0 : route.description) === null || _a === void 0 ? void 0 : _a.hasGpx);
|
|
258
260
|
const preview = showMap ? undefined : (_b = route === null || route === void 0 ? void 0 : route.description) === null || _b === void 0 ? void 0 : _b.previewUrl;
|
|
259
261
|
const props = {
|
|
260
262
|
activity: this.activity,
|
|
@@ -696,7 +698,7 @@ let ActivityRideService = (() => {
|
|
|
696
698
|
return log;
|
|
697
699
|
}
|
|
698
700
|
createActivity(requestedId) {
|
|
699
|
-
var _a;
|
|
701
|
+
var _a, _b;
|
|
700
702
|
const user = this.getUserSettings().get('user', {});
|
|
701
703
|
const { weight, ftp } = user;
|
|
702
704
|
const uuid = this.getUserSettings().get('uuid', undefined);
|
|
@@ -735,7 +737,7 @@ let ActivityRideService = (() => {
|
|
|
735
737
|
realityFactor = s.realityFactor;
|
|
736
738
|
routeId = selectedRoute.description.id;
|
|
737
739
|
routeHash = selectedRoute.description.routeHash;
|
|
738
|
-
routeName = selectedRoute.description.title;
|
|
740
|
+
routeName = (_b = selectedRoute.description.originalName) !== null && _b !== void 0 ? _b : selectedRoute.description.title;
|
|
739
741
|
routeType = selectedRoute.description.hasVideo ? 'Video' : 'GPX';
|
|
740
742
|
this.current.position = (0, route_1.getPosition)(selectedRoute, { distance: startPos });
|
|
741
743
|
}
|
|
@@ -1 +1,9 @@
|
|
|
1
|
+
import { ActivityDetails } from "../base";
|
|
1
2
|
export type ActivityState = 'ininitalized' | 'active' | 'paused' | 'completed' | 'idle';
|
|
3
|
+
export type ActivitySummaryDisplayProperties = {
|
|
4
|
+
activity?: ActivityDetails;
|
|
5
|
+
showSave?: boolean;
|
|
6
|
+
showContinue?: boolean;
|
|
7
|
+
showMap?: boolean;
|
|
8
|
+
preview?: string;
|
|
9
|
+
};
|
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DEFAULT_FILTERS = exports.DEFAULT_TITLE = void 0;
|
|
4
4
|
exports.DEFAULT_TITLE = 'Import Route';
|
|
5
5
|
exports.DEFAULT_FILTERS = [
|
|
6
|
-
{ name: 'Routes', extensions: ['gpx', 'epm', 'xml'] },
|
|
6
|
+
{ name: 'Routes', extensions: ['gpx', 'epm', 'xml', 'rlv', 'pgmf'] },
|
|
7
7
|
{ name: 'Tracks', extensions: ['gpx'] },
|
|
8
8
|
{ name: 'RLV: ErgoPlanet', extensions: ['epm'] },
|
|
9
9
|
{ name: 'RLV: Incyclist, KWT, Rouvy,Virtualtrainer ', extensions: ['xml'] },
|
|
10
|
+
{ name: 'RLV: Tacx', extensions: ['rlv', 'pgmf'] }
|
|
10
11
|
];
|