1 line
328 KiB
Plaintext
1 line
328 KiB
Plaintext
{"version":3,"sources":["locales/fr/resources.js","locales/index.js","locales/en/resources.js","i18n.js","components/Common/Message.jsx","utils/index.js","fitTrackeeApi/index.js","actions/index.js","actions/application.js","components/Admin/AdminApplication.jsx","components/Admin/AdminStats.jsx","components/Admin/AdminDashboard.jsx","components/Admin/AdminSports.jsx","components/Common/Pagination.jsx","components/Admin/AdminUsers.jsx","components/Others/NotFound.jsx","components/Admin/index.jsx","utils/workouts.js","fitTrackeeApi/auth.js","actions/user.js","actions/workouts.js","components/Workout/WorkoutForms/FormWithGpx.jsx","components/Workout/WorkoutForms/FormWithoutGpx.jsx","components/Workout/WorkoutAddOrEdit.jsx","components/Workout/WorkoutAdd.jsx","components/Common/CustomModal.jsx","components/Workout/WorkoutDisplay/WorkoutCardHeader.jsx","components/Workout/WorkoutDisplay/WorkoutCharts.jsx","components/Workout/WorkoutDisplay/WorkoutWeather.jsx","components/Workout/WorkoutDisplay/WorkoutDetails.jsx","components/Workout/WorkoutDisplay/Map.jsx","components/Workout/WorkoutDisplay/WorkoutMap.jsx","components/Workout/WorkoutDisplay/WorkoutNoMap.jsx","components/Workout/WorkoutDisplay/WorkoutNotes.jsx","components/Workout/WorkoutDisplay/WorkoutSegments.jsx","components/Workout/WorkoutDisplay/index.jsx","components/Workout/WorkoutEdit.jsx","components/Workout/index.jsx","components/Common/NoWorkouts.jsx","components/Workouts/WorkoutsFilter.jsx","components/Common/StaticMap.jsx","components/Workouts/WorkoutsList.jsx","components/Workouts/index.jsx","components/User/ProfileDetail.jsx","components/User/CurrentUserProfile.jsx","components/Dashboard/CalendarWorkout.jsx","components/Dashboard/CalendarWorkouts.jsx","components/Dashboard/Calendar.jsx","components/Dashboard/Records.jsx","utils/stats.js","components/Common/Stats/CustomTooltip.jsx","components/Common/Stats/CustomLabel.jsx","components/Common/Stats/StatsChart.jsx","components/Common/Stats/index.jsx","actions/stats.js","components/Dashboard/Statistics.jsx","components/Dashboard/UserStatistics.jsx","components/Dashboard/WorkoutCard.jsx","components/Dashboard/index.jsx","components/Footer/index.jsx","components/User/Logout.jsx","images/flags/en.svg","images/flags/fr.svg","components/NavBar/LanguageDropdown.jsx","components/NavBar/index.jsx","images/password.svg","images/mail-send.svg","components/User/PasswordReset.jsx","components/User/ProfileEdit.jsx","components/Statistics/index.jsx","components/User/Form.jsx","components/User/UserForm.jsx","components/User/UserProfile.jsx","components/App.jsx","components/Root.jsx","registerServiceWorker.js","reducers/initial.js","reducers/index.js","utils/history.js","index.js"],"names":["resources","en","workouts","administration","common","dashboard","messages","sports","statistics","user","fr","i18n","use","XHR","LanguageDetector","init","debug","process","lng","fallbackLng","keySeparator","interpolation","escapeValue","ns","defaultNS","Message","React","PureComponent","render","this","props","message","t","singleMessage","split","length","className","map","msg","value","id","suffixes","getFileSize","fileSize","asText","i","Math","floor","log","size","suffix","pow","toFixed","apiUrl","userFilters","key","label","sortOrders","isLoggedIn","window","localStorage","authToken","createApiRequest","params","headers","noAuthorization","Authorization","getItem","type","requestParams","method","body","JSON","stringify","request","Request","url","fetch","then","response","status","json","catch","error","console","Error","getDateWithTZ","date","tz","dt","DateTime","fromISO","format","Date","setZone","parse","toFormat","sortValues","a","b","valueALabel","toLowerCase","valueBLabel","translateValues","values","sort","formatUrl","pathname","query","username","Object","keys","filter","index","FitTrackeeApi","target","data","setData","setError","setLoading","loading","getOrUpdateData","action","canDispatch","dispatch","isNaN","ret","pagination","setPaginatedData","updateSportsData","updateUsersData","users","updateLanguage","language","i18next","changeLanguage","setLanguage","setAppConfig","getAppData","FitTrackeeGenericApi","getData","AdminApplication","Component","constructor","context","super","state","formData","isInEdition","componentDidMount","initForm","componentDidUpdate","prevProps","appConfig","k","includes","setState","handleFormChange","e","name","toggleInEdition","preventDefault","onHandleConfigFormSubmit","onSubmit","htmlFor","aria-hidden","title","min","max_users","onChange","step","max_single_file_size","max_zip_file_size","gpx_limit_import","onClick","history","push","connect","assign","updateData","updateAppConfig","AdminStats","loadAppStats","appStats","uploadDirSize","uploads_dir_size","withTranslation","application","AdminDashboard","to","is_registration_enabled","AdminSports","loadSports","updateSport","sport","src","img","alt","is_active","data-toggle","has_workouts","sportId","isActive","Pagination","getUrl","newQuery","page","aria-label","has_prev","aria-disabled","pages","Array","from","_","has_next","AdminUsers","per_page","order_by","order","loadUsers","initState","location","updatePage","authUser","updateUser","translatedFilters","translatedSortOrders","picture","now","email","created_at","nb_workouts","admin","disabled","router","userName","isAdmin","NotFound","useTranslation","Helmet","config","exact","path","component","workoutColors","recordsLabels","record_type","formatWorkoutDate","dateTime","dateFormat","timeFormat","workout_date","workout_time","formatWorkoutDuration","seconds","newDate","subHours","setSeconds","getTime","formatChartData","chartData","time","duration","sortSports","sportALabel","sportBLabel","translateSports","onlyActive","PictureError","ProfileUpdateError","loadProfile","getProfile","isAuthenticated","profil","handleUserFormSubmit","formType","onlyPasswords","errMsg","password","password_conf","RegisterFormControl","arr","val","obj","generateIds","loginOrRegisterOrPasswordReset","setItem","auth_token","deleteUser","deleteData","r","setGpx","gpxContent","setChartData","editWorkout","form","getMoreWorkouts","onAddWorkout","FormData","append","gpxFile","files","notes","addDataWithFile","addWorkout","onEditWorkout","workout","sport_id","translatedSports","zipTooltip","fileSizeLimit","encType","event","defaultValue","required","Trans","i18nKey","data-placement","accept","maxLength","onAddOrEdit","d","distance","addData","workoutDate","workoutTime","workoutDateTime","timezone","pattern","placeholder","WorkoutAddEdit","withGpx","handleRadioChange","changeEvent","with_gpx","checked","WorkoutAddOrEdit","CustomModal","close","text","confirm","WorkoutCardHeader","dataType","displayModal","segmentId","previousUrl","previous_workout","nextUrl","segments","next_workout","WorkoutCharts","displayDistance","dataToHide","loadWorkoutData","loadSegmentData","componentWillUnmount","handleLegendChange","find","splice","indexOf","displayData","updateCoordinates","xInterval","parseInt","xDataKey","xScale","height","margin","top","right","left","bottom","onMouseMove","activePayload","onMouseLeave","allowDecimals","dataKey","offset","position","scale","interval","tickFormatter","angle","yAxisId","orientation","fill","stroke","dot","unit","strokeWidth","labelFormatter","workoutId","chart_data","getWorkoutChartData","getSegmentChartData","WorkoutWeather","weather_start","weather_end","icon","summary","Number","temperature","humidity","wind","WorkoutDetails","withPauses","pauses","moving","records","record","ave_speed","max_speed","min_alt","max_alt","ascent","descent","Map","bounds","coordinates","jsonData","mapAttribution","useMap","fitBounds","TileLayer","attribution","GeoJSON","hash","latitude","Marker","longitude","WorkoutMap","zoom","loadWorkoutGpx","loadSegmentGpx","gpx","DOMParser","parseFromString","togeojson","getGeoJson","MapContainer","boundsOptions","padding","map_attribution","getWorkoutGpx","getSegmentGpx","WorkoutNoMap","WorkoutNotes","WorkoutSegments","segment","workout_id","WorkoutDisplay","loadWorkout","match","prevState","payload","onDeleteWorkout","s","Promise","resolve","WorkoutEdit","WorkoutAdd","NoWorkouts","WorkoutsFilter","loadWorkouts","updateParams","StaticMap","display","href","rel","WorkoutsList","scope","idx","Workouts","setParams","loadMoreWorkouts","paginationEnd","onDeletePicture","deletePicture","onUploadPicture","reset","uploadPicture","editable","isDeletable","createdAt","birthDate","birth_date","first_name","last_name","bio","weekm","go","CalendarWorkout","isDisabled","isMore","sportImg","rec","CalendarWorkouts","isHidden","handleDisplayMore","dayWorkouts","act","getStartAndEndMonth","weekStartOnMonday","monthStart","startOfMonth","monthEnd","endOfMonth","weekStartsOn","start","startOfWeek","end","endOfWeek","Calendar","calendarDate","currentMonth","startDate","endDate","loadMonthWorkouts","renderHeader","localeOptions","handlePrevMonth","handleNextMonth","renderDays","days","addDays","filterWorkouts","day","isSameDay","renderCells","rows","formattedDate","isSameMonth","isWeekEnd","isToday","updateStateDate","addMonths","subMonths","locale","enGB","calendarWorkouts","RecordsCard","recordsBySport","reduce","sportList","recordType","formatRecord","sportLabel","colSpan","xAxisFormats","xAxis","formatDuration","totalSeconds","formatWithDay","String","hours","padStart","minutes","formatValue","displayedData","dateIncrement","addYears","formatStats","stats","displayedSports","nbWorkoutsStats","distanceStats","durationStats","startOfYear","x","xAxisFormat","dataNbWorkouts","dataDistance","dataDuration","total_distance","total_duration","CustomTooltip","active","total","p","style","color","CustomLabel","y","width","formattedValue","fontSize","textAnchor","dominantBaseline","StatsCharts","content","isAnimationActive","stackId","Statistics","statsParams","displayEmpty","getStats","Stats","UserStatistics","nb_sports","WorkoutCard","DashBoard","Footer","Logout","UserLogout","_extends","arguments","source","prototype","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","sourceKeys","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","_ref10","_ref11","_ref12","_ref13","_ref14","SvgEn","_ref","svgRef","titleId","enableBackground","viewBox","xmlns","ref","ForwardRef","SvgFr","languages","selected","flag","Dropdown","isOpen","toggleDropdown","onUpdateLanguage","lang","NavBar","data-target","aria-controls","aria-expanded","LanguageDropdown","SvgPassword","xmlnsXlink","xmlSpace","SvgMailSend","PasswordReset","ProfileEdit","onDeleteUser","onHandleProfileFormSubmit","readOnly","postData","handleProfileFormSubmit","durations","updateDisplayedSports","handleOnChangeDuration","subYears","endOfYear","handleOnChangeSports","concat","handleOnClickArrows","forward","newStart","newEnd","subWeeks","addWeeks","sports_list","Form","pageTitle","charAt","toUpperCase","slice","isRegistrationAllowed","userForm","onHandleFormChange","UserForm","emptyForm","onHandleUserFormSubmit","token","UserProfile","loadUser","currentUser","App","loadAppConfig","Dashboard","CurrentUserProfile","Workout","Admin","Root","store","children","isLocalhost","Boolean","hostname","registerValidSW","swUrl","navigator","serviceWorker","register","registration","onupdatefound","installingWorker","installing","onstatechange","controller","emptyData","handleDataAndError","initial","removeItem","routesWithoutAuthentication","updatePath","toPath","newPath","pathInterceptor","originalHistory","createBrowserHistory","args","replace","listen","scrollTo","rootNode","document","getElementById","createStore","combineReducers","connectRouter","__STATE__","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","applyMiddleware","routerMiddleware","thunk","ReactDOM","I18nextProvider","URL","origin","addEventListener","get","ready","unregister","reload","checkValidServiceWorker","registerServiceWorker"],"mappings":"mmlBASO,MCNMA,EAAY,CACvBC,GCKyB,CACzBC,S,OACAC,e,OACAC,O,OACAC,U,OACAC,S,OACAC,O,OACAC,W,OACAC,K,QDZAC,GDIyB,CACzBR,S,OACAC,e,OACAC,O,OACAC,U,OACAC,S,OACAC,O,OACAC,W,OACAC,K,SGXFE,IACGC,IAAIC,KACJD,IAAIE,KACJC,KAAK,CACJC,OAAOC,EACPC,IAAK,KACLC,YAAa,KACbC,cAAc,EACdC,cAAe,CACbC,aAAa,GAEftB,YACAuB,GAAI,CAAC,UACLC,UAAW,WAGAb,QAAf,E,0CCpBe,MAAMc,UAAgBC,IAAMC,cACzCC,SAAU,MAAD,EAC0BC,KAAKC,MAA9BC,EADD,EACCA,QAASzB,EADV,EACUA,SAAU0B,EADpB,EACoBA,EACrBC,EACQ,KAAZF,GAAmBA,EAEfA,EAAQG,MAAM,KAAKC,OAAS,EAA5B,UACGH,EAAE,YAAD,OAAaD,EAAQG,MAAM,KAAK,KADpC,aAC8CF,EAAE,YAAD,OACjCD,EAAQG,MAAM,KAAK,MAEjCF,EAAE,YAAD,OAAaD,IALd,GAMN,OACE,sBAAKK,UAAU,gBAAf,UACqB,KAAlBH,GAAwB,+BAAOA,IAC/B3B,GAAYA,EAAS6B,OAAS,GAC7B,+BACE,6BACG7B,EAAS+B,KAAIC,GACZ,6BAAkBN,EAAE,YAAD,OAAaM,EAAIC,SAA3BD,EAAIE,c,uCCjB7B,MAAMC,EAAW,CAAC,QAAS,KAAM,KAAM,KAAM,MAChCC,EAAc,CAACC,EAAUC,GAAS,KAC7C,MAAMC,EAAIC,KAAKC,MAAMD,KAAKE,IAAIL,GAAYG,KAAKE,IAAI,OACnD,IAAKL,EACH,OAAOC,EAAS,UAAY,CAAEK,KAAM,EAAGC,OAAQ,SAEjD,MAAMD,GAAQN,EAAWG,KAAKK,IAAI,KAAMN,IAAIO,QAAQ,GAC9CF,EAAST,EAASI,GAC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IACjCA,EAAawC,aAAahqB,MAAK,KAC7BnB,OAAOkK,SAASkhB,eAKpB9C,GAAgBC,MAGnBhnB,OAAM,KAELE,QAAQpC,IACN,oEA/DAgsB,CAAwB9C,GAGxBD,GAAgBC,OIIxB+C,K","file":"static/js/main.9f2642a3.chunk.js","sourcesContent":["import FrWorkoutsTranslations from './workouts.json'\nimport FrAdministrationTranslations from './administration.json'\nimport FrCommonTranslations from './common.json'\nimport FrDashboardTranslations from './dashboard.json'\nimport FrMessagesTranslations from './messages.json'\nimport FrSportsTranslations from './sports.json'\nimport FrStatisticsTranslations from './statistics.json'\nimport FrUserTranslations from './user.json'\n\nexport const frResources = {\n workouts: FrWorkoutsTranslations,\n administration: FrAdministrationTranslations,\n common: FrCommonTranslations,\n dashboard: FrDashboardTranslations,\n messages: FrMessagesTranslations,\n sports: FrSportsTranslations,\n statistics: FrStatisticsTranslations,\n user: FrUserTranslations,\n}\n","import { enResources } from './en/resources'\nimport { frResources } from './fr/resources'\n\nexport const resources = {\n en: enResources,\n fr: frResources,\n}\n","import EnWorkoutsTranslations from './workouts.json'\nimport EnAdministrationTranslations from './administration.json'\nimport EnCommonTranslations from './common.json'\nimport EnDashboardTranslations from './dashboard.json'\nimport EnMessagesTranslations from './messages.json'\nimport EnSportsTranslations from './sports.json'\nimport EnStatisticsTranslations from './statistics.json'\nimport EnUserTranslations from './user.json'\n\nexport const enResources = {\n workouts: EnWorkoutsTranslations,\n administration: EnAdministrationTranslations,\n common: EnCommonTranslations,\n dashboard: EnDashboardTranslations,\n messages: EnMessagesTranslations,\n sports: EnSportsTranslations,\n statistics: EnStatisticsTranslations,\n user: EnUserTranslations,\n}\n","import i18n from 'i18next'\nimport LanguageDetector from 'i18next-browser-languagedetector'\nimport XHR from 'i18next-xhr-backend'\n\nimport { resources } from './locales'\n\ni18n\n .use(XHR)\n .use(LanguageDetector)\n .init({\n debug: process.env.NODE_ENV === 'development',\n lng: 'en',\n fallbackLng: 'en',\n keySeparator: false,\n interpolation: {\n escapeValue: false,\n },\n resources,\n ns: ['common'],\n defaultNS: 'common',\n })\n\nexport default i18n\n","import React from 'react'\n\nexport default class Message extends React.PureComponent {\n render() {\n const { message, messages, t } = this.props\n const singleMessage =\n message === '' || !message\n ? ''\n : message.split('|').length > 1\n ? `${t(`messages:${message.split('|')[0]}`)}: ${t(\n `messages:${message.split('|')[1]}`\n )}`\n : t(`messages:${message}`)\n return (\n <div className=\"error-message\">\n {singleMessage !== '' && <code>{singleMessage}</code>}\n {messages && messages.length > 0 && (\n <code>\n <ul>\n {messages.map(msg => (\n <li key={msg.id}>{t(`messages:${msg.value}`)}</li>\n ))}\n </ul>\n </code>\n )}\n </div>\n )\n }\n}\n","import { format, parse } from 'date-fns'\nimport { DateTime } from 'luxon'\n\nconst suffixes = ['bytes', 'KB', 'MB', 'GB', 'TB']\nexport const getFileSize = (fileSize, asText = true) => {\n const i = Math.floor(Math.log(fileSize) / Math.log(1024))\n if (!fileSize) {\n return asText ? '0 bytes' : { size: 0, suffix: 'bytes' }\n }\n const size = (fileSize / Math.pow(1024, i)).toFixed(1)\n const suffix = suffixes[i]\n return asText ? `${size}${suffix}` : { size, suffix }\n}\n\nexport const getFileSizeInMB = fileSize => {\n const value = fileSize / 1048576\n return (!fileSize && 0) || +value.toFixed(2)\n}\n\nexport const version = '0.4.4' // version stored in 'utils' for now\nexport const apiUrl =\n process.env.NODE_ENV === 'production'\n ? '/api/'\n : `${process.env.REACT_APP_API_URL}/api/`\n\nexport const userFilters = [\n { key: 'workouts_count', label: 'workouts count' },\n { key: 'admin', label: 'admin rights' },\n { key: 'created_at', label: 'registration date' },\n { key: 'username', label: 'user name' },\n]\n\nexport const sortOrders = [\n { key: 'asc', label: 'ascending' },\n { key: 'desc', label: 'descending' },\n]\n\nexport const isLoggedIn = () => !!window.localStorage.authToken\n\nexport const generateIds = arr => {\n let i = 0\n return arr.map(val => {\n const obj = { id: i, value: val }\n i++\n return obj\n })\n}\n\nexport const createApiRequest = params => {\n const headers = {}\n if (!params.noAuthorization) {\n headers.Authorization = `Bearer ${window.localStorage.getItem('authToken')}`\n }\n if (params.type) {\n headers['Content-Type'] = params.type\n }\n const requestParams = {\n method: params.method,\n headers: headers,\n }\n if (params.type === 'application/json' && params.body) {\n requestParams.body = JSON.stringify(params.body)\n } else if (params.body) {\n requestParams.body = params.body\n }\n const request = new Request(`${apiUrl}${params.url}`, requestParams)\n return fetch(request)\n .then(response =>\n params.method === 'DELETE' || response.status === 413\n ? response\n : response.json()\n )\n .catch(error => {\n console.error(error)\n return new Error('An error occurred. Please contact the administrator.')\n })\n}\n\nexport const getDateWithTZ = (date, tz) => {\n if (!date) {\n return ''\n }\n const dt = DateTime.fromISO(\n format(new Date(date), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n ).setZone(tz)\n return parse(\n dt.toFormat('yyyy-MM-dd HH:mm:ss'),\n 'yyyy-MM-dd HH:mm:ss',\n new Date()\n )\n}\n\nexport const capitalize = target =>\n target.charAt(0).toUpperCase() + target.slice(1)\n\nexport const rangePagination = pages =>\n Array.from({ length: pages }, (_, i) => i + 1)\n\nconst sortValues = (a, b) => {\n const valueALabel = a.label.toLowerCase()\n const valueBLabel = b.label.toLowerCase()\n return valueALabel > valueBLabel ? 1 : valueALabel < valueBLabel ? -1 : 0\n}\n\nexport const translateValues = (t, values, key = 'common') =>\n values\n .map(value => ({\n ...value,\n label: t(`${key}:${value.label}`),\n }))\n .sort(sortValues)\n\nexport const formatUrl = (pathname, query) => {\n let url = pathname\n if (query.id || (pathname === 'users' && query.username)) {\n url = `${url}/${query.username ? query.username : query.id}`\n } else if (Object.keys(query).length > 0) {\n url += '?'\n Object.keys(query)\n .filter(key => query[key])\n .map(\n (key, index) => (url += `${index === 0 ? '' : '&'}${key}=${query[key]}`)\n )\n }\n return url\n}\n","import { createApiRequest, formatUrl } from '../utils'\n\nexport default class FitTrackeeApi {\n static getData(target, data = {}) {\n const url = formatUrl(target, data)\n const params = {\n url: url,\n method: 'GET',\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static addData(target, data) {\n const params = {\n url: target,\n method: 'POST',\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static addDataWithFile(target, data) {\n const params = {\n url: target,\n method: 'POST',\n body: data,\n }\n return createApiRequest(params)\n }\n\n static postData(target, data) {\n const params = {\n url: `${target}${data.id ? `/${data.id}` : ''}`,\n method: 'POST',\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static updateData(target, data) {\n const params = {\n url: `${target}${\n data.id ? `/${data.id}` : data.username ? `/${data.username}` : ''\n }`,\n method: 'PATCH',\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static deleteData(target, id) {\n const params = {\n url: `${target}/${id}`,\n method: 'DELETE',\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n}\n","import i18next from 'i18next'\n\nimport FitTrackeeApi from '../fitTrackeeApi/index'\nimport { history } from '../index'\n\nexport const setData = (target, data) => ({\n type: 'SET_DATA',\n data,\n target,\n})\nexport const setPaginatedData = (target, data, pagination) => ({\n type: 'SET_PAGINATED_DATA',\n data,\n pagination,\n target,\n})\n\nexport const setError = message => ({\n type: 'SET_ERROR',\n message,\n})\n\nexport const setLanguage = language => ({\n type: 'SET_LANGUAGE',\n language,\n})\n\nexport const setLoading = loading => ({\n type: 'SET_LOADING',\n loading,\n})\n\nexport const updateSportsData = data => ({\n type: 'UPDATE_SPORT_DATA',\n data,\n})\n\nexport const updateUsersData = data => ({\n type: 'UPDATE_USER_DATA',\n data,\n})\n\nexport const getOrUpdateData = (\n action,\n target,\n data,\n canDispatch = true\n) => dispatch => {\n dispatch(setLoading(true))\n if (data && data.id && target !== 'workouts' && isNaN(data.id)) {\n dispatch(setLoading(false))\n return dispatch(setError(`${target}|Incorrect id`))\n }\n dispatch(setError(''))\n return FitTrackeeApi[action](target, data)\n .then(ret => {\n if (ret.status === 'success') {\n if (canDispatch) {\n if (target === 'users' && action === 'getData') {\n return dispatch(setPaginatedData(target, ret.data, ret.pagination))\n }\n dispatch(setData(target, ret.data))\n } else if (action === 'updateData' && target === 'sports') {\n dispatch(updateSportsData(ret.data.sports[0]))\n } else if (action === 'updateData' && target === 'users') {\n dispatch(updateUsersData(ret.data.users[0]))\n }\n } else {\n dispatch(setError(`${target}|${ret.message || ret.status}`))\n }\n dispatch(setLoading(false))\n })\n .catch(error => {\n dispatch(setLoading(false))\n dispatch(setError(`${target}|${error}`))\n })\n}\n\nexport const addData = (target, data) => dispatch =>\n FitTrackeeApi.addData(target, data)\n .then(ret => {\n if (ret.status === 'created') {\n history.push(`/admin/${target}`)\n } else {\n dispatch(setError(`${target}|${ret.status}`))\n }\n })\n .catch(error => dispatch(setError(`${target}|${error}`)))\n\nexport const deleteData = (target, id) => dispatch => {\n if (isNaN(id)) {\n return dispatch(setError(target, `${target}|Incorrect id`))\n }\n return FitTrackeeApi.deleteData(target, id)\n .then(ret => {\n if (ret.status === 204) {\n history.push(`/admin/${target}`)\n } else {\n dispatch(setError(`${target}|${ret.message || ret.status}`))\n }\n })\n .catch(error => dispatch(setError(`${target}|${error}`)))\n}\n\nexport const updateLanguage = language => dispatch => {\n i18next.changeLanguage(language).then(dispatch(setLanguage(language)))\n}\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport { setError } from './index'\n\nexport const setAppConfig = data => ({\n type: 'SET_APP_CONFIG',\n data,\n})\n\nexport const setAppStats = data => ({\n type: 'SET_APP_STATS',\n data,\n})\n\nexport const getAppData = target => dispatch =>\n FitTrackeeGenericApi.getData(target)\n .then(ret => {\n if (ret.status === 'success') {\n if (target === 'config') {\n dispatch(setAppConfig(ret.data))\n } else if (target === 'stats/all') {\n dispatch(setAppStats(ret.data))\n }\n } else {\n dispatch(setError(`application|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`application|${error}`)))\n\nexport const updateAppConfig = formData => dispatch =>\n FitTrackeeGenericApi.updateData('config', formData)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setAppConfig(ret.data))\n } else {\n dispatch(setError(`application|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`application|${error}`)))\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport { updateAppConfig } from '../../actions/application'\nimport { history } from '../../index'\nimport { getFileSizeInMB } from '../../utils'\n\nclass AdminApplication extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n formData: {},\n isInEdition: false,\n }\n }\n\n componentDidMount() {\n this.initForm()\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.appConfig !== prevProps.appConfig) {\n this.initForm()\n }\n }\n\n initForm() {\n const { appConfig } = this.props\n const formData = {}\n Object.keys(appConfig).map(k =>\n appConfig[k] === null\n ? (formData[k] = '')\n : ['max_single_file_size', 'max_zip_file_size'].includes(k)\n ? (formData[k] = getFileSizeInMB(appConfig[k]))\n : (formData[k] = appConfig[k])\n )\n this.setState({ formData })\n }\n\n handleFormChange(e) {\n const { formData } = this.state\n formData[e.target.name] = +e.target.value\n this.setState(formData)\n }\n\n toggleInEdition(e) {\n e.preventDefault()\n const { isInEdition } = this.state\n this.setState({ isInEdition: !isInEdition })\n }\n\n render() {\n const { message, onHandleConfigFormSubmit, t } = this.props\n const { formData, isInEdition } = this.state\n return (\n <div>\n {message && <Message message={message} t={t} />}\n {Object.keys(formData).length > 0 && (\n <div className=\"row\">\n <div className=\"col-md-12\">\n <div className=\"card\">\n <div className=\"card-header\">\n <strong>\n {t('administration:Application configuration')}\n </strong>\n </div>\n <div className=\"card-body\">\n <form\n className={`app-config-form ${\n isInEdition ? '' : 'form-disabled'\n }`}\n onSubmit={e => {\n this.toggleInEdition(e)\n onHandleConfigFormSubmit(formData)\n }}\n >\n <div className=\"form-group row\">\n <label\n className=\"col-sm-6 col-form-label\"\n htmlFor=\"max_users\"\n >\n {t(\n // eslint-disable-next-line max-len\n 'administration:Max. number of active users'\n )}\n <sup>\n <i\n className=\"fa fa-question-circle\"\n aria-hidden=\"true\"\n title={t('administration:if 0, no limitation')}\n />\n </sup>\n :\n </label>\n <input\n className=\"col-sm-5\"\n id=\"max_users\"\n name=\"max_users\"\n type=\"number\"\n min=\"0\"\n value={formData.max_users}\n onChange={e => this.handleFormChange(e)}\n />\n </div>\n <div className=\"form-group row\">\n <label\n className=\"col-sm-6 col-form-label\"\n htmlFor=\"max_single_file_size\"\n >\n {t(\n 'administration:Max. size of uploaded files (in Mb)'\n )}\n :\n </label>\n <input\n className=\"col-sm-5\"\n id=\"max_single_file_size\"\n name=\"max_single_file_size\"\n type=\"number\"\n step=\"0.1\"\n min=\"0\"\n value={formData.max_single_file_size}\n onChange={e => this.handleFormChange(e)}\n />\n </div>\n <div className=\"form-group row\">\n <label\n className=\"col-sm-6 col-form-label\"\n htmlFor=\"max_zip_file_size\"\n >\n {t('administration:Max. size of zip archive (in Mb)')}:\n </label>\n <input\n className=\"col-sm-5\"\n id=\"max_zip_file_size\"\n name=\"max_zip_file_size\"\n type=\"number\"\n step=\"0.1\"\n min=\"0\"\n value={formData.max_zip_file_size}\n onChange={e => this.handleFormChange(e)}\n />\n </div>\n <div className=\"form-group row\">\n <label\n className=\"col-sm-6 col-form-label\"\n htmlFor=\"gpx_limit_import\"\n >\n {t('administration:Max. files of zip archive')}\n </label>\n <input\n className=\"col-sm-5\"\n id=\"gpx_limit_import\"\n name=\"gpx_limit_import\"\n type=\"number\"\n min=\"0\"\n value={formData.gpx_limit_import}\n onChange={e => this.handleFormChange(e)}\n />\n </div>\n {isInEdition ? (\n <>\n <input\n type=\"submit\"\n className=\"btn btn-primary\"\n value={t('common:Submit')}\n />\n <input\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={e => this.toggleInEdition(e)}\n value={t('common:Cancel')}\n />\n </>\n ) : (\n <>\n <input\n type=\"submit\"\n className=\"btn btn-primary\"\n onClick={e => {\n this.toggleInEdition(e)\n }}\n value={t('common:Edit')}\n />\n <input\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={() => history.push('/admin')}\n value={t('common:Back')}\n />\n </>\n )}\n </form>\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n message: state.message,\n }),\n dispatch => ({\n onHandleConfigFormSubmit: formData => {\n const data = Object.assign({}, formData)\n data.max_single_file_size *= 1048576\n data.max_zip_file_size *= 1048576\n dispatch(updateAppConfig(data))\n },\n })\n)(AdminApplication)\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport { getAppData } from '../../actions/application'\nimport { getFileSize } from '../../utils'\n\nclass AdminStats extends React.Component {\n componentDidMount() {\n this.props.loadAppStats()\n }\n\n render() {\n const { appStats, t } = this.props\n const uploadDirSize = getFileSize(appStats.uploads_dir_size, false)\n return (\n <div className=\"row\">\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card workout-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-users fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">\n {appStats.users ? appStats.users : 0}\n </div>\n <div>{`${\n appStats.users === 1\n ? t('administration:user')\n : t('administration:users')\n }`}</div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card workout-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-tags fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">\n {appStats.sports ? appStats.sports : 0}\n </div>\n <div>{`${\n appStats.sports === 1 ? t('common:sport') : t('common:sports')\n }`}</div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card workout-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-calendar fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">\n {appStats.workouts ? appStats.workouts : 0}\n </div>\n <div>{`${\n appStats.workouts === 1\n ? t('common:workout')\n : t('common:workouts')\n }`}</div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card workout-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-folder-open fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">{uploadDirSize.size}</div>\n <div>\n {uploadDirSize.suffix} ({t('administration:uploads')})\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n appStats: state.application.statistics,\n }),\n dispatch => ({\n loadAppStats: () => {\n dispatch(getAppData('stats/all'))\n },\n })\n )(AdminStats)\n)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport AdminStats from './AdminStats'\n\nexport default function AdminDashboard(props) {\n const { appConfig, t } = props\n return (\n <div className=\"card workout-card\">\n <div className=\"card-header\">\n <strong>{t('administration:Administration')}</strong>\n </div>\n <div className=\"card-body\">\n <AdminStats />\n <br />\n <dl className=\"admin-items\">\n <dt>\n <Link\n to={{\n pathname: '/admin/application',\n }}\n >\n {t('administration:Application')}\n </Link>\n </dt>\n <dd>\n {t(\n 'administration:Update application configuration ' +\n '(maximum number of registered users, maximum files size).'\n )}\n <br />\n <strong>\n {t(\n `administration:Registration is currently ${\n appConfig.is_registration_enabled ? 'enabled' : 'disabled'\n }.`\n )}\n </strong>\n </dd>\n <br />\n <dt>\n <Link\n to={{\n pathname: '/admin/sports',\n }}\n >\n {t('administration:Sports')}\n </Link>\n </dt>\n <dd>{t('administration:Enable/disable sports.')}</dd>\n <br />\n <dt>\n <Link\n to={{\n pathname: '/admin/users',\n }}\n >\n {t('administration:Users')}\n </Link>\n </dt>\n <dd>\n {t(\n 'administration:Add/remove admin rights, ' +\n 'delete user account.'\n )}\n </dd>\n </dl>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport { getOrUpdateData } from '../../actions'\nimport { history } from '../../index'\n\nclass AdminSports extends React.Component {\n componentDidMount() {\n this.props.loadSports()\n }\n\n render() {\n const { message, sports, t, updateSport } = this.props\n return (\n <div>\n {message && <Message message={message} t={t} />}\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"card\">\n <div className=\"card-header\">\n <strong>{t('administration:Sports')}</strong>\n </div>\n <div className=\"card-body\">\n {sports.length > 0 && (\n <table className=\"table\">\n <thead>\n <tr>\n <th>{t('administration:id')}</th>\n <th>{t('administration:Image')}</th>\n <th>{t('administration:Label')}</th>\n <th>{t('administration:Active')}</th>\n <th>{t('administration:Actions')}</th>\n </tr>\n </thead>\n <tbody>\n {sports.map(sport => (\n <tr key={sport.id}>\n <td>\n <span className=\"heading-span-absolute\">\n {t('administration:id')}\n </span>\n {sport.id}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('administration:Image')}\n </span>\n <img\n className=\"admin-img\"\n src={sport.img ? sport.img : '/img/photo.png'}\n alt=\"sport logo\"\n />\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('administration:Label')}\n </span>\n {t(`sports:${sport.label}`)}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('administration:Active')}\n </span>\n {sport.is_active ? (\n <i\n className=\"fa fa-check-square-o custom-fa\"\n aria-hidden=\"true\"\n data-toggle=\"tooltip\"\n />\n ) : (\n <i\n className=\"fa fa-square-o custom-fa\"\n aria-hidden=\"true\"\n data-toggle=\"tooltip\"\n />\n )}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('administration:Actions')}\n </span>\n <input\n type=\"submit\"\n className={`btn btn-${\n sport.is_active ? 'dark' : 'primary'\n } btn-sm`}\n value={\n sport.is_active\n ? t('administration:Disable')\n : t('administration:Enable')\n }\n onClick={() =>\n updateSport(sport.id, !sport.is_active)\n }\n />\n {sport.has_workouts && (\n <span className=\"admin-message\">\n <i\n className=\"fa fa-warning custom-fa\"\n aria-hidden=\"true\"\n />\n {t('administration:workouts exist')}\n </span>\n )}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n )}\n <input\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={() => history.push('/admin/')}\n value={t('common:Back')}\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadSports: () => {\n dispatch(getOrUpdateData('getData', 'sports'))\n },\n updateSport: (sportId, isActive) => {\n const data = { id: sportId, is_active: isActive }\n dispatch(getOrUpdateData('updateData', 'sports', data, false))\n },\n })\n)(AdminSports)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { formatUrl, rangePagination } from '../../utils'\n\nexport default class Pagination extends React.PureComponent {\n getUrl(value) {\n const { query, pathname } = this.props\n const newQuery = Object.assign({}, query)\n let page = query.page ? +query.page : 1\n switch (value) {\n case 'prev':\n page -= 1\n break\n case 'next':\n page += 1\n break\n default:\n page = +value\n }\n newQuery.page = page\n return formatUrl(pathname, newQuery)\n }\n\n render() {\n const { pagination, t } = this.props\n return (\n <>\n {pagination && Object.keys(pagination).length > 0 && (\n <nav aria-label=\"Page navigation example\">\n <ul className=\"pagination justify-content-center\">\n <li\n className={`page-item ${pagination.has_prev ? '' : 'disabled'}`}\n >\n <Link\n className=\"page-link\"\n to={this.getUrl('prev')}\n aria-disabled={!pagination.has_prev}\n >\n {t('common:Previous')}\n </Link>\n </li>\n {rangePagination(pagination.pages).map(page => (\n <li\n key={page}\n className={`page-item ${\n page === pagination.page ? 'active' : ''\n }`}\n >\n <Link className=\"page-link\" to={this.getUrl(page)}>\n {page}\n </Link>\n </li>\n ))}\n <li\n className={`page-item ${pagination.has_next ? '' : 'disabled'}`}\n >\n <Link\n className=\"page-link\"\n to={this.getUrl('next')}\n aria-disabled={!pagination.has_next}\n >\n {t('common:Next')}\n </Link>\n </li>\n </ul>\n </nav>\n )}\n </>\n )\n }\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { connect } from 'react-redux'\nimport { Link } from 'react-router-dom'\n\nimport Message from '../Common/Message'\nimport Pagination from '../Common/Pagination'\nimport { history } from '../../index'\nimport { getOrUpdateData } from '../../actions'\nimport {\n apiUrl,\n formatUrl,\n sortOrders,\n translateValues,\n userFilters,\n} from '../../utils'\n\nclass AdminUsers extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n page: null,\n per_page: null,\n order_by: 'created_at',\n order: 'asc',\n }\n }\n\n componentDidMount() {\n this.props.loadUsers(this.initState())\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.location.query !== this.props.location.query) {\n this.props.loadUsers(this.props.location.query)\n }\n }\n\n initState() {\n const { query } = this.props.location\n const newQuery = {\n page: query.page,\n per_page: query.per_page,\n order_by: query.order_by ? query.order_by : 'created_at',\n order: query.order ? query.order : 'asc',\n }\n this.setState(newQuery)\n return newQuery\n }\n\n updatePage(key, value) {\n const query = Object.assign({}, this.state)\n query[key] = value\n this.setState(query)\n const url = formatUrl(this.props.location.pathname, query)\n history.push(url)\n }\n\n render() {\n const {\n authUser,\n location,\n message,\n t,\n pagination,\n updateUser,\n users,\n } = this.props\n const translatedFilters = translateValues(t, userFilters)\n const translatedSortOrders = translateValues(t, sortOrders)\n return (\n <div>\n {message && <Message message={message} t={t} />}\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"card\">\n <div className=\"card-header\">\n <strong>{t('administration:Users')}</strong>\n </div>\n <div className=\"card-body\">\n <div className=\"row user-filters\">\n <div className=\"col-lg-4 col-md-6 col-sm-12\">\n <label htmlFor=\"order_by\">\n {t('common:Sort by')}:{' '}\n <select\n id=\"order_by\"\n name=\"order_by\"\n value={this.state.order_by}\n onChange={e =>\n this.updatePage('order_by', e.target.value)\n }\n >\n {translatedFilters.map(filter => (\n <option key={filter.key} value={filter.key}>\n {filter.label}\n </option>\n ))}\n </select>{' '}\n </label>\n </div>\n <div className=\"col-lg-4 col-md-6 col-sm-12\">\n <label htmlFor=\"sort\">\n {t('common:Sort')}:{' '}\n <select\n id=\"sort\"\n name=\"sort\"\n value={this.state.order}\n onChange={e =>\n this.updatePage('order', e.target.value)\n }\n >\n {translatedSortOrders.map(sort => (\n <option key={sort.key} value={sort.key}>\n {sort.label}\n </option>\n ))}\n </select>{' '}\n </label>\n </div>\n </div>\n <table className=\"table\">\n <thead>\n <tr>\n <th>#</th>\n <th>{t('user:Username')}</th>\n <th>{t('user:Email')}</th>\n <th>{t('user:Registration Date')}</th>\n <th>{t('workouts:Workouts')}</th>\n <th>{t('user:Admin')}</th>\n <th>{t('administration:Actions')}</th>\n </tr>\n </thead>\n <tbody>\n {users.map(user => (\n <tr key={user.username}>\n <td>\n <span className=\"heading-span-absolute\">#</span>\n {user.picture === true ? (\n <img\n alt=\"Avatar\"\n src={`${apiUrl}users/${\n user.username\n }/picture?${Date.now()}`}\n className=\"img-fluid App-nav-profile-img\"\n />\n ) : (\n <i\n className=\"fa fa-user-circle-o fa-2x no-picture\"\n aria-hidden=\"true\"\n />\n )}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('user:Username')}\n </span>\n <Link to={`/users/${user.username}`}>\n {user.username}\n </Link>\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('user:Email')}\n </span>\n {user.email}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('user:Registration Date')}\n </span>\n {format(\n new Date(user.created_at),\n 'dd/MM/yyyy HH:mm'\n )}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('workouts:Workouts')}\n </span>\n {user.nb_workouts}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('user:Admin')}\n </span>\n {user.admin ? (\n <i\n className=\"fa fa-check-square-o custom-fa\"\n aria-hidden=\"true\"\n data-toggle=\"tooltip\"\n />\n ) : (\n <i\n className=\"fa fa-square-o custom-fa\"\n aria-hidden=\"true\"\n data-toggle=\"tooltip\"\n />\n )}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('administration:Actions')}\n </span>\n <input\n type=\"submit\"\n className={`btn btn-${\n user.admin ? 'dark' : 'primary'\n } btn-sm`}\n disabled={user.username === authUser.username}\n value={\n user.admin\n ? t('administration:Remove admin rights')\n : t('administration:Add admin rights')\n }\n onClick={() =>\n updateUser(user.username, !user.admin)\n }\n />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n <Pagination\n pagination={pagination}\n pathname={location.pathname}\n query={this.state}\n t={t}\n />\n <input\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={() => history.push('/admin/')}\n value={t('common:Back')}\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n authUser: state.user,\n location: state.router.location,\n message: state.message,\n pagination: state.users.pagination,\n users: state.users.data,\n }),\n dispatch => ({\n loadUsers: query => {\n dispatch(getOrUpdateData('getData', 'users', query))\n },\n updateUser: (userName, isAdmin) => {\n const data = { username: userName, admin: isAdmin }\n dispatch(getOrUpdateData('updateData', 'users', data, false))\n },\n })\n)(AdminUsers)\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { useTranslation } from 'react-i18next'\n\nexport default function NotFound() {\n const { t } = useTranslation()\n return (\n <div>\n <Helmet>\n <title>fittrackee - 404</title>\n </Helmet>\n <h1 className=\"page-title\">{t('Page not found')}</h1>\n </div>\n )\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport { Route, Switch } from 'react-router-dom'\n\nimport AdminApplication from './AdminApplication'\nimport AdminDashboard from './AdminDashboard'\nimport AdminSports from './AdminSports'\nimport AdminUsers from './AdminUsers'\nimport NotFound from './../Others/NotFound'\n\nfunction Admin(props) {\n const { appConfig, t, user } = props\n return (\n <>\n <Helmet>\n <title>FitTrackee - {t('administration:Administration')}</title>\n </Helmet>\n <div className=\"container dashboard\">\n {user.admin ? (\n <Switch>\n <Route\n exact\n path=\"/admin\"\n render={() => <AdminDashboard appConfig={appConfig} t={t} />}\n />\n <Route\n exact\n path=\"/admin/application\"\n render={() => <AdminApplication appConfig={appConfig} t={t} />}\n />\n <Route\n exact\n path=\"/admin/sports\"\n render={() => <AdminSports t={t} />}\n />\n <Route\n exact\n path=\"/admin/users\"\n render={() => <AdminUsers t={t} />}\n />\n <Route component={NotFound} />\n </Switch>\n ) : (\n <NotFound />\n )}\n </div>\n </>\n )\n}\n\nexport default withTranslation()(\n connect(state => ({\n appConfig: state.application.config,\n user: state.user,\n }))(Admin)\n)\n","import { format, subHours } from 'date-fns'\nimport togeojson from '@mapbox/togeojson'\n\nimport { getDateWithTZ } from './index'\n\nexport const workoutColors = [\n '#55a8a3',\n '#98C3A9',\n '#D0838A',\n '#ECC77E',\n '#926692',\n '#929292',\n '#428bca',\n]\n\nexport const recordsLabels = [\n { record_type: 'AS', label: 'Ave. speed' },\n { record_type: 'FD', label: 'Farest distance' },\n { record_type: 'LD', label: 'Longest duration' },\n { record_type: 'MS', label: 'Max. speed' },\n]\n\nexport const getGeoJson = gpxContent => {\n let jsonData\n if (gpxContent) {\n const gpx = new DOMParser().parseFromString(gpxContent, 'text/xml')\n jsonData = togeojson.gpx(gpx)\n }\n return { jsonData }\n}\n\nexport const formatWorkoutDate = (\n dateTime,\n dateFormat = null,\n timeFormat = null\n) => {\n if (!dateFormat) {\n dateFormat = 'yyyy/MM/dd'\n }\n if (!timeFormat) {\n timeFormat = 'HH:mm'\n }\n return {\n workout_date: dateTime ? format(dateTime, dateFormat) : null,\n workout_time: dateTime ? format(dateTime, timeFormat) : null,\n }\n}\n\nexport const formatWorkoutDuration = seconds => {\n let newDate = new Date(0)\n newDate = subHours(newDate.setSeconds(seconds), 1)\n return newDate.getTime()\n}\n\nexport const formatChartData = chartData => {\n for (let i = 0; i < chartData.length; i++) {\n chartData[i].time = new Date(chartData[i].time).getTime()\n chartData[i].duration = formatWorkoutDuration(chartData[i].duration)\n }\n return chartData\n}\n\nexport const formatRecord = (record, tz) => {\n let value\n switch (record.record_type) {\n case 'AS':\n case 'MS':\n value = `${record.value} km/h`\n break\n case 'FD':\n value = `${record.value} km`\n break\n default:\n // 'LD'\n value = record.value // eslint-disable-line prefer-destructuring\n }\n const [recordType] = recordsLabels.filter(\n r => r.record_type === record.record_type\n )\n return {\n workout_date: formatWorkoutDate(getDateWithTZ(record.workout_date, tz))\n .workout_date,\n workout_id: record.workout_id,\n id: record.id,\n record_type: recordType.label,\n value: value,\n }\n}\n\nconst sortSports = (a, b) => {\n const sportALabel = a.label.toLowerCase()\n const sportBLabel = b.label.toLowerCase()\n return sportALabel > sportBLabel ? 1 : sportALabel < sportBLabel ? -1 : 0\n}\n\nexport const translateSports = (sports, t, onlyActive = false) =>\n sports\n .filter(sport => (onlyActive ? sport.is_active : true))\n .map(sport => ({\n ...sport,\n label: t(`sports:${sport.label}`),\n }))\n .sort(sortSports)\n","import { createApiRequest } from '../utils'\n\nexport default class FitTrackeeApi {\n static loginOrRegisterOrPasswordReset(target, data) {\n const params = {\n url: `auth/${target}`,\n method: 'POST',\n noAuthorization: true,\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static deletePicture() {\n const params = {\n url: 'auth/picture',\n method: 'DELETE',\n }\n return createApiRequest(params)\n }\n}\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport FitTrackeeApi from '../fitTrackeeApi/auth'\nimport { history } from '../index'\nimport { generateIds } from '../utils'\nimport { getOrUpdateData, setError, updateLanguage } from './index'\nimport { getAppData } from './application'\n\nconst AuthError = message => ({ type: 'AUTH_ERROR', message })\n\nconst AuthErrors = messages => ({ type: 'AUTH_ERRORS', messages })\n\nconst PictureError = message => ({ type: 'PICTURE_ERROR', message })\n\nconst ProfileSuccess = profil => ({ type: 'PROFILE_SUCCESS', profil })\n\nconst ProfileError = message => ({ type: 'PROFILE_ERROR', message })\n\nconst ProfileUpdateError = message => ({\n type: 'PROFILE_UPDATE_ERROR',\n message,\n})\n\nexport const logout = () => ({ type: 'LOGOUT' })\n\nexport const loadProfile = () => dispatch => {\n if (window.localStorage.getItem('authToken')) {\n return dispatch(getProfile())\n }\n return { type: 'LOGOUT' }\n}\n\nexport const getProfile = () => dispatch =>\n FitTrackeeGenericApi.getData('auth/profile')\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(getOrUpdateData('getData', 'sports'))\n ret.data.isAuthenticated = true\n if (ret.data.language) {\n dispatch(updateLanguage(ret.data.language))\n }\n return dispatch(ProfileSuccess(ret.data))\n }\n return dispatch(ProfileError(ret.message))\n })\n .catch(error => {\n throw error\n })\n\nexport const loginOrRegisterOrPasswordReset = (target, formData) => dispatch =>\n FitTrackeeApi.loginOrRegisterOrPasswordReset(target, formData)\n .then(ret => {\n if (ret.status === 'success') {\n if (target === 'password/reset-request') {\n return history.push({\n pathname: '/password-reset/sent',\n })\n }\n if (target === 'password/update') {\n return history.push({\n pathname: '/updated-password',\n })\n }\n if (target === 'login' || target === 'register') {\n window.localStorage.setItem('authToken', ret.auth_token)\n if (target === 'register') {\n dispatch(getAppData('config'))\n }\n return dispatch(getProfile())\n }\n }\n return dispatch(AuthError(ret.message))\n })\n .catch(error => {\n throw error\n })\n\nconst RegisterFormControl = (formData, onlyPasswords = false) => {\n const errMsg = []\n if (\n !onlyPasswords &&\n (formData.username.length < 3 || formData.username.length > 12)\n ) {\n errMsg.push('3 to 12 characters required for username.')\n }\n if (formData.password !== formData.password_conf) {\n errMsg.push(\"Password and password confirmation don't match.\")\n }\n if (formData.password.length < 8) {\n errMsg.push('8 characters required for password.')\n }\n return errMsg\n}\n\nexport const handleUserFormSubmit = (formData, formType) => dispatch => {\n if (formType === 'register' || formType === 'password/update') {\n const ret = RegisterFormControl(formData, formType === 'password/update')\n if (ret.length > 0) {\n return dispatch(AuthErrors(generateIds(ret)))\n }\n }\n return dispatch(loginOrRegisterOrPasswordReset(formType, formData))\n}\n\nexport const handleProfileFormSubmit = formData => dispatch => {\n if (!formData.password === formData.password_conf) {\n return dispatch(\n ProfileUpdateError(\"Password and password confirmation don't match.\")\n )\n }\n delete formData.id\n return FitTrackeeGenericApi.postData('auth/profile/edit', formData)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(getProfile())\n return history.push('/profile')\n }\n dispatch(ProfileUpdateError(ret.message))\n })\n .catch(error => {\n throw error\n })\n}\n\nexport const uploadPicture = event => dispatch => {\n event.preventDefault()\n const form = new FormData()\n form.append('file', event.target.picture.files[0])\n event.target.reset()\n return FitTrackeeGenericApi.addDataWithFile('auth/picture', form)\n .then(ret => {\n if (ret.status === 'success') {\n return dispatch(getProfile())\n }\n const msg =\n ret.status === 413\n ? 'Error during picture update, file size exceeds max size.'\n : ret.message\n return dispatch(PictureError(msg))\n })\n .catch(error => {\n throw error\n })\n}\n\nexport const deletePicture = () => dispatch =>\n FitTrackeeApi.deletePicture()\n .then(ret => {\n if (ret.status === 204) {\n return dispatch(getProfile())\n }\n return dispatch(PictureError(ret.message))\n })\n .catch(error => {\n throw error\n })\n\nexport const deleteUser = (username, isAdmin = false) => dispatch =>\n FitTrackeeGenericApi.deleteData('users', username)\n .then(ret => {\n if (ret.status === 204) {\n dispatch(getAppData('config'))\n if (isAdmin) {\n history.push('/admin/users')\n } else {\n dispatch(logout())\n history.push('/')\n }\n } else {\n ret.json().then(r => dispatch(setError(`${r.message}`)))\n }\n })\n .catch(error => dispatch(setError(`user|${error}`)))\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport { history } from '../index'\nimport { formatChartData } from '../utils/workouts'\nimport { setError, setLoading } from './index'\nimport { loadProfile } from './user'\n\nexport const pushWorkouts = workouts => ({\n type: 'PUSH_WORKOUTS',\n workouts,\n})\n\nexport const removeWorkout = workoutId => ({\n type: 'REMOVE_WORKOUT',\n workoutId,\n})\n\nexport const updateCalendar = workouts => ({\n type: 'UPDATE_CALENDAR',\n workouts,\n})\n\nexport const setGpx = gpxContent => ({\n type: 'SET_GPX',\n gpxContent,\n})\n\nexport const setChartData = chartData => ({\n type: 'SET_CHART_DATA',\n chartData,\n})\n\nexport const addWorkout = form => dispatch =>\n FitTrackeeGenericApi.addDataWithFile('workouts', form)\n .then(ret => {\n if (ret.status === 'created') {\n if (ret.data.workouts.length === 0) {\n dispatch(setError('workouts|no correct file.'))\n } else if (ret.data.workouts.length === 1) {\n dispatch(loadProfile())\n history.push(`/workouts/${ret.data.workouts[0].id}`)\n } else {\n // ret.data.workouts.length > 1\n dispatch(loadProfile())\n history.push('/')\n }\n } else if (ret.status === 413) {\n dispatch(\n setError('workouts|File size is greater than the allowed size')\n )\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n dispatch(setLoading(false))\n })\n .catch(error => {\n dispatch(setLoading(false))\n dispatch(setError(`workouts|${error}`))\n })\n\nexport const addWorkoutWithoutGpx = form => dispatch =>\n FitTrackeeGenericApi.addData('workouts/no_gpx', form)\n .then(ret => {\n if (ret.status === 'created') {\n dispatch(loadProfile())\n history.push(`/workouts/${ret.data.workouts[0].id}`)\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n\nexport const getWorkoutGpx = workoutId => dispatch => {\n if (workoutId) {\n return FitTrackeeGenericApi.getData(`workouts/${workoutId}/gpx`)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setGpx(ret.data.gpx))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n }\n dispatch(setGpx(null))\n}\n\nexport const getSegmentGpx = (workoutId, segmentId) => dispatch => {\n if (workoutId) {\n return FitTrackeeGenericApi.getData(\n `workouts/${workoutId}/gpx/segment/${segmentId}`\n )\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setGpx(ret.data.gpx))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n }\n dispatch(setGpx(null))\n}\n\nexport const getWorkoutChartData = workoutId => dispatch => {\n if (workoutId) {\n return FitTrackeeGenericApi.getData(`workouts/${workoutId}/chart_data`)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setChartData(formatChartData(ret.data.chart_data)))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n }\n dispatch(setChartData(null))\n}\n\nexport const getSegmentChartData = (workoutId, segmentId) => dispatch => {\n if (workoutId) {\n return FitTrackeeGenericApi.getData(\n `workouts/${workoutId}/chart_data/segment/${segmentId}`\n )\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setChartData(formatChartData(ret.data.chart_data)))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n }\n dispatch(setChartData(null))\n}\n\nexport const deleteWorkout = id => dispatch =>\n FitTrackeeGenericApi.deleteData('workouts', id)\n .then(ret => {\n if (ret.status === 204) {\n Promise.resolve(dispatch(removeWorkout(id)))\n .then(() => dispatch(loadProfile()))\n .then(() => history.push('/'))\n } else {\n dispatch(setError(`workouts|${ret.status}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n\nexport const editWorkout = form => dispatch =>\n FitTrackeeGenericApi.updateData('workouts', form)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(loadProfile())\n history.push(`/workouts/${ret.data.workouts[0].id}`)\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n dispatch(setLoading(false))\n })\n .catch(error => {\n dispatch(setLoading(false))\n dispatch(setError(`workouts|${error}`))\n })\n\nexport const getMoreWorkouts = params => dispatch =>\n FitTrackeeGenericApi.getData('workouts', params)\n .then(ret => {\n if (ret.status === 'success') {\n if (ret.data.workouts.length > 0) {\n dispatch(pushWorkouts(ret.data.workouts))\n }\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n\nexport const getMonthWorkouts = (from, to) => dispatch =>\n FitTrackeeGenericApi.getData('workouts', {\n from,\n to,\n order: 'desc',\n per_page: 100,\n })\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(updateCalendar(ret.data.workouts))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n","import React from 'react'\nimport { Trans } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport { setLoading } from '../../../actions/index'\nimport { addWorkout, editWorkout } from '../../../actions/workouts'\nimport { history } from '../../../index'\nimport { getFileSize } from '../../../utils'\nimport { translateSports } from '../../../utils/workouts'\n\nfunction FormWithGpx(props) {\n const {\n appConfig,\n loading,\n onAddWorkout,\n onEditWorkout,\n sports,\n t,\n workout,\n } = props\n const sportId = workout ? workout.sport_id : ''\n const translatedSports = translateSports(sports, t, true)\n const zipTooltip = `${t('workouts:no folder inside')}, ${\n appConfig.gpx_limit_import\n } ${t('workouts:files max')}, ${t('workouts:max size')}: ${getFileSize(\n appConfig.max_zip_file_size\n )}`\n const fileSizeLimit = getFileSize(appConfig.max_single_file_size)\n return (\n <form\n encType=\"multipart/form-data\"\n method=\"post\"\n onSubmit={event => event.preventDefault()}\n >\n <div className=\"form-group\">\n <label>\n {t('common:Sport')}:\n <select\n className=\"form-control input-lg\"\n defaultValue={sportId}\n disabled={loading}\n name=\"sport\"\n required\n >\n <option value=\"\" />\n {translatedSports.map(sport => (\n <option key={sport.id} value={sport.id}>\n {sport.label}\n </option>\n ))}\n </select>\n </label>\n </div>\n {workout ? (\n <div className=\"form-group\">\n <label>\n {t('workouts:Title')}:\n <input\n name=\"title\"\n defaultValue={workout ? workout.title : ''}\n disabled={loading}\n className=\"form-control input-lg\"\n />\n </label>\n </div>\n ) : (\n <div className=\"form-group\">\n <label>\n <Trans i18nKey=\"workouts:gpxFile\">\n <strong>gpx</strong> file\n </Trans>\n <sup>\n <i\n className=\"fa fa-question-circle\"\n aria-hidden=\"true\"\n data-toggle=\"tooltip\"\n title={`${t('workouts:max size')}: ${fileSizeLimit}`}\n />\n </sup>{' '}\n <Trans i18nKey=\"workouts:zipFile\">\n or <strong> zip</strong> file containing <strong>gpx </strong>\n files\n </Trans>\n <sup>\n <i\n className=\"fa fa-question-circle\"\n aria-hidden=\"true\"\n data-toggle=\"tooltip\"\n data-placement=\"top\"\n title={zipTooltip}\n />\n </sup>{' '}\n :\n <input\n accept=\".gpx, .zip\"\n className=\"form-control form-control-file gpx-file\"\n disabled={loading}\n name=\"gpxFile\"\n required\n type=\"file\"\n />\n </label>\n </div>\n )}\n <div className=\"form-group\">\n <label>\n {t('workouts:Notes')}:\n <textarea\n name=\"notes\"\n defaultValue={workout ? workout.notes : ''}\n disabled={loading}\n className=\"form-control input-lg\"\n maxLength=\"500\"\n />\n </label>\n </div>\n {loading ? (\n <div className=\"loader\" />\n ) : (\n <div>\n <input\n type=\"submit\"\n className=\"btn btn-primary\"\n onClick={event =>\n workout ? onEditWorkout(event, workout) : onAddWorkout(event)\n }\n value={t('common:Submit')}\n />\n <input\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={() => history.push('/')}\n value={t('common:Cancel')}\n />\n </div>\n )}\n </form>\n )\n}\n\nexport default connect(\n state => ({\n appConfig: state.application.config,\n loading: state.loading,\n }),\n dispatch => ({\n onAddWorkout: e => {\n dispatch(setLoading(true))\n const form = new FormData()\n form.append('file', e.target.form.gpxFile.files[0])\n /* prettier-ignore */\n form.append(\n 'data',\n `{\"sport_id\": ${e.target.form.sport.value\n }, \"notes\": \"${e.target.form.notes.value}\"}`\n )\n dispatch(addWorkout(form))\n },\n onEditWorkout: (e, workout) => {\n dispatch(\n editWorkout({\n id: workout.id,\n notes: e.target.form.notes.value,\n sport_id: +e.target.form.sport.value,\n title: e.target.form.title.value,\n })\n )\n },\n })\n)(FormWithGpx)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport { addWorkoutWithoutGpx, editWorkout } from '../../../actions/workouts'\nimport { history } from '../../../index'\nimport { getDateWithTZ } from '../../../utils'\nimport { formatWorkoutDate, translateSports } from '../../../utils/workouts'\n\nfunction FormWithoutGpx(props) {\n const { onAddOrEdit, sports, t, user, workout } = props\n const translatedSports = translateSports(sports, t, true)\n let workoutDate,\n workoutTime,\n sportId = ''\n if (workout) {\n const workoutDateTime = formatWorkoutDate(\n getDateWithTZ(workout.workout_date, user.timezone),\n 'yyyy-MM-dd'\n )\n workoutDate = workoutDateTime.workout_date\n workoutTime = workoutDateTime.workout_time\n sportId = workout.sport_id\n }\n\n return (\n <form onSubmit={event => event.preventDefault()}>\n <div className=\"form-group\">\n <label>\n {t('workouts:Title')}:\n <input\n name=\"title\"\n defaultValue={workout ? workout.title : ''}\n className=\"form-control input-lg\"\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('common:Sport')}:\n <select\n className=\"form-control input-lg\"\n defaultValue={sportId}\n name=\"sport_id\"\n required\n >\n <option value=\"\" />\n {translatedSports.map(sport => (\n <option key={sport.id} value={sport.id}>\n {sport.label}\n </option>\n ))}\n </select>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('workouts:Workout Date')}:\n <div className=\"container\">\n <div className=\"row\">\n <input\n name=\"workout_date\"\n defaultValue={workoutDate}\n className=\"form-control col-md\"\n required\n type=\"date\"\n />\n <input\n name=\"workout_time\"\n defaultValue={workoutTime}\n className=\"form-control col-md\"\n required\n type=\"time\"\n />\n </div>\n </div>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('workouts:Duration')}:\n <input\n name=\"duration\"\n defaultValue={workout ? workout.duration : ''}\n className=\"form-control col-xs-4\"\n pattern=\"^([0-9]*[0-9]):([0-5][0-9]):([0-5][0-9])$\"\n placeholder=\"hh:mm:ss\"\n required\n type=\"text\"\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('workouts:Distance')} (km):\n <input\n name=\"distance\"\n defaultValue={workout ? workout.distance : ''}\n className=\"form-control input-lg\"\n min={0}\n required\n step=\"0.001\"\n type=\"number\"\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('workouts:Notes')}:\n <textarea\n name=\"notes\"\n defaultValue={workout ? workout.notes : ''}\n className=\"form-control input-lg\"\n maxLength=\"500\"\n />\n </label>\n </div>\n <input\n type=\"submit\"\n className=\"btn btn-primary\"\n onClick={event => onAddOrEdit(event, workout)}\n value={t('common:Submit')}\n />\n <input\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={() => history.push('/')}\n value={t('common:Cancel')}\n />\n </form>\n )\n}\n\nexport default connect(\n state => ({\n user: state.user,\n }),\n dispatch => ({\n onAddOrEdit: (e, workout) => {\n const d = e.target.form.duration.value.split(':')\n const duration = +d[0] * 60 * 60 + +d[1] * 60 + +d[2]\n\n /* prettier-ignore */\n const workoutDate = `${e.target.form.workout_date.value\n } ${ e.target.form.workout_time.value}`\n\n const data = {\n workout_date: workoutDate,\n distance: +e.target.form.distance.value,\n duration,\n notes: e.target.form.notes.value,\n sport_id: +e.target.form.sport_id.value,\n title: e.target.form.title.value,\n }\n if (workout) {\n data.id = workout.id\n dispatch(editWorkout(data))\n } else {\n dispatch(addWorkoutWithoutGpx(data))\n }\n },\n })\n)(FormWithoutGpx)\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport FormWithGpx from './WorkoutForms/FormWithGpx'\nimport FormWithoutGpx from './WorkoutForms/FormWithoutGpx'\nimport Message from '../Common/Message'\n\nclass WorkoutAddEdit extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n withGpx: true,\n }\n }\n\n handleRadioChange(changeEvent) {\n this.setState({\n withGpx:\n changeEvent.target.name === 'withGpx'\n ? changeEvent.target.value\n : !changeEvent.target.value,\n })\n }\n\n render() {\n const { loading, message, sports, t, workout } = this.props\n const { withGpx } = this.state\n return (\n <div>\n <Helmet>\n <title>\n FitTrackee -{' '}\n {workout\n ? t('workouts:Edit a workout')\n : t('workouts:Add a workout')}\n </title>\n </Helmet>\n <br />\n <br />\n <Message message={message} t={t} />\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-md-2\" />\n <div className=\"col-md-8\">\n <div className=\"card add-workout\">\n <h2 className=\"card-header text-center\">\n {workout\n ? t('workouts:Edit a workout')\n : t('workouts:Add a workout')}\n </h2>\n <div className=\"card-body\">\n {workout ? (\n workout.with_gpx ? (\n <FormWithGpx workout={workout} sports={sports} t={t} />\n ) : (\n <FormWithoutGpx workout={workout} sports={sports} t={t} />\n )\n ) : (\n <div>\n <form>\n <div className=\"form-group row\">\n <div className=\"col\">\n <label className=\"radioLabel\">\n <input\n className=\"add-workout-radio\"\n type=\"radio\"\n name=\"withGpx\"\n disabled={loading}\n checked={withGpx}\n onChange={event =>\n this.handleRadioChange(event)\n }\n />\n {t('workouts:with gpx file')}\n </label>\n </div>\n <div className=\"col\">\n <label className=\"radioLabel\">\n <input\n className=\"add-workout-radio\"\n type=\"radio\"\n name=\"withoutGpx\"\n disabled={loading}\n checked={!withGpx}\n onChange={event =>\n this.handleRadioChange(event)\n }\n />\n {t('workouts:without gpx file')}\n </label>\n </div>\n </div>\n </form>\n {withGpx ? (\n <FormWithGpx sports={sports} t={t} />\n ) : (\n <FormWithoutGpx sports={sports} t={t} />\n )}\n </div>\n )}\n </div>\n </div>\n </div>\n <div className=\"col-md-2\" />\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(state => ({\n loading: state.loading,\n }))(WorkoutAddEdit)\n)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport WorkoutAddOrEdit from './WorkoutAddOrEdit'\n\nfunction WorkoutAdd(props) {\n const { message, sports } = props\n return (\n <div>\n <WorkoutAddOrEdit workout={null} message={message} sports={sports} />\n </div>\n )\n}\n\nexport default connect(state => ({\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n}))(WorkoutAdd)\n","import React from 'react'\nimport { useTranslation } from 'react-i18next'\n\nexport default function CustomModal(props) {\n const { t } = useTranslation()\n return (\n <div className=\"custom-modal-backdrop\">\n <div className=\"custom-modal\">\n <div className=\"modal-content\">\n <div className=\"modal-header\">\n <h5 className=\"modal-title\">{props.title}</h5>\n <button\n type=\"button\"\n className=\"close\"\n aria-label=\"Close\"\n onClick={() => props.close()}\n >\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div className=\"modal-body\">\n <p>{props.text}</p>\n </div>\n <div className=\"modal-footer\">\n <button\n type=\"button\"\n className=\"btn btn-primary\"\n onClick={() => props.confirm()}\n >\n {t('common:Yes')}\n </button>\n <button\n type=\"button\"\n className=\"btn btn-secondary\"\n onClick={() => props.close()}\n >\n {t('common:No')}\n </button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { getDateWithTZ } from '../../../utils'\nimport { formatWorkoutDate } from '../../../utils/workouts'\n\nexport default function WorkoutCardHeader(props) {\n const {\n dataType,\n displayModal,\n segmentId,\n sport,\n t,\n title,\n user,\n workout,\n } = props\n const workoutDate = workout\n ? formatWorkoutDate(getDateWithTZ(workout.workout_date, user.timezone))\n : null\n\n const previousUrl =\n dataType === 'segment' && segmentId !== 1\n ? `/workouts/${workout.id}/segment/${segmentId - 1}`\n : dataType === 'workout' && workout.previous_workout\n ? `/workouts/${workout.previous_workout}`\n : null\n const nextUrl =\n dataType === 'segment' && segmentId < workout.segments.length\n ? `/workouts/${workout.id}/segment/${segmentId + 1}`\n : dataType === 'workout' && workout.next_workout\n ? `/workouts/${workout.next_workout}`\n : null\n\n return (\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-auto\">\n {previousUrl ? (\n <Link className=\"unlink\" to={previousUrl}>\n <i\n className=\"fa fa-chevron-left\"\n aria-hidden=\"true\"\n title={t(`workouts:See previous ${dataType}`)}\n />\n </Link>\n ) : (\n <i\n className=\"fa fa-chevron-left inactive-link\"\n aria-hidden=\"true\"\n title={t(`workouts:No previous ${dataType}`)}\n />\n )}\n </div>\n <div className=\"col-auto col-workout-logo\">\n <img className=\"sport-img-medium\" src={sport.img} alt=\"sport logo\" />\n </div>\n <div className=\"col\">\n {dataType === 'workout' ? (\n <>\n {title}{' '}\n <Link className=\"unlink\" to={`/workouts/${workout.id}/edit`}>\n <i\n className=\"fa fa-edit custom-fa\"\n aria-hidden=\"true\"\n title={t('workouts:Edit workout')}\n />\n </Link>\n <i\n className=\"fa fa-trash custom-fa\"\n aria-hidden=\"true\"\n onClick={() => displayModal(true)}\n title={t('workouts:Delete workout')}\n />\n </>\n ) : (\n <>\n {/* prettier-ignore */}\n <Link\n to={`/workouts/${workout.id}`}\n >\n {title}\n </Link>{' '}\n - {t('workouts:segment')} {segmentId}\n </>\n )}\n <br />\n {workoutDate && (\n <span className=\"workout-date\">\n {`${workoutDate.workout_date} - ${workoutDate.workout_time}`}\n </span>\n )}\n </div>\n <div className=\"col-auto\">\n {nextUrl ? (\n <Link className=\"unlink\" to={nextUrl}>\n <i\n className=\"fa fa-chevron-right\"\n aria-hidden=\"true\"\n title={t(`workouts:See next ${dataType}`)}\n />\n </Link>\n ) : (\n <i\n className=\"fa fa-chevron-right inactive-link\"\n aria-hidden=\"true\"\n title={t(`workouts:No next ${dataType}`)}\n />\n )}\n </div>\n </div>\n </div>\n )\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { connect } from 'react-redux'\nimport {\n Area,\n ComposedChart,\n Line,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts'\n\nimport {\n getSegmentChartData,\n getWorkoutChartData,\n} from '../../../actions/workouts'\n\nclass WorkoutCharts extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayDistance: true,\n dataToHide: [],\n }\n }\n\n componentDidMount() {\n if (this.props.dataType === 'workout') {\n this.props.loadWorkoutData(this.props.workout.id)\n } else {\n this.props.loadSegmentData(this.props.workout.id, this.props.segmentId)\n }\n }\n\n componentDidUpdate(prevProps) {\n if (\n (this.props.dataType === 'workout' &&\n prevProps.workout.id !== this.props.workout.id) ||\n (this.props.dataType === 'workout' && prevProps.dataType === 'segment')\n ) {\n this.props.loadWorkoutData(this.props.workout.id)\n }\n if (\n this.props.dataType === 'segment' &&\n prevProps.segmentId !== this.props.segmentId\n ) {\n this.props.loadSegmentData(this.props.workout.id, this.props.segmentId)\n }\n }\n\n componentWillUnmount() {\n this.props.loadWorkoutData(null)\n }\n\n handleRadioChange(changeEvent) {\n this.setState({\n displayDistance:\n changeEvent.target.name === 'distance'\n ? changeEvent.target.value\n : !changeEvent.target.value,\n })\n }\n\n handleLegendChange(e) {\n const { dataToHide } = this.state\n const name = e.target.name // eslint-disable-line prefer-destructuring\n if (dataToHide.find(d => d === name)) {\n dataToHide.splice(dataToHide.indexOf(name), 1)\n } else {\n dataToHide.push(name)\n }\n this.setState({ dataToHide })\n }\n\n displayData(name) {\n const { dataToHide } = this.state\n return !dataToHide.find(d => d === name)\n }\n\n render() {\n const { chartData, t, updateCoordinates } = this.props\n const { displayDistance } = this.state\n const xInterval = chartData ? parseInt(chartData.length / 10, 10) : 0\n let xDataKey, xScale\n if (displayDistance) {\n xDataKey = 'distance'\n xScale = 'linear'\n } else {\n xDataKey = 'duration'\n xScale = 'time'\n }\n return (\n <div className=\"container\">\n {chartData && chartData.length > 0 ? (\n <div>\n <div className=\"row chart-radio\">\n <label className=\"radioLabel col-md-1\">\n <input\n type=\"radio\"\n name=\"distance\"\n checked={displayDistance}\n onChange={e => this.handleRadioChange(e)}\n />\n {t('workouts:distance')}\n </label>\n <label className=\"radioLabel col-md-1\">\n <input\n type=\"radio\"\n name=\"duration\"\n checked={!displayDistance}\n onChange={e => this.handleRadioChange(e)}\n />\n {t('workouts:duration')}\n </label>\n </div>\n <div className=\"row chart-radio\">\n <div className=\"col-md-5\" />\n <label className=\"radioLabel col-md-1\">\n <input\n type=\"checkbox\"\n name=\"speed\"\n checked={this.displayData('speed')}\n onChange={e => this.handleLegendChange(e)}\n />\n {t('workouts:speed')}\n </label>\n <label className=\"radioLabel col-md-1\">\n <input\n type=\"checkbox\"\n name=\"elevation\"\n checked={this.displayData('elevation')}\n onChange={e => this.handleLegendChange(e)}\n />\n {t('workouts:elevation')}\n </label>\n <div className=\"col-md-5\" />\n </div>\n <div className=\"row chart\">\n <ResponsiveContainer height={300}>\n <ComposedChart\n data={chartData}\n margin={{ top: 15, right: 30, left: 20, bottom: 15 }}\n onMouseMove={e => updateCoordinates(e.activePayload)}\n onMouseLeave={() => updateCoordinates(null)}\n >\n <XAxis\n allowDecimals={false}\n dataKey={xDataKey}\n label={{\n value: t(`workouts:${xDataKey}`),\n offset: 0,\n position: 'bottom',\n }}\n scale={xScale}\n interval={xInterval}\n tickFormatter={value =>\n displayDistance ? value : format(value, 'HH:mm:ss')\n }\n type=\"number\"\n />\n <YAxis\n label={{\n value: `${t('workouts:speed')} (km/h)`,\n angle: -90,\n position: 'left',\n }}\n yAxisId=\"left\"\n />\n <YAxis\n label={{\n value: `${t('workouts:elevation')} (m)`,\n angle: -90,\n position: 'right',\n }}\n yAxisId=\"right\"\n orientation=\"right\"\n />\n {this.displayData('elevation') && (\n <Area\n yAxisId=\"right\"\n type=\"linear\"\n dataKey=\"elevation\"\n name={t('workouts:elevation')}\n fill=\"#e5e5e5\"\n stroke=\"#cccccc\"\n dot={false}\n unit=\" m\"\n />\n )}\n {this.displayData('speed') && (\n <Line\n yAxisId=\"left\"\n type=\"linear\"\n dataKey=\"speed\"\n name={t('workouts:speed')}\n stroke=\"#8884d8\"\n strokeWidth={2}\n dot={false}\n unit=\" km/h\"\n />\n )}\n <Tooltip\n labelFormatter={value =>\n displayDistance\n ? `${t('workouts:distance')}: ${value} km`\n : `${t('workouts:duration')}: ${format(\n value,\n 'HH:mm:ss'\n )}`\n }\n />\n </ComposedChart>\n </ResponsiveContainer>\n </div>\n <div className=\"chart-info\">\n {t('workouts:data from gpx, without any cleaning')}\n </div>\n </div>\n ) : (\n t('workouts:No data to display')\n )}\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n chartData: state.chartData,\n }),\n dispatch => ({\n loadWorkoutData: workoutId => {\n dispatch(getWorkoutChartData(workoutId))\n },\n loadSegmentData: (workoutId, segmentId) => {\n dispatch(getSegmentChartData(workoutId, segmentId))\n },\n })\n)(WorkoutCharts)\n","import React from 'react'\n\nexport default function WorkoutWeather(props) {\n const { t, workout } = props\n return (\n <div className=\"container\">\n {workout.weather_start && workout.weather_end && (\n <table className=\"table table-borderless weather-table text-center\">\n <thead>\n <tr>\n <th />\n <th>\n {t('workouts:Start')}\n <br />\n <img\n className=\"weather-img\"\n src={`/img/weather/${workout.weather_start.icon}.png`}\n alt={`workout weather (${workout.weather_start.icon})`}\n title={workout.weather_start.summary}\n />\n </th>\n <th>\n {t('workouts:End')}\n <br />\n <img\n className=\"weather-img\"\n src={`/img/weather/${workout.weather_end.icon}.png`}\n alt={`workout weather (${workout.weather_end.icon})`}\n title={workout.weather_end.summary}\n />\n </th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>\n <img\n className=\"weather-img-small\"\n src=\"/img/weather/temperature.png\"\n alt=\"Temperatures\"\n />\n </td>\n <td>{Number(workout.weather_start.temperature).toFixed(1)}°C</td>\n <td>{Number(workout.weather_end.temperature).toFixed(1)}°C</td>\n </tr>\n <tr>\n <td>\n <img\n className=\"weather-img-small\"\n src=\"/img/weather/pour-rain.png\"\n alt=\"Temperatures\"\n />\n </td>\n <td>\n {Number(workout.weather_start.humidity * 100).toFixed(1)}%\n </td>\n <td>{Number(workout.weather_end.humidity * 100).toFixed(1)}%</td>\n </tr>\n <tr>\n <td>\n <img\n className=\"weather-img-small\"\n src=\"/img/weather/breeze.png\"\n alt=\"Temperatures\"\n />\n </td>\n <td>{Number(workout.weather_start.wind).toFixed(1)}m/s</td>\n <td>{Number(workout.weather_end.wind).toFixed(1)}m/s</td>\n </tr>\n </tbody>\n </table>\n )}\n </div>\n )\n}\n","import React from 'react'\n\nimport WorkoutWeather from './WorkoutWeather'\n\nexport default function WorkoutDetails(props) {\n const { t, workout } = props\n const withPauses = workout.pauses !== '0:00:00' && workout.pauses !== null\n return (\n <div className=\"workout-details\">\n <p>\n <i className=\"fa fa-clock-o custom-fa\" aria-hidden=\"true\" />\n {t('workouts:Duration')}: {workout.moving}\n {workout.records &&\n workout.records.find(record => record.record_type === 'LD') && (\n <sup>\n <i className=\"fa fa-trophy custom-fa\" aria-hidden=\"true\" />\n </sup>\n )}\n {withPauses && (\n <span>\n <br />({t('workouts:pauses')}: {workout.pauses},{' '}\n {t('workouts:total duration')}: {workout.duration})\n </span>\n )}\n </p>\n <p>\n <i className=\"fa fa-road custom-fa\" aria-hidden=\"true\" />\n {t('workouts:Distance')}: {workout.distance} km\n {workout.records &&\n workout.records.find(record => record.record_type === 'FD') && (\n <sup>\n <i className=\"fa fa-trophy custom-fa\" aria-hidden=\"true\" />\n </sup>\n )}\n </p>\n <p>\n <i className=\"fa fa-tachometer custom-fa\" aria-hidden=\"true\" />\n {t('workouts:Average speed')}: {workout.ave_speed} km/h\n {workout.records &&\n workout.records.find(record => record.record_type === 'AS') && (\n <sup>\n <i className=\"fa fa-trophy custom-fa\" aria-hidden=\"true\" />\n </sup>\n )}\n <br />\n {t('workouts:Max. speed')}: {workout.max_speed} km/h\n {workout.records &&\n workout.records.find(record => record.record_type === 'MS') && (\n <sup>\n <i className=\"fa fa-trophy custom-fa\" aria-hidden=\"true\" />\n </sup>\n )}\n </p>\n {workout.min_alt && workout.max_alt && (\n <p>\n <i className=\"fi-mountains custom-fa\" />\n {t('workouts:Min. altitude')}: {workout.min_alt}m\n <br />\n {t('workouts:Max. altitude')}: {workout.max_alt}m\n </p>\n )}\n {workout.ascent && workout.descent && (\n <p>\n <i className=\"fa fa-location-arrow custom-fa\" />\n {t('workouts:Ascent')}: {workout.ascent}m\n <br />\n {t('workouts:Descent')}: {workout.descent}m\n </p>\n )}\n <WorkoutWeather workout={workout} t={t} />\n </div>\n )\n}\n","import React from 'react'\nimport { GeoJSON, Marker, TileLayer, useMap } from 'react-leaflet'\nimport hash from 'object-hash'\n\nimport { apiUrl } from '../../../utils'\n\nexport default function Map({ bounds, coordinates, jsonData, mapAttribution }) {\n const map = useMap()\n map.fitBounds(bounds)\n return (\n <>\n <TileLayer\n // eslint-disable-next-line max-len\n attribution={mapAttribution}\n url={`${apiUrl}workouts/map_tile/{s}/{z}/{x}/{y}.png`}\n />\n <GeoJSON\n // hash as a key to force re-rendering\n key={hash(jsonData)}\n data={jsonData}\n />\n {coordinates.latitude && (\n <Marker position={[coordinates.latitude, coordinates.longitude]} />\n )}\n </>\n )\n}\n","import React from 'react'\nimport { MapContainer } from 'react-leaflet'\nimport { connect } from 'react-redux'\n\nimport Map from './Map'\nimport { getSegmentGpx, getWorkoutGpx } from '../../../actions/workouts'\nimport { getGeoJson } from '../../../utils/workouts'\n\nclass WorkoutMap extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n zoom: 13,\n }\n }\n\n componentDidMount() {\n if (this.props.dataType === 'workout') {\n this.props.loadWorkoutGpx(this.props.workout.id)\n } else {\n this.props.loadSegmentGpx(this.props.workout.id, this.props.segmentId)\n }\n }\n\n componentDidUpdate(prevProps) {\n if (\n (this.props.dataType === 'workout' &&\n prevProps.workout.id !== this.props.workout.id) ||\n (this.props.dataType === 'workout' && prevProps.dataType === 'segment')\n ) {\n this.props.loadWorkoutGpx(this.props.workout.id)\n }\n if (\n this.props.dataType === 'segment' &&\n prevProps.segmentId !== this.props.segmentId\n ) {\n this.props.loadSegmentGpx(this.props.workout.id, this.props.segmentId)\n }\n }\n\n componentWillUnmount() {\n this.props.loadWorkoutGpx(null)\n }\n\n render() {\n const { coordinates, gpxContent, mapAttribution, workout } = this.props\n const { jsonData } = getGeoJson(gpxContent)\n const bounds = [\n [workout.bounds[0], workout.bounds[1]],\n [workout.bounds[2], workout.bounds[3]],\n ]\n\n return (\n <div>\n {jsonData && (\n <MapContainer\n zoom={this.state.zoom}\n bounds={bounds}\n boundsOptions={{ padding: [10, 10] }}\n >\n <Map\n bounds={bounds}\n coordinates={coordinates}\n jsonData={jsonData}\n mapAttribution={mapAttribution}\n />\n </MapContainer>\n )}\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n gpxContent: state.gpx,\n mapAttribution: state.application.config.map_attribution,\n }),\n dispatch => ({\n loadWorkoutGpx: workoutId => {\n dispatch(getWorkoutGpx(workoutId))\n },\n loadSegmentGpx: (workoutId, segmentId) => {\n dispatch(getSegmentGpx(workoutId, segmentId))\n },\n })\n)(WorkoutMap)\n","import React from 'react'\n\nexport default function WorkoutNoMap(props) {\n const { t } = props\n return (\n <div className=\"workout-no-map text-center\">{t('workouts:No Map')}</div>\n )\n}\n","import React from 'react'\n\nexport default function WorkoutNotes(props) {\n const { notes, t } = props\n return (\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"card workout-card\">\n <div className=\"card-body\">\n Notes\n <div className=\"workout-notes\">\n {notes ? notes : t('workouts:No notes')}\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nexport default function WorkoutSegments(props) {\n const { segments, t } = props\n return (\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"card workout-card\">\n <div className=\"card-body\">\n {t('workouts:Segments')}\n <div className=\"workout-segments\">\n <ul>\n {segments.map((segment, index) => (\n <li\n className=\"workout-segments-list\"\n // eslint-disable-next-line react/no-array-index-key\n key={`segment-${index}`}\n >\n <Link\n to={`/workouts/${segment.workout_id}/segment/${\n index + 1\n }`}\n >\n {t('workouts:segment')} {index + 1}\n </Link>{' '}\n ({t('workouts:distance')}: {segment.distance} km,{' '}\n {t('workouts:duration')}: {segment.duration})\n </li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport CustomModal from '../../Common/CustomModal'\nimport Message from '../../Common/Message'\nimport WorkoutCardHeader from './WorkoutCardHeader'\nimport WorkoutCharts from './WorkoutCharts'\nimport WorkoutDetails from './WorkoutDetails'\nimport WorkoutMap from './WorkoutMap'\nimport WorkoutNoMap from './WorkoutNoMap'\nimport WorkoutNotes from './WorkoutNotes'\nimport WorkoutSegments from './WorkoutSegments'\nimport { getOrUpdateData } from '../../../actions'\nimport { deleteWorkout } from '../../../actions/workouts'\n\nclass WorkoutDisplay extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayModal: false,\n coordinates: {\n latitude: null,\n longitude: null,\n },\n }\n }\n\n componentDidMount() {\n this.props.loadWorkout(this.props.match.params.workoutId)\n }\n\n componentDidUpdate(prevProps) {\n if (\n prevProps.match.params.workoutId !== this.props.match.params.workoutId\n ) {\n this.props.loadWorkout(this.props.match.params.workoutId)\n }\n }\n\n displayModal(value) {\n this.setState(prevState => ({\n ...prevState,\n displayModal: value,\n }))\n }\n\n updateCoordinates(activePayload) {\n const coordinates =\n activePayload && activePayload.length > 0\n ? {\n latitude: activePayload[0].payload.latitude,\n longitude: activePayload[0].payload.longitude,\n }\n : {\n latitude: null,\n longitude: null,\n }\n this.setState(prevState => ({\n ...prevState,\n coordinates,\n }))\n }\n\n render() {\n const { message, onDeleteWorkout, sports, t, user, workouts } = this.props\n const { coordinates, displayModal } = this.state\n const [workout] = workouts\n const title = workout ? workout.title : t('workouts:Workout')\n const [sport] = workout ? sports.filter(s => s.id === workout.sport_id) : []\n const segmentId = parseInt(this.props.match.params.segmentId)\n const dataType = segmentId >= 0 ? 'segment' : 'workout'\n return (\n <div className=\"workout-page\">\n <Helmet>\n <title>FitTrackee - {title}</title>\n </Helmet>\n {message ? (\n <Message message={message} t={t} />\n ) : (\n <div className=\"container\">\n {displayModal && (\n <CustomModal\n title={t('common:Confirmation')}\n text={t(\n 'workouts:Are you sure you want to delete this workout?'\n )}\n confirm={() => {\n onDeleteWorkout(workout.id)\n this.displayModal(false)\n }}\n close={() => this.displayModal(false)}\n />\n )}\n {workout && sport && workouts.length === 1 && (\n <div>\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"card workout-card\">\n <div className=\"card-header\">\n <WorkoutCardHeader\n workout={workout}\n dataType={dataType}\n segmentId={segmentId}\n sport={sport}\n t={t}\n title={title}\n user={user}\n displayModal={() => this.displayModal(true)}\n />\n </div>\n <div className=\"card-body\">\n <div className=\"row\">\n <div className=\"col-md-8\">\n {workout.with_gpx ? (\n <WorkoutMap\n workout={workout}\n coordinates={coordinates}\n dataType={dataType}\n segmentId={segmentId}\n />\n ) : (\n <WorkoutNoMap t={t} />\n )}\n </div>\n <div className=\"col\">\n <WorkoutDetails\n workout={\n dataType === 'workout'\n ? workout\n : workout.segments[segmentId - 1]\n }\n t={t}\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n {workout.with_gpx && (\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"card workout-card\">\n <div className=\"card-body\">\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"chart-title\">\n {t('workouts:Chart')}\n </div>\n <WorkoutCharts\n workout={workout}\n dataType={dataType}\n segmentId={segmentId}\n t={t}\n updateCoordinates={e =>\n this.updateCoordinates(e)\n }\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )}\n {dataType === 'workout' && (\n <>\n <WorkoutNotes notes={workout.notes} t={t} />\n {workout.segments.length > 1 && (\n <WorkoutSegments segments={workout.segments} t={t} />\n )}\n </>\n )}\n </div>\n )}\n </div>\n )}\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n workouts: state.workouts.data,\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkout: workoutId => {\n dispatch(getOrUpdateData('getData', 'workouts', { id: workoutId }))\n },\n onDeleteWorkout: workoutId => {\n dispatch(deleteWorkout(workoutId))\n },\n })\n )(WorkoutDisplay)\n)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport WorkoutAddOrEdit from './WorkoutAddOrEdit'\nimport { getOrUpdateData } from '../../actions'\n\nclass WorkoutEdit extends React.Component {\n componentDidMount() {\n this.props.loadWorkout(this.props.match.params.workoutId)\n }\n\n render() {\n const { message, sports, workouts } = this.props\n const [workout] = workouts\n return (\n <div>\n {sports.length > 0 && (\n <WorkoutAddOrEdit\n workout={workout}\n message={message}\n sports={sports}\n />\n )}\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n workouts: state.workouts.data,\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkout: workoutId => {\n dispatch(getOrUpdateData('getData', 'workouts', { id: workoutId }))\n },\n })\n)(WorkoutEdit)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { Redirect, Route, Switch } from 'react-router-dom'\n\nimport NotFound from './../Others/NotFound'\nimport WorkoutAdd from './WorkoutAdd'\nimport WorkoutDisplay from './WorkoutDisplay'\nimport WorkoutEdit from './WorkoutEdit'\nimport { isLoggedIn } from '../../utils'\n\nfunction Workout() {\n return (\n <div>\n {isLoggedIn() ? (\n <Switch>\n <Route exact path=\"/workouts/add\" component={WorkoutAdd} />\n <Route exact path=\"/workouts/:workoutId\" component={WorkoutDisplay} />\n <Route\n exact\n path=\"/workouts/:workoutId/edit\"\n component={WorkoutEdit}\n />\n <Route\n path=\"/workouts/:workoutId/segment/:segmentId\"\n component={WorkoutDisplay}\n />\n <Route component={NotFound} />\n </Switch>\n ) : (\n <Redirect to=\"/login\" />\n )}\n </div>\n )\n}\n\nexport default connect(state => ({\n user: state.user,\n}))(Workout)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nexport default class NoWorkouts extends React.PureComponent {\n render() {\n const { t } = this.props\n return (\n <div className=\"card text-center\">\n <div className=\"card-body\">\n {t('common:No workouts.')}{' '}\n <Link to={{ pathname: '/workouts/add' }}>\n {t('dashboard:Upload one !')}\n </Link>\n </div>\n </div>\n )\n }\n}\n","import React from 'react'\n\nimport { translateSports } from '../../utils/workouts'\n\nexport default class WorkoutsFilter extends React.PureComponent {\n render() {\n const { loadWorkouts, sports, t, updateParams } = this.props\n const translatedSports = translateSports(sports, t)\n return (\n <div className=\"card\">\n <div className=\"card-body workout-filter\">\n <form onSubmit={event => event.preventDefault()}>\n <div className=\"form-group\">\n <label>\n {t('workouts:From')}:\n <input\n className=\"form-control col-md\"\n name=\"from\"\n onChange={e => updateParams(e)}\n type=\"date\"\n />\n </label>\n <label>\n {t('workouts:To')}:\n <input\n className=\"form-control col-md\"\n name=\"to\"\n onChange={e => updateParams(e)}\n type=\"date\"\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('common:Sport')}:\n <select\n className=\"form-control input-lg\"\n name=\"sport_id\"\n onChange={e => updateParams(e)}\n >\n <option value=\"\" />\n {translatedSports.map(sport => (\n <option key={sport.id} value={sport.id}>\n {sport.label}\n </option>\n ))}\n </select>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('workouts:Distance')} (km):\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n min={0}\n name=\"distance_from\"\n onChange={e => updateParams(e)}\n step=\"1\"\n type=\"number\"\n />\n </div>\n <div className=\"col-2 align-middle text-center\">\n {t('common:to')}\n </div>\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n min={0}\n name=\"distance_to\"\n onChange={e => updateParams(e)}\n step=\"1\"\n type=\"number\"\n />\n </div>\n </div>\n </div>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('workouts:Duration')}:\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n name=\"duration_from\"\n onChange={e => updateParams(e)}\n pattern=\"^([0-9]*[0-9]):([0-5][0-9])$\"\n placeholder=\"hh:mm\"\n type=\"text\"\n />\n </div>\n <div className=\"col-2 align-middle text-center\">\n {t('common:to')}\n </div>\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n name=\"duration_to\"\n onChange={e => updateParams(e)}\n pattern=\"^([0-9]*[0-9]):([0-5][0-9])$\"\n placeholder=\"hh:mm\"\n type=\"text\"\n />\n </div>\n </div>\n </div>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('workouts:Average speed')} (km/h):\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n min={0}\n name=\"ave_speed_from\"\n onChange={e => updateParams(e)}\n step=\"1\"\n type=\"number\"\n />\n </div>\n <div className=\"col-2 align-middle text-center\">\n {t('common:to')}\n </div>\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n min={0}\n name=\"ave_speed_to\"\n onChange={e => updateParams(e)}\n step=\"1\"\n type=\"number\"\n />\n </div>\n </div>\n </div>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('workouts:Max. speed')} (km/h):\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n min={0}\n name=\"max_speed_from\"\n onChange={e => updateParams(e)}\n step=\"1\"\n type=\"number\"\n />\n </div>\n <div className=\"col-2 align-middle text-center\">\n {t('common:to')}\n </div>\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n min={0}\n name=\"max_speed_to\"\n onChange={e => updateParams(e)}\n step=\"1\"\n type=\"number\"\n />\n </div>\n </div>\n </div>\n </label>\n </div>\n <input\n className=\"btn btn-primary btn-lg btn-block\"\n onClick={() => loadWorkouts()}\n type=\"submit\"\n value={t('workouts:Filter')}\n />\n </form>\n </div>\n </div>\n )\n }\n}\n","import React from 'react'\n\nimport { apiUrl } from '../../utils'\n\nexport default class StaticMap extends React.PureComponent {\n render() {\n const { display, workout } = this.props\n\n return (\n <div className={`workout-map${display === 'list' ? '-list' : ''}`}>\n <img\n src={`${apiUrl}workouts/map/${workout.map}?${Date.now()}`}\n alt=\"workout map\"\n />\n <div className={`map-attribution${display === 'list' ? '-list' : ''}`}>\n <span className=\"map-attribution-text\">©</span>\n <a\n className=\"map-attribution-text\"\n href=\"http://www.openstreetmap.org/copyright\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n OpenStreetMap\n </a>\n </div>\n </div>\n )\n }\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport StaticMap from '../Common/StaticMap'\nimport { getDateWithTZ } from '../../utils'\n\nexport default class WorkoutsList extends React.PureComponent {\n render() {\n const { loading, sports, t, user, workouts } = this.props\n return (\n <div className=\"card workout-card\">\n <div className=\"card-body\">\n <table className=\"table\">\n <thead>\n <tr>\n <th scope=\"col\" />\n <th scope=\"col\">{t('common:Workout')}</th>\n <th scope=\"col\">{t('workouts:Date')}</th>\n <th scope=\"col\">{t('workouts:Distance')}</th>\n <th scope=\"col\">{t('workouts:Duration')}</th>\n <th scope=\"col\">{t('workouts:Ave. speed')}</th>\n <th scope=\"col\">{t('workouts:Max. speed')}</th>\n </tr>\n </thead>\n <tbody>\n {!loading &&\n sports &&\n workouts.map((workout, idx) => (\n // eslint-disable-next-line react/no-array-index-key\n <tr key={idx}>\n <td>\n <span className=\"heading-span-absolute\">\n {t('common:Sport')}\n </span>\n <img\n className=\"workout-sport\"\n src={sports\n .filter(s => s.id === workout.sport_id)\n .map(s => s.img)}\n alt=\"workout sport logo\"\n />\n </td>\n <td className=\"workout-title\">\n <span className=\"heading-span-absolute\">\n {t('common:Workout')}\n </span>\n <Link to={`/workouts/${workout.id}`}>\n {workout.title}\n </Link>\n {workout.map && (\n <StaticMap workout={workout} display=\"list\" />\n )}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('workouts:Date')}\n </span>\n {format(\n getDateWithTZ(workout.workout_date, user.timezone),\n 'dd/MM/yyyy HH:mm'\n )}\n </td>\n <td className=\"text-right\">\n <span className=\"heading-span-absolute\">\n {t('workouts:Distance')}\n </span>\n {Number(workout.distance).toFixed(2)} km\n </td>\n <td className=\"text-right\">\n <span className=\"heading-span-absolute\">\n {t('workouts:Duration')}\n </span>\n {workout.moving}\n </td>\n <td className=\"text-right\">\n <span className=\"heading-span-absolute\">\n {t('workouts:Ave. speed')}\n </span>\n {workout.ave_speed} km/h\n </td>\n <td className=\"text-right\">\n <span className=\"heading-span-absolute\">\n {t('workouts:Max. speed')}\n </span>\n {workout.max_speed} km/h\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n {loading && <div className=\"loader\" />}\n </div>\n </div>\n )\n }\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport NoWorkouts from '../Common/NoWorkouts'\nimport WorkoutsFilter from './WorkoutsFilter'\nimport WorkoutsList from './WorkoutsList'\nimport { getOrUpdateData } from '../../actions'\nimport { getMoreWorkouts } from '../../actions/workouts'\n\nclass Workouts extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n params: {\n page: 1,\n per_page: 10,\n },\n }\n }\n\n componentDidMount() {\n this.props.loadWorkouts(this.state.params)\n }\n\n setParams(e) {\n const { params } = this.state\n if (e.target.value === '') {\n delete params[e.target.name]\n } else {\n params[e.target.name] = e.target.value\n }\n params.page = 1\n this.setState(params)\n }\n render() {\n const {\n loading,\n loadWorkouts,\n loadMoreWorkouts,\n message,\n sports,\n t,\n user,\n workouts,\n } = this.props\n const { params } = this.state\n const paginationEnd =\n workouts.length > 0\n ? workouts[workouts.length - 1].previous_workout === null\n : true\n return (\n <div>\n <Helmet>\n <title>FitTrackee - {t('common:Workouts')}</title>\n </Helmet>\n {message ? (\n <Message message={message} t={t} />\n ) : (\n <div className=\"container history\">\n <div className=\"row\">\n <div className=\"col-md-3\">\n <WorkoutsFilter\n sports={sports}\n loadWorkouts={() => loadWorkouts(params)}\n t={t}\n updateParams={e => this.setParams(e)}\n />\n </div>\n <div className=\"col-md-9 workouts-result\">\n <WorkoutsList\n workouts={workouts}\n loading={loading}\n sports={sports}\n t={t}\n user={user}\n />\n {!paginationEnd && (\n <input\n type=\"submit\"\n className=\"btn btn-default btn-md btn-block\"\n value=\"Load more workouts\"\n onClick={() => {\n params.page += 1\n loadMoreWorkouts(params)\n this.setState(params)\n }}\n />\n )}\n {workouts.length === 0 && <NoWorkouts t={t} />}\n </div>\n </div>\n </div>\n )}\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n workouts: state.workouts.data,\n loading: state.loading,\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkouts: params => {\n dispatch(getOrUpdateData('getData', 'workouts', params))\n },\n loadMoreWorkouts: params => {\n dispatch(getMoreWorkouts(params))\n },\n })\n )(Workouts)\n)\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport { deletePicture, uploadPicture } from '../../actions/user'\nimport { apiUrl, getFileSize } from '../../utils'\nimport { history } from '../../index'\n\nfunction ProfileDetail({\n appConfig,\n displayModal,\n editable,\n isDeletable,\n message,\n onDeletePicture,\n onUploadPicture,\n pathname,\n t,\n user,\n}) {\n const createdAt = user.created_at\n ? format(new Date(user.created_at), 'dd/MM/yyyy HH:mm')\n : ''\n const birthDate = user.birth_date\n ? format(new Date(user.birth_date), 'dd/MM/yyyy')\n : ''\n const fileSizeLimit = getFileSize(appConfig.max_single_file_size)\n return (\n <div>\n <Helmet>\n <title>FitTrackee - {t('user:Profile')}</title>\n </Helmet>\n <Message message={message} t={t} />\n <div className=\"container\">\n <h1 className=\"page-title\">{t('user:Profile')}</h1>\n <div className=\"row\">\n <div className=\"col-md-12\">\n <div className=\"card\">\n <div className=\"card-header userName\">\n <strong>{user.username}</strong>\n </div>\n <div className=\"card-body\">\n <div className=\"row\">\n <div className=\"col-md-8\">\n <p>\n {/* eslint-disable-next-line max-len */}\n <span className=\"user-label\">\n {t('user:Email')}\n </span>: {user.email}\n </p>\n <p>\n <span className=\"user-label\">\n {t('user:Registration Date')}\n </span>\n : {createdAt}\n </p>\n <p>\n <span className=\"user-label\">{t('user:First Name')}</span>\n : {user.first_name}\n </p>\n <p>\n {/* eslint-disable-next-line max-len */}\n <span className=\"user-label\">\n {t('user:Last Name')}\n </span>: {user.last_name}\n </p>\n <p>\n <span className=\"user-label\">{t('user:Birth Date')}</span>\n : {birthDate}\n </p>\n <p>\n {/* eslint-disable-next-line max-len */}\n <span className=\"user-label\">\n {t('user:Location')}\n </span>: {user.location}\n </p>\n <p>\n <span className=\"user-label\">{t('user:Bio')}</span>:{' '}\n {user.bio}\n </p>\n <p>\n {/* eslint-disable-next-line max-len */}\n <span className=\"user-label\">\n {t('user:Language')}\n </span>: {user.language}\n </p>\n <p>\n {/* eslint-disable-next-line max-len */}\n <span className=\"user-label\">\n {t('user:Timezone')}\n </span>: {user.timezone}\n </p>\n <p>\n <span className=\"user-label\">\n {t('user:First day of week')}\n </span>\n : {user.weekm ? t('user:Monday') : t('user:Sunday')}\n </p>\n </div>\n <div className=\"col-md-4\">\n {user.picture === true && (\n <div>\n <img\n alt=\"Profile\"\n src={\n `${apiUrl}users/${user.username}/picture` +\n `?${Date.now()}`\n }\n className=\"img-fluid App-profile-img-small\"\n />\n {editable && (\n <>\n <br />\n <button\n type=\"submit\"\n onClick={() => onDeletePicture()}\n >\n {t('user:Delete picture')}\n </button>\n <br />\n <br />\n </>\n )}\n </div>\n )}\n {editable && (\n <form\n encType=\"multipart/form-data\"\n onSubmit={event => onUploadPicture(event)}\n >\n <input\n type=\"file\"\n name=\"picture\"\n accept=\".png,.jpg,.gif\"\n />\n <br />\n <button type=\"submit\">{t('user:Send')}</button>\n {` (max. size: ${fileSizeLimit})`}\n </form>\n )}{' '}\n </div>\n </div>\n {editable && (\n <button\n className=\"btn btn-primary\"\n onClick={() => history.push('/profile/edit')}\n >\n {t('common:Edit')}\n </button>\n )}\n {isDeletable && (\n <button\n className=\"btn btn-danger\"\n onClick={() => displayModal(true)}\n >\n {t('user:Delete user account')}\n </button>\n )}\n <button\n className=\"btn btn-secondary\"\n onClick={() =>\n pathname === '/profile' ? history.push('/') : history.go(-1)\n }\n >\n {t(\n pathname === '/profile'\n ? 'common:Back to home'\n : 'common:Back'\n )}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n appConfig: state.application.config,\n pathname: state.router.location.pathname,\n message: state.message,\n }),\n dispatch => ({\n onDeletePicture: () => {\n dispatch(deletePicture())\n },\n onUploadPicture: event => {\n dispatch(uploadPicture(event))\n },\n })\n )(ProfileDetail)\n)\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport ProfileDetail from './ProfileDetail'\n\nfunction CurrentUserProfile({ t, user }) {\n return (\n <div>\n <ProfileDetail editable t={t} user={user} />\n </div>\n )\n}\n\nexport default withTranslation()(\n connect(state => ({\n user: state.user,\n }))(CurrentUserProfile)\n)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { recordsLabels } from '../../utils/workouts'\n\nexport default function CalendarWorkout(props) {\n const { isDisabled, isMore, sportImg, workout } = props\n return (\n <Link\n className={`calendar-workout${isMore}`}\n to={`/workouts/${workout.id}`}\n >\n <>\n <img\n alt=\"workout sport logo\"\n className={`workout-sport ${isDisabled}`}\n src={sportImg}\n title={workout.title}\n />\n {workout.records.length > 0 && (\n <sup>\n <i\n className=\"fa fa-trophy custom-fa-small\"\n aria-hidden=\"true\"\n title={workout.records.map(\n rec =>\n ` ${\n recordsLabels.filter(\n r => r.record_type === rec.record_type\n )[0].label\n }`\n )}\n />\n </sup>\n )}\n </>\n </Link>\n )\n}\n","import React from 'react'\n\nimport CalendarWorkout from './CalendarWorkout'\n\nexport default class CalendarWorkouts extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n isHidden: true,\n }\n }\n\n handleDisplayMore() {\n this.setState({\n isHidden: !this.state.isHidden,\n })\n }\n\n render() {\n const { dayWorkouts, isDisabled, sports } = this.props\n const { isHidden } = this.state\n return (\n <div>\n {dayWorkouts.map(act => (\n <CalendarWorkout\n key={act.id}\n workout={act}\n isDisabled={isDisabled}\n isMore=\"\"\n sportImg={sports.filter(s => s.id === act.sport_id).map(s => s.img)}\n />\n ))}\n {dayWorkouts.length > 2 && (\n <i\n className={`fa fa-${isHidden ? 'plus' : 'times'} calendar-more`}\n aria-hidden=\"true\"\n onClick={() => this.handleDisplayMore()}\n title=\"show more workouts\"\n />\n )}\n {!isHidden && (\n <div className=\"calendar-display-more\">\n {dayWorkouts.map(act => (\n <CalendarWorkout\n key={act.id}\n workout={act}\n isDisabled={isDisabled}\n isMore=\"-more\"\n sportImg={sports\n .filter(s => s.id === act.sport_id)\n .map(s => s.img)}\n />\n ))}\n </div>\n )}\n </div>\n )\n }\n}\n","// eslint-disable-next-line max-len\n// source: https://blog.flowandform.agency/create-a-custom-calendar-in-react-3df1bfd0b728\nimport {\n addDays,\n addMonths,\n endOfMonth,\n endOfWeek,\n format,\n isSameDay,\n isSameMonth,\n isToday,\n startOfMonth,\n startOfWeek,\n subMonths,\n} from 'date-fns'\nimport { enGB, fr } from 'date-fns/locale'\nimport React from 'react'\nimport { connect } from 'react-redux'\n\nimport CalendarWorkouts from './CalendarWorkouts'\nimport { getMonthWorkouts } from '../../actions/workouts'\nimport { getDateWithTZ } from '../../utils'\n\nconst getStartAndEndMonth = (date, weekStartOnMonday) => {\n const monthStart = startOfMonth(date)\n const monthEnd = endOfMonth(date)\n const weekStartsOn = weekStartOnMonday ? 1 : 0\n return {\n start: startOfWeek(monthStart, { weekStartsOn }),\n end: endOfWeek(monthEnd),\n }\n}\n\nclass Calendar extends React.Component {\n constructor(props, context) {\n super(props, context)\n const calendarDate = new Date()\n this.state = {\n currentMonth: calendarDate,\n startDate: getStartAndEndMonth(calendarDate, props.weekm).start,\n endDate: getStartAndEndMonth(calendarDate, props.weekm).end,\n weekStartOnMonday: props.weekm,\n }\n }\n\n componentDidMount() {\n this.props.loadMonthWorkouts(this.state.startDate, this.state.endDate)\n }\n\n renderHeader(localeOptions) {\n const dateFormat = 'MMM yyyy'\n return (\n <div className=\"header row flex-middle\">\n <div className=\"col col-start\" onClick={() => this.handlePrevMonth()}>\n <i className=\"fa fa-chevron-left\" aria-hidden=\"true\" />\n </div>\n <div className=\"col col-center\">\n <span>\n {format(this.state.currentMonth, dateFormat, localeOptions)}\n </span>\n </div>\n <div className=\"col col-end\" onClick={() => this.handleNextMonth()}>\n <i className=\"fa fa-chevron-right\" aria-hidden=\"true\" />\n </div>\n </div>\n )\n }\n\n renderDays(localeOptions) {\n const dateFormat = 'EEE'\n const days = []\n const { startDate } = this.state\n\n for (let i = 0; i < 7; i++) {\n days.push(\n <div className=\"col col-center\" key={i}>\n {format(addDays(startDate, i), dateFormat, localeOptions)}\n </div>\n )\n }\n return <div className=\"days row\">{days}</div>\n }\n\n filterWorkouts(day) {\n const { workouts, user } = this.props\n if (workouts) {\n return workouts.filter(act =>\n isSameDay(getDateWithTZ(act.workout_date, user.timezone), day)\n )\n }\n return []\n }\n\n renderCells() {\n const { currentMonth, startDate, endDate, weekStartOnMonday } = this.state\n const { sports } = this.props\n\n const dateFormat = 'd'\n const rows = []\n\n let days = []\n let day = startDate\n let formattedDate = ''\n\n while (day <= endDate) {\n for (let i = 0; i < 7; i++) {\n formattedDate = format(day, dateFormat)\n const dayWorkouts = this.filterWorkouts(day)\n const isDisabled = isSameMonth(day, currentMonth) ? '' : '-disabled'\n const isWeekEnd = weekStartOnMonday\n ? [5, 6].includes(i)\n : [0, 6].includes(i)\n days.push(\n <div\n className={`col cell ${isWeekEnd ? ' weekend' : ''}${\n isToday(day) ? ' today' : ''\n }`}\n key={day}\n >\n <div className={`img${isDisabled}`}>\n <span className=\"number\">{formattedDate}</span>\n <CalendarWorkouts\n dayWorkouts={dayWorkouts}\n isDisabled={isDisabled}\n sports={sports}\n />\n </div>\n </div>\n )\n day = addDays(day, 1)\n }\n rows.push(\n <div className=\"row\" key={day}>\n {days}\n </div>\n )\n days = []\n }\n return <div className=\"body\">{rows}</div>\n }\n\n updateStateDate(calendarDate) {\n const { start, end } = getStartAndEndMonth(\n calendarDate,\n this.state.weekStartOnMonday\n )\n this.setState({\n currentMonth: calendarDate,\n startDate: start,\n endDate: end,\n })\n this.props.loadMonthWorkouts(start, end)\n }\n\n handleNextMonth() {\n const calendarDate = addMonths(this.state.currentMonth, 1)\n this.updateStateDate(calendarDate)\n }\n\n handlePrevMonth() {\n const calendarDate = subMonths(this.state.currentMonth, 1)\n this.updateStateDate(calendarDate)\n }\n\n render() {\n const localeOptions = {\n locale: this.props.language === 'fr' ? fr : enGB,\n }\n return (\n <div className=\"card workout-card\">\n <div className=\"calendar\">\n {this.renderHeader(localeOptions)}\n {this.renderDays(localeOptions)}\n {this.renderCells()}\n </div>\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n workouts: state.calendarWorkouts.data,\n language: state.language,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadMonthWorkouts: (start, end) => {\n const dateFormat = 'yyyy-MM-dd'\n dispatch(\n getMonthWorkouts(format(start, dateFormat), format(end, dateFormat))\n )\n },\n })\n)(Calendar)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { formatRecord, translateSports } from '../../utils/workouts'\n\nexport default function RecordsCard(props) {\n const { records, sports, t, user } = props\n const translatedSports = translateSports(sports, t)\n const recordsBySport = records.reduce((sportList, record) => {\n const sport = translatedSports.find(s => s.id === record.sport_id)\n if (sportList[sport.label] === void 0) {\n sportList[sport.label] = {\n img: sport.img,\n records: [],\n }\n }\n sportList[sport.label].records.push(formatRecord(record, user.timezone))\n return sportList\n }, {})\n\n return (\n <div className=\"card workout-card\">\n <div className=\"card-header\">{t('workouts:Personal records')}</div>\n <div className=\"card-body\">\n {Object.keys(recordsBySport).length === 0\n ? t('common:No records.')\n : Object.keys(recordsBySport)\n .sort()\n .map(sportLabel => (\n <div key={sportLabel}>\n <span className=\"heading-span\">\n <img\n alt={`${sportLabel} logo`}\n className=\"record-logo\"\n src={recordsBySport[sportLabel].img}\n />\n {sportLabel}\n </span>\n {/* eslint-disable-next-line max-len */}\n <table className=\"table table-borderless table-sm record-table\">\n <thead>\n <tr>\n <th colSpan=\"3\">\n <img\n alt={`${sportLabel} logo`}\n className=\"record-logo\"\n src={recordsBySport[sportLabel].img}\n />\n {sportLabel}\n </th>\n </tr>\n </thead>\n <tbody>\n {recordsBySport[sportLabel].records.map(rec => (\n <tr className=\"record-tr\" key={rec.id}>\n <td className=\"record-td\">\n {t(`workouts:${rec.record_type}`)}\n </td>\n <td className=\"record-td text-right\">{rec.value}</td>\n <td className=\"record-td text-right\">\n <Link to={`/workouts/${rec.workout_id}`}>\n {rec.workout_date}\n </Link>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n ))}\n </div>\n </div>\n )\n}\n","import {\n addDays,\n addMonths,\n addYears,\n format,\n startOfMonth,\n startOfWeek,\n startOfYear,\n} from 'date-fns'\n\nconst xAxisFormats = [\n { duration: 'week', dateFormat: 'yyyy-MM-dd', xAxis: 'dd/MM' },\n { duration: 'month', dateFormat: 'yyyy-MM', xAxis: 'MM/yyyy' },\n { duration: 'year', dateFormat: 'yyyy', xAxis: 'yyyy' },\n]\n\nexport const formatDuration = (totalSeconds, formatWithDay = false) => {\n let days = '0'\n if (formatWithDay) {\n days = String(Math.floor(totalSeconds / 86400))\n totalSeconds %= 86400\n }\n const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0')\n totalSeconds %= 3600\n const minutes = String(Math.floor(totalSeconds / 60)).padStart(2, '0')\n const seconds = String(totalSeconds % 60).padStart(2, '0')\n if (formatWithDay) {\n return `${days === '0' ? '' : `${days}d:`}${\n hours === '00' ? '' : `${hours}h:`\n }${minutes}m:${seconds}s`\n }\n return `${hours === '00' ? '' : `${hours}:`}${minutes}:${seconds}`\n}\n\nexport const formatValue = (displayedData, value) =>\n value === 0\n ? ''\n : displayedData === 'distance'\n ? `${value.toFixed(2)} km`\n : displayedData === 'duration'\n ? formatDuration(value)\n : value\n\nconst dateIncrement = (duration, day) => {\n switch (duration) {\n case 'week':\n return addDays(day, 7)\n case 'year':\n return addYears(day, 1)\n case 'month':\n default:\n return addMonths(day, 1)\n }\n}\n\nconst startDate = (duration, day, weekm) => {\n switch (duration) {\n case 'week':\n return startOfWeek(day, { weekStartsOn: weekm ? 1 : 0 })\n case 'year':\n return startOfYear(day)\n case 'month':\n default:\n return startOfMonth(day)\n }\n}\n\nexport const formatStats = (stats, sports, params, displayedSports, weekm) => {\n const nbWorkoutsStats = []\n const distanceStats = []\n const durationStats = []\n\n for (\n let day = startDate(params.duration, params.start, weekm);\n day <= params.end;\n day = dateIncrement(params.duration, day)\n ) {\n const [xAxisFormat] = xAxisFormats.filter(\n x => x.duration === params.duration\n )\n const date = format(day, xAxisFormat.dateFormat)\n const xAxis = format(day, xAxisFormat.xAxis)\n const dataNbWorkouts = { date: xAxis }\n const dataDistance = { date: xAxis }\n const dataDuration = { date: xAxis }\n\n if (stats[date]) {\n Object.keys(stats[date])\n .filter(sportId =>\n displayedSports ? displayedSports.includes(+sportId) : true\n )\n .map(sportId => {\n const sportLabel = sports.filter(s => s.id === +sportId)[0].label\n dataNbWorkouts[sportLabel] = stats[date][sportId].nb_workouts\n dataDistance[sportLabel] = stats[date][sportId].total_distance\n dataDuration[sportLabel] = stats[date][sportId].total_duration\n return null\n })\n }\n nbWorkoutsStats.push(dataNbWorkouts)\n distanceStats.push(dataDistance)\n durationStats.push(dataDuration)\n }\n\n return {\n workouts: nbWorkoutsStats,\n distance: distanceStats,\n duration: durationStats,\n }\n}\n","import React from 'react'\n\nimport { formatDuration } from '../../../utils/stats'\n\nconst formatValue = (displayedData, value) =>\n displayedData === 'duration'\n ? formatDuration(value, true)\n : displayedData === 'distance'\n ? value.toFixed(2)\n : value\n\n/**\n * @return {null}\n */\nexport default function CustomTooltip(props) {\n const { active } = props\n if (active) {\n const { displayedData, payload, label } = props\n let total = 0\n payload.map(p => (total += p.value))\n return (\n <div className=\"custom-tooltip\">\n <p className=\"custom-tooltip-label\">{label}</p>\n {payload.map(p => (\n <p key={p.name} style={{ color: p.fill }}>\n {p.name}: {formatValue(displayedData, p.value)} {p.unit}\n </p>\n ))}\n {payload.length > 0 && (\n <p>Total: {formatValue(displayedData, total)}</p>\n )}\n </div>\n )\n }\n return null\n}\n","import React from 'react'\n\nimport { formatValue } from '../../../utils/stats'\n\n/**\n * @return {null}\n */\nexport default function CustomLabel(props) {\n const { displayedData, x, y, width, value } = props\n if (!value) {\n return null\n }\n const radius = 10\n const formattedValue = formatValue(displayedData, value)\n\n return (\n <g>\n <text\n x={x + width / 2}\n y={y - radius}\n fill=\"#666\"\n fontSize=\"11\"\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n >\n {formattedValue}\n </text>\n </g>\n )\n}\n","import React from 'react'\nimport {\n Bar,\n BarChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts'\n\nimport { formatValue } from '../../../utils/stats'\nimport { workoutColors } from '../../../utils/workouts'\nimport CustomTooltip from './CustomTooltip'\nimport CustomLabel from './CustomLabel'\n\nexport default class StatsCharts extends React.PureComponent {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayedData: 'distance',\n }\n }\n handleRadioChange(changeEvent) {\n this.setState({\n displayedData: changeEvent.target.name,\n })\n }\n\n render() {\n const { displayedData } = this.state\n const { sports, stats, t } = this.props\n if (Object.keys(stats).length === 0) {\n return t('common:No workouts.')\n }\n return (\n <div className=\"chart-stats\">\n <div className=\"row chart-radio\">\n <label className=\"radioLabel col\">\n <input\n type=\"radio\"\n name=\"distance\"\n checked={displayedData === 'distance'}\n onChange={e => this.handleRadioChange(e)}\n />\n {t('statistics:distance')}\n </label>\n <label className=\"radioLabel col\">\n <input\n type=\"radio\"\n name=\"duration\"\n checked={displayedData === 'duration'}\n onChange={e => this.handleRadioChange(e)}\n />\n {t('statistics:duration')}\n </label>\n <label className=\"radioLabel col\">\n <input\n type=\"radio\"\n name=\"workouts\"\n checked={displayedData === 'workouts'}\n onChange={e => this.handleRadioChange(e)}\n />\n {t('statistics:workouts')}\n </label>\n </div>\n <ResponsiveContainer height={300}>\n <BarChart data={stats[displayedData]} margin={{ top: 15, bottom: 0 }}>\n <XAxis\n dataKey=\"date\"\n interval={0} // to force to display all ticks\n />\n <YAxis tickFormatter={value => formatValue(displayedData, value)} />\n <Tooltip\n content={<CustomTooltip displayedData={displayedData} />}\n />\n {sports.map((s, i) => (\n <Bar\n // disable for now due to problems w/ CustomLabel\n // see https://github.com/recharts/recharts/issues/829\n isAnimationActive={false}\n key={s.id}\n dataKey={s.label}\n stackId=\"a\"\n fill={workoutColors[i]}\n label={\n i === sports.length - 1 ? (\n <CustomLabel displayedData={displayedData} />\n ) : (\n ''\n )\n }\n name={t(`sports:${s.label}`)}\n />\n ))}\n </BarChart>\n </ResponsiveContainer>\n </div>\n )\n }\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { connect } from 'react-redux'\n\nimport { getStats } from '../../../actions/stats'\nimport { formatStats } from '../../../utils/stats'\nimport StatsChart from './StatsChart'\n\nclass Statistics extends React.PureComponent {\n componentDidMount() {\n this.updateData()\n }\n\n componentDidUpdate(prevProps) {\n if (\n (this.props.user.username &&\n this.props.user.username !== prevProps.user.username) ||\n this.props.statsParams !== prevProps.statsParams\n ) {\n this.updateData()\n }\n }\n\n updateData() {\n if (this.props.user.username) {\n this.props.loadWorkouts(\n this.props.user.username,\n this.props.user.weekm,\n this.props.statsParams\n )\n }\n }\n\n render() {\n const {\n displayedSports,\n sports,\n statistics,\n statsParams,\n displayEmpty,\n t,\n user,\n } = this.props\n if (!displayEmpty && Object.keys(statistics).length === 0) {\n return <span>{t('common:No workouts.')}</span>\n }\n const stats = formatStats(\n statistics,\n sports,\n statsParams,\n displayedSports,\n user.weekm\n )\n return <StatsChart sports={sports} stats={stats} t={t} />\n }\n}\n\nexport default connect(\n state => ({\n sports: state.sports.data,\n statistics: state.statistics.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkouts: (userName, weekm, data) => {\n const dateFormat = 'yyyy-MM-dd'\n // depends on user config (first day of week)\n const time =\n data.duration === 'week'\n ? `${data.duration}${weekm ? 'm' : ''}`\n : data.duration\n const params = {\n from: format(data.start, dateFormat),\n to: format(data.end, dateFormat),\n time: time,\n }\n dispatch(getStats(userName, data.type, params))\n },\n })\n)(Statistics)\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport { setData, setError } from './index'\n\nexport const getStats = (userName, type, data) => dispatch =>\n FitTrackeeGenericApi.getData(`stats/${userName}/${type}`, data)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setData('statistics', ret.data))\n } else {\n dispatch(setError(`statistics|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`statistics|${error}`)))\n","import { endOfMonth, startOfMonth } from 'date-fns'\nimport React from 'react'\n\nimport Stats from '../Common/Stats'\n\nexport default class Statistics extends React.Component {\n constructor(props, context) {\n super(props, context)\n const date = new Date()\n this.state = {\n start: startOfMonth(date),\n end: endOfMonth(date),\n duration: 'week',\n type: 'by_time',\n }\n }\n\n render() {\n const { t } = this.props\n return (\n <div className=\"card workout-card\">\n <div className=\"card-header\">{t('dashboard:This month')}</div>\n <div className=\"card-body\">\n <Stats displayEmpty={false} statsParams={this.state} t={t} />\n </div>\n </div>\n )\n }\n}\n","import React from 'react'\n\nexport default function UserStatistics(props) {\n const { t, user } = props\n const days = user.total_duration.match(/day/g)\n ? `${user.total_duration.split(' ')[0]} ${\n user.total_duration.match(/days/g) ? t('common:days') : t('common:day')\n }`\n : `0 ${t('common:days')},`\n let duration = user.total_duration.match(/day/g)\n ? user.total_duration.split(', ')[1]\n : user.total_duration\n duration = `${duration.split(':')[0]}h ${duration.split(':')[1]}min`\n return (\n <div className=\"row\">\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card workout-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-calendar fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">{user.nb_workouts}</div>\n <div>{`${\n user.nb_workouts === 1\n ? t('common:workout')\n : t('common:workouts')\n }`}</div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card workout-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-road fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">\n {Number(user.total_distance).toFixed(2)}\n </div>\n <div>km</div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card workout-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-clock-o fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">{days}</div>\n <div>{duration}</div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card workout-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-tags fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">{user.nb_sports}</div>\n <div>{`${\n user.nb_sports === 1 ? t('common:sport') : t('common:sports')\n }`}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport StaticMap from '../Common/StaticMap'\nimport { getDateWithTZ } from '../../utils'\n\nexport default function WorkoutCard(props) {\n const { sports, t, user, workout } = props\n\n return (\n <div className=\"card workout-card text-center\">\n <div className=\"card-header\">\n <Link to={`/workouts/${workout.id}`}>\n {sports\n .filter(sport => sport.id === workout.sport_id)\n .map(sport => t(`sports:${sport.label}`))}{' '}\n -{' '}\n {format(\n getDateWithTZ(workout.workout_date, user.timezone),\n 'dd/MM/yyyy HH:mm'\n )}\n </Link>\n </div>\n <div className=\"card-body\">\n <div className=\"row\">\n {workout.map && (\n <div className=\"col\">\n <StaticMap workout={workout} />\n </div>\n )}\n <div className=\"col\">\n <p>\n <i className=\"fa fa-clock-o\" aria-hidden=\"true\" />{' '}\n {t('workouts:Duration')}: {workout.moving}\n {workout.map ? (\n <span>\n <br />\n <br />\n </span>\n ) : (\n ' - '\n )}\n <i className=\"fa fa-road\" aria-hidden=\"true\" />{' '}\n {t('workouts:Distance')}: {workout.distance} km\n </p>\n </div>\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport Calendar from './Calendar'\nimport Message from '../Common/Message'\nimport NoWorkouts from '../Common/NoWorkouts'\nimport Records from './Records'\nimport Statistics from './Statistics'\nimport UserStatistics from './UserStatistics'\nimport WorkoutCard from './WorkoutCard'\nimport { getOrUpdateData } from '../../actions'\nimport { getMoreWorkouts } from '../../actions/workouts'\n\nclass DashBoard extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n page: 1,\n }\n }\n\n componentDidMount() {\n this.props.loadWorkouts()\n }\n\n render() {\n const {\n loadMoreWorkouts,\n message,\n records,\n sports,\n t,\n user,\n workouts,\n } = this.props\n const paginationEnd =\n workouts.length > 0\n ? workouts[workouts.length - 1].previous_workout === null\n : true\n const { page } = this.state\n return (\n <div>\n <Helmet>\n <title>FitTrackee - {t('common:Dashboard')}</title>\n </Helmet>\n {message ? (\n <Message message={message} t={t} />\n ) : (\n workouts &&\n user.total_duration &&\n sports.length > 0 && (\n <div className=\"container dashboard\">\n <UserStatistics user={user} t={t} />\n <div className=\"row\">\n <div className=\"col-md-4\">\n <Statistics t={t} />\n <Records\n t={t}\n records={records}\n sports={sports}\n user={user}\n />\n </div>\n <div className=\"col-md-8\">\n <Calendar weekm={user.weekm} />\n {workouts.length > 0 ? (\n workouts.map(workout => (\n <WorkoutCard\n workout={workout}\n key={workout.id}\n sports={sports}\n t={t}\n user={user}\n />\n ))\n ) : (\n <NoWorkouts t={t} />\n )}\n {!paginationEnd && (\n <input\n type=\"submit\"\n className=\"btn btn-default btn-md btn-block\"\n value=\"Load more workouts\"\n onClick={() => {\n loadMoreWorkouts(page + 1)\n this.setState({ page: page + 1 })\n }}\n />\n )}\n </div>\n </div>\n </div>\n )\n )}\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n workouts: state.workouts.data,\n message: state.message,\n records: state.records.data,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkouts: () => {\n dispatch(getOrUpdateData('getData', 'workouts', { page: 1 }))\n dispatch(getOrUpdateData('getData', 'records'))\n },\n loadMoreWorkouts: page => {\n dispatch(getMoreWorkouts({ page }))\n },\n })\n )(DashBoard)\n)\n","import React from 'react'\n\nimport { version } from './../../utils'\n\nexport default function Footer() {\n return (\n <footer className=\"footer\">\n <div className=\"container\">\n <strong>FitTrackee</strong> v{version} -{' '}\n <a\n href=\"https://github.com/SamR1/FitTrackee\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n source code\n </a>{' '}\n under{' '}\n <a\n href=\"https://choosealicense.com/licenses/gpl-3.0/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n GPLv3\n </a>{' '}\n license -{' '}\n <a\n href=\"https://samr1.github.io/FitTrackee/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n documentation\n </a>\n </div>\n </footer>\n )\n}\n","import React from 'react'\nimport { Trans } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport { Link } from 'react-router-dom'\n\nimport { logout } from '../../actions/user'\n\nclass Logout extends React.Component {\n componentDidMount() {\n this.props.UserLogout()\n }\n render() {\n return (\n <div className=\"container dashboard\">\n <div className=\"row\">\n <div className=\"col-2\" />\n <div className=\"card col-8\">\n <div className=\"card-body\">\n <div className=\"text-center\">\n <Trans i18nKey=\"user:loggedOut\">\n You are now logged out. Click <Link to=\"/login\">here</Link> to\n log back in.\n </Trans>\n </div>\n </div>\n </div>\n <div className=\"col-2\" />\n </div>\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n user: state.user,\n }),\n dispatch => ({\n UserLogout: () => {\n dispatch(logout())\n },\n })\n)(Logout)\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m466.916 27.803h-421.832c-24.859 0-45.084 20.225-45.084 45.084v366.226c0 24.859 20.225 45.084 45.084 45.084h421.832c24.859 0 45.084-20.225 45.084-45.084v-366.226c0-24.859-20.225-45.084-45.084-45.084z\",\n fill: \"#f0f9ff\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m198.58 188.334-181.344-150.862c-7.75 6.107-13.456 14.691-15.905 24.554l164.142 136.551h33.102z\",\n fill: \"#f40055\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 198.576h33.93l163.447-135.973c-2.325-9.923-7.93-18.592-15.613-24.796l-181.764 151.211z\",\n fill: \"#c20044\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m165.472 313.425-164.141 136.549c2.449 9.863 8.155 18.447 15.905 24.553l181.344-150.861-.005-10.241z\",\n fill: \"#f40055\"\n});\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 313.425v9.557l181.765 151.211c7.683-6.204 13.288-14.874 15.613-24.796l-163.446-135.971z\",\n fill: \"#c20044\"\n});\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m53.273 27.803 145.302 120.879v-120.879z\",\n fill: \"#406bd4\"\n});\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 150.571v-122.768h148.082z\",\n fill: \"#3257b0\"\n});\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m394.732 198.575 117.268-97.556v97.556z\",\n fill: \"#3257b0\"\n});\n\nvar _ref10 = /*#__PURE__*/React.createElement(\"g\", {\n fill: \"#406bd4\"\n}, /*#__PURE__*/React.createElement(\"path\", {\n d: \"m0 99.317v99.258h119.313z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m0 313.425v97.699l117.44-97.699z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m50.49 484.197 148.085-122.676v122.676z\"\n}));\n\nvar _ref11 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 484.197v-124.139l149.221 124.139z\",\n fill: \"#3257b0\"\n});\n\nvar _ref12 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m512 409.423-115.395-95.998h115.395z\",\n fill: \"#3257b0\"\n});\n\nvar _ref13 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m512 222.142h-222.142v-194.339h-67.716v194.339h-222.142v67.716h222.142v194.339h67.716v-194.339h222.142z\",\n fill: \"#f40055\"\n});\n\nvar _ref14 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m289.858 222.142v-194.339h-33.858v456.394h33.858v-194.339h222.142v-67.716z\",\n fill: \"#c20044\"\n});\n\nfunction SvgEn(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n enableBackground: \"new 0 0 512 512\",\n height: 512,\n viewBox: \"0 0 512 512\",\n width: 512,\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14);\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgEn);\nexport default __webpack_public_path__ + \"static/media/en.9e6dbfb0.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m173.899 31.804h-8.707l-4.397-4h-115.711c-24.859-.001-45.084 20.224-45.084 45.083v366.226c0 24.859 20.225 45.084 45.084 45.084h115.711l6.348-4h6.755v-448.393z\",\n fill: \"#406bd4\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m466.916 27.803h-115.711l-4.523 4h-5.141v448.393h4.141l5.523 4h115.711c24.859 0 45.084-20.225 45.084-45.084v-366.225c0-24.859-20.225-45.084-45.084-45.084z\",\n fill: \"#c20044\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m160.795 27.803h190.409v456.394h-190.409z\",\n fill: \"#f0f9ff\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m256 27.803h95.205v456.394h-95.205z\",\n fill: \"#cee5f5\"\n});\n\nfunction SvgFr(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n enableBackground: \"new 0 0 512 512\",\n height: 512,\n viewBox: \"0 0 512 512\",\n width: 512,\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4, _ref5);\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgFr);\nexport default __webpack_public_path__ + \"static/media/fr.d0f9280c.svg\";\nexport { ForwardRef as ReactComponent };","import React, { Component } from 'react'\nimport { connect } from 'react-redux'\n\nimport { ReactComponent as EnFlag } from '../../images/flags/en.svg'\nimport { ReactComponent as FrFlag } from '../../images/flags/fr.svg'\nimport { updateLanguage } from '../../actions/index'\n\nexport const languages = [\n {\n name: 'en',\n selected: true,\n flag: <EnFlag />,\n },\n {\n name: 'fr',\n selected: false,\n flag: <FrFlag />,\n },\n]\n\nclass Dropdown extends Component {\n constructor(props) {\n super(props)\n this.state = {\n isOpen: false,\n }\n }\n\n toggleDropdown() {\n this.setState(prevState => ({\n isOpen: !prevState.isOpen,\n }))\n }\n\n render() {\n const { isOpen } = this.state\n const { language: selected, onUpdateLanguage } = this.props\n return (\n <div className=\"dropdown-wrapper\" onClick={() => this.toggleDropdown()}>\n <ul className=\"dropdown-list i18n-flag\">\n {languages\n .filter(language =>\n isOpen ? language : language.name === selected\n )\n .map(language => (\n <li\n className={`dropdown-item${\n language.name === selected && isOpen\n ? ' dropdown-item-selected'\n : ''\n }`}\n key={language.name}\n onClick={() => onUpdateLanguage(language.name, selected)}\n >\n {language.flag} {language.name}\n </li>\n ))}\n </ul>\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n language: state.language,\n }),\n dispatch => ({\n onUpdateLanguage: (lang, selected) => {\n if (lang !== selected) {\n dispatch(updateLanguage(lang))\n }\n },\n })\n)(Dropdown)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { withTranslation } from 'react-i18next'\nimport { Link } from 'react-router-dom'\n\nimport LanguageDropdown from './LanguageDropdown'\nimport { apiUrl } from '../../utils'\n\nclass NavBar extends React.PureComponent {\n render() {\n const { admin, isAuthenticated, picture, t, username } = this.props\n return (\n <header>\n <nav className=\"navbar navbar-expand-lg navbar-light bg-light\">\n <div className=\"container\">\n <span className=\"navbar-brand\">FitTrackee</span>\n <button\n className=\"navbar-toggler\"\n type=\"button\"\n data-toggle=\"collapse\"\n data-target=\"#navbarSupportedContent\"\n aria-controls=\"navbarSupportedContent\"\n aria-expanded=\"false\"\n aria-label=\"Toggle navigation\"\n >\n <span className=\"navbar-toggler-icon\" />\n </button>\n <div\n className=\"collapse navbar-collapse\"\n id=\"navbarSupportedContent\"\n >\n <ul className=\"navbar-nav mr-auto\">\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/',\n }}\n >\n {t('common:Dashboard')}\n </Link>\n </li>\n {isAuthenticated && (\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/workouts/history',\n }}\n >\n {t('Workouts')}\n </Link>\n </li>\n )}\n {isAuthenticated && (\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/workouts/statistics',\n }}\n >\n {t('common:Statistics')}\n </Link>\n </li>\n )}\n {admin && (\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/admin',\n }}\n >\n Admin\n </Link>\n </li>\n )}\n {isAuthenticated && (\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/workouts/add',\n }}\n >\n <strong>{t('common:Add workout')}</strong>\n </Link>\n </li>\n )}\n </ul>\n {/* prettier-ignore */}\n <ul\n className=\"navbar-nav flex-row ml-md-auto d-none d-md-flex\"\n >\n {!isAuthenticated && (\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/register',\n }}\n >\n {t('user:Register')}\n </Link>\n </li>\n )}\n {!isAuthenticated && (\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/login',\n }}\n >\n {t('user:Login')}\n </Link>\n </li>\n )}\n {isAuthenticated && (\n <>\n {picture === true ? (\n <img\n alt=\"Avatar\"\n src={`${apiUrl}users/${username}/picture?${Date.now()}`}\n className=\"img-fluid App-nav-profile-img\"\n />\n ) : (\n <i\n className=\"fa fa-user-circle-o fa-2x no-picture\"\n aria-hidden=\"true\"\n />\n )}\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/profile',\n }}\n >\n {username}\n </Link>\n </li>\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/logout',\n }}\n >\n {t('user:Logout')}\n </Link>\n </li>\n </>\n )}\n <li><LanguageDropdown /></li>\n </ul>\n </div>\n </div>\n </nav>\n </header>\n )\n }\n}\n\nexport default withTranslation()(\n connect(({ user }) => ({\n admin: user.admin,\n isAuthenticated: user.isAuthenticated,\n picture: user.picture,\n username: user.username,\n }))(NavBar)\n)\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M468.683,287.265h-69.07c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h69.07 c4.147,0,7.508-3.361,7.508-7.508C476.191,290.626,472.83,287.265,468.683,287.265z\"\n})));\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M105.012,268.377L85.781,256l19.231-12.376c3.487-2.243,4.495-6.888,2.251-10.376c-2.244-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.776c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.47-11.243 c-3.486-2.245-8.132-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L58.034,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.47-11.243v20.775 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C109.507,275.266,108.499,270.62,105.012,268.377z\"\n})));\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M194.441,268.377L175.21,256l19.231-12.376c3.487-2.244,4.495-6.889,2.25-10.376c-2.245-3.486-6.888-4.497-10.376-2.25 l-17.47,11.243v-20.775c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.776l-17.471-11.243 c-3.487-2.245-8.133-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L147.463,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.471-11.243v20.776 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.47,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C198.936,275.266,197.928,270.62,194.441,268.377z\"\n})));\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M283.871,268.377L264.64,256l19.231-12.376c3.487-2.243,4.495-6.888,2.251-10.376c-2.245-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.775c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.471-11.243 c-3.486-2.245-8.134-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L236.892,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.471-11.243v20.775 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.886-1.216,6.32-3.446C288.366,275.266,287.358,270.62,283.871,268.377z\"\n})));\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M373.3,268.377L354.069,256l19.231-12.376c3.487-2.244,4.495-6.889,2.25-10.376c-2.244-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.776c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.47-11.243 c-3.486-2.245-8.132-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L326.322,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.47-11.243v20.776 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C377.795,275.266,376.787,270.62,373.3,268.377z\"\n})));\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M271.792,330.359H15.016V181.642h93.1c4.147,0,7.508-3.361,7.508-7.508c0-4.147-3.361-7.508-7.508-7.508H12.513 C5.613,166.626,0,172.24,0,179.14v153.722c0,6.9,5.613,12.513,12.513,12.513h259.278c4.147,0,7.508-3.361,7.508-7.508 C279.299,333.72,275.939,330.359,271.792,330.359z\"\n})));\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M499.487,166.626H162.174c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h334.811v148.716H323.848 c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h175.64c6.9,0,12.513-5.613,12.513-12.513V179.14 C512.001,172.24,506.387,166.626,499.487,166.626z\"\n})));\n\nfunction SvgPassword(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Layer_1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n x: \"0px\",\n y: \"0px\",\n viewBox: \"0 0 512.001 512.001\",\n style: {\n enableBackground: \"new 0 0 512.001 512.001\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8);\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgPassword);\nexport default __webpack_public_path__ + \"static/media/password.afe6a2a5.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M339.798,260.429c0.13-0.026,0.257-0.061,0.385-0.094c0.109-0.028,0.219-0.051,0.326-0.084 c0.125-0.038,0.247-0.085,0.369-0.129c0.108-0.039,0.217-0.074,0.324-0.119c0.115-0.048,0.226-0.104,0.338-0.157 c0.109-0.052,0.22-0.1,0.327-0.158c0.107-0.057,0.208-0.122,0.312-0.184c0.107-0.064,0.215-0.124,0.319-0.194 c0.111-0.074,0.214-0.156,0.321-0.236c0.09-0.067,0.182-0.13,0.27-0.202c0.162-0.133,0.316-0.275,0.466-0.421 c0.027-0.026,0.056-0.048,0.083-0.075c0.028-0.028,0.052-0.059,0.079-0.088c0.144-0.148,0.284-0.3,0.416-0.46 c0.077-0.094,0.144-0.192,0.216-0.289c0.074-0.1,0.152-0.197,0.221-0.301c0.074-0.111,0.139-0.226,0.207-0.34 c0.057-0.096,0.118-0.19,0.171-0.289c0.062-0.115,0.114-0.234,0.169-0.351c0.049-0.104,0.101-0.207,0.146-0.314 c0.048-0.115,0.086-0.232,0.128-0.349c0.041-0.114,0.085-0.227,0.12-0.343c0.036-0.118,0.062-0.238,0.092-0.358 c0.029-0.118,0.063-0.234,0.086-0.353c0.028-0.141,0.045-0.283,0.065-0.425c0.014-0.1,0.033-0.199,0.043-0.3 c0.025-0.249,0.038-0.498,0.038-0.748V92.76c0-4.143-3.357-7.5-7.5-7.5h-236.25c-0.066,0-0.13,0.008-0.196,0.01 c-0.143,0.004-0.285,0.01-0.427,0.022c-0.113,0.009-0.225,0.022-0.337,0.037c-0.128,0.016-0.255,0.035-0.382,0.058 c-0.119,0.021-0.237,0.046-0.354,0.073c-0.119,0.028-0.238,0.058-0.356,0.092c-0.117,0.033-0.232,0.069-0.346,0.107 c-0.117,0.04-0.234,0.082-0.349,0.128c-0.109,0.043-0.216,0.087-0.322,0.135c-0.118,0.053-0.235,0.11-0.351,0.169 c-0.099,0.051-0.196,0.103-0.292,0.158c-0.116,0.066-0.23,0.136-0.343,0.208c-0.093,0.06-0.184,0.122-0.274,0.185 c-0.106,0.075-0.211,0.153-0.314,0.235c-0.094,0.075-0.186,0.152-0.277,0.231c-0.09,0.079-0.179,0.158-0.266,0.242 c-0.099,0.095-0.194,0.194-0.288,0.294c-0.047,0.05-0.097,0.094-0.142,0.145c-0.027,0.03-0.048,0.063-0.074,0.093 c-0.094,0.109-0.182,0.223-0.27,0.338c-0.064,0.084-0.13,0.168-0.19,0.254c-0.078,0.112-0.15,0.227-0.222,0.343 c-0.059,0.095-0.12,0.189-0.174,0.286c-0.063,0.112-0.118,0.227-0.175,0.342c-0.052,0.105-0.106,0.21-0.153,0.317 c-0.049,0.113-0.092,0.23-0.135,0.345c-0.043,0.113-0.087,0.225-0.124,0.339c-0.037,0.115-0.067,0.232-0.099,0.349 c-0.032,0.12-0.066,0.239-0.093,0.36c-0.025,0.113-0.042,0.228-0.062,0.342c-0.022,0.13-0.044,0.26-0.06,0.39 c-0.013,0.108-0.019,0.218-0.027,0.328c-0.01,0.14-0.019,0.28-0.021,0.421c-0.001,0.041-0.006,0.081-0.006,0.122v46.252 c0,4.143,3.357,7.5,7.5,7.5s7.5-3.357,7.5-7.5v-29.595l66.681,59.037c-0.348,0.245-0.683,0.516-0.995,0.827l-65.687,65.687v-49.288 c0-4.143-3.357-7.5-7.5-7.5s-7.5,3.357-7.5,7.5v9.164h-38.75c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h38.75v43.231 c0,4.143,3.357,7.5,7.5,7.5h236.25c0.247,0,0.494-0.013,0.74-0.037c0.115-0.011,0.226-0.033,0.339-0.049 C339.542,260.469,339.67,260.454,339.798,260.429z M330.834,234.967l-65.688-65.687c-0.042-0.042-0.087-0.077-0.13-0.117 l49.383-41.897c3.158-2.68,3.546-7.412,0.866-10.571c-2.678-3.157-7.41-3.547-10.571-0.866l-84.381,71.59l-98.444-87.158h208.965 V234.967z M185.878,179.888c0.535-0.535,0.969-1.131,1.308-1.765l28.051,24.835c1.418,1.255,3.194,1.885,4.972,1.885 c1.726,0,3.451-0.593,4.853-1.781l28.587-24.254c0.26,0.38,0.553,0.743,0.89,1.08l65.687,65.687H120.191L185.878,179.888z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.5,170.676h126.667c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H7.5c-4.143,0-7.5,3.357-7.5,7.5 S3.357,170.676,7.5,170.676z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.625,129.345H77.5c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H20.625c-4.143,0-7.5,3.357-7.5,7.5 S16.482,129.345,20.625,129.345z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M62.5,226.51h-55c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h55c4.143,0,7.5-3.357,7.5-7.5S66.643,226.51,62.5,226.51z\"\n}));\n\nfunction SvgMailSend(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n x: \"0px\",\n y: \"0px\",\n viewBox: \"0 0 345.834 345.834\",\n style: {\n enableBackground: \"new 0 0 345.834 345.834\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgMailSend);\nexport default __webpack_public_path__ + \"static/media/mail-send.619079f0.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { Link } from 'react-router-dom'\n\nimport { ReactComponent as Password } from '../../images/password.svg'\nimport { ReactComponent as MailSend } from '../../images/mail-send.svg'\n\nexport default function PasswordReset(props) {\n const { t } = useTranslation()\n const { action } = props\n return (\n <div className=\"container dashboard\">\n <div className=\"row\">\n <div className=\"col-2\" />\n <div className=\"card col-8\">\n <div className=\"card-body\">\n <div className=\"text-center \">\n {action === 'sent' && (\n <>\n <div className=\"svg-icon\">\n <MailSend />\n </div>\n {t(\n // eslint-disable-next-line max-len\n \"user:Check your email. If your address is in our database, you'll received an email with a link to reset your password.\"\n )}\n </>\n )}\n {action === 'updated' && (\n <>\n <div className=\"svg-icon\">\n <Password />\n </div>\n <Trans i18nKey=\"user:updatedPasswordText\">\n {/* prettier-ignore */}\n Your password have been updated. Click\n <Link to=\"/login\">here</Link> to log in.\n </Trans>\n </>\n )}\n </div>\n </div>\n </div>\n <div className=\"col-2\" />\n </div>\n </div>\n )\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport TimezonePicker from 'react-timezone'\n\nimport Message from '../Common/Message'\nimport { deleteUser, handleProfileFormSubmit } from '../../actions/user'\nimport { history } from '../../index'\nimport { languages } from '../NavBar/LanguageDropdown'\nimport CustomModal from '../Common/CustomModal'\n\nclass ProfileEdit extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n formData: {},\n displayModal: false,\n }\n }\n\n componentDidMount() {\n this.initForm()\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.user !== this.props.user) {\n this.initForm()\n }\n }\n\n initForm() {\n const { user } = this.props\n const formData = {}\n Object.keys(user).map(k =>\n user[k] === null\n ? (formData[k] = '')\n : k === 'birth_date'\n ? (formData[k] = format(new Date(user[k]), 'yyyy-MM-DD'))\n : (formData[k] = user[k])\n )\n this.setState({ formData })\n }\n\n handleFormChange(e) {\n const { formData } = this.state\n if (e.target.name === 'weekm') {\n formData.weekm = e.target.value === 'Monday'\n } else {\n formData[e.target.name] = e.target.value\n }\n this.setState(formData)\n }\n\n displayModal(value) {\n this.setState(prevState => ({\n ...prevState,\n displayModal: value,\n }))\n }\n\n render() {\n const {\n message,\n onDeleteUser,\n onHandleProfileFormSubmit,\n t,\n user,\n } = this.props\n const { displayModal, formData } = this.state\n return (\n <div>\n <Helmet>\n <title>FitTrackee - {t('user:Profile Edition')}</title>\n </Helmet>\n {formData.isAuthenticated && (\n <div className=\"container\">\n {displayModal && (\n <CustomModal\n title={t('common:Confirmation')}\n text={t(\n 'user:Are you sure you want to delete your account? ' +\n 'All data will be deleted, this cannot be undone.'\n )}\n confirm={() => {\n onDeleteUser(user.username)\n this.displayModal(false)\n }}\n close={() => this.displayModal(false)}\n />\n )}\n <h1 className=\"page-title\">{t('user:Profile Edition')}</h1>\n <div className=\"row\">\n <div className=\"col-md-2\" />\n <div className=\"col-md-8\">\n <div className=\"card\">\n <div className=\"card-header\">{user.username}</div>\n <div className=\"card-body\">\n <div className=\"row\">\n <div className=\"col-md-12\">\n <form\n onSubmit={event => {\n event.preventDefault()\n onHandleProfileFormSubmit(formData)\n }}\n >\n <div className=\"form-group\">\n <label>\n {t('user:Email')}:\n <input\n name=\"email\"\n className=\"form-control input-lg\"\n type=\"text\"\n value={formData.email}\n readOnly\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Registration Date')}:\n <input\n name=\"createdAt\"\n className=\"form-control input-lg\"\n type=\"text\"\n value={formData.created_at}\n disabled\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Password')}:\n <input\n name=\"password\"\n className=\"form-control input-lg\"\n type=\"password\"\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Password Confirmation')}:\n <input\n name=\"password_conf\"\n className=\"form-control input-lg\"\n type=\"password\"\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <hr />\n <div className=\"form-group\">\n <label>\n {t('user:First Name')}:\n <input\n name=\"first_name\"\n className=\"form-control input-lg\"\n type=\"text\"\n value={formData.first_name}\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Last Name')}:\n <input\n name=\"last_name\"\n className=\"form-control input-lg\"\n type=\"text\"\n value={formData.last_name}\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Birth Date')}\n <input\n name=\"birth_date\"\n className=\"form-control input-lg\"\n type=\"date\"\n value={formData.birth_date}\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Location')}:\n <input\n name=\"location\"\n className=\"form-control input-lg\"\n type=\"text\"\n value={formData.location}\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Bio')}:\n <textarea\n name=\"bio\"\n className=\"form-control input-lg\"\n maxLength=\"200\"\n value={formData.bio}\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Language')}:\n <select\n name=\"language\"\n className=\"form-control input-lg\"\n value={formData.language}\n onChange={e => this.handleFormChange(e)}\n >\n {languages.map(lang => (\n <option value={lang.name} key={lang.name}>\n {lang.name}\n </option>\n ))}\n </select>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Timezone')}:\n <TimezonePicker\n className=\"form-control timezone-custom\"\n onChange={tz => {\n const e = {\n target: {\n name: 'timezone',\n value: tz ? tz : 'Europe/Paris',\n },\n }\n this.handleFormChange(e)\n }}\n value={formData.timezone}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:First day of week')}:\n <select\n name=\"weekm\"\n className=\"form-control input-lg\"\n value={formData.weekm ? 'Monday' : 'Sunday'}\n onChange={e => this.handleFormChange(e)}\n >\n <option value=\"Sunday\">\n {t('user:Sunday')}\n </option>\n <option value=\"Monday\">\n {t('user:Monday')}\n </option>\n </select>\n </label>\n </div>\n <button type=\"submit\" className=\"btn btn-primary\">\n {t('common:Submit')}\n </button>\n <button\n className=\"btn btn-danger\"\n onClick={event => {\n event.preventDefault()\n this.displayModal(true)\n }}\n >\n {t('user:Delete my account')}\n </button>\n <button\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={() => history.push('/profile')}\n >\n {t('common:Cancel')}\n </button>\n </form>\n <Message message={message} t={t} />\n </div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-md-2\" />\n </div>\n </div>\n )}\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n location: state.router.location,\n message: state.message,\n user: state.user,\n }),\n dispatch => ({\n onDeleteUser: username => {\n dispatch(deleteUser(username))\n },\n onHandleProfileFormSubmit: formData => {\n dispatch(handleProfileFormSubmit(formData))\n },\n })\n )(ProfileEdit)\n)\n","import {\n endOfMonth,\n endOfWeek,\n endOfYear,\n startOfMonth,\n startOfYear,\n startOfWeek,\n addMonths,\n addWeeks,\n addYears,\n subMonths,\n subWeeks,\n subYears,\n} from 'date-fns'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport NoWorkouts from '../Common/NoWorkouts'\nimport Stats from '../Common/Stats'\nimport { workoutColors, translateSports } from '../../utils/workouts'\n\nconst durations = ['week', 'month', 'year']\n\nclass Statistics extends React.Component {\n constructor(props, context) {\n super(props, context)\n const date = new Date()\n this.state = {\n displayedSports: props.sports.map(sport => sport.id),\n statsParams: {\n start: startOfMonth(subMonths(date, 11)),\n end: endOfMonth(date),\n duration: 'month',\n type: 'by_time',\n },\n }\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.sports !== prevProps.sports) {\n this.updateDisplayedSports()\n }\n }\n\n updateDisplayedSports() {\n const { sports } = this.props\n this.setState({ displayedSports: sports.map(sport => sport.id) })\n }\n\n handleOnChangeDuration(e) {\n const duration = e.target.name\n\n const date = new Date()\n const start =\n duration === 'year'\n ? startOfYear(subYears(date, 9))\n : duration === 'week'\n ? startOfMonth(subMonths(date, 2))\n : startOfMonth(subMonths(date, 11))\n const end =\n duration === 'year'\n ? endOfYear(date)\n : duration === 'week'\n ? endOfWeek(date)\n : endOfMonth(date)\n this.setState({ statsParams: { duration, end, start, type: 'by_time' } })\n }\n\n handleOnChangeSports(sportId) {\n const { displayedSports } = this.state\n if (displayedSports.includes(sportId)) {\n this.setState({\n displayedSports: displayedSports.filter(s => s !== sportId),\n })\n } else {\n this.setState({ displayedSports: displayedSports.concat([sportId]) })\n }\n }\n\n handleOnClickArrows(forward) {\n const { start, end, duration } = this.state.statsParams\n let newStart, newEnd\n if (forward) {\n newStart =\n duration === 'year'\n ? startOfYear(subYears(start, 1))\n : duration === 'week'\n ? startOfWeek(subWeeks(start, 1))\n : startOfMonth(subMonths(start, 1))\n newEnd =\n duration === 'year'\n ? endOfYear(subYears(end, 1))\n : duration === 'week'\n ? endOfWeek(subWeeks(end, 1))\n : endOfMonth(subMonths(end, 1))\n } else {\n newStart =\n duration === 'year'\n ? startOfYear(addYears(start, 1))\n : duration === 'week'\n ? startOfWeek(addWeeks(start, 1))\n : startOfMonth(addMonths(start, 1))\n newEnd =\n duration === 'year'\n ? endOfYear(addYears(end, 1))\n : duration === 'week'\n ? endOfWeek(addWeeks(end, 1))\n : endOfMonth(addMonths(end, 1))\n }\n this.setState({\n statsParams: { duration, end: newEnd, start: newStart, type: 'by_time' },\n })\n }\n\n render() {\n const { displayedSports, statsParams } = this.state\n const { sports, t, user } = this.props\n const translatedSports = translateSports(\n sports.filter(sport => user.sports_list.includes(sport.id)),\n t\n )\n return (\n <>\n <Helmet>\n <title>FitTrackee - {t('statistics:Statistics')}</title>\n </Helmet>\n <div className=\"container dashboard\">\n <div className=\"card workout-card\">\n <div className=\"card-header\">{t('statistics:Statistics')}</div>\n <div\n className={`card-body${\n user.nb_workouts === 0 ? ' stats-disabled' : ''\n }`}\n >\n <div className=\"chart-filters row\">\n <div className=\"col chart-arrows\">\n <p className=\"text-center\">\n <i\n className=\"fa fa-chevron-left\"\n aria-hidden=\"true\"\n onClick={() => this.handleOnClickArrows(true)}\n />\n </p>\n </div>\n <div className=\"col-md-3 time-frames justify-content-around\">\n {durations.map(d => (\n <div className=\"time-frame\" key={d}>\n <label>\n <input\n type=\"radio\"\n id={d}\n name={d}\n checked={d === statsParams.duration}\n onChange={e => this.handleOnChangeDuration(e)}\n />\n <span>{t(`statistics:${d}`)}</span>\n </label>\n </div>\n ))}\n </div>\n <div className=\"col chart-arrows\">\n <p className=\"text-center\">\n <i\n className=\"fa fa-chevron-right\"\n aria-hidden=\"true\"\n onClick={() => this.handleOnClickArrows(false)}\n />\n </p>\n </div>\n </div>\n <Stats\n displayEmpty\n displayedSports={displayedSports}\n statsParams={statsParams}\n t={t}\n />\n <div className=\"row chart-workouts\">\n {translatedSports.map(sport => (\n <label className=\"col workout-label\" key={sport.id}>\n <input\n type=\"checkbox\"\n checked={displayedSports.includes(sport.id)}\n name={sport.label}\n onChange={() => this.handleOnChangeSports(sport.id)}\n />\n <span style={{ color: workoutColors[sport.id - 1] }}>\n {` ${sport.label}`}\n </span>\n </label>\n ))}\n </div>\n </div>\n </div>\n {user.nb_workouts === 0 && <NoWorkouts t={t} />}\n </div>\n </>\n )\n }\n}\n\nexport default withTranslation()(\n connect(state => ({\n sports: state.sports.data,\n user: state.user,\n }))(Statistics)\n)\n","import React from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { Helmet } from 'react-helmet'\nimport { Link } from 'react-router-dom'\n\nimport { history } from '../../index'\n\nexport default function Form(props) {\n const { t } = useTranslation()\n const pageTitle = `user:${props.formType\n .charAt(0)\n .toUpperCase()}${props.formType.slice(1)}`\n return (\n <div>\n <Helmet>\n <title>FitTrackee - {t(`user:${props.formType}`)}</title>\n </Helmet>\n <h1 className=\"page-title\">{t(pageTitle)}</h1>\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-md-3\" />\n <div className=\"col-md-6\">\n <br />\n {props.formType === 'register' && !props.isRegistrationAllowed ? (\n <div className=\"card\">\n <div className=\"card-body\">Registration is disabled.</div>\n <div className=\"card-body\">\n <button\n type=\"submit\"\n className=\"btn btn-secondary btn-lg btn-block\"\n onClick={() => history.go(-1)}\n >\n Back\n </button>\n </div>\n </div>\n ) : (\n <>\n <form\n onSubmit={event =>\n props.handleUserFormSubmit(event, props.formType)\n }\n >\n {props.formType === 'register' && (\n <div className=\"form-group\">\n <input\n className=\"form-control input-lg\"\n name=\"username\"\n placeholder={t('user:Enter a username')}\n required\n type=\"text\"\n value={props.userForm.username}\n onChange={props.onHandleFormChange}\n />\n </div>\n )}\n {props.formType !== 'password reset' && (\n <div className=\"form-group\">\n <input\n className=\"form-control input-lg\"\n name=\"email\"\n placeholder={t('user:Enter an email address')}\n required\n type=\"email\"\n value={props.userForm.email}\n onChange={props.onHandleFormChange}\n />\n </div>\n )}\n {props.formType !== 'reset your password' && (\n <>\n <div className=\"form-group\">\n <input\n className=\"form-control input-lg\"\n name=\"password\"\n placeholder={t('user:Enter a password')}\n required\n type=\"password\"\n value={props.userForm.password}\n onChange={props.onHandleFormChange}\n />\n </div>\n {props.formType !== 'login' && (\n <div className=\"form-group\">\n <input\n className=\"form-control input-lg\"\n name=\"password_conf\"\n placeholder={t(\n 'user:Enter the password confirmation'\n )}\n required\n type=\"password\"\n value={props.userForm.password_conf}\n onChange={props.onHandleFormChange}\n />\n </div>\n )}\n </>\n )}\n <input\n type=\"submit\"\n className=\"btn btn-primary btn-lg btn-block\"\n value={t('Submit')}\n />\n </form>\n <p className=\"password-forget\">\n {props.formType === 'login' && (\n <Link\n to={{\n pathname: '/password-reset/request',\n }}\n >\n {t('user:Forgot password?')}\n </Link>\n )}\n </p>\n </>\n )}\n </div>\n <div className=\"col-md-3\" />\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport { Redirect } from 'react-router-dom'\n\nimport Form from './Form'\nimport Message from '../Common/Message'\nimport { handleUserFormSubmit } from '../../actions/user'\nimport { isLoggedIn } from '../../utils'\n\nclass UserForm extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n formData: {\n username: '',\n email: '',\n password: '',\n password_conf: '',\n },\n }\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.location.pathname !== this.props.location.pathname) {\n this.emptyForm()\n }\n }\n\n emptyForm() {\n const { formData } = this.state\n Object.keys(formData).map(k => (formData[k] = ''))\n this.setState(formData)\n }\n\n onHandleFormChange(e) {\n const { formData } = this.state\n formData[e.target.name] = e.target.value\n this.setState(formData)\n }\n\n render() {\n const {\n formType,\n isRegistrationAllowed,\n message,\n messages,\n onHandleUserFormSubmit,\n t,\n } = this.props\n const { formData } = this.state\n const { token } = this.props.location.query\n return (\n <div>\n {isLoggedIn() || (formType === 'password reset' && !token) ? (\n <Redirect to=\"/\" />\n ) : (\n <div>\n <Message message={message} messages={messages} t={t} />\n <Form\n isRegistrationAllowed={isRegistrationAllowed}\n formType={formType}\n userForm={formData}\n onHandleFormChange={event => this.onHandleFormChange(event)}\n handleUserFormSubmit={event => {\n event.preventDefault()\n if (formType === 'password reset') {\n formData.token = token\n }\n onHandleUserFormSubmit(formData, formType)\n }}\n />\n </div>\n )}\n </div>\n )\n }\n}\nexport default withTranslation()(\n connect(\n state => ({\n isRegistrationAllowed: state.application.config.is_registration_enabled,\n location: state.router.location,\n message: state.message,\n messages: state.messages,\n }),\n dispatch => ({\n onHandleUserFormSubmit: (formData, formType) => {\n formType =\n formType === 'password reset'\n ? 'password/update'\n : formType === 'reset your password'\n ? 'password/reset-request'\n : formType\n dispatch(handleUserFormSubmit(formData, formType))\n },\n })\n )(UserForm)\n)\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport CustomModal from '../Common/CustomModal'\nimport ProfileDetail from './ProfileDetail'\nimport { getOrUpdateData } from '../../actions'\nimport { deleteUser } from '../../actions/user'\n\nclass UserProfile extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayModal: false,\n }\n }\n\n componentDidMount() {\n this.props.loadUser(this.props.match.params.userName)\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.match.params.userName !== this.props.match.params.userName) {\n this.props.loadUser(this.props.match.params.userName)\n }\n }\n\n displayModal(value) {\n this.setState(prevState => ({\n ...prevState,\n displayModal: value,\n }))\n }\n\n render() {\n const { t, currentUser, onDeleteUser, users } = this.props\n const { displayModal } = this.state\n const [user] = users\n const editable = user ? currentUser.username === user.username : false\n return (\n <div>\n {displayModal && (\n <CustomModal\n title={t('common:Confirmation')}\n text={t(\n 'user:Are you sure you want to delete this account? ' +\n 'All data will be deleted, this cannot be undone.'\n )}\n confirm={() => {\n onDeleteUser(user.username)\n this.displayModal(false)\n }}\n close={() => this.displayModal(false)}\n />\n )}\n {user && (\n <ProfileDetail\n editable={editable}\n isDeletable={currentUser.admin && !editable}\n onDeleteUser={onDeleteUser}\n displayModal={e => this.displayModal(e)}\n t={t}\n user={user}\n />\n )}\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n currentUser: state.user,\n users: state.users.data,\n }),\n dispatch => ({\n onDeleteUser: username => {\n dispatch(deleteUser(username, true))\n },\n loadUser: userName => {\n dispatch(getOrUpdateData('getData', 'users', { username: userName }))\n },\n })\n )(UserProfile)\n)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { Route, Switch } from 'react-router-dom'\n\nimport './App.css'\nimport Admin from './Admin'\nimport Workout from './Workout'\nimport Workouts from './Workouts'\nimport CurrentUserProfile from './User/CurrentUserProfile'\nimport Dashboard from './Dashboard'\nimport Footer from './Footer'\nimport Logout from './User/Logout'\nimport NavBar from './NavBar'\nimport NotFound from './Others/NotFound'\nimport PasswordReset from './User/PasswordReset'\nimport ProfileEdit from './User/ProfileEdit'\nimport Statistics from './Statistics'\nimport UserForm from './User/UserForm'\nimport UserProfile from './User/UserProfile'\nimport { getAppData } from '../actions/application'\n\nclass App extends React.Component {\n constructor(props) {\n super(props)\n this.props = props\n }\n componentDidMount() {\n this.props.loadAppConfig()\n }\n\n render() {\n return (\n <div className=\"App\">\n <NavBar />\n <Switch>\n <Route exact path=\"/\" component={Dashboard} />\n <Route\n exact\n path=\"/register\"\n render={() => <UserForm formType={'register'} />}\n />\n <Route\n exact\n path=\"/login\"\n render={() => <UserForm formType={'login'} />}\n />\n <Route\n exact\n path=\"/password-reset\"\n render={() => <UserForm formType={'password reset'} />}\n />\n <Route\n exact\n path=\"/password-reset/request\"\n render={() => <UserForm formType={'reset your password'} />}\n />\n <Route\n exact\n path=\"/password-reset/sent\"\n render={() => <PasswordReset action={'sent'} />}\n />\n <Route\n exact\n path=\"/updated-password\"\n render={() => <PasswordReset action={'updated'} />}\n />\n <Route exact path=\"/password-reset/sent\" component={PasswordReset} />\n <Route exact path=\"/logout\" component={Logout} />\n <Route exact path=\"/profile/edit\" component={ProfileEdit} />\n <Route exact path=\"/profile\" component={CurrentUserProfile} />\n <Route exact path=\"/workouts/history\" component={Workouts} />\n <Route exact path=\"/workouts/statistics\" component={Statistics} />\n <Route exact path=\"/users/:userName\" component={UserProfile} />\n <Route path=\"/workouts\" component={Workout} />\n <Route path=\"/admin\" component={Admin} />\n <Route component={NotFound} />\n </Switch>\n <Footer />\n </div>\n )\n }\n}\nexport default connect(\n () => ({}),\n dispatch => ({\n loadAppConfig: () => {\n dispatch(getAppData('config'))\n },\n })\n)(App)\n","import React from 'react'\nimport { Provider } from 'react-redux'\nimport { ConnectedRouter } from 'connected-react-router'\n\nexport default function Root({ store, history, children }) {\n return (\n <Provider store={store}>\n <ConnectedRouter history={history}>{children}</ConnectedRouter>\n </Provider>\n )\n}\n","// In production, we register a service worker to serve assets from local cache.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\n// cached resources are updated in the background.\n\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\n// This link also includes instructions on opting out of this behavior.\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n)\n\nexport default function register() {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location)\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets;\n // see https://github.com/facebookincubator/create-react-app/issues/2374\n return\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`\n\n if (isLocalhost) {\n // This is running on localhost.\n // Lets check if a service worker still exists or not.\n checkValidServiceWorker(swUrl)\n } else {\n // Is not local host. Just register service worker\n registerValidSW(swUrl)\n }\n })\n }\n}\n\nfunction registerValidSW(swUrl) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a \"New content is\n // available; please refresh.\" message in your web app.\n // eslint-disable-next-line no-console\n console.log('New content is available; please refresh.')\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n // eslint-disable-next-line no-console\n console.log('Content is cached for offline use.')\n }\n }\n }\n }\n })\n .catch(error => {\n console.error('Error during service worker registration:', error)\n })\n}\n\nfunction checkValidServiceWorker(swUrl) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n if (\n response.status === 404 ||\n response.headers.get('content-type').indexOf('javascript') === -1\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload()\n })\n })\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl)\n }\n })\n .catch(() => {\n // eslint-disable-next-line no-console\n console.log(\n 'No internet connection found. App is running in offline mode.'\n )\n })\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister()\n })\n }\n}\n","const emptyData = {\n data: [],\n}\n\nexport default {\n language: 'en',\n message: '',\n messages: [],\n user: {\n isAuthenticated: false,\n },\n workouts: {\n ...emptyData,\n },\n application: {\n statistics: {},\n config: {\n gpx_limit_import: null,\n is_registration_enabled: null,\n max_single_file_size: null,\n max_users: null,\n max_zip_file_size: null,\n registration: null,\n },\n },\n calendarWorkouts: {\n ...emptyData,\n },\n chartData: [],\n // check if storing gpx content is OK\n gpx: null,\n loading: false,\n records: {\n ...emptyData,\n },\n sports: {\n ...emptyData,\n },\n statistics: {\n data: {},\n },\n users: {\n ...emptyData,\n },\n}\n","import { connectRouter } from 'connected-react-router'\nimport { combineReducers } from 'redux'\n\nimport initial from './initial'\n\nconst handleDataAndError = (state, type, action) => {\n if (action.target !== type) {\n return state\n }\n if (action.type === 'SET_DATA') {\n return {\n ...state,\n data: action.data[action.target],\n }\n }\n if (action.type === 'SET_PAGINATED_DATA') {\n return {\n ...state,\n data: action.data[action.target],\n pagination: action.pagination,\n }\n }\n return state\n}\n\nconst workouts = (state = initial.workouts, action) => {\n switch (action.type) {\n case 'LOGOUT':\n return initial.workouts\n case 'PUSH_WORKOUTS':\n return {\n ...state,\n data: state.data.concat(action.workouts),\n }\n case 'REMOVE_WORKOUT':\n return {\n ...state,\n data: state.data.filter(workout => workout.id !== action.workoutId),\n }\n default:\n return handleDataAndError(state, 'workouts', action)\n }\n}\n\nconst application = (state = initial.application, action) => {\n if (action.type === 'SET_APP_CONFIG') {\n return {\n ...state,\n config: action.data,\n }\n }\n if (action.type === 'SET_APP_STATS') {\n return {\n ...state,\n statistics: action.data,\n }\n }\n return state\n}\n\nconst calendarWorkouts = (state = initial.calendarWorkouts, action) => {\n switch (action.type) {\n case 'LOGOUT':\n return initial.calendarWorkouts\n case 'UPDATE_CALENDAR':\n return {\n ...state,\n data: action.workouts,\n }\n default:\n return handleDataAndError(state, 'calendarWorkouts', action)\n }\n}\n\nconst chartData = (state = initial.chartData, action) => {\n if (action.type === 'SET_CHART_DATA') {\n return action.chartData\n }\n return state\n}\n\nconst gpx = (state = initial.gpx, action) => {\n if (action.type === 'SET_GPX') {\n return action.gpxContent\n }\n return state\n}\n\nconst language = (state = initial.language, action) => {\n if (action.type === 'SET_LANGUAGE') {\n return action.language\n }\n return state\n}\n\nconst loading = (state = initial.loading, action) => {\n if (action.type === 'SET_LOADING') {\n return action.loading\n }\n return state\n}\n\nconst message = (state = initial.message, action) => {\n switch (action.type) {\n case 'AUTH_ERROR':\n case 'PROFILE_ERROR':\n case 'PROFILE_UPDATE_ERROR':\n case 'PICTURE_ERROR':\n case 'SET_ERROR':\n return action.message\n case 'LOGOUT':\n case 'PROFILE_SUCCESS':\n case 'SET_RESULTS':\n case '@@router/LOCATION_CHANGE':\n return ''\n default:\n return state\n }\n}\n\nconst messages = (state = initial.messages, action) => {\n switch (action.type) {\n case 'AUTH_ERRORS':\n return action.messages\n case 'LOGOUT':\n case 'PROFILE_SUCCESS':\n case '@@router/LOCATION_CHANGE':\n return []\n default:\n return state\n }\n}\n\nconst records = (state = initial.records, action) => {\n if (action.type === 'LOGOUT') {\n return initial.records\n }\n return handleDataAndError(state, 'records', action)\n}\n\nconst sports = (state = initial.sports, action) => {\n if (action.type === 'UPDATE_SPORT_DATA') {\n return {\n ...state,\n data: state.data.map(sport => {\n if (sport.id === action.data.id) {\n sport.is_active = action.data.is_active\n }\n return sport\n }),\n }\n }\n return handleDataAndError(state, 'sports', action)\n}\n\nconst users = (state = initial.users, action) => {\n if (action.type === 'UPDATE_USER_DATA') {\n return {\n ...state,\n data: state.data.map(user => {\n if (user.username === action.data.username) {\n user.admin = action.data.admin\n }\n return user\n }),\n }\n }\n return handleDataAndError(state, 'users', action)\n}\n\nconst user = (state = initial.user, action) => {\n switch (action.type) {\n case 'AUTH_ERROR':\n case 'PROFILE_ERROR':\n case 'LOGOUT':\n window.localStorage.removeItem('authToken')\n return initial.user\n case 'PROFILE_SUCCESS':\n return action.profil\n default:\n return state\n }\n}\n\nconst statistics = (state = initial.statistics, action) => {\n if (action.type === 'LOGOUT') {\n return initial.statistics\n }\n return handleDataAndError(state, 'statistics', action)\n}\n\nexport default history =>\n combineReducers({\n workouts,\n application,\n calendarWorkouts,\n chartData,\n gpx,\n language,\n loading,\n message,\n messages,\n records,\n router: connectRouter(history),\n sports,\n statistics,\n user,\n users,\n })\n","const routesWithoutAuthentication = [\n '/login',\n '/register',\n '/password-reset',\n '/password-reset/request',\n '/password-reset/sent',\n '/updated-password',\n]\n\nconst updatePath = (toPath, newPath) => {\n if (typeof toPath === 'string' || toPath instanceof String) {\n toPath = newPath\n } else {\n toPath.pathname = newPath\n }\n return toPath\n}\n\nconst pathInterceptor = toPath => {\n if (\n !window.localStorage.authToken &&\n !routesWithoutAuthentication.includes(toPath.pathname)\n ) {\n toPath = updatePath(toPath, '/login')\n }\n if (\n window.localStorage.authToken &&\n routesWithoutAuthentication.includes(toPath.pathname)\n ) {\n toPath = updatePath(toPath, '/')\n }\n return toPath\n}\n\nexport const historyEnhancer = originalHistory => {\n originalHistory.location = pathInterceptor(originalHistory.location)\n return {\n ...originalHistory,\n push: (path, ...args) =>\n originalHistory.push(pathInterceptor(path), ...args),\n replace: (path, ...args) =>\n originalHistory.replace(pathInterceptor(path), ...args),\n }\n}\n","/* eslint-disable react/jsx-filename-extension */\nimport { createBrowserHistory } from 'history'\nimport React from 'react'\nimport { I18nextProvider } from 'react-i18next'\nimport ReactDOM from 'react-dom'\nimport { routerMiddleware } from 'connected-react-router'\nimport { applyMiddleware, compose, createStore } from 'redux'\nimport thunk from 'redux-thunk'\n\nimport i18n from './i18n'\nimport App from './components/App'\nimport Root from './components/Root'\nimport registerServiceWorker from './registerServiceWorker'\nimport createRootReducer from './reducers'\nimport { loadProfile } from './actions/user'\nimport { historyEnhancer } from './utils/history'\n\nexport const history = historyEnhancer(createBrowserHistory())\n\nhistory.listen(() => {\n window.scrollTo(0, 0)\n})\n\nexport const rootNode = document.getElementById('root')\n\nexport const store = createStore(\n createRootReducer(history),\n window.__STATE__, // Server state\n (window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose)(\n applyMiddleware(routerMiddleware(history), thunk)\n )\n)\n\nif (window.localStorage.authToken !== null) {\n store.dispatch(loadProfile())\n}\n\nReactDOM.render(\n <Root store={store} history={history}>\n <I18nextProvider i18n={i18n}>\n <App />\n </I18nextProvider>\n </Root>,\n rootNode\n)\nregisterServiceWorker()\n"],"sourceRoot":""} |