incyclist-services 1.7.78 → 1.7.79

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.
@@ -74,6 +74,7 @@ let WorkoutListPageService = (() => {
74
74
  __runInitializers(_classThis, _classExtraInitializers);
75
75
  }
76
76
  groupFilter = (__runInitializers(this, _instanceExtraInitializers), null);
77
+ detailWorkoutId = null;
77
78
  importPhase;
78
79
  importGroup;
79
80
  importingFileName;
@@ -132,7 +133,7 @@ let WorkoutListPageService = (() => {
132
133
  const workouts = groups.selected ? allWorkouts.filter(w => w.group === groups.selected) : allWorkouts;
133
134
  const selectedId = service.getSelected()?.id ?? null;
134
135
  const isEmpty = allWorkouts.length === 0;
135
- return { pageType: 'list', loading, upcoming, groups, workouts, selectedId, isEmpty };
136
+ return { pageType: 'list', loading, upcoming, groups, workouts, selectedId, isEmpty, detailWorkoutId: this.detailWorkoutId };
136
137
  }
137
138
  catch (err) {
138
139
  this.logError(err, 'getPageDisplayProps');
@@ -199,10 +200,24 @@ let WorkoutListPageService = (() => {
199
200
  }
200
201
  }
201
202
  onOpenDetails(id) {
202
- this.logEvent({ message: 'details opened', id });
203
+ try {
204
+ this.detailWorkoutId = id;
205
+ this.logEvent({ message: 'details opened', id });
206
+ this.emitPageUpdate();
207
+ }
208
+ catch (err) {
209
+ this.logError(err, 'onOpenDetails');
210
+ }
203
211
  }
204
212
  onCloseDetails() {
205
- this.logEvent({ message: 'details closed' });
213
+ try {
214
+ this.detailWorkoutId = null;
215
+ this.logEvent({ message: 'details closed' });
216
+ this.emitPageUpdate();
217
+ }
218
+ catch (err) {
219
+ this.logError(err, 'onCloseDetails');
220
+ }
206
221
  }
207
222
  onSetFtp(ftp) {
208
223
  try {
@@ -71,6 +71,7 @@ let WorkoutListPageService = (() => {
71
71
  __runInitializers(_classThis, _classExtraInitializers);
72
72
  }
73
73
  groupFilter = (__runInitializers(this, _instanceExtraInitializers), null);
74
+ detailWorkoutId = null;
74
75
  importPhase;
75
76
  importGroup;
76
77
  importingFileName;
@@ -129,7 +130,7 @@ let WorkoutListPageService = (() => {
129
130
  const workouts = groups.selected ? allWorkouts.filter(w => w.group === groups.selected) : allWorkouts;
130
131
  const selectedId = service.getSelected()?.id ?? null;
131
132
  const isEmpty = allWorkouts.length === 0;
132
- return { pageType: 'list', loading, upcoming, groups, workouts, selectedId, isEmpty };
133
+ return { pageType: 'list', loading, upcoming, groups, workouts, selectedId, isEmpty, detailWorkoutId: this.detailWorkoutId };
133
134
  }
134
135
  catch (err) {
135
136
  this.logError(err, 'getPageDisplayProps');
@@ -196,10 +197,24 @@ let WorkoutListPageService = (() => {
196
197
  }
197
198
  }
198
199
  onOpenDetails(id) {
199
- this.logEvent({ message: 'details opened', id });
200
+ try {
201
+ this.detailWorkoutId = id;
202
+ this.logEvent({ message: 'details opened', id });
203
+ this.emitPageUpdate();
204
+ }
205
+ catch (err) {
206
+ this.logError(err, 'onOpenDetails');
207
+ }
200
208
  }
201
209
  onCloseDetails() {
202
- this.logEvent({ message: 'details closed' });
210
+ try {
211
+ this.detailWorkoutId = null;
212
+ this.logEvent({ message: 'details closed' });
213
+ this.emitPageUpdate();
214
+ }
215
+ catch (err) {
216
+ this.logError(err, 'onCloseDetails');
217
+ }
203
218
  }
204
219
  onSetFtp(ftp) {
205
220
  try {
@@ -6,6 +6,7 @@ import { WorkoutListService } from "../list/service";
6
6
  import { GroupFilterProps, IWorkoutListPageService, UpcomingTrainingProps, WorkoutDetailsProps, WorkoutImportDisplayProps, WorkoutListItemProps, WorkoutListPageDisplayProps } from "./types";
7
7
  export declare class WorkoutListPageService extends IncyclistPageService implements IWorkoutListPageService {
8
8
  protected groupFilter: string | null;
9
+ protected detailWorkoutId: string | null;
9
10
  protected importPhase: 'landing' | 'importing' | 'result' | 'error' | undefined;
10
11
  protected importGroup: string;
11
12
  protected importingFileName: string;
@@ -12,6 +12,7 @@ export interface WorkoutListContentProps {
12
12
  workouts: WorkoutListItemProps[];
13
13
  selectedId: string | null;
14
14
  isEmpty: boolean;
15
+ detailWorkoutId: string | null;
15
16
  }
16
17
  export interface UpcomingTrainingProps {
17
18
  items: ScheduledWorkoutItemProps[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.7.78",
3
+ "version": "1.7.79",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.27"
6
6
  },