-
Notifications
You must be signed in to change notification settings - Fork 509
Refactor NewMessageForm component
#9430
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
Conversation
a27f6da to
55d7ef3
Compare
To discuss:Shall we rename a parent component to make all names shorter? It requires changes only in three additional files: |
55d7ef3 to
de09c9c
Compare
|
ShGKme
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good to me, makes this super component simpler and smaller.
I added some not blocking comments.
Tested, that all still work in main chat view and breakout rooms.
| <NcActionButton v-if="canUploadFiles" | ||
| close-after-click | ||
| @click.prevent="$emit('open-file-upload')"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prevent modifier cannot be used on Vue component events, only on native DOM events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a lot of NcButtons with @click.prevent, should be a follow-up
src/components/NewMessageForm/NewMessageFormTextCreateDialog.vue
Outdated
Show resolved
Hide resolved
src/components/NewMessageForm/NewMessageFormTextCreateDialog.vue
Outdated
Show resolved
Hide resolved
src/components/NewMessageForm/NewMessageFormTextCreateDialog.vue
Outdated
Show resolved
Hide resolved
I agree to rename it. It's shorter, the component is actually more, than a @marcoambrosini what do you think? |
Signed-off-by: Maksim Sukharev <[email protected]>
Signed-off-by: Maksim Sukharev <[email protected]>
Signed-off-by: Maksim Sukharev <[email protected]>
Signed-off-by: Maksim Sukharev <[email protected]>
Signed-off-by: Maksim Sukharev <[email protected]>
Signed-off-by: Maksim Sukharev <[email protected]>
Signed-off-by: Maksim Sukharev <[email protected]>
fbcd9a9 to
1ffd8e5
Compare
|
I disabled auto-merge, as it is a bit large refactoring in case @marcoambrosini would want to review it too. Feel free to re-enable if you want it to be in the beta release. |
ShGKme
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still works after changes and rebase 😀
| const indexOfNewPollOption = this.pollOptions.length - 1 | ||
| const refOfNewPollOption = `pollOption${indexOfNewPollOption}` | ||
| this.$refs[refOfNewPollOption][0].$el.querySelector('.input-field__input').focus() | ||
| this.$refs.pollOption[this.pollOptions.length - 1].$el.querySelector('.input-field__input').focus() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current ES the last element is easy to get with at
| this.$refs.pollOption[this.pollOptions.length - 1].$el.querySelector('.input-field__input').focus() | |
| this.$refs.pollOption.at(-1).$el.querySelector('.input-field__input').focus() |
☑️ Resolves
🚧 Tasks
🏁 Checklist
docs/has been updated or is not required