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
Do not show the service to the user if it is disabled, fixes #6184 #8406
base: develop
Are you sure you want to change the base?
Conversation
This breaks Jasmine, there are specs that have expectations around available services that are no longer true with this PR. |
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.
(see previous comment)
Yep, it should be fixed now. I had to switch to another computer so it took time for |
a882b04
to
700ebec
Compare
OK so I'm confused @SuperTux88 said this to me on IRC:
But actually locally the jasmine tests are green without adding anything else that what I did here. What you are saying is that I should also modify |
When I wrote that I didn't check which fixture is used and where it's generated. I assumed that you didn't re-generate your fixtures locally, so you are still using fixtures that were generated before your change in So in the line below the line you added, you see it loads |
700ebec
to
0c029de
Compare
The related tests are fixed, the current failure in Rspec is unrelated, |
cdac600
to
b3b2a16
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.
Ideally, this would have a test with a service that's disabled globally but enabled in the user settings, and then confirming that the button isn't showing up. Writing a test for the actual behavior change here, that is.
But I feel adventurous today, so I'm personally not gonna block on that.
@@ -57,7 +57,8 @@ | |||
.btn-toolbar.pull-right#publisher-service-icons | |||
- if current_user.services | |||
- current_user.services.each do |service| | |||
= service_button(service) | |||
- if AppConfig.configured_services.map(&:to_s).include? service.provider |
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 only fixes it for the standard (desktop) UI, but it would also need to be fixed on mobile. And then it probably would be better to just extract a little helper to publisher_helper.rb
that returns a list of all enabled services, which can then be looped over for both UIs (without needing to do additional filters), and is also easier to write a little test for.
@@ -57,7 +57,8 @@ | |||
.btn-toolbar.pull-right#publisher-service-icons | |||
- if current_user.services |
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.
Sidenote, as you didn't change it here, but I don't think this if
is needed, as if there are no services, the list would just be empty, so there is nothing to loop over anyway?
b3b2a16
to
4e6772c
Compare
I was wondering if we should disconnect all users if we detect that the podmin changed the config to disable the service, but first of all config change isn't easy to detect, and second I think that if the podmin then re-enables it it would be a shame to ask all users to reconnect.