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

View raw message source #2264

Merged
merged 1 commit into from
Mar 25, 2020
Merged

View raw message source #2264

merged 1 commit into from
Mar 25, 2020

Conversation

StCyr
Copy link
Collaborator

@StCyr StCyr commented Nov 19, 2019

Should fix #2221

TODO:

  • Effectively show raw message (with modal component?)
  • Add a nice icon
  • Also add action in Message component
  • Return raw message as html rather than json

@ChristophWurst
Copy link
Member

I'll try to find some time to look into this and see where we should put the logic. Hacking it into the existing already quite complex logic won't be the best choice in the long run.

#2214 and #2064 will clean some of that logic up. We might want to wait with this feature until these large features are done 🙌

Hope this makes sense ✌️

@jancborchardt
Copy link
Member

Design-wise:

  • Should only be in the 3-dot menu when in the mail detail view, last item before "Delete".
  • Wording "View source"
  • Icon can be .icon-details (the info i)

@StCyr
Copy link
Collaborator Author

StCyr commented Nov 22, 2019

Design-wise:

* Should only be in the 3-dot menu when in the mail detail view, last item before "Delete".

* Wording "View source"

* Icon can be `.icon-details` (the info i)

Fixed

@jancborchardt
Copy link
Member

Just a note @StCyr, since you are member of our organization on Github, you can also just work on branches of the main repository and don’t need a fork. :) This has the advantage that if any changes are needed or you want to hand over a pull request, other contributors can continue.

@StCyr
Copy link
Collaborator Author

StCyr commented Nov 25, 2019

I'll try to find some time to look into this and see where we should put the logic. Hacking it into the existing already quite complex logic won't be the best choice in the long run.

#2214 and #2064 will clean some of that logic up. We might want to wait with this feature until these large features are done 🙌

Hope this makes sense ✌️

I let you devise if some refactoring is needed. But, for me, it's done.

@ChristophWurst
Copy link
Member

Just a note @StCyr, since you are member of our organization on Github, you can also just work on branches of the main repository and don’t need a fork. :) This has the advantage that if any changes are needed or you want to hand over a pull request, other contributors can continue.

That's not true anymore. For a long time they changed this and you can now (unless explicitly opted out) push to the PR's fork branch as a maintainer of the destination repo. I use this regularly to clean up external contributor's branches. It works just fine adding the other user's fork as new git remote and pushing there.

@jancborchardt
Copy link
Member

It works just fine adding the other user's fork as new git remote and pushing there.

Still much more complicated than a simple branch change. ;) All about removing the small barriers.

@jancborchardt
Copy link
Member

jancborchardt commented Nov 25, 2019

Nice! :) For me just 2 things are missing:

  • "View source" entry should be before "Delete", as Delete should always be the last element in an action menu.
  • Can we get the source displayed in a modal instead of a separate window and all. Not so important but would be nice. :)

@StCyr
Copy link
Collaborator Author

StCyr commented Nov 26, 2019

* [x]  Can we get the source displayed in a modal instead of a separate window and all. Not _so_ important but would be nice. :)

I've done this but Modal components don't have a vertical scrollbar and as such can't display the whole content :-(

@jancborchardt
Copy link
Member

* [x]  Can we get the source displayed in a modal instead of a separate window and all. Not _so_ important but would be nice. :)

I've done this but Modal components don't have a vertical scrollbar and as such can't display the whole content :-(

Oh they don’t? I guess only the filepicker component has that. But the modal component should for sure have that. Could you try adding overflow-y: scroll; manually to the relevant container? Let me know if I should look into it instead. :)

Also cc @skjnldsv @juliushaertl on how we could do this properly in the component – should be possible of course to have modals with scrollbar?

@juliusknorr
Copy link
Member

Also cc @skjnldsv @juliushaertl on how we could do this properly in the component – should be possible of course to have modals with scrollbar?

The idea is that the modal size fits to the content size so it is more flexible to be used with a fixed content size like in the image viewer. Adding the scollbars with CSS in the apps scope is fine I'd say.

@jancborchardt
Copy link
Member

The idea is that the modal size fits to the content size so it is more flexible to be used with a fixed content size like in the image viewer. Adding the scollbars with CSS in the apps scope is fine I'd say.

Right, I’m also thinking about e.g. the keyboard shortcuts list and the account settings. Both of these would work a bit better in a modal than the display they use right now, with left navigation still visible. But not fully relevant to this pull request, will open an issue in the components repo.

@StCyr
Copy link
Collaborator Author

StCyr commented Nov 26, 2019

Oh they don’t? I guess only the filepicker component has that. But the modal component should for sure have that. Could you try adding overflow-y: scroll; manually to the relevant container? Let me know if I should look into it instead. :)

it seems that the component applies a overflow: hidden style that overrides my settings:

image

@jancborchardt
Copy link
Member

it seems that the component applies a overflow: hidden style that overrides my settings:

That’s because the style in the component is more specific as it has 2 classes. :) Simply change your rule to .modal-wrapper .modal-container so it has 2 classes as well. If that still doesn’t work (cause of the data attribute maybe), it’s fine in this case to use overflow-y: scroll !important; to override it.

Oh and yeah, only use overflow**-y** as we don’t want horizontal (-x) scrolling. :)

@StCyr
Copy link
Collaborator Author

StCyr commented Dec 1, 2019

If that still doesn’t work (cause of the data attribute maybe), it’s fine in this case to use overflow-y: scroll !important; to override it.

Yeah, indeed, I think the data attribute came into play during the tests I made.

I'll try to make use of that !important stanza then

@StCyr
Copy link
Collaborator Author

StCyr commented Dec 2, 2019

Ok, good for me

@ChristophWurst
Copy link
Member

#2214 and #2064 will clean some of that logic up. We might want to wait with this feature until these large features are done raised_hands

Still blocked. But these two will be integrated soon. Will take a look at this one ASAP

@StCyr
Copy link
Collaborator Author

StCyr commented Feb 10, 2020 via email

@ChristophWurst
Copy link
Member

I'm not sure, tbh. I tried to read the diff. But something is wrong with the commits. Could you please try to clean that up, so it's just one commit with your changes? :)

You moved the method from the message to the mapper, but the logic was unchanged. IMO it should be one dedicated method for the message source. We should not hack this into any other method. And the returned value shouldn't be an IMAPMessage but just a string, no?

Also, in the controller you don't have to catch all possible exceptions. It's fine to let some bubble up with the controller method is annotated with @TrapError. In Mail this means we'll catch the exception anyway, log it and return a proper JSON response.

@StCyr
Copy link
Collaborator Author

StCyr commented Feb 12, 2020

HI @ChristophWurst

I think I've corrupted my mail cache. Is there some command to reset it?

image

@ChristophWurst
Copy link
Member

Looks like it lost recipients? What happens if you refresh the page?

@StCyr
Copy link
Collaborator Author

StCyr commented Feb 13, 2020

Looks like it lost recipients? What happens if you refresh the page?

Refreshing the page doesn't help :)

bah. It's okay now. I only have 2 more interesting emails left in this state.

@ChristophWurst
Copy link
Member

So it was just a temporary bug? Or what do you mean by that?

Just to be clear: it's possible to clear the cache by dropping some data. But I'd really like to identify the problem first as this should be fixed before the release 😬

@StCyr
Copy link
Collaborator Author

StCyr commented Feb 13, 2020

So it was just a temporary bug? Or what do you mean by that?

Oh, yes, I think it was due to a change I made while working on this PR. Change that I have now reverted.

Just to be clear: it's possible to clear the cache by dropping some data. But I'd really like to identify the problem first as this should be fixed before the release 😬

So, no need to clear the cache anymore, for what I'm concerned. Thanks :)

@ChristophWurst
Copy link
Member

Awesome 🙏

@StCyr StCyr requested a review from ChristophWurst February 14, 2020 09:21
@StCyr
Copy link
Collaborator Author

StCyr commented Feb 14, 2020

@ChristophWurst

I think you might like this PR better now :)

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks indeed fine :) Just a few more nitpicks :)

lib/Controller/MessagesController.php Outdated Show resolved Hide resolved
lib/Controller/MessagesController.php Outdated Show resolved Hide resolved
lib/Controller/MessagesController.php Outdated Show resolved Hide resolved
lib/IMAP/MessageMapper.php Outdated Show resolved Hide resolved
lib/Model/IMAPMessage.php Outdated Show resolved Hide resolved
src/components/Message.vue Show resolved Hide resolved
@StCyr StCyr requested a review from ChristophWurst March 20, 2020 10:37
@ChristophWurst
Copy link
Member

Pushed a few minor fixes

  • Remove use of dangerous v-html and use <pre> instead
  • Show a loading spinner whlie the messages is fetched (this takes time for large messages or ones with attachments)
  • Rename raw message to message source in the back-end
  • Minor code cleanups

Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Co-authored-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this :)

@ChristophWurst ChristophWurst merged commit 53b51b5 into nextcloud:master Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

View Raw Source
4 participants