incyclist-services 1.7.102 → 1.7.103

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.
@@ -151,15 +151,14 @@ let ActivitiesPageService = (() => {
151
151
  }
152
152
  }
153
153
  getActivityDetailsProps(activityId) {
154
- const comboEnabled = this.isWorkoutComboEnabled();
155
154
  try {
156
155
  const workout = this.getWorkoutList().getSelected();
157
156
  const attachedWorkout = workout ? { id: workout.id, title: workout.name } : null;
158
- return { activityId, attachedWorkout, comboEnabled };
157
+ return { activityId, attachedWorkout };
159
158
  }
160
159
  catch (err) {
161
160
  this.logError(err, 'getActivityDetailsProps');
162
- return { activityId, attachedWorkout: null, comboEnabled };
161
+ return { activityId, attachedWorkout: null };
163
162
  }
164
163
  }
165
164
  onClearWorkoutSelection() {
@@ -122,17 +122,6 @@ let IncyclistPageService = (() => {
122
122
  getAppState() {
123
123
  return (0, appstate_1.useAppState)();
124
124
  }
125
- isWorkoutComboEnabled() {
126
- try {
127
- const appState = this.getAppState();
128
- return appState.hasFeature('MOBILE_WORKOUTS')
129
- && appState.hasFeature('MOBILE_WORKOUT_ROUTE_COMBO');
130
- }
131
- catch (err) {
132
- this.logError(err, 'isWorkoutComboEnabled');
133
- return false;
134
- }
135
- }
136
125
  };
137
126
  })();
138
127
  exports.IncyclistPageService = IncyclistPageService;
@@ -388,7 +388,7 @@ let RidePageService = (() => {
388
388
  }
389
389
  getCornerWidget() {
390
390
  try {
391
- if (!this.isWorkoutAttached() || !this.isWorkoutComboEnabled())
391
+ if (!this.isWorkoutAttached())
392
392
  return undefined;
393
393
  return this.getUserSettings().get(CORNER_WIDGET_SETTING_KEY, 'elevation');
394
394
  }
@@ -764,8 +764,6 @@ let RidePageService = (() => {
764
764
  return true;
765
765
  if (!this.isRideType('Video', 'GPX'))
766
766
  return false;
767
- if (!this.isWorkoutComboEnabled())
768
- return false;
769
767
  return this.getWorkoutRide().inUse();
770
768
  }
771
769
  catch (err) {
@@ -383,8 +383,7 @@ let RouteCard = (() => {
383
383
  const next = (0, route_1.getNextVideoId)(this.route);
384
384
  showNextOverwrite = !!next;
385
385
  hasWorkout = (0, valid_1.valid)(workouts.getSelected());
386
- const workoutsEnabled = this.isMobile() ? this.getAppState().hasFeature('MOBILE_WORKOUTS') : true;
387
- showWorkoutOption = workoutsEnabled && !hasWorkout;
386
+ showWorkoutOption = !hasWorkout;
388
387
  if (showNextOverwrite) {
389
388
  const card = (0, service_1.getRouteList)().getCard(next);
390
389
  const route = card?.getData();
@@ -321,13 +321,12 @@ let RoutesPageService = (() => {
321
321
  }
322
322
  }
323
323
  getRouteDetailsProps(routeId) {
324
- const comboEnabled = this.isWorkoutComboEnabled();
325
324
  try {
326
- return { routeId, attachedWorkout: this.getAttachedWorkoutProps(), comboEnabled };
325
+ return { routeId, attachedWorkout: this.getAttachedWorkoutProps() };
327
326
  }
328
327
  catch (err) {
329
328
  this.logError(err, 'getRouteDetailsProps');
330
- return { routeId, attachedWorkout: null, comboEnabled };
329
+ return { routeId, attachedWorkout: null };
331
330
  }
332
331
  }
333
332
  getAttachedWorkoutProps() {
@@ -38,7 +38,6 @@ exports.getWorkoutListPageService = exports.WorkoutListPageService = void 0;
38
38
  const types_1 = require("../../base/types");
39
39
  const pages_1 = require("../../base/pages");
40
40
  const decorators_1 = require("../../base/decorators");
41
- const appstate_1 = require("../../appstate");
42
41
  const observer_1 = require("../../base/types/observer");
43
42
  const settings_1 = require("../../settings");
44
43
  const calendar_1 = require("../calendar");
@@ -59,7 +58,6 @@ let WorkoutListPageService = (() => {
59
58
  let _getRouteList_decorators;
60
59
  let _getWorkoutCalendar_decorators;
61
60
  let _getUserSettings_decorators;
62
- let _getAppState_decorators;
63
61
  var WorkoutListPageService = class extends _classSuper {
64
62
  static { _classThis = this; }
65
63
  static {
@@ -69,13 +67,11 @@ let WorkoutListPageService = (() => {
69
67
  _getRouteList_decorators = [decorators_1.Injectable];
70
68
  _getWorkoutCalendar_decorators = [decorators_1.Injectable];
71
69
  _getUserSettings_decorators = [decorators_1.Injectable];
72
- _getAppState_decorators = [decorators_1.Injectable];
73
70
  __esDecorate(this, null, _getDevicePairing_decorators, { kind: "method", name: "getDevicePairing", static: false, private: false, access: { has: obj => "getDevicePairing" in obj, get: obj => obj.getDevicePairing }, metadata: _metadata }, null, _instanceExtraInitializers);
74
71
  __esDecorate(this, null, _getWorkoutList_decorators, { kind: "method", name: "getWorkoutList", static: false, private: false, access: { has: obj => "getWorkoutList" in obj, get: obj => obj.getWorkoutList }, metadata: _metadata }, null, _instanceExtraInitializers);
75
72
  __esDecorate(this, null, _getRouteList_decorators, { kind: "method", name: "getRouteList", static: false, private: false, access: { has: obj => "getRouteList" in obj, get: obj => obj.getRouteList }, metadata: _metadata }, null, _instanceExtraInitializers);
76
73
  __esDecorate(this, null, _getWorkoutCalendar_decorators, { kind: "method", name: "getWorkoutCalendar", static: false, private: false, access: { has: obj => "getWorkoutCalendar" in obj, get: obj => obj.getWorkoutCalendar }, metadata: _metadata }, null, _instanceExtraInitializers);
77
74
  __esDecorate(this, null, _getUserSettings_decorators, { kind: "method", name: "getUserSettings", static: false, private: false, access: { has: obj => "getUserSettings" in obj, get: obj => obj.getUserSettings }, metadata: _metadata }, null, _instanceExtraInitializers);
78
- __esDecorate(this, null, _getAppState_decorators, { kind: "method", name: "getAppState", static: false, private: false, access: { has: obj => "getAppState" in obj, get: obj => obj.getAppState }, metadata: _metadata }, null, _instanceExtraInitializers);
79
75
  __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
80
76
  WorkoutListPageService = _classThis = _classDescriptor.value;
81
77
  if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
@@ -97,11 +93,7 @@ let WorkoutListPageService = (() => {
97
93
  openPage() {
98
94
  try {
99
95
  super.openPage();
100
- let pageType;
101
- if (!this.getAppState().hasFeature('MOBILE_WORKOUTS')) {
102
- pageType = 'placeholder';
103
- }
104
- this.logEvent({ message: 'page shown', page: 'Workouts', pageType });
96
+ this.logEvent({ message: 'page shown', page: 'Workouts' });
105
97
  const { observer } = this.getWorkoutList().open();
106
98
  this.listObserver = observer;
107
99
  this.listObserver?.on('started', this.listUpdateHandler);
@@ -134,9 +126,6 @@ let WorkoutListPageService = (() => {
134
126
  }
135
127
  getPageDisplayProps() {
136
128
  try {
137
- if (!this.getAppState().hasFeature('MOBILE_WORKOUTS')) {
138
- return { pageType: 'placeholder' };
139
- }
140
129
  const service = this.getWorkoutList();
141
130
  const loading = service.isStillLoading();
142
131
  const upcoming = this.getUpcomingTrainingProps();
@@ -176,8 +165,7 @@ let WorkoutListPageService = (() => {
176
165
  canDelete: card.canDelete(),
177
166
  isScheduled,
178
167
  date: isScheduled ? settingsProps.date : undefined,
179
- attachedRoute: this.getAttachedRouteProps(),
180
- comboEnabled: this.isWorkoutComboEnabled()
168
+ attachedRoute: this.getAttachedRouteProps()
181
169
  };
182
170
  }
183
171
  catch (err) {
@@ -526,9 +514,6 @@ let WorkoutListPageService = (() => {
526
514
  getUserSettings() {
527
515
  return (0, settings_1.useUserSettings)();
528
516
  }
529
- getAppState() {
530
- return (0, appstate_1.useAppState)();
531
- }
532
517
  };
533
518
  return WorkoutListPageService = _classThis;
534
519
  })();
@@ -148,15 +148,14 @@ let ActivitiesPageService = (() => {
148
148
  }
149
149
  }
150
150
  getActivityDetailsProps(activityId) {
151
- const comboEnabled = this.isWorkoutComboEnabled();
152
151
  try {
153
152
  const workout = this.getWorkoutList().getSelected();
154
153
  const attachedWorkout = workout ? { id: workout.id, title: workout.name } : null;
155
- return { activityId, attachedWorkout, comboEnabled };
154
+ return { activityId, attachedWorkout };
156
155
  }
157
156
  catch (err) {
158
157
  this.logError(err, 'getActivityDetailsProps');
159
- return { activityId, attachedWorkout: null, comboEnabled };
158
+ return { activityId, attachedWorkout: null };
160
159
  }
161
160
  }
162
161
  onClearWorkoutSelection() {
@@ -119,17 +119,6 @@ let IncyclistPageService = (() => {
119
119
  getAppState() {
120
120
  return useAppState();
121
121
  }
122
- isWorkoutComboEnabled() {
123
- try {
124
- const appState = this.getAppState();
125
- return appState.hasFeature('MOBILE_WORKOUTS')
126
- && appState.hasFeature('MOBILE_WORKOUT_ROUTE_COMBO');
127
- }
128
- catch (err) {
129
- this.logError(err, 'isWorkoutComboEnabled');
130
- return false;
131
- }
132
- }
133
122
  };
134
123
  })();
135
124
  export { IncyclistPageService };
@@ -385,7 +385,7 @@ let RidePageService = (() => {
385
385
  }
386
386
  getCornerWidget() {
387
387
  try {
388
- if (!this.isWorkoutAttached() || !this.isWorkoutComboEnabled())
388
+ if (!this.isWorkoutAttached())
389
389
  return undefined;
390
390
  return this.getUserSettings().get(CORNER_WIDGET_SETTING_KEY, 'elevation');
391
391
  }
@@ -761,8 +761,6 @@ let RidePageService = (() => {
761
761
  return true;
762
762
  if (!this.isRideType('Video', 'GPX'))
763
763
  return false;
764
- if (!this.isWorkoutComboEnabled())
765
- return false;
766
764
  return this.getWorkoutRide().inUse();
767
765
  }
768
766
  catch (err) {
@@ -380,8 +380,7 @@ let RouteCard = (() => {
380
380
  const next = getNextVideoId(this.route);
381
381
  showNextOverwrite = !!next;
382
382
  hasWorkout = valid(workouts.getSelected());
383
- const workoutsEnabled = this.isMobile() ? this.getAppState().hasFeature('MOBILE_WORKOUTS') : true;
384
- showWorkoutOption = workoutsEnabled && !hasWorkout;
383
+ showWorkoutOption = !hasWorkout;
385
384
  if (showNextOverwrite) {
386
385
  const card = getRouteList().getCard(next);
387
386
  const route = card?.getData();
@@ -318,13 +318,12 @@ let RoutesPageService = (() => {
318
318
  }
319
319
  }
320
320
  getRouteDetailsProps(routeId) {
321
- const comboEnabled = this.isWorkoutComboEnabled();
322
321
  try {
323
- return { routeId, attachedWorkout: this.getAttachedWorkoutProps(), comboEnabled };
322
+ return { routeId, attachedWorkout: this.getAttachedWorkoutProps() };
324
323
  }
325
324
  catch (err) {
326
325
  this.logError(err, 'getRouteDetailsProps');
327
- return { routeId, attachedWorkout: null, comboEnabled };
326
+ return { routeId, attachedWorkout: null };
328
327
  }
329
328
  }
330
329
  getAttachedWorkoutProps() {
@@ -35,7 +35,6 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
35
35
  import { Singleton } from "../../base/types";
36
36
  import { IncyclistPageService } from "../../base/pages";
37
37
  import { Injectable } from "../../base/decorators";
38
- import { useAppState } from "../../appstate";
39
38
  import { Observer } from "../../base/types/observer";
40
39
  import { useUserSettings } from "../../settings";
41
40
  import { useWorkoutCalendar } from "../calendar";
@@ -56,7 +55,6 @@ let WorkoutListPageService = (() => {
56
55
  let _getRouteList_decorators;
57
56
  let _getWorkoutCalendar_decorators;
58
57
  let _getUserSettings_decorators;
59
- let _getAppState_decorators;
60
58
  var WorkoutListPageService = class extends _classSuper {
61
59
  static { _classThis = this; }
62
60
  static {
@@ -66,13 +64,11 @@ let WorkoutListPageService = (() => {
66
64
  _getRouteList_decorators = [Injectable];
67
65
  _getWorkoutCalendar_decorators = [Injectable];
68
66
  _getUserSettings_decorators = [Injectable];
69
- _getAppState_decorators = [Injectable];
70
67
  __esDecorate(this, null, _getDevicePairing_decorators, { kind: "method", name: "getDevicePairing", static: false, private: false, access: { has: obj => "getDevicePairing" in obj, get: obj => obj.getDevicePairing }, metadata: _metadata }, null, _instanceExtraInitializers);
71
68
  __esDecorate(this, null, _getWorkoutList_decorators, { kind: "method", name: "getWorkoutList", static: false, private: false, access: { has: obj => "getWorkoutList" in obj, get: obj => obj.getWorkoutList }, metadata: _metadata }, null, _instanceExtraInitializers);
72
69
  __esDecorate(this, null, _getRouteList_decorators, { kind: "method", name: "getRouteList", static: false, private: false, access: { has: obj => "getRouteList" in obj, get: obj => obj.getRouteList }, metadata: _metadata }, null, _instanceExtraInitializers);
73
70
  __esDecorate(this, null, _getWorkoutCalendar_decorators, { kind: "method", name: "getWorkoutCalendar", static: false, private: false, access: { has: obj => "getWorkoutCalendar" in obj, get: obj => obj.getWorkoutCalendar }, metadata: _metadata }, null, _instanceExtraInitializers);
74
71
  __esDecorate(this, null, _getUserSettings_decorators, { kind: "method", name: "getUserSettings", static: false, private: false, access: { has: obj => "getUserSettings" in obj, get: obj => obj.getUserSettings }, metadata: _metadata }, null, _instanceExtraInitializers);
75
- __esDecorate(this, null, _getAppState_decorators, { kind: "method", name: "getAppState", static: false, private: false, access: { has: obj => "getAppState" in obj, get: obj => obj.getAppState }, metadata: _metadata }, null, _instanceExtraInitializers);
76
72
  __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
77
73
  WorkoutListPageService = _classThis = _classDescriptor.value;
78
74
  if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
@@ -94,11 +90,7 @@ let WorkoutListPageService = (() => {
94
90
  openPage() {
95
91
  try {
96
92
  super.openPage();
97
- let pageType;
98
- if (!this.getAppState().hasFeature('MOBILE_WORKOUTS')) {
99
- pageType = 'placeholder';
100
- }
101
- this.logEvent({ message: 'page shown', page: 'Workouts', pageType });
93
+ this.logEvent({ message: 'page shown', page: 'Workouts' });
102
94
  const { observer } = this.getWorkoutList().open();
103
95
  this.listObserver = observer;
104
96
  this.listObserver?.on('started', this.listUpdateHandler);
@@ -131,9 +123,6 @@ let WorkoutListPageService = (() => {
131
123
  }
132
124
  getPageDisplayProps() {
133
125
  try {
134
- if (!this.getAppState().hasFeature('MOBILE_WORKOUTS')) {
135
- return { pageType: 'placeholder' };
136
- }
137
126
  const service = this.getWorkoutList();
138
127
  const loading = service.isStillLoading();
139
128
  const upcoming = this.getUpcomingTrainingProps();
@@ -173,8 +162,7 @@ let WorkoutListPageService = (() => {
173
162
  canDelete: card.canDelete(),
174
163
  isScheduled,
175
164
  date: isScheduled ? settingsProps.date : undefined,
176
- attachedRoute: this.getAttachedRouteProps(),
177
- comboEnabled: this.isWorkoutComboEnabled()
165
+ attachedRoute: this.getAttachedRouteProps()
178
166
  };
179
167
  }
180
168
  catch (err) {
@@ -523,9 +511,6 @@ let WorkoutListPageService = (() => {
523
511
  getUserSettings() {
524
512
  return useUserSettings();
525
513
  }
526
- getAppState() {
527
- return useAppState();
528
- }
529
514
  };
530
515
  return WorkoutListPageService = _classThis;
531
516
  })();
@@ -10,7 +10,6 @@ export type { AttachedWorkoutProps };
10
10
  export interface ActivityDetailsProps {
11
11
  activityId: string;
12
12
  attachedWorkout: AttachedWorkoutProps | null;
13
- comboEnabled: boolean;
14
13
  }
15
14
  export interface IActivitiesPageService extends IPageService {
16
15
  getPageDisplayProps(): ActivitiesPageDisplayProps;
@@ -1,4 +1,4 @@
1
- export type FeatureToggle = 'NEW_SEARCH_UI' | 'CONTROLLERS' | 'MOBILE_WORKOUTS' | 'WEBBLE_WINDOWS' | 'MOBILE_NEXT_VIDEO' | 'MOBILE_WORKOUT_ROUTE_COMBO';
1
+ export type FeatureToggle = 'NEW_SEARCH_UI' | 'CONTROLLERS' | 'WEBBLE_WINDOWS' | 'MOBILE_NEXT_VIDEO';
2
2
  export type Interfaces = 'ant' | 'ble' | 'serial' | 'wifi' | 'tcpip';
3
3
  export type BLEFeatures = {
4
4
  services: Array<string>;
@@ -20,5 +20,4 @@ export declare class IncyclistPageService extends IncyclistService implements IP
20
20
  protected getUIBinding(): import("../../api").INativeUI;
21
21
  protected getBindings(): import("../../api").IncyclistBindings;
22
22
  protected getAppState(): import("../../appstate").AppStateService;
23
- protected isWorkoutComboEnabled(): boolean;
24
23
  }
@@ -41,7 +41,6 @@ export interface AttachedWorkoutProps {
41
41
  export interface RouteDetailsProps {
42
42
  routeId: string;
43
43
  attachedWorkout: AttachedWorkoutProps | null;
44
- comboEnabled: boolean;
45
44
  }
46
45
  export type DownloadStatus = 'downloading' | 'done' | 'failed' | 'required';
47
46
  export interface DownloadRowDisplayProps {
@@ -60,6 +60,5 @@ export declare class WorkoutListPageService extends IncyclistPageService impleme
60
60
  protected getRouteList(): import("../../routes").RouteListService;
61
61
  protected getWorkoutCalendar(): import("../calendar").WorkoutCalendarService;
62
62
  protected getUserSettings(): import("../../settings").UserSettingsService;
63
- protected getAppState(): import("../../appstate").AppStateService;
64
63
  }
65
64
  export declare const getWorkoutListPageService: () => WorkoutListPageService;
@@ -1,9 +1,6 @@
1
1
  import { FileInfo, IObserver } from "../../types";
2
2
  import { Workout } from "../base/model";
3
- export type WorkoutListPageDisplayProps = WorkoutListPlaceholderProps | WorkoutListContentProps;
4
- export interface WorkoutListPlaceholderProps {
5
- pageType: 'placeholder';
6
- }
3
+ export type WorkoutListPageDisplayProps = WorkoutListContentProps;
7
4
  export interface WorkoutListContentProps {
8
5
  pageType: 'list';
9
6
  loading: boolean;
@@ -62,7 +59,6 @@ export interface WorkoutDetailsProps {
62
59
  isScheduled: boolean;
63
60
  date?: Date;
64
61
  attachedRoute: AttachedRouteProps | null;
65
- comboEnabled: boolean;
66
62
  }
67
63
  export interface WorkoutImportDisplayProps {
68
64
  phase: 'landing' | 'importing' | 'result' | 'error';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.7.102",
3
+ "version": "1.7.103",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.27"
6
6
  },