diff --git a/fittrackee_client/src/components/Common/StatsChart/index.vue b/fittrackee_client/src/components/Common/StatsChart/index.vue
index 0016ad9f..af45059d 100644
--- a/fittrackee_client/src/components/Common/StatsChart/index.vue
+++ b/fittrackee_client/src/components/Common/StatsChart/index.vue
@@ -10,6 +10,7 @@
type="radio"
name="total_distance"
:checked="displayedData === 'total_distance'"
+ :disabled="isDisabled"
@click="updateDisplayData"
/>
{{ $t('workouts.DISTANCE') }}
@@ -19,6 +20,7 @@
type="radio"
name="total_duration"
:checked="displayedData === 'total_duration'"
+ :disabled="isDisabled"
@click="updateDisplayData"
/>
{{ $t('workouts.DURATION') }}
@@ -28,6 +30,7 @@
type="radio"
name="nb_workouts"
:checked="displayedData === 'nb_workouts'"
+ :disabled="isDisabled"
@click="updateDisplayData"
/>
{{ $t('workouts.WORKOUT', 2) }}
@@ -37,6 +40,7 @@
type="radio"
name="average_speed"
:checked="displayedData === 'average_speed'"
+ :disabled="isDisabled"
@click="updateDisplayData"
/>
{{ $t('workouts.AVERAGE_SPEED') }}
@@ -46,6 +50,7 @@
type="radio"
name="total_ascent"
:checked="displayedData === 'total_ascent'"
+ :disabled="isDisabled"
@click="updateDisplayData"
/>
{{ $t('workouts.ASCENT') }}
@@ -55,6 +60,7 @@
type="radio"
name="total_descent"
:checked="displayedData === 'total_descent'"
+ :disabled="isDisabled"
@click="updateDisplayData"
/>
{{ $t('workouts.DESCENT') }}
@@ -130,6 +136,10 @@
type: Boolean,
default: false,
},
+ isDisabled: {
+ type: Boolean,
+ default: false,
+ },
},
setup(props) {
const store = useStore()
diff --git a/fittrackee_client/src/components/Statistics/StatsMenu.vue b/fittrackee_client/src/components/Statistics/StatsMenu.vue
index d3ecc1ec..aa9d6767 100644
--- a/fittrackee_client/src/components/Statistics/StatsMenu.vue
+++ b/fittrackee_client/src/components/Statistics/StatsMenu.vue
@@ -4,6 +4,7 @@
class="chart-arrow transparent"
@click="emit('arrowClick', true)"
@keydown.enter="emit('arrowClick', true)"
+ :disabled="isDisabled"
>
@@ -21,10 +22,11 @@
:name="frame"
:checked="selectedTimeFrame === frame"
@input="onUpdateTimeFrame(frame)"
+ :disabled="isDisabled"
/>
@@ -38,6 +40,7 @@
class="chart-arrow transparent"
@click="emit('arrowClick', false)"
@keydown.enter="emit('arrowClick', false)"
+ :disabled="isDisabled"
>
@@ -45,7 +48,12 @@
diff --git a/fittrackee_client/src/components/Statistics/index.vue b/fittrackee_client/src/components/Statistics/index.vue
index 4116b0d9..31f46425 100644
--- a/fittrackee_client/src/components/Statistics/index.vue
+++ b/fittrackee_client/src/components/Statistics/index.vue
@@ -3,6 +3,7 @@
()
diff --git a/fittrackee_client/src/views/StatisticsView.vue b/fittrackee_client/src/views/StatisticsView.vue
index d2ef598d..959167ce 100644
--- a/fittrackee_client/src/views/StatisticsView.vue
+++ b/fittrackee_client/src/views/StatisticsView.vue
@@ -5,9 +5,10 @@
{{ $t('statistics.STATISTICS') }}
@@ -36,6 +37,9 @@
authUser.value.sports_list.includes(sport.id)
)
)
+ const isDisabled: ComputedRef = computed(
+ () => authUser.value.nb_workouts === 0
+ )