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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff