-
Notifications
You must be signed in to change notification settings - Fork 37
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
#164878049 Disable contextmenu on H mark image #707
#164878049 Disable contextmenu on H mark image #707
Conversation
- disable contextmenu - add a tooltip on the image [Finishes #164878049]
745ac79
to
9194401
Compare
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.
- Change the title of the PR to start with "WIP" to show that this is a "Work In Progress" -- that more work will be coming after you get feedback. I don't know if we discussed this; I likely didn't mention this to you.
- need to get feedback from @thesuss and @patmbolger to see if they like this approach and if so, have suggestions for the specific wording in the tooltip
- add these to your list of changes that will need to be included in this PR:
- cucumber test(s)
- change CSS so that this tooltip (
.tooltip-text
) has the same style as the others (fas_tooltip(...)
)
Initial comments (in addition to @weedySeaDragon 's):
|
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.
Pls see comments.
One thing about the text design is to make the purpose clearer by cleaning it up. Make the buttons stand out as clear CTA's should and make the text shorter. A good way to improve UX is to show users what they can do and why. Changing the text to "Download Image" and "Copy Link to Image" is a good start, check out the image. The idea is to have the design work for you so you don't have to explain so much, which in turn makes intructions shorter and more compact. Also, by removing the CTA's from to outside of the text paragraph it is easier for the user to really understand what to do instead of insisting to right-click the image. A better UX would actually be to have the image rendered (once) and the setup of the business through ImageMagick. |
- make context message show onclick only - disable contextmenu on 'proof of membership' image - Change CTA buttons layout [#164878049]
- make context message show onclick only - disable contextmenu on 'proof of membership' image - Change CTA buttons layout [#164878049]
62f3d30
to
f8b7c0f
Compare
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 have some thoughts on layout and style, but want to wait to hear the feedback from @patmbolger and @thesuss about what they think of this in general.
Also -- I have the cucumber tests written and passing. I did need to add a cucumber step
to handle right-clicking. Will post about that later.
- create custom-menu file - fix custom context bug - update yaml files
- add tests - add translation
config/database.yml
Outdated
@@ -9,14 +9,10 @@ default: &default | |||
development: | |||
<<: *default | |||
database: shf_project_development |
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.
🎉
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.
Good work! It's getting there.
Now it's clear enough for me to realize that we need to change the functionality so that the button actually copies the URL to the clipboard -- which is different from what it was doing before. See my comments in the app/views/users/show.html.haml
file.
Please also paste a new screenshot into the PR description so that we can see the latest version (since it's now been improved so much).
config/locales/en.yml
Outdated
Link to it from your website and use it in social media. | ||
Or Print to use in a physical context, for example, to show a customer. | ||
image_how_to_use_html: You can download the image, take a screenshot, | ||
link to it from you website and use it in social media, |
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.
"you" should be "your"
config/locales/sv.yml
Outdated
@@ -788,7 +788,8 @@ sv: | |||
use_this_image_link_html: "<span style='font-weight: bold'> | |||
Använd den här länken på en extern webbplats: | |||
</span>" | |||
show_image: Visa bild | |||
show_image: Kopiera bildadress |
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.
Don't change this one because it makes the meaning of the key (show_image
) different from the meaning of the value (copy the url
).
Instead, add a new entry (line) below (you'll need to ensure that the indentation is correct):
copy_image_url: Kopiera bildadress
Likewise for the English translation file (en.yml
), add the same line but with the English words: copy_image_url: Copy the URL
Then you need to be sure to use the users.show.copy_image_url
translation key instead of the old one (old = users.show.show_image
).
(That includes places in cucumber tests.)
@@ -90,10 +90,10 @@ | |||
%p= t('.proof_of_membership_describe') | |||
= link_to(t('.download_image'), | |||
proof_of_membership_path(@user, render_to: :jpg), | |||
class: 'btn btn-sm btn-secondary') | |||
class: 'btn btn-sm btn-primary') | |||
= link_to(t('.show_image'), |
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 now need to change the functionality: The action of this button needs to (1) get the short url for the proof of membership, (2) copy it to the user's clipboard, and then (3) show a message to the user that the information has been copied to their clipboard and that they can now paste it where needed.
Just glancing quickly at the code (you should look more carefully at it to verify), seems that you need to use the short_proof_of_membership_url(user)
method to get the url.
We'll need new text in the locale files for (3) above. See my review comments in the sv.yml
file.
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'll need the same stuff for the Company H-markt (need to copy the URL to the clipboard instead of showing the image and add the entries to the locale files)
Looking at the latest version of the PR:
It shouldn't have that text at the top.
We should discuss at our next meeting and get consensus on how we want this to work. |
- implement copy_to_clipboard button - write logic for contextmenu actions - update test [Finishes #164878049]
%ul.custom-menu | ||
%li{"data-action" => "download"}= t('users.show.download_image') | ||
%li{"data-action" => "link"}= t('users.show.copy_image_url') | ||
%li{"data-action" => "show"}= t('users.show.show_image') |
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.
Hash attribute should start with one space after the opening brace
Hash attribute should end with one space before the closing brace
Files should end with a trailing newline
@@ -0,0 +1,4 @@ | |||
%ul.custom-menu | |||
%li{"data-action" => "download"}= t('users.show.download_image') | |||
%li{"data-action" => "link"}= t('users.show.copy_image_url') |
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.
Hash attribute should start with one space after the opening brace
Hash attribute should end with one space before the closing brace
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.
The code looks very nice! I have just one remaining comment - other than that I am fine with the PR.
PT Story: H-mark image: users are right-clicking to just save it; it's not the customized version
https://www.pivotaltracker.com/n/projects/1904891/stories/164878049
Changes proposed in this pull request:
Screenshots (Optional):
Ready for review:
@weedySeaDragon @thesuss @patmbolger