Client - eslint fix
This commit is contained in:
parent
d1e2d01e19
commit
a8ed6dcdfa
@ -61,7 +61,7 @@
|
|||||||
}
|
}
|
||||||
function scroll() {
|
function scroll() {
|
||||||
window.onscroll = () => {
|
window.onscroll = () => {
|
||||||
let bottom = document.querySelector('#bottom')
|
const bottom = document.querySelector('#bottom')
|
||||||
displayScrollButton.value = bottom !== null && isScrolledToBottom(bottom)
|
displayScrollButton.value = bottom !== null && isScrolledToBottom(bottom)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
const emit = defineEmits(['updateValue'])
|
const emit = defineEmits(['updateValue'])
|
||||||
|
|
||||||
let text = ref('')
|
const text = ref('')
|
||||||
|
|
||||||
function updateText(event: Event & { target: HTMLInputElement }) {
|
function updateText(event: Event & { target: HTMLInputElement }) {
|
||||||
emit('updateValue', event.target.value)
|
emit('updateValue', event.target.value)
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
let isOpen = ref(false)
|
const isOpen = ref(false)
|
||||||
let dropdownOptions = props.options.map((option) => option)
|
const dropdownOptions = props.options.map((option) => option)
|
||||||
|
|
||||||
function toggleDropdown() {
|
function toggleDropdown() {
|
||||||
isOpen.value = !isOpen.value
|
isOpen.value = !isOpen.value
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
onBeforeMount(async () => await setZxcvbnOptions(language.value))
|
onBeforeMount(async () => await setZxcvbnOptions(language.value))
|
||||||
|
|
||||||
function calculatePasswordStrength(password: string) {
|
function calculatePasswordStrength(password: string) {
|
||||||
let zxcvbnResult = zxcvbn(password)
|
const zxcvbnResult = zxcvbn(password)
|
||||||
passwordScore.value = zxcvbnResult.score
|
passwordScore.value = zxcvbnResult.score
|
||||||
passwordStrength.value = getPasswordStrength(passwordScore.value)
|
passwordStrength.value = getPasswordStrength(passwordScore.value)
|
||||||
passwordSuggestions.value = zxcvbnResult.feedback.suggestions
|
passwordSuggestions.value = zxcvbnResult.feedback.suggestions
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
function getSum(total: any, value: any): number {
|
function getSum(total: any, value: any): number {
|
||||||
return getNumber(total) + getNumber(value)
|
return getNumber(total) + getNumber(value)
|
||||||
}
|
}
|
||||||
let chartData: ComputedRef<ChartData<'bar'>> = computed(() => ({
|
const chartData: ComputedRef<ChartData<'bar'>> = 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)),
|
||||||
|
@ -134,7 +134,7 @@
|
|||||||
setup(props) {
|
setup(props) {
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
|
||||||
let displayedData: Ref<TStatisticsDatasetKeys> = ref('total_distance')
|
const displayedData: Ref<TStatisticsDatasetKeys> = ref('total_distance')
|
||||||
const statistics: ComputedRef<TStatisticsFromApi> = computed(
|
const statistics: ComputedRef<TStatisticsFromApi> = computed(
|
||||||
() => store.getters[STATS_STORE.GETTERS.USER_STATS]
|
() => store.getters[STATS_STORE.GETTERS.USER_STATS]
|
||||||
)
|
)
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
|
||||||
const { sports, user } = toRefs(props)
|
const { sports, user } = toRefs(props)
|
||||||
let page = ref(1)
|
const page = ref(1)
|
||||||
const per_page = 5
|
const per_page = 5
|
||||||
const initWorkoutsCount =
|
const initWorkoutsCount =
|
||||||
props.user.nb_workouts >= per_page ? per_page : props.user.nb_workouts
|
props.user.nb_workouts >= per_page ? per_page : props.user.nb_workouts
|
||||||
|
@ -49,8 +49,8 @@
|
|||||||
|
|
||||||
const { sports, user } = toRefs(props)
|
const { sports, user } = toRefs(props)
|
||||||
const dateFormat = 'yyyy-MM-dd'
|
const dateFormat = 'yyyy-MM-dd'
|
||||||
let day = ref(new Date())
|
const day = ref(new Date())
|
||||||
let calendarDates = ref(getCalendarStartAndEnd(day.value, props.user.weekm))
|
const calendarDates = ref(getCalendarStartAndEnd(day.value, props.user.weekm))
|
||||||
const calendarWorkouts: ComputedRef<IWorkout[]> = computed(
|
const calendarWorkouts: ComputedRef<IWorkout[]> = computed(
|
||||||
() => store.getters[WORKOUTS_STORE.GETTERS.CALENDAR_WORKOUTS]
|
() => store.getters[WORKOUTS_STORE.GETTERS.CALENDAR_WORKOUTS]
|
||||||
)
|
)
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
const language: ComputedRef<string> = computed(
|
const language: ComputedRef<string> = computed(
|
||||||
() => store.getters[ROOT_STORE.GETTERS.LANGUAGE]
|
() => store.getters[ROOT_STORE.GETTERS.LANGUAGE]
|
||||||
)
|
)
|
||||||
let isMenuOpen = ref(false)
|
const isMenuOpen = ref(false)
|
||||||
|
|
||||||
function openMenu() {
|
function openMenu() {
|
||||||
isMenuOpen.value = true
|
isMenuOpen.value = true
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
const emit = defineEmits(['arrowClick', 'timeFrameUpdate'])
|
const emit = defineEmits(['arrowClick', 'timeFrameUpdate'])
|
||||||
|
|
||||||
let selectedTimeFrame = ref('month')
|
const selectedTimeFrame = ref('month')
|
||||||
const timeFrames = ['week', 'month', 'year']
|
const timeFrames = ['week', 'month', 'year']
|
||||||
|
|
||||||
function onUpdateTimeFrame(timeFrame: string) {
|
function onUpdateTimeFrame(timeFrame: string) {
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const { sports, user } = toRefs(props)
|
const { sports, user } = toRefs(props)
|
||||||
let selectedTimeFrame = ref('month')
|
const selectedTimeFrame = ref('month')
|
||||||
const chartParams: Ref<IStatisticsDateParams> = ref(
|
const chartParams: Ref<IStatisticsDateParams> = ref(
|
||||||
getChartParams(selectedTimeFrame.value)
|
getChartParams(selectedTimeFrame.value)
|
||||||
)
|
)
|
||||||
|
@ -164,7 +164,7 @@
|
|||||||
const appConfig: ComputedRef<TAppConfig> = computed(
|
const appConfig: ComputedRef<TAppConfig> = computed(
|
||||||
() => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]
|
() => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]
|
||||||
)
|
)
|
||||||
let displayModal: Ref<string> = ref('')
|
const displayModal: Ref<string> = ref('')
|
||||||
const formErrors = ref(false)
|
const formErrors = ref(false)
|
||||||
const displayUserEmailForm: Ref<boolean> = ref(false)
|
const displayUserEmailForm: Ref<boolean> = ref(false)
|
||||||
const newUserEmail: Ref<string> = ref('')
|
const newUserEmail: Ref<string> = ref('')
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
const fileSizeLimit = appConfig.value.max_single_file_size
|
const fileSizeLimit = appConfig.value.max_single_file_size
|
||||||
? getReadableFileSize(appConfig.value.max_single_file_size)
|
? getReadableFileSize(appConfig.value.max_single_file_size)
|
||||||
: ''
|
: ''
|
||||||
let pictureFile: Ref<File | null> = ref(null)
|
const pictureFile: Ref<File | null> = ref(null)
|
||||||
|
|
||||||
function deleteUserPicture() {
|
function deleteUserPicture() {
|
||||||
store.dispatch(AUTH_USER_STORE.ACTIONS.DELETE_PICTURE)
|
store.dispatch(AUTH_USER_STORE.ACTIONS.DELETE_PICTURE)
|
||||||
|
@ -77,14 +77,14 @@
|
|||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
let displayDistance = ref(true)
|
const displayDistance = ref(true)
|
||||||
let beginElevationAtZero = ref(true)
|
const beginElevationAtZero = ref(true)
|
||||||
const datasets: ComputedRef<IWorkoutChartData> = computed(() =>
|
const datasets: ComputedRef<IWorkoutChartData> = computed(() =>
|
||||||
getDatasets(props.workoutData.chartData, t, props.authUser.imperial_units)
|
getDatasets(props.workoutData.chartData, t, props.authUser.imperial_units)
|
||||||
)
|
)
|
||||||
const fromKmUnit = getUnitTo('km')
|
const fromKmUnit = getUnitTo('km')
|
||||||
const fromMUnit = getUnitTo('m')
|
const fromMUnit = getUnitTo('m')
|
||||||
let chartData: ComputedRef<ChartData<'line'>> = computed(() => ({
|
const chartData: ComputedRef<ChartData<'line'>> = computed(() => ({
|
||||||
labels: displayDistance.value
|
labels: displayDistance.value
|
||||||
? datasets.value.distance_labels
|
? datasets.value.distance_labels
|
||||||
: datasets.value.duration_labels,
|
: datasets.value.duration_labels,
|
||||||
|
@ -75,7 +75,7 @@
|
|||||||
const workout: ComputedRef<IWorkout> = computed(
|
const workout: ComputedRef<IWorkout> = computed(
|
||||||
() => props.workoutData.workout
|
() => props.workoutData.workout
|
||||||
)
|
)
|
||||||
let segmentId: Ref<number | null> = ref(
|
const segmentId: Ref<number | null> = ref(
|
||||||
route.params.workoutId ? +route.params.segmentId : null
|
route.params.workoutId ? +route.params.segmentId : null
|
||||||
)
|
)
|
||||||
const segment: ComputedRef<IWorkoutSegment | null> = computed(() =>
|
const segment: ComputedRef<IWorkoutSegment | null> = computed(() =>
|
||||||
@ -83,7 +83,7 @@
|
|||||||
? workout.value.segments[+segmentId.value - 1]
|
? workout.value.segments[+segmentId.value - 1]
|
||||||
: null
|
: null
|
||||||
)
|
)
|
||||||
let displayModal: Ref<boolean> = ref(false)
|
const displayModal: Ref<boolean> = ref(false)
|
||||||
const sport = computed(() =>
|
const sport = computed(() =>
|
||||||
props.sports
|
props.sports
|
||||||
? props.sports.find(
|
? props.sports.find(
|
||||||
|
@ -301,7 +301,7 @@
|
|||||||
workoutDurationSeconds: '',
|
workoutDurationSeconds: '',
|
||||||
workoutDistance: '',
|
workoutDistance: '',
|
||||||
})
|
})
|
||||||
let withGpx = ref(
|
const withGpx = ref(
|
||||||
props.workout.id ? props.workout.with_gpx : props.isCreation
|
props.workout.id ? props.workout.with_gpx : props.isCreation
|
||||||
)
|
)
|
||||||
let gpxFile: File | null = null
|
let gpxFile: File | null = null
|
||||||
|
@ -238,7 +238,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getWorkoutsQuery(newQuery: LocationQuery): TWorkoutsPayload {
|
function getWorkoutsQuery(newQuery: LocationQuery): TWorkoutsPayload {
|
||||||
let workoutQuery = getQuery(newQuery, orderByList, defaultOrder.order_by, {
|
const workoutQuery = getQuery(newQuery, orderByList, defaultOrder.order_by, {
|
||||||
defaultSort: defaultOrder.order,
|
defaultSort: defaultOrder.order,
|
||||||
})
|
})
|
||||||
Object.keys(newQuery)
|
Object.keys(newQuery)
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
const sports: ComputedRef<ISport[]> = computed(
|
const sports: ComputedRef<ISport[]> = computed(
|
||||||
() => store.getters[SPORTS_STORE.GETTERS.SPORTS]
|
() => store.getters[SPORTS_STORE.GETTERS.SPORTS]
|
||||||
)
|
)
|
||||||
let markerCoordinates: Ref<TCoordinates> = ref({
|
const markerCoordinates: Ref<TCoordinates> = ref({
|
||||||
latitude: null,
|
latitude: null,
|
||||||
longitude: null,
|
longitude: null,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user