commit
bc352b1277
2
fittrackee/dist/index.html
vendored
2
fittrackee/dist/index.html
vendored
@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="/favicon.ico"><![endif]--><link rel="stylesheet" href="/static/css/fork-awesome.min.css"/><link rel="stylesheet" href="/static/css/leaflet.css"/><title>FitTrackee</title><script defer="defer" src="/static/js/chunk-vendors.1d69c386.js"></script><script defer="defer" src="/static/js/app.27b920e4.js"></script><link href="/static/css/app.33ec7d01.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png"><link rel="manifest" href="/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="fittrackee_client"><link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but FitTrackee doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="/favicon.ico"><![endif]--><link rel="stylesheet" href="/static/css/fork-awesome.min.css"/><link rel="stylesheet" href="/static/css/leaflet.css"/><title>FitTrackee</title><script defer="defer" src="/static/js/chunk-vendors.1d69c386.js"></script><script defer="defer" src="/static/js/app.622d8445.js"></script><link href="/static/css/app.966592aa.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png"><link rel="manifest" href="/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="fittrackee_client"><link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but FitTrackee doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
2
fittrackee/dist/service-worker.js
vendored
2
fittrackee/dist/service-worker.js
vendored
File diff suppressed because one or more lines are too long
2
fittrackee/dist/service-worker.js.map
vendored
2
fittrackee/dist/service-worker.js.map
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
fittrackee/dist/static/js/app.27b920e4.js
vendored
2
fittrackee/dist/static/js/app.27b920e4.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
fittrackee/dist/static/js/app.622d8445.js
vendored
Normal file
2
fittrackee/dist/static/js/app.622d8445.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
fittrackee/dist/static/js/app.622d8445.js.map
vendored
Normal file
1
fittrackee/dist/static/js/app.622d8445.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1,10 +1,9 @@
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
from datetime import datetime
|
||||
from io import BytesIO
|
||||
from typing import Any, Dict, Optional
|
||||
from unittest.mock import Mock
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
from flask import Flask
|
||||
@ -300,23 +299,25 @@ class TestPostWorkoutWithGpx(ApiTestCaseMixin, CallArgsMixin):
|
||||
client, auth_token = self.get_test_client_and_auth_token(
|
||||
app, user_1.email
|
||||
)
|
||||
expected_suffix = self.random_string()
|
||||
|
||||
client.post(
|
||||
'/api/workouts',
|
||||
data=dict(
|
||||
file=(BytesIO(str.encode(gpx_file)), 'example.gpx'),
|
||||
data='{"sport_id": 1}',
|
||||
),
|
||||
headers=dict(
|
||||
content_type='multipart/form-data',
|
||||
Authorization=f'Bearer {auth_token}',
|
||||
),
|
||||
)
|
||||
with patch('secrets.token_urlsafe', return_value=expected_suffix):
|
||||
client.post(
|
||||
'/api/workouts',
|
||||
data=dict(
|
||||
file=(BytesIO(str.encode(gpx_file)), 'example.gpx'),
|
||||
data='{"sport_id": 1}',
|
||||
),
|
||||
headers=dict(
|
||||
content_type='multipart/form-data',
|
||||
Authorization=f'Bearer {auth_token}',
|
||||
),
|
||||
)
|
||||
|
||||
workout = Workout.query.first()
|
||||
assert re.match(
|
||||
r'^workouts/1/2018-03-13_12-44-45_1_([\w\d_-]*).gpx$',
|
||||
workout.gpx,
|
||||
assert (
|
||||
workout.gpx
|
||||
== f"workouts/1/2018-03-13_12-44-45_1_{expected_suffix}.gpx"
|
||||
)
|
||||
|
||||
def test_it_creates_workout_with_expecting_map_path(
|
||||
@ -325,23 +326,25 @@ class TestPostWorkoutWithGpx(ApiTestCaseMixin, CallArgsMixin):
|
||||
client, auth_token = self.get_test_client_and_auth_token(
|
||||
app, user_1.email
|
||||
)
|
||||
expected_suffix = self.random_string()
|
||||
|
||||
client.post(
|
||||
'/api/workouts',
|
||||
data=dict(
|
||||
file=(BytesIO(str.encode(gpx_file)), 'example.gpx'),
|
||||
data='{"sport_id": 1}',
|
||||
),
|
||||
headers=dict(
|
||||
content_type='multipart/form-data',
|
||||
Authorization=f'Bearer {auth_token}',
|
||||
),
|
||||
)
|
||||
with patch('secrets.token_urlsafe', return_value=expected_suffix):
|
||||
client.post(
|
||||
'/api/workouts',
|
||||
data=dict(
|
||||
file=(BytesIO(str.encode(gpx_file)), 'example.gpx'),
|
||||
data='{"sport_id": 1}',
|
||||
),
|
||||
headers=dict(
|
||||
content_type='multipart/form-data',
|
||||
Authorization=f'Bearer {auth_token}',
|
||||
),
|
||||
)
|
||||
|
||||
workout = Workout.query.first()
|
||||
assert re.match(
|
||||
r'^workouts/1/2018-03-13_12-44-45_1_([\w\d_-]*).png$',
|
||||
workout.map,
|
||||
assert (
|
||||
workout.map
|
||||
== f"workouts/1/2018-03-13_12-44-45_1_{expected_suffix}.png"
|
||||
)
|
||||
|
||||
def test_it_adds_a_workout_with_gpx_without_name(
|
||||
|
@ -1,5 +1,5 @@
|
||||
import os
|
||||
import tempfile
|
||||
import secrets
|
||||
import zipfile
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Dict, List, Optional, Tuple, Union
|
||||
@ -272,9 +272,8 @@ def get_new_file_path(
|
||||
"""
|
||||
if not extension and old_filename:
|
||||
extension = f".{old_filename.rsplit('.', 1)[1].lower()}"
|
||||
_, new_filename = tempfile.mkstemp(
|
||||
prefix=f'{workout_date}_{sport_id}_', suffix=extension
|
||||
)
|
||||
suffix = secrets.token_urlsafe(8)
|
||||
new_filename = f"{workout_date}_{sport_id}_{suffix}{extension}"
|
||||
dir_path = os.path.join('workouts', str(auth_user_id))
|
||||
file_path = os.path.join(dir_path, new_filename.split('/')[-1])
|
||||
return file_path
|
||||
|
@ -34,7 +34,7 @@ authApi.interceptors.response.use(
|
||||
return response
|
||||
},
|
||||
(error) => {
|
||||
if (error.message !== 'canceled') {
|
||||
if (error.message !== 'canceled' && error.response) {
|
||||
removeRequestIfPending(error.response.config)
|
||||
}
|
||||
return Promise.reject(error)
|
||||
|
@ -24,7 +24,7 @@ api.interceptors.response.use(
|
||||
return response
|
||||
},
|
||||
(error) => {
|
||||
if (error.message !== 'canceled') {
|
||||
if (error.message !== 'canceled' && error.response) {
|
||||
removeRequestIfPending(error.response.config)
|
||||
}
|
||||
return Promise.reject(error)
|
||||
|
@ -68,20 +68,17 @@
|
||||
background-color: var(--modal-background-color);
|
||||
padding: $default-padding;
|
||||
z-index: 1240;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.custom-modal {
|
||||
background-color: var(--app-background-color);
|
||||
border-radius: $border-radius;
|
||||
max-width: 500px;
|
||||
margin: 25% auto;
|
||||
z-index: 1250;
|
||||
|
||||
@media screen and (max-width: $medium-limit) {
|
||||
margin: 15% auto;
|
||||
width: 100%;
|
||||
}
|
||||
@media screen and (max-width: $small-limit) {
|
||||
margin: 50% 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user