From 8004e41ae355ef2e012b301085dd3d8c8cb73fc4 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 19 Jul 2023 11:15:28 +0200 Subject: [PATCH] API & Client - add Open Water Swimming --- ...34_24eb097614e4_add_open_water_swimming.py | 33 ++++ .../Images/SportImage/OpenWaterSwimming.vue | 145 ++++++++++++++++++ .../Common/Images/SportImage/index.vue | 2 + fittrackee_client/src/locales/en/sports.json | 3 + fittrackee_client/src/locales/fr/sports.json | 3 + fittrackee_client/src/utils/sports.ts | 1 + 6 files changed, 187 insertions(+) create mode 100644 fittrackee/migrations/versions/34_24eb097614e4_add_open_water_swimming.py create mode 100644 fittrackee_client/src/components/Common/Images/SportImage/OpenWaterSwimming.vue diff --git a/fittrackee/migrations/versions/34_24eb097614e4_add_open_water_swimming.py b/fittrackee/migrations/versions/34_24eb097614e4_add_open_water_swimming.py new file mode 100644 index 00000000..e6fc6a72 --- /dev/null +++ b/fittrackee/migrations/versions/34_24eb097614e4_add_open_water_swimming.py @@ -0,0 +1,33 @@ +"""add open water swimming + +Revision ID: 24eb097614e4 +Revises: d22670a89a54 +Create Date: 2023-07-19 10:34:40.297525 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '24eb097614e4' +down_revision = 'd22670a89a54' +branch_labels = None +depends_on = None + + +def upgrade(): + op.execute( + """ + INSERT INTO sports (label, is_active, stopped_speed_threshold) + VALUES ('Open Water Swimming', True, 0.1) + """ + ) + +def downgrade(): + op.execute( + """ + DELETE FROM sports + WHERE label = 'Open Water Swimming'; + """ + ) diff --git a/fittrackee_client/src/components/Common/Images/SportImage/OpenWaterSwimming.vue b/fittrackee_client/src/components/Common/Images/SportImage/OpenWaterSwimming.vue new file mode 100644 index 00000000..61637dd3 --- /dev/null +++ b/fittrackee_client/src/components/Common/Images/SportImage/OpenWaterSwimming.vue @@ -0,0 +1,145 @@ + + + diff --git a/fittrackee_client/src/components/Common/Images/SportImage/index.vue b/fittrackee_client/src/components/Common/Images/SportImage/index.vue index dc573bf8..1d910f08 100644 --- a/fittrackee_client/src/components/Common/Images/SportImage/index.vue +++ b/fittrackee_client/src/components/Common/Images/SportImage/index.vue @@ -14,6 +14,7 @@ /> + @@ -34,6 +35,7 @@ import MountainBiking from '@/components/Common/Images/SportImage/MountainBiking.vue' import MountainBikingElectric from '@/components/Common/Images/SportImage/MountainBikingElectric.vue' import Mountaineering from '@/components/Common/Images/SportImage/Mountaineering.vue' + import OpenWaterSwimming from '@/components/Common/Images/SportImage/OpenWaterSwimming.vue' import Paragliding from '@/components/Common/Images/SportImage/Paragliding.vue' import Rowing from '@/components/Common/Images/SportImage/Rowing.vue' import Running from '@/components/Common/Images/SportImage/Running.vue' diff --git a/fittrackee_client/src/locales/en/sports.json b/fittrackee_client/src/locales/en/sports.json index 08a20fcc..5ed8e07d 100644 --- a/fittrackee_client/src/locales/en/sports.json +++ b/fittrackee_client/src/locales/en/sports.json @@ -20,6 +20,9 @@ "Mountaineering": { "LABEL": "Mountaineering" }, + "Open Water Swimming": { + "LABEL": "Open Water Swimming" + }, "Paragliding": { "LABEL": "Paragliding" }, diff --git a/fittrackee_client/src/locales/fr/sports.json b/fittrackee_client/src/locales/fr/sports.json index 6237e0ae..d624b91c 100644 --- a/fittrackee_client/src/locales/fr/sports.json +++ b/fittrackee_client/src/locales/fr/sports.json @@ -20,6 +20,9 @@ "Mountaineering": { "LABEL": "Alpinisme" }, + "Open Water Swimming": { + "LABEL": "Nage en eau libre" + }, "Paragliding": { "LABEL": "Parapente" }, diff --git a/fittrackee_client/src/utils/sports.ts b/fittrackee_client/src/utils/sports.ts index feafe3d0..de0a4c51 100644 --- a/fittrackee_client/src/utils/sports.ts +++ b/fittrackee_client/src/utils/sports.ts @@ -9,6 +9,7 @@ export const sportColors: Record = { 'Mountain Biking': '#d4b371', 'Mountain Biking (Electric)': '#fc9d6f', Mountaineering: '#48b3b7', + 'Open Water Swimming': '#4058a4', Paragliding: '#c23c50', Rowing: '#fcce72', Running: '#835b83',