incyclist-services 1.3.25 → 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.
@@ -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 = "1";
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 = '1';
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 = (_v = this.getTotalElevation() - this.current.elevationGainDisplay) !== null && _v !== void 0 ? _v : 0;
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 = (0, routes_1.useRouteList)().getSelected();
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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.3.25",
3
+ "version": "1.3.26",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.26"
6
6
  },