-
Notifications
You must be signed in to change notification settings - Fork 74
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
⬆️ Update switch.js
#4017
base: master
Are you sure you want to change the base?
⬆️ Update switch.js
#4017
Conversation
6388ba9
to
1098f2e
Compare
@@ -1,10 +1,9 @@ | |||
<% if cinstance.service.backend_version == "2" %> |
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 guess this is removed because it is redundant?
porta/app/views/applications/access_details/show.html.erb
Lines 4 to 5 in c44891a
<% if @cinstance.service.backend_version == "2" %> | |
<%= render 'applications/applications/api_credentials', :cinstance => @cinstance %> |
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.
Correct
1098f2e
to
8395d09
Compare
e7d6d40
to
3215c96
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 tried the the key section in the Application screen:
- Removing keys works fine
- Adding a key , random or manually, shows a JS error, but the key is added correctly. You need to refresh the screen to see it.
- Referrer filter works fine
# FIXME: at some point in the past this feature broke | ||
# Then they should see "At most 5 keys are allowed." | ||
# And there should not be a button to "Create new key" within the application keys |
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.
Then, where did you get this cukes from? Were they somewhere else?
# FIXME: at some point in the past this feature broke | ||
# And there should be a button to "Create new key" within the application keys |
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.
Can cukes be fixed?
TL;DR
This long description is for the sake of describing why this script exists. The PR is pretty straightforward.
Full description
Part of
Switch is a custom component that uses jQuery. It's used both in admin portal and developer portal, but only the admin portal uses jQuery 1.
Admin portal
Used in Application show page, in API Credentials and Referrer filters. The switch shows/hides the "add button" and the "limit warning" alternatively:




Dev Portal
Same usage, different origins. Depending on how long ago the dev portal was created, it uses switch from either:
3scale.js
3scale-v2.js
oressential_assets
These are basically copy-pasta files with a collection of scripts from
app/assets/javascripts
that are used in dev portal:porta/lib/developer_portal/app/views/developer_portal/javascripts/3scale_v2.js
Lines 498 to 515 in 5749f2d