Bruno Predot

Nettoyage + ajout todo + commentaire de tests.

... ... @@ -22,12 +22,11 @@ watch(
if (comments.length) {
comments.forEach((comment, index) => {
const element = document.getElementById(`message${index}`) as HTMLParagraphElement;
console.log(element);
element.innerHTML = comment.message;
});
}
});
},
}, { immediate: true }
);
//#endregion
</script>
... ...
... ... @@ -56,6 +56,10 @@ const formData = reactive({
const v$ = useVuelidate(rules, formData);
//#endregion
const errormessages = computed(() => {
return v$.value.message.$errors.map((e) => e.$message);
});
//#region --Function--.
async function submitComment() {
emit("event:submit", formData);
... ... @@ -70,27 +74,12 @@ function clear() {
function handleMessageEvent(event: string) {
formData.message = event;
// todo : revoir ici la validation manquante (dû au retour de TinyMCE).
v$.value.message.$touch();
// console.log(formData.message.replace(/<[^>]*>/g, ''));
// console.log(formData.message.replace(/(&lt;([^&gt;]+)&gt;)/ig, ''));
}
/*
if (event.length < 3) {
v$.value.message.$errors[0] = {
$propertyPath: "username",
$property: "username",
$validator: "required",
$uid: "username-required",
$message: rules.message.minLength as unknown as string,
$params: {
type:"required"
},
$response: false,
$pending: false,
};
}
*/
//#endregion
</script>
... ... @@ -116,6 +105,7 @@ function handleMessageEvent(event: string) {
@blur="v$.rating.$touch"
@input="v$.rating.$touch"
/>
<!-- <pre>{{ errormessages }}</pre>-->
<ui-components-tiny-mce-field-editor
:error-message="v$?.message?.$errors[0]?.$message ? (v$.message.$errors[0].$message as string) : ''"
:model-value="formData.message"
... ...
... ... @@ -55,6 +55,9 @@ const init = {
content_style: "body { font-family:Helvetica,Arial,sans-serif; font-size:14px }",
skin: "oxide-dark",
content_css: "dark",
// forced_root_block: false,
// valid_elements: [],
// entity_encoding : "raw",
};
//#endregion
... ...