-
Notifications
You must be signed in to change notification settings - Fork 262
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
Check mail for missing attachment #6172
Conversation
Thanks for opening your first pull request in this repository! ✌️ |
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.
I like the feature, e.g. to warn for the possibly missing attachments.
Translation will be tricky, because there are one or multiple words in each language (and variants of them, think: singular vs plural). For HTML messages we need to saveguard that a translation doesn't match a HTML tag or attribute, because that would show false warnings.
The editor is based on CKEditor. We could check if there is anything existing, like a module built in or a third party module that we could add.
src/components/NewMessageModal.vue
Outdated
if (warnings !== "") { | ||
warnings += ", " | ||
} | ||
warnings += "missing attachments" |
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.
this needs translation
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.
@max65482 could you address this please?
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.
I will be looking at this PR again soon (with warnings only about missing attachments, not salutations for now).
(If you are referring to the translation: At this time I feel unable to address this.)
For simplicity, we should assume that the singular word is always part of the plural word.
|
@ChristophWurst Can you give it another look? |
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.
Looks good otherwise codewise
Are users able to send despite the error?
src/components/NewMessageModal.vue
Outdated
break | ||
} | ||
if (line.includes(wordAttachment) || line.includes(wordAttached)) { | ||
attachmentMissing = true |
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.
remove the variable and just throw here
src/components/NewMessageModal.vue
Outdated
var lines = toPlain(data.body).value.toLowerCase().split('\n') | ||
var wordAttachment = t('mail', 'attachment').toLowerCase() | ||
var wordAttached = t('mail', 'attached').toLowerCase() |
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.
replace var
with const
d7fa8dd
to
9a88393
Compare
@ChristophWurst I rebased and stumbled across changes that came with this commit. mail/src/components/NewMessageModal.vue Lines 6 to 32 in 41b17c7
In particular, |
We had to move some code around for a new feature. Sorry for the confusion. |
0f78724
to
ed74ceb
Compare
I still cannot find |
Thanks to #8625 Now I stumbled across another issue. NewMessageModal seems to use states that aren't defined in the modal: mail/src/components/NewMessageModal.vue Line 18 in 8f7fd93
Can someone help out? @GretaD? |
i am having a look if its a leftover or needs to be declared |
the pr to remove the leftovers is merged. You can continue now :) |
ed74ceb
to
ca3b68c
Compare
Thanks @GretaD! |
Yes, as of now there is no distinction between error and warning. E.g. Speaking about |
this is the ticket that i was looking for. When Anna is back from vacation, im gonna bring this up |
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 can get this in, when we have the warning part done, we can change this into a warning instead of an error.
@@ -362,7 +390,7 @@ export default { | |||
} | |||
}, | |||
async onForceSend() { | |||
await this.onSend(null, true) | |||
await this.onSend(this.cookedComposerData, true) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
fd9e7a7
to
e2f9310
Compare
after rebasing, this pr has issues, having a look why |
e2f9310
to
acbd487
Compare
Signed-off-by: Maximilian Martin <maximilian_martin@gmx.de>
acbd487
to
66346e7
Compare
running npm run lint:fix changed a lot of things. I hope i didnt broke something..now looks good |
This PR sketches a solution to awkward problems that I sometimes encounter before my first coffee: I misspell the name of the email recipient in the salutation (Dear XXX) or I mention an attachment, but forget to attach something.
Before sending an email, the app now searches for these accidents and warns the user.
If there is interest, I can refactor and give the code presentable quality. Otherwise, feel free to close this.