diff --git a/.eslintrc.json b/.eslintrc.json index 5bbb54c8..48b39fbf 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -320,7 +320,7 @@ "react/no-unknown-property": "error", "react/no-unused-prop-types": "off", "react/prefer-es6-class": "error", - "react/prefer-stateless-function": "error", + "react/prefer-stateless-function": [1, { "ignorePureComponents": true }], "react/prop-types": "off", "react/react-in-jsx-scope": "error", "react/react-default-props": "off", diff --git a/.travis.yml b/.travis.yml index 5e229442..5e24351c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js -node_js: '10' +node_js: '11' -dist: trusty +dist: xenial sudo: required addons: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..ae87c606 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,35 @@ +# Change log + +## Version 0.1.1 - Fix and improvements (2019/01/xx) + +### Issues Closed + +#### Bugs Fixed + +* [#31](https://github.com/SamR1/FitTrackee/issues/31) - Use moving duration for stats +* [#29](https://github.com/SamR1/FitTrackee/issues/29) - Pause duration calculation with segments +* [#26](https://github.com/SamR1/FitTrackee/issues/26) - Total is incorrect in tooltip when duration is displayed +* [#24](https://github.com/SamR1/FitTrackee/issues/24) - Some distances are not displayed correctly on current month statistics + +#### New Features + +* [#25](https://github.com/SamR1/FitTrackee/issues/25) - Display records on calendar +* [#22](https://github.com/SamR1/FitTrackee/issues/22) - Add a total on current month statistics + +In this release 6 issues were closed. + + +## Version 0.1 - Minimal version (2018-07-04) + +### Issues Closed + +#### New Features + +* [#11](https://github.com/SamR1/FitTrackee/issues/11) - Timezone support +* [#10](https://github.com/SamR1/FitTrackee/issues/10) - Add a note to an activity +* [#9](https://github.com/SamR1/FitTrackee/issues/9) - User statistics on dashboard +* [#8](https://github.com/SamR1/FitTrackee/issues/8) - Add weather to activities +* [#3](https://github.com/SamR1/FitTrackee/issues/3) - Search filter for activities +* [#2](https://github.com/SamR1/FitTrackee/issues/2) - Calendar to view activities + +In this release 6 issues were closed. diff --git a/README.md b/README.md index 5b81223b..2c8ed82f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This web application allows you to track your outdoor activities from gpx files No mobile app is developed yet, but several existing mobile apps can store workouts data locally and export them into a gpx file. Examples (for Android): * [Runner Up](https://github.com/jonasoreland/runnerup) (GPL v3) -* [ForRunners](https://github.com/brvier/ForRunners) (GPL v3) +* [ForRunners](https://gitlab.com/brvier/ForRunners) (GPL v3) * [AlpineQuest](https://www.alpinequest.net/) (Proprietary, no trackers according to [exodus privay report](https://reports.exodus-privacy.eu.org/reports/2975/)) Maps are displayed using [Open Street Map](https://www.openstreetmap.org). diff --git a/docs/images/fittrackee_screenshot-01.png b/docs/images/fittrackee_screenshot-01.png index e15d1933..22f701e6 100644 Binary files a/docs/images/fittrackee_screenshot-01.png and b/docs/images/fittrackee_screenshot-01.png differ diff --git a/docs/images/fittrackee_screenshot-02.png b/docs/images/fittrackee_screenshot-02.png index 13916579..eac84a5c 100644 Binary files a/docs/images/fittrackee_screenshot-02.png and b/docs/images/fittrackee_screenshot-02.png differ diff --git a/docs/images/fittrackee_screenshot-03.png b/docs/images/fittrackee_screenshot-03.png index b7f8f5c6..cb64d3df 100644 Binary files a/docs/images/fittrackee_screenshot-03.png and b/docs/images/fittrackee_screenshot-03.png differ diff --git a/fittrackee_api/Pipfile.lock b/fittrackee_api/Pipfile.lock index 81718a74..4d7939d7 100644 --- a/fittrackee_api/Pipfile.lock +++ b/fittrackee_api/Pipfile.lock @@ -211,38 +211,38 @@ }, "pillow": { "hashes": [ - "sha256:0cd42fe2d99ec6ce23aaf00947a7b7956ad2ed4b1695fd37545c3b8eae06d95a", - "sha256:137bed8972089d65da63fb79b4949b0f2b99e9a58f1b494e82be43ba8b0f4226", - "sha256:14eb2b2e4f2a14f5c89fd0edf55c5af0bf1a40fdf3838d81867f26f131cd557d", - "sha256:1fc43ce8c4fa3754222cd6831d599ad17ca2fc9868d2fb52f4e5362dfbfaf379", - "sha256:26dfeee23a86dad6277a63d18f61f53b957cb2cd3506dbbd74b88ba2fa65b3b1", - "sha256:2e0e582942e025cc58f669499a8e0bffde5bcc8d42b65729f294c1dac54e4672", - "sha256:3bb8dd3ce101dd8b0b37eaae924a5bb93abb6ffdd034bf68a066a808e11768ab", - "sha256:3f07da3874f0b085421f1d4f979785131aa9d497501d8610d82f7378b33858f8", - "sha256:429b2b5ae5f57f8fd9ec2e012c1e7b342ff10f1a8977dc291976b9a3b4c096e1", - "sha256:4a000fdd89d77b6b675de27e1ab91c6fba517c08f19ee83e6716b78930634e04", - "sha256:4ccbe7cce6156391a3ecf447c79a7d4a1a0ecd3de79bdec9ca5e4f7242a306d1", - "sha256:4d08034196db41acb7392e4fccfc0448e7a87192c41d3011ad4093eac2c31ffd", - "sha256:6b202b1cb524bc76ed52a7eb0314f4b0a0497c7cceb9a93539b5a25800e1f2b6", - "sha256:8563b56fa7c34f1606848c2143ea67d27cf225b9726a1b041c3d27cf85e46edc", - "sha256:86d7421e8803d7bae2e594765c378a867b629d46b32fbfe5ed9fd95b30989feb", - "sha256:8d4bddedcb4ab99131d9705a75720efc48b3d006122dae1a4cc329496ac47c9a", - "sha256:a4929c6de9590635c34533609402c9da12b22bfc2feb8c0c4f38c39bab48a9ad", - "sha256:b0736e21798448cee3e663c0df7a6dfa83d805b3f3a45e67f7457a2f019e5fca", - "sha256:b669acba91d47395de84c9ca52a7ad393b487e5ae2e20b9b2790b22a57d479fa", - "sha256:bba993443921f2d077195b425a3283357f52b07807d53704610c1249d20b183a", - "sha256:bdf706a93d00547c9443b2654ae424fd54d5dece4bc4333e7035740aeb7a7cea", - "sha256:c5aa93e55175b9cde95279ccd03c93d218976b376480222d37be41d2c9c54510", - "sha256:cc11fd997d8ad71bb0412e983b711e49639c2ddba9b9dce04d4bdab575fe5f84", - "sha256:d584f1c33995c3dc16a35e30ef43e0881fa0d085f0fef29cebf154ffb5643363", - "sha256:d88f54bdefb7ddccb68efdd710d689aa6a09b875cc3e44b7e81ef54e0751e3a7", - "sha256:de0d323072be72fa4d74f4e013cd594e3f8ee03b2e0eac5876a3249fa076ef7b", - "sha256:f139c963c6679d236b2c45369524338eabd36a853fe23abd39ba246ab0a75aec", - "sha256:f41c0bf667c4c1c30b873eaa8d6bb894f6d721b3e38e9c993bddd1263c02fb1f", - "sha256:fbd0ea468b4ec04270533bf5206f1cd57746fcf226520bb133318fa276de2644", - "sha256:fe2d2850521c467c915ff0a6e27dc64c3c04c2f66612e0072672bd1bd4854b61" + "sha256:051de330a06c99d6f84bcf582960487835bcae3fc99365185dc2d4f65a390c0e", + "sha256:0ae5289948c5e0a16574750021bd8be921c27d4e3527800dc9c2c1d2abc81bf7", + "sha256:0b1efce03619cdbf8bcc61cfae81fcda59249a469f31c6735ea59badd4a6f58a", + "sha256:163136e09bd1d6c6c6026b0a662976e86c58b932b964f255ff384ecc8c3cefa3", + "sha256:18e912a6ccddf28defa196bd2021fe33600cbe5da1aa2f2e2c6df15f720b73d1", + "sha256:24ec3dea52339a610d34401d2d53d0fb3c7fd08e34b20c95d2ad3973193591f1", + "sha256:267f8e4c0a1d7e36e97c6a604f5b03ef58e2b81c1becb4fccecddcb37e063cc7", + "sha256:3273a28734175feebbe4d0a4cde04d4ed20f620b9b506d26f44379d3c72304e1", + "sha256:4c678e23006798fc8b6f4cef2eaad267d53ff4c1779bd1af8725cc11b72a63f3", + "sha256:4d4bc2e6bb6861103ea4655d6b6f67af8e5336e7216e20fff3e18ffa95d7a055", + "sha256:505738076350a337c1740a31646e1de09a164c62c07db3b996abdc0f9d2e50cf", + "sha256:5233664eadfa342c639b9b9977190d64ad7aca4edc51a966394d7e08e7f38a9f", + "sha256:5d95cb9f6cced2628f3e4de7e795e98b2659dfcc7176ab4a01a8b48c2c2f488f", + "sha256:7eda4c737637af74bac4b23aa82ea6fbb19002552be85f0b89bc27e3a762d239", + "sha256:801ddaa69659b36abf4694fed5aa9f61d1ecf2daaa6c92541bbbbb775d97b9fe", + "sha256:825aa6d222ce2c2b90d34a0ea31914e141a85edefc07e17342f1d2fdf121c07c", + "sha256:9c215442ff8249d41ff58700e91ef61d74f47dfd431a50253e1a1ca9436b0697", + "sha256:a3d90022f2202bbb14da991f26ca7a30b7e4c62bf0f8bf9825603b22d7e87494", + "sha256:a631fd36a9823638fe700d9225f9698fb59d049c942d322d4c09544dc2115356", + "sha256:a6523a23a205be0fe664b6b8747a5c86d55da960d9586db039eec9f5c269c0e6", + "sha256:a756ecf9f4b9b3ed49a680a649af45a8767ad038de39e6c030919c2f443eb000", + "sha256:b117287a5bdc81f1bac891187275ec7e829e961b8032c9e5ff38b70fd036c78f", + "sha256:ba04f57d1715ca5ff74bb7f8a818bf929a204b3b3c2c2826d1e1cc3b1c13398c", + "sha256:cd878195166723f30865e05d87cbaf9421614501a4bd48792c5ed28f90fd36ca", + "sha256:cee815cc62d136e96cf76771b9d3eb58e0777ec18ea50de5cfcede8a7c429aa8", + "sha256:d1722b7aa4b40cf93ac3c80d3edd48bf93b9208241d166a14ad8e7a20ee1d4f3", + "sha256:d7c1c06246b05529f9984435fc4fa5a545ea26606e7f450bdbe00c153f5aeaad", + "sha256:e9c8066249c040efdda84793a2a669076f92a301ceabe69202446abb4c5c5ef9", + "sha256:f227d7e574d050ff3996049e086e1f18c7bd2d067ef24131e50a1d3fe5831fbc", + "sha256:fc9a12aad714af36cf3ad0275a96a733526571e52710319855628f476dcb144e" ], - "version": "==5.4.0" + "version": "==5.4.1" }, "psycopg2-binary": { "hashes": [ @@ -316,11 +316,11 @@ }, "pytz": { "hashes": [ - "sha256:31cb35c89bd7d333cd32c5f278fca91b523b0834369e757f4c5641ea252236ca", - "sha256:8e0f8568c118d3077b46be7d654cc8167fa916092e28320cde048e54bfc9f1e6" + "sha256:32b0891edff07e28efe91284ed9c31e123d84bea3fd98e1f72be2508f43ef8d9", + "sha256:d5f05e487007e29e03409f9398d074e158d920d36eb82eaf66fb1136b0c5374c" ], "index": "pypi", - "version": "==2018.7" + "version": "==2018.9" }, "requests": { "hashes": [ @@ -345,9 +345,9 @@ }, "sqlalchemy": { "hashes": [ - "sha256:809547455d012734b4252081db1e6b4fc731de2299f3755708c39863625e1c77" + "sha256:6af3ca2f7f00844465ab4fa78337d487b39e53f516c51328aed4ed3a719d4264" ], - "version": "==1.2.15" + "version": "==1.2.16" }, "staticmap": { "hashes": [ @@ -358,11 +358,11 @@ }, "tqdm": { "hashes": [ - "sha256:3c4d4a5a41ef162dd61f1edb86b0e1c7859054ab656b2e7c7b77e7fbf6d9f392", - "sha256:5b4d5549984503050883bc126280b386f5f4ca87e6c023c5d015655ad75bdebb" + "sha256:b856be5cb6cfaee3b2733655c7c5bbc7751291bb5d1a4f54f020af4727570b3e", + "sha256:c9b9b5eeba13994a4c266aae7eef7aeeb0ba2973e431027e942b4faea139ef49" ], "index": "pypi", - "version": "==4.28.1" + "version": "==4.29.1" }, "urllib3": { "hashes": [ @@ -491,10 +491,10 @@ }, "pluggy": { "hashes": [ - "sha256:447ba94990e8014ee25ec853339faf7b0fc8050cdc3289d4d71f7f410fb90095", - "sha256:bde19360a8ec4dfd8a20dcb811780a30998101f078fc7ded6162f0076f50508f" + "sha256:8ddc32f03971bfdf900a81961a48ccf2fb677cf7715108f85295c67405798616", + "sha256:980710797ff6a041e9a73a5787804f848996ecaa6f8a1b1e08224a5894f2074a" ], - "version": "==0.8.0" + "version": "==0.8.1" }, "py": { "hashes": [ @@ -519,19 +519,19 @@ }, "pytest": { "hashes": [ - "sha256:f689bf2fc18c4585403348dd56f47d87780bf217c53ed9ae7a3e2d7faa45f8e9", - "sha256:f812ea39a0153566be53d88f8de94839db1e8a05352ed8a49525d7d7f37861e9" + "sha256:41568ea7ecb4a68d7f63837cf65b92ce8d0105e43196ff2b26622995bb3dc4b2", + "sha256:c3c573a29d7c9547fb90217ece8a8843aa0c1328a797e200290dc3d0b4b823be" ], "index": "pypi", - "version": "==4.0.2" + "version": "==4.1.1" }, "pytest-cov": { "hashes": [ - "sha256:513c425e931a0344944f84ea47f3956be0e416d95acbd897a44970c8d926d5d7", - "sha256:e360f048b7dae3f2f2a9a4d067b2dd6b6a015d384d1577c994a43f3f7cbad762" + "sha256:0ab664b25c6aa9716cbf203b17ddb301932383046082c081b9848a0edf5add33", + "sha256:230ef817450ab0699c6cc3c9c8f7a829c34674456f2ed8df1fe1d39780f7c87f" ], "index": "pypi", - "version": "==2.6.0" + "version": "==2.6.1" }, "pytest-flake8": { "hashes": [ diff --git a/fittrackee_api/fittrackee_api/activities/activities.py b/fittrackee_api/fittrackee_api/activities/activities.py index 61f97a25..dc26e0dd 100644 --- a/fittrackee_api/fittrackee_api/activities/activities.py +++ b/fittrackee_api/fittrackee_api/activities/activities.py @@ -56,9 +56,9 @@ def get_activities(auth_user_id): if date_to else True, Activity.distance >= int(distance_from) if distance_from else True, Activity.distance <= int(distance_to) if distance_to else True, - Activity.duration >= convert_in_duration(duration_from) + Activity.moving >= convert_in_duration(duration_from) if duration_from else True, - Activity.duration <= convert_in_duration(duration_to) + Activity.moving <= convert_in_duration(duration_to) if duration_to else True, Activity.ave_speed >= float(ave_speed_from) if ave_speed_from else True, diff --git a/fittrackee_api/fittrackee_api/activities/stats.py b/fittrackee_api/fittrackee_api/activities/stats.py index 4fd493e3..97da785f 100644 --- a/fittrackee_api/fittrackee_api/activities/stats.py +++ b/fittrackee_api/fittrackee_api/activities/stats.py @@ -70,7 +70,7 @@ def get_activities(user_id, filter_type): activities_list[sport_id]['total_distance'] += \ float(activity.distance) activities_list[sport_id]['total_duration'] += \ - convert_timedelta_to_integer(activity.duration) + convert_timedelta_to_integer(activity.moving) else: if time == 'week': @@ -108,7 +108,7 @@ def get_activities(user_id, filter_type): activities_list[time_period][sport_id]['total_distance'] += \ float(activity.distance) activities_list[time_period][sport_id]['total_duration'] += \ - convert_timedelta_to_integer(activity.duration) + convert_timedelta_to_integer(activity.moving) response_object = { 'status': 'success', diff --git a/fittrackee_api/fittrackee_api/tests/conftest.py b/fittrackee_api/fittrackee_api/tests/conftest.py index 177e2dc1..308c6587 100644 --- a/fittrackee_api/fittrackee_api/tests/conftest.py +++ b/fittrackee_api/fittrackee_api/tests/conftest.py @@ -113,6 +113,7 @@ def activity_cycling_user_1_segment(): segment_id=0 ) activity_segment.duration = datetime.timedelta(seconds=6000) + activity_segment.moving = activity_segment.duration activity_segment.distance = 5 db.session.add(activity_segment) db.session.commit() @@ -128,6 +129,7 @@ def activity_running_user_1(): distance=12, duration=datetime.timedelta(seconds=6000) ) + activity.moving = activity.duration db.session.add(activity) db.session.commit() return activity @@ -143,6 +145,7 @@ def seven_activities_user_1(): duration=datetime.timedelta(seconds=1024) ) activity.ave_speed = float(activity.distance) / (1024 / 3600) + activity.moving = activity.duration db.session.add(activity) db.session.flush() activity = Activity( @@ -153,6 +156,7 @@ def seven_activities_user_1(): duration=datetime.timedelta(seconds=3456) ) activity.ave_speed = float(activity.distance) / (3456 / 3600) + activity.moving = activity.duration db.session.add(activity) db.session.flush() activity = Activity( @@ -163,6 +167,7 @@ def seven_activities_user_1(): duration=datetime.timedelta(seconds=1024) ) activity.ave_speed = float(activity.distance) / (1024 / 3600) + activity.moving = activity.duration db.session.add(activity) db.session.flush() activity = Activity( @@ -173,6 +178,7 @@ def seven_activities_user_1(): duration=datetime.timedelta(seconds=600) ) activity.ave_speed = float(activity.distance) / (600 / 3600) + activity.moving = activity.duration db.session.add(activity) db.session.flush() activity = Activity( @@ -183,6 +189,7 @@ def seven_activities_user_1(): duration=datetime.timedelta(seconds=1000) ) activity.ave_speed = float(activity.distance) / (1000 / 3600) + activity.moving = activity.duration db.session.add(activity) db.session.flush() activity = Activity( @@ -193,6 +200,7 @@ def seven_activities_user_1(): duration=datetime.timedelta(seconds=6000) ) activity.ave_speed = float(activity.distance) / (6000 / 3600) + activity.moving = activity.duration db.session.add(activity) db.session.flush() activity = Activity( @@ -203,6 +211,7 @@ def seven_activities_user_1(): duration=datetime.timedelta(seconds=3000) ) activity.ave_speed = float(activity.distance) / (3000 / 3600) + activity.moving = activity.duration db.session.add(activity) db.session.commit() return activity @@ -217,6 +226,7 @@ def activity_cycling_user_2(): distance=15, duration=datetime.timedelta(seconds=3600) ) + activity.moving = activity.duration db.session.add(activity) db.session.commit() return activity diff --git a/fittrackee_client/Dockerfile b/fittrackee_client/Dockerfile index 6952f5df..b2bc4f2e 100644 --- a/fittrackee_client/Dockerfile +++ b/fittrackee_client/Dockerfile @@ -1,4 +1,4 @@ -FROM node:10.9.0 +FROM node:11.6.0 MAINTAINER SamR1@users.noreply.github.com diff --git a/fittrackee_client/public/manifest.json b/fittrackee_client/public/manifest.json index 8788be72..e782e789 100644 --- a/fittrackee_client/public/manifest.json +++ b/fittrackee_client/public/manifest.json @@ -12,5 +12,5 @@ "display": "standalone", "theme_color": "#000000", "background_color": "#ffffff", - "version": "0.2.0" + "version": "0.2.0-beta" } diff --git a/fittrackee_client/src/components/Activities/ActivitiesFilter.jsx b/fittrackee_client/src/components/Activities/ActivitiesFilter.jsx index 0b9e2119..a78fa2e9 100644 --- a/fittrackee_client/src/components/Activities/ActivitiesFilter.jsx +++ b/fittrackee_client/src/components/Activities/ActivitiesFilter.jsx @@ -1,176 +1,178 @@ import React from 'react' -export default function ActivitiesList (props) { - const { loadActivities, sports, updateParams } = props - return ( -
-
-
event.preventDefault()}> -
- - -
-
- -
-
-