fix: dashboard i18n build/console warnings (#587)
* fix: build warnings * feat: remove other instances of invalid_type_error and the unused translation key
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@
|
||||
import { isFreePlan } from '$lib/utils/store/org';
|
||||
import { lesson } from '../../store/lessons';
|
||||
|
||||
export let lessonId = '';
|
||||
export const lessonId = '';
|
||||
|
||||
let fileInput: HTMLInputElement;
|
||||
let selectedFile: File | null = null;
|
||||
|
||||
+2
-17
@@ -47,17 +47,11 @@
|
||||
name: z.string().min(5, {
|
||||
message: `${$t(
|
||||
'course.navItem.landing_page.editor.reviews_form.validations.name.min_char'
|
||||
)}`,
|
||||
invalid_type_error: `${$t(
|
||||
'course.navItem.landing_page.editor.reviews_form.validations.invalid_type_error'
|
||||
)}`
|
||||
}),
|
||||
avatar_url: z.string().min(6, {
|
||||
message: `${$t(
|
||||
'course.navItem.landing_page.editor.reviews_form.validations.avatar_url.message'
|
||||
)}`,
|
||||
invalid_type_error: `${$t(
|
||||
'course.navItem.landing_page.editor.reviews_form.validations.invalid_type_error'
|
||||
)}`
|
||||
}),
|
||||
rating: z
|
||||
@@ -65,25 +59,16 @@
|
||||
.min(1, {
|
||||
message: `${$t(
|
||||
'course.navItem.landing_page.editor.reviews_form.validations.rating.message'
|
||||
)}`,
|
||||
invalid_type_error: `${$t(
|
||||
'course.navItem.landing_page.editor.reviews_form.validations.invalid_type_error'
|
||||
)}`
|
||||
})
|
||||
.max(5, {
|
||||
message: `${$t(
|
||||
'course.navItem.landing_page.editor.reviews_form.validations.rating.message'
|
||||
)}`,
|
||||
invalid_type_error: `${$t(
|
||||
'course.navItem.landing_page.editor.reviews_form.validations.invalid_type_error'
|
||||
)}`
|
||||
}),
|
||||
description: z.string().min(10, {
|
||||
message: `${$t(
|
||||
'course.navItem.landing_page.editor.reviews_form.validations.description.min_char'
|
||||
)}`,
|
||||
invalid_type_error: `${$t(
|
||||
'course.navItem.landing_page.editor.reviews_form.validations.invalid_type_error'
|
||||
)}`
|
||||
})
|
||||
});
|
||||
@@ -120,11 +105,11 @@
|
||||
{#each reviews || [] as review}
|
||||
<div
|
||||
id={review.id}
|
||||
class="relative flex items-center flex-col border border-gray-300 rounded-lg p-2 my-2.5"
|
||||
class="relative my-2.5 flex flex-col items-center rounded-lg border border-gray-300 p-2"
|
||||
>
|
||||
{#if review.id !== reviewToExpand}
|
||||
<!-- the headers -->
|
||||
<div class="flex w-full justify-between items-center">
|
||||
<div class="flex w-full items-center justify-between">
|
||||
<Avatar src={review.avatar_url} name={review.name} className="mt-1" />
|
||||
<p class="text-sm">{review.name}</p>
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
<div
|
||||
tabindex="0"
|
||||
class="overflow-y-auto {isPageNavHidden
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
import { t } from '$lib/utils/functions/translations';
|
||||
import isNumber from 'lodash/isNumber';
|
||||
import z from 'zod';
|
||||
import { get } from 'svelte/store';
|
||||
import isNumber from 'lodash/isNumber';
|
||||
import { validateEmail } from './validateEmail';
|
||||
import { t as _t, initialized } from '$lib/utils/functions/translations';
|
||||
|
||||
const t = {
|
||||
get: (key: string) => {
|
||||
const isInitialized = get(initialized);
|
||||
if (!isInitialized) return key;
|
||||
|
||||
return _t.get(key);
|
||||
}
|
||||
};
|
||||
|
||||
const getOrgNameValidation = () =>
|
||||
z
|
||||
@@ -31,73 +41,60 @@ const lessonSchema = z.object({
|
||||
|
||||
const createQuizValidationSchema = z.object({
|
||||
title: z.string().min(6, {
|
||||
message: 'Must be 6 or more characters long',
|
||||
invalid_type_error: `${t.get('validations.invalid_type_error')}`
|
||||
message: `${t.get('validations.course_payment.full_name.min_char')}`
|
||||
})
|
||||
});
|
||||
|
||||
const askCommunityValidationSchema = z.object({
|
||||
title: z.string().min(6, {
|
||||
message: `${t.get('validations.ask_community.title.min_char')}`,
|
||||
invalid_type_error: `${t.get('validations.invalid_type_error')}`
|
||||
message: `${t.get('validations.ask_community.title.min_char')}`
|
||||
}),
|
||||
body: z.string().min(20, {
|
||||
message: `${t.get('validations.ask_community.body.min_char')}`,
|
||||
invalid_type_error: `${t.get('validations.invalid_type_error')}`
|
||||
message: `${t.get('validations.ask_community.body.min_char')}`
|
||||
}),
|
||||
courseId: z.string().min(36, {
|
||||
message: `${t.get('validations.ask_community.course_id.select_course')}`,
|
||||
invalid_type_error: `${t.get('validations.ask_community.course_id.select_course')}`
|
||||
message: `${t.get('validations.ask_community.course_id.select_course')}`
|
||||
})
|
||||
});
|
||||
const commentInCommunityValidationSchema = z.object({
|
||||
comment: z.string().min(6, {
|
||||
message: `${t.get('validations.comment_in_community.min_char')}`,
|
||||
invalid_type_error: `${t.get('validations.invalid_type_error')}`
|
||||
message: `${t.get('validations.comment_in_community.min_char')}`
|
||||
})
|
||||
});
|
||||
|
||||
const orgLandingpageValidationSchema = z.object({
|
||||
name: z.string().min(6, {
|
||||
message: `${t.get('validations.org_landing_page.name.min_char')}`,
|
||||
invalid_type_error: `${t.get('validations.invalid_type_error')}`
|
||||
message: `${t.get('validations.org_landing_page.name.min_char')}`
|
||||
}),
|
||||
email: z.string().email({
|
||||
message: `${t.get('validations.org_landing_page.email.invalid_email')}`,
|
||||
invalid_type_error: `${t.get('validations.invalid_type_error')}`
|
||||
message: `${t.get('validations.org_landing_page.email.invalid_email')}`
|
||||
}),
|
||||
phone: z.string().min(6, {
|
||||
message: `${t.get('validations.org_landing_page.phone.min_char')}`,
|
||||
invalid_type_error: `${t.get('validations.invalid_type_error')}`
|
||||
message: `${t.get('validations.org_landing_page.phone.min_char')}`
|
||||
}),
|
||||
message: z.string().min(20, {
|
||||
message: `${t.get('validations.org_landing_page.message.min_char')}`,
|
||||
invalid_type_error: `${t.get('validations.invalid_type_error')}`
|
||||
message: `${t.get('validations.org_landing_page.message.min_char')}`
|
||||
})
|
||||
});
|
||||
|
||||
const forgotValidationSchema = z.object({
|
||||
email: z.string().email({
|
||||
message: `${t.get('validations.forgot.invalid_email')}`,
|
||||
invalid_type_error: `${t.get('validations.invalid_type_error')}`
|
||||
message: `${t.get('validations.forgot.invalid_email')}`
|
||||
})
|
||||
});
|
||||
|
||||
const authValidationSchema = z.object({
|
||||
email: z.string().email({
|
||||
message: 'validations.auth.email.invalid_email',
|
||||
invalid_type_error: 'validations.invalid_type_error'
|
||||
message: 'validations.auth.email.invalid_email'
|
||||
}),
|
||||
password: z.string().min(6, {
|
||||
message: 'validations.auth.password.min_char',
|
||||
invalid_type_error: 'validations.invalid_type_error'
|
||||
message: 'validations.auth.password.min_char'
|
||||
})
|
||||
});
|
||||
|
||||
const resetValidationSchema = z.object({
|
||||
password: z.string().min(6, {
|
||||
message: `${t.get('validations.reset.password.min_char')}`,
|
||||
invalid_type_error: `${t.get('validations.invalid_type_error')}`
|
||||
message: `${t.get('validations.reset.password.min_char')}`
|
||||
})
|
||||
});
|
||||
|
||||
@@ -112,14 +109,12 @@ const onboardingValidationSchema = {
|
||||
stepTwo: z.object({
|
||||
goal: z
|
||||
.string({
|
||||
required_error: `${t.get('validations.onboarding.step_two.goal.required')}`,
|
||||
invalid_type_error: `${t.get('validations.onboarding.step_two.goal.required')}`
|
||||
required_error: `${t.get('validations.onboarding.step_two.goal.required')}`
|
||||
})
|
||||
.min(1),
|
||||
source: z
|
||||
.string({
|
||||
required_error: `${t.get('validations.onboarding.step_two.source.required')}`,
|
||||
invalid_type_error: `${t.get('validations.onboarding.step_two.source.required')}`
|
||||
required_error: `${t.get('validations.onboarding.step_two.source.required')}`
|
||||
})
|
||||
.min(1)
|
||||
})
|
||||
@@ -190,12 +185,10 @@ export const lessonValidation = (lesson = {}) => {
|
||||
export const coursePaymentValidation = (fields = {}) => {
|
||||
const schema = z.object({
|
||||
fullname: z.string().min(6, {
|
||||
message: `${t.get('validations.course_payment.full_name.min_char')}`,
|
||||
invalid_type_error: `${t.get('validations.invalid_type_error')}`
|
||||
message: `${t.get('validations.course_payment.full_name.min_char')}`
|
||||
}),
|
||||
email: z.string().email({
|
||||
message: `${t.get('validations.course_payment.email.invalid_email')}`,
|
||||
invalid_type_error: `${t.get('validations.invalid_type_error')}`
|
||||
message: `${t.get('validations.course_payment.email.invalid_email')}`
|
||||
})
|
||||
});
|
||||
const { error } = schema.safeParse(fields);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
}
|
||||
},
|
||||
"validations": {
|
||||
"invalid_type_error": "Må ikke være tom",
|
||||
"email": {
|
||||
"not_valid": "Ikke gyldig e -mail"
|
||||
},
|
||||
@@ -535,7 +534,6 @@
|
||||
"rating": "Bedømmelse",
|
||||
"hide": "Skjul gennemgang",
|
||||
"validations": {
|
||||
"invalid_type_error": "Må ikke være tom",
|
||||
"description": {
|
||||
"min_char": "'Beskrivelse er for kort, min af 5 tegn"
|
||||
},
|
||||
@@ -1572,4 +1570,4 @@
|
||||
"seconds": "sekunder",
|
||||
"snackbar_error": "Fejl under afsendelse af kode"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +363,6 @@
|
||||
"rating": "Bewertung",
|
||||
"hide": "Bewertung ausblenden",
|
||||
"validations": {
|
||||
"invalid_type_error": "Darf nicht leer sein",
|
||||
"description": {
|
||||
"min_char": "„Beschreibung ist zu kurz, mindestens 5 Zeichen.“"
|
||||
},
|
||||
@@ -1450,7 +1449,6 @@
|
||||
"launch_week": "Startwoche"
|
||||
},
|
||||
"validations": {
|
||||
"invalid_type_error": "Darf nicht leer sein",
|
||||
"email": {
|
||||
"not_valid": "Ungültige E-Mail-Adresse"
|
||||
},
|
||||
@@ -1603,4 +1601,4 @@
|
||||
"message": "Sie haben nicht gerettete Änderungen. Bist du sicher, dass du gehen willst?"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1067,7 +1067,6 @@
|
||||
"rating": "Rating",
|
||||
"hide": "Hide Review",
|
||||
"validations": {
|
||||
"invalid_type_error": "Must not be empty",
|
||||
"name": {
|
||||
"min_char": "Name is too short, min of 5 character"
|
||||
},
|
||||
@@ -1643,8 +1642,7 @@
|
||||
},
|
||||
"email": {
|
||||
"not_valid": "Not valid email"
|
||||
},
|
||||
"invalid_type_error": "Must not be empty"
|
||||
}
|
||||
},
|
||||
|
||||
"common": {
|
||||
|
||||
@@ -363,7 +363,6 @@
|
||||
"rating": "Clasificación",
|
||||
"hide": "Ocultar reseña",
|
||||
"validations": {
|
||||
"invalid_type_error": "No debe estar vacío",
|
||||
"description": {
|
||||
"min_char": "'La descripción es demasiado corta, mínimo de 5 caracteres."
|
||||
},
|
||||
@@ -1450,7 +1449,6 @@
|
||||
"launch_week": "Semana de lanzamiento"
|
||||
},
|
||||
"validations": {
|
||||
"invalid_type_error": "No debe estar vacío",
|
||||
"email": {
|
||||
"not_valid": "Correo electrónico no válido"
|
||||
},
|
||||
@@ -1603,4 +1601,4 @@
|
||||
"message": "Tienes cambios no salvos. ¿Estás seguro de que quieres irte?"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +363,6 @@
|
||||
"rating": "Notation",
|
||||
"hide": "Masquer l'avis",
|
||||
"validations": {
|
||||
"invalid_type_error": "Ne doit pas être vide",
|
||||
"description": {
|
||||
"min_char": "'La description est trop courte, minimum 5 caractères"
|
||||
},
|
||||
@@ -1450,7 +1449,6 @@
|
||||
"launch_week": "Semaine de lancement"
|
||||
},
|
||||
"validations": {
|
||||
"invalid_type_error": "Ne doit pas être vide",
|
||||
"email": {
|
||||
"not_valid": "E-mail non valide"
|
||||
},
|
||||
@@ -1603,4 +1601,4 @@
|
||||
"message": "Vous avez des changements non sauvés. Êtes-vous sûr de vouloir partir?"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +363,6 @@
|
||||
"rating": "रेटिंग",
|
||||
"hide": "समीक्षा छिपाएँ",
|
||||
"validations": {
|
||||
"invalid_type_error": "खाली नहीं होना चाहिए",
|
||||
"description": {
|
||||
"min_char": "'विवरण बहुत छोटा है, न्यूनतम 5 अक्षर"
|
||||
},
|
||||
@@ -1450,7 +1449,6 @@
|
||||
"launch_week": "लॉन्च सप्ताह"
|
||||
},
|
||||
"validations": {
|
||||
"invalid_type_error": "खाली नहीं होना चाहिए",
|
||||
"email": {
|
||||
"not_valid": "वैध ईमेल नहीं"
|
||||
},
|
||||
@@ -1603,4 +1601,4 @@
|
||||
"message": "आपके पास अनसुना परिवर्तन हैं। क्या आपकी वाकई छोड़ने की इच्छा है?"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"validations": {
|
||||
"invalid_type_error": "Nie może być pusty",
|
||||
"email": {
|
||||
"not_valid": "Nieważny e -mail"
|
||||
},
|
||||
@@ -527,7 +526,6 @@
|
||||
"rating": "Ocena",
|
||||
"hide": "Ukryj recenzję",
|
||||
"validations": {
|
||||
"invalid_type_error": "Nie może być pusty",
|
||||
"description": {
|
||||
"min_char": "„Opis jest zbyt krótki, min z 5 znaków"
|
||||
},
|
||||
@@ -1573,4 +1571,4 @@
|
||||
"message": "Masz niezbawione zmiany. Czy na pewno chcesz odejść?"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +363,6 @@
|
||||
"rating": "Avaliação",
|
||||
"hide": "Ocultar revisão",
|
||||
"validations": {
|
||||
"invalid_type_error": "Não deve estar vazio",
|
||||
"description": {
|
||||
"min_char": "'A descrição é muito curta, com no mínimo 5 caracteres"
|
||||
},
|
||||
@@ -1450,7 +1449,6 @@
|
||||
"launch_week": "Semana de lançamento"
|
||||
},
|
||||
"validations": {
|
||||
"invalid_type_error": "Não deve estar vazio",
|
||||
"email": {
|
||||
"not_valid": "E-mail inválido"
|
||||
},
|
||||
@@ -1603,4 +1601,4 @@
|
||||
"message": "Você tem mudanças não salvas. Tem certeza de que deseja sair?"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +363,6 @@
|
||||
"rating": "Рейтинг",
|
||||
"hide": "Скрыть обзор",
|
||||
"validations": {
|
||||
"invalid_type_error": "Не должно быть пустым",
|
||||
"description": {
|
||||
"min_char": "'Описание слишком короткое, минимум 5 символов."
|
||||
},
|
||||
@@ -1450,7 +1449,6 @@
|
||||
"launch_week": "Неделя запуска"
|
||||
},
|
||||
"validations": {
|
||||
"invalid_type_error": "Не должно быть пустым",
|
||||
"email": {
|
||||
"not_valid": "Недействительный адрес электронной почты"
|
||||
},
|
||||
@@ -1603,4 +1601,4 @@
|
||||
"message": "У вас есть неспасенные изменения. Вы уверены, что хотите уйти?"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +363,6 @@
|
||||
"rating": "Xếp hạng",
|
||||
"hide": "Ẩn đánh giá",
|
||||
"validations": {
|
||||
"invalid_type_error": "Không được để trống",
|
||||
"description": {
|
||||
"min_char": "'Mô tả quá ngắn, tối thiểu 5 ký tự"
|
||||
},
|
||||
@@ -1450,7 +1449,6 @@
|
||||
"launch_week": "Tuần ra mắt"
|
||||
},
|
||||
"validations": {
|
||||
"invalid_type_error": "Không được để trống",
|
||||
"email": {
|
||||
"not_valid": "Email không hợp lệ"
|
||||
},
|
||||
@@ -1603,4 +1601,4 @@
|
||||
"message": "Bạn có những thay đổi chưa được lưu. Bạn có chắc bạn muốn rời đi?"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user