Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Displaying the note title limit warning message only when trying to add more than the limit - EXO-74261 - Meeds-io/MIPs#129 #1118

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
v-model="noteObject.title"
:placeholder="titlePlaceholder"
type="text"
:maxlength="noteTitleMaxLength"
:maxlength="noteTitleMaxLength + 1"
class="py-0 px-1 mt-5 mb-0">
</div>
<div class="formInputGroup white overflow-auto flex notes-content-wrapper">
Expand Down Expand Up @@ -191,13 +191,10 @@ export default {
}
},
watch: {
'noteObject.title': function() {
if (this.noteObject.title.length >= this.noteTitleMaxLength) {
const messageObject = {
type: 'warning',
message: this.$t('notes.title.max.length.warning.message', {0: this.noteTitleMaxLength})
};
this.displayAlert(messageObject);
'noteObject.title': function(newVal, oldVal) {
if (newVal.length > this.noteTitleMaxLength) {
this.displayNoteTitleMaxLengthCheckAlert();
this.noteObject.title = oldVal;
}
this.updateData();
},
Expand Down Expand Up @@ -512,6 +509,13 @@ export default {
alertMessage: detail?.message,
}}));
},
displayNoteTitleMaxLengthCheckAlert(){
const messageObject = {
type: 'warning',
message: this.$t('notes.title.max.length.warning.message', {0: this.noteTitleMaxLength})
};
this.displayAlert(messageObject);
}
}
};
</script>