update js dependencies

This commit is contained in:
Sam 2022-11-26 12:55:14 +01:00
parent 6c9fa65558
commit 5e859e31c9
6 changed files with 475 additions and 573 deletions

View File

@ -11,25 +11,25 @@
"i18n:report": "vue-cli-service i18n:report --src \"./src/**/*.?(js|vue)\" --locales \"./src/locales/**/*.json\"" "i18n:report": "vue-cli-service i18n:report --src \"./src/**/*.?(js|vue)\" --locales \"./src/locales/**/*.json\""
}, },
"dependencies": { "dependencies": {
"@tmcw/togeojson": "^5.4.0", "@tmcw/togeojson": "^5.5.0",
"@vue-leaflet/vue-leaflet": "^0.6.1", "@vue-leaflet/vue-leaflet": "^0.6.1",
"@zxcvbn-ts/core": "^2.0.5", "@zxcvbn-ts/core": "^2.0.5",
"@zxcvbn-ts/language-common": "^2.0.1", "@zxcvbn-ts/language-common": "^2.0.1",
"@zxcvbn-ts/language-de": "^2.1.0", "@zxcvbn-ts/language-de": "^2.1.0",
"@zxcvbn-ts/language-en": "^2.1.0", "@zxcvbn-ts/language-en": "^2.1.0",
"@zxcvbn-ts/language-fr": "^2.2.0", "@zxcvbn-ts/language-fr": "^2.2.0",
"axios": "^0.26.1", "axios": "^1.2.0",
"chart.js": "^3.9.1", "chart.js": "^4.0.1",
"chartjs-plugin-datalabels": "^2.1.0", "chartjs-plugin-datalabels": "^2.1.0",
"core-js": "^3.26.0", "core-js": "^3.26.1",
"date-fns": "^2.29.3", "date-fns": "^2.29.3",
"date-fns-tz": "^1.3.7", "date-fns-tz": "^1.3.7",
"leaflet": "^1.9.2", "leaflet": "^1.9.3",
"linkify-html": "^4.0.2", "linkify-html": "^4.0.2",
"linkifyjs": "^4.0.2", "linkifyjs": "^4.0.2",
"register-service-worker": "^1.7.1", "register-service-worker": "^1.7.1",
"sanitize-html": "^2.7.3", "sanitize-html": "^2.7.3",
"vue": "^3.2.43", "vue": "^3.2.45",
"vue-chart-3": "3.1.1", "vue-chart-3": "3.1.1",
"vue-fullscreen": "^3.1.1", "vue-fullscreen": "^3.1.1",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
@ -41,8 +41,8 @@
"@types/chai": "^4.3.4", "@types/chai": "^4.3.4",
"@types/mocha": "^10.0.0", "@types/mocha": "^10.0.0",
"@types/sanitize-html": "^2.6.2", "@types/sanitize-html": "^2.6.2",
"@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.42.1", "@typescript-eslint/parser": "^5.44.0",
"@vue/cli-plugin-babel": "~5.0.8", "@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8", "@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-pwa": "~5.0.8", "@vue/cli-plugin-pwa": "~5.0.8",
@ -52,18 +52,18 @@
"@vue/cli-plugin-vuex": "~5.0.8", "@vue/cli-plugin-vuex": "~5.0.8",
"@vue/cli-service": "~5.0.8", "@vue/cli-service": "~5.0.8",
"@vue/eslint-config-typescript": "^11.0.2", "@vue/eslint-config-typescript": "^11.0.2",
"@vue/test-utils": "^2.2.1", "@vue/test-utils": "^2.2.4",
"chai": "^4.3.7", "chai": "^4.3.7",
"eslint": "8.27.0", "eslint": "8.28.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.2", "eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.26.0", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.7.0", "eslint-plugin-vue": "^9.8.0",
"prettier": "^2.7.1", "prettier": "^2.8.0",
"sass": "^1.56.1", "sass": "^1.56.1",
"sass-loader": "^13.1.0", "sass-loader": "^13.2.0",
"typescript": "^4.8.4", "typescript": "^4.9.3",
"vue-cli-plugin-i18n": "~2.3.1" "vue-cli-plugin-i18n": "~2.3.1"
}, },
"eslintConfig": { "eslintConfig": {

View File

@ -5,8 +5,8 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { ChartData, ChartOptions, LayoutItem } from 'chart.js' import { ChartOptions, LayoutItem } from 'chart.js'
import { ComputedRef, PropType, computed, defineComponent } from 'vue' import { PropType, computed, defineComponent } from 'vue'
import { BarChart, useBarChart } from 'vue-chart-3' import { BarChart, useBarChart } from 'vue-chart-3'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
@ -60,7 +60,7 @@
? 'm' ? 'm'
: 'km' : 'km'
} }
const chartData: ComputedRef<ChartData<'bar'>> = computed(() => ({ const chartData = computed(() => ({
labels: props.labels, labels: props.labels,
// workaround to avoid dataset modification // workaround to avoid dataset modification
datasets: JSON.parse(JSON.stringify(props.datasets)), datasets: JSON.parse(JSON.stringify(props.datasets)),

View File

@ -108,7 +108,7 @@
}, },
}, },
scales: { scales: {
[displayDistance.value ? 'xDistance' : 'xDuration']: { x: {
grid: { grid: {
drawOnChartArea: false, drawOnChartArea: false,
}, },

View File

@ -19,3 +19,8 @@ export interface IQueryOptions {
defaultSort?: string defaultSort?: string
query?: TPaginationPayload query?: TPaginationPayload
} }
export interface IApiErrorMessage {
error?: string
message?: string
}

View File

@ -9,6 +9,7 @@ import { ISportsState } from '@/store/modules/sports/types'
import { IStatisticsState } from '@/store/modules/statistics/types' import { IStatisticsState } from '@/store/modules/statistics/types'
import { IUsersState } from '@/store/modules/users/types' import { IUsersState } from '@/store/modules/users/types'
import { IWorkoutsState } from '@/store/modules/workouts/types' import { IWorkoutsState } from '@/store/modules/workouts/types'
import { IApiErrorMessage } from '@/types/api'
export const getApiUrl = (): string => { export const getApiUrl = (): string => {
return process.env.NODE_ENV === 'production' return process.env.NODE_ENV === 'production'
@ -33,11 +34,11 @@ export const handleError = (
return return
} }
const errorInfo: IApiErrorMessage | null =
error?.response && error.response.data ? error.response.data : null
// if stored token is blacklisted, disconnect user // if stored token is blacklisted, disconnect user
if ( if (error?.response?.status === 401 && errorInfo?.error === 'invalid_token') {
error?.response?.status === 401 &&
error.response.data.error === 'invalid_token'
) {
localStorage.removeItem('authToken') localStorage.removeItem('authToken')
context.dispatch(AUTH_USER_STORE.ACTIONS.CHECK_AUTH_USER) context.dispatch(AUTH_USER_STORE.ACTIONS.CHECK_AUTH_USER)
return return
@ -48,8 +49,8 @@ export const handleError = (
: error.response : error.response
? error.response.status === 413 ? error.response.status === 413
? 'file size is greater than the allowed size' ? 'file size is greater than the allowed size'
: error.response.data.message : errorInfo?.message
? error.response.data.message ? errorInfo.message
: msg : msg
: error.message : error.message
? error.message ? error.message

File diff suppressed because it is too large Load Diff