From 3f64b88f60d04b375eb23906ee4e865584428336 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 27 Jul 2022 09:04:01 +0200 Subject: [PATCH] Client - display HA record icon depending on user preferences --- .../Dashboard/UserCalendar/CalendarCells.vue | 3 +++ .../Dashboard/UserCalendar/CalendarWorkout.vue | 11 +++++++---- .../Dashboard/UserCalendar/CalendarWorkouts.vue | 4 +++- .../src/components/Dashboard/UserCalendar/index.vue | 1 + .../components/Workout/WorkoutDetail/WorkoutData.vue | 10 ++++++++-- .../src/components/Workout/WorkoutDetail/index.vue | 1 + 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/fittrackee_client/src/components/Dashboard/UserCalendar/CalendarCells.vue b/fittrackee_client/src/components/Dashboard/UserCalendar/CalendarCells.vue index 1973a5a0..8a27eaa1 100644 --- a/fittrackee_client/src/components/Dashboard/UserCalendar/CalendarCells.vue +++ b/fittrackee_client/src/components/Dashboard/UserCalendar/CalendarCells.vue @@ -14,6 +14,7 @@
{{ format(day, 'd') }} @@ -34,6 +35,7 @@ interface Props { currentDay: Date + displayHARecord: boolean endDate: Date sports: ISport[] startDate: Date @@ -45,6 +47,7 @@ const { currentDay, + displayHARecord, endDate, sports, startDate, diff --git a/fittrackee_client/src/components/Dashboard/UserCalendar/CalendarWorkout.vue b/fittrackee_client/src/components/Dashboard/UserCalendar/CalendarWorkout.vue index 4273d386..30d20e05 100644 --- a/fittrackee_client/src/components/Dashboard/UserCalendar/CalendarWorkout.vue +++ b/fittrackee_client/src/components/Dashboard/UserCalendar/CalendarWorkout.vue @@ -16,9 +16,11 @@ class="fa fa-trophy custom-fa-small" aria-hidden="true" :title=" - workout.records.map( - (record) => ` ${$t(`workouts.RECORD_${record.record_type}`)}` - ) + workout.records + .filter((record) => + displayHARecord ? true : record.record_type !== 'HA' + ) + .map((record) => ` ${$t(`workouts.RECORD_${record.record_type}`)}`) " /> @@ -30,13 +32,14 @@ import { IWorkout } from '@/types/workouts' interface Props { + displayHARecord: boolean workout: IWorkout sportLabel: string sportColor: string | null } const props = defineProps() - const { workout, sportLabel, sportColor } = toRefs(props) + const { displayHARecord, workout, sportLabel, sportColor } = toRefs(props)