From 95cf71055b31c377a0f4ef9f3be145bd87efe5e3 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 5 Oct 2021 17:52:36 +0200 Subject: [PATCH] Client - display message when no workouts --- .../src/components/Common/NoWorkouts.vue | 35 +++++++++++++++++++ .../components/Common/StatsChart/index.vue | 7 +++- .../components/Dashboard/Timeline/index.vue | 11 +++--- .../components/Dashboard/UserMonthStats.vue | 1 + .../Dashboard/UserRecords/index.vue | 3 ++ .../src/components/Statistics/index.vue | 5 +++ .../src/components/Workouts/WorkoutsList.vue | 5 +++ .../src/locales/en/workouts.json | 1 + .../src/locales/fr/workouts.json | 1 + .../src/views/StatisticsView.vue | 14 +++++--- 10 files changed, 71 insertions(+), 12 deletions(-) create mode 100644 fittrackee_client/src/components/Common/NoWorkouts.vue diff --git a/fittrackee_client/src/components/Common/NoWorkouts.vue b/fittrackee_client/src/components/Common/NoWorkouts.vue new file mode 100644 index 00000000..8a5966c2 --- /dev/null +++ b/fittrackee_client/src/components/Common/NoWorkouts.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/fittrackee_client/src/components/Common/StatsChart/index.vue b/fittrackee_client/src/components/Common/StatsChart/index.vue index 96ee1c49..98c5a693 100644 --- a/fittrackee_client/src/components/Common/StatsChart/index.vue +++ b/fittrackee_client/src/components/Common/StatsChart/index.vue @@ -1,6 +1,6 @@ diff --git a/fittrackee_client/src/components/Dashboard/UserRecords/index.vue b/fittrackee_client/src/components/Dashboard/UserRecords/index.vue index 591c068b..1870ba4a 100644 --- a/fittrackee_client/src/components/Dashboard/UserRecords/index.vue +++ b/fittrackee_client/src/components/Dashboard/UserRecords/index.vue @@ -62,7 +62,10 @@ .user-records { .no-records { + border: solid 1px var(--card-border-color); + border-radius: $border-radius; padding: $default-padding; + margin: $default-margin; } } diff --git a/fittrackee_client/src/components/Statistics/index.vue b/fittrackee_client/src/components/Statistics/index.vue index ae27b473..72a477f5 100644 --- a/fittrackee_client/src/components/Statistics/index.vue +++ b/fittrackee_client/src/components/Statistics/index.vue @@ -123,6 +123,11 @@ @import '~@/scss/base'; #user-statistics { + &.stats-disabled { + opacity: 0.3; + pointer-events: none; + } + ::v-deep(.chart-radio) { justify-content: space-around; padding: $default-padding * 3 $default-padding diff --git a/fittrackee_client/src/components/Workouts/WorkoutsList.vue b/fittrackee_client/src/components/Workouts/WorkoutsList.vue index b8d8b55a..6507ca07 100644 --- a/fittrackee_client/src/components/Workouts/WorkoutsList.vue +++ b/fittrackee_client/src/components/Workouts/WorkoutsList.vue @@ -93,6 +93,7 @@ +
@@ -15,6 +20,7 @@ import { ComputedRef, computed, defineComponent } from 'vue' import Card from '@/components/Common/Card.vue' + import NoWorkouts from '@/components/Common/NoWorkouts.vue' import Statistics from '@/components/Statistics/index.vue' import { USER_STORE, SPORTS_STORE } from '@/store/constants' import { ISport } from '@/types/sports' @@ -25,6 +31,7 @@ name: 'StatisticsView', components: { Card, + NoWorkouts, Statistics, }, setup() { @@ -49,10 +56,9 @@ width: 100%; margin-bottom: 30px; .container { + display: flex; + flex-direction: column; width: 100%; - ::v-deep(.card) { - width: 100%; - } } }