Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Bruno Predot
/
tmdb_test
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Bruno Predot
2025-04-29 16:16:01 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5b65b88fb86ae8ccc365ca040da8438fdff4ab3e
5b65b88f
1 parent
d2f0dea0
Nettoyage + ajout todo + commentaire de tests.
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
20 deletions
components/MovieCommentList.vue
components/form/MovieCommentForm.vue
components/ui-components/TinyMceFieldEditor.vue
components/MovieCommentList.vue
View file @
5b65b88
...
...
@@ -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>
...
...
components/form/MovieCommentForm.vue
View file @
5b65b88
...
...
@@ -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(/(<([^>]+)>)/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"
...
...
components/ui-components/TinyMceFieldEditor.vue
View file @
5b65b88
...
...
@@ -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
...
...
Please
register
or
login
to post a comment