Disable proxy button when proxy is added#1604
Conversation
|
TODO: add help text to disabled button |
|
@frenchbread Why not hide the button instead of disabling? |
|
@bajiat IMHO Hiding the "Add proxy" can confuse users. I have no idea where, in that case, to put a message saying e.g. "You have already added one proxy. Can't add more for now." Disabling the button was also suggested by @Nazarah here. What's left is attaching a tooltip with helper text to a button. Open to suggestions. |
proxies/client/proxies.js
Outdated
| return instance.proxies.get(); | ||
| } | ||
| }, | ||
| biggerThan (a, b) { |
There was a problem hiding this comment.
Please use more meaningful name variables here, didn't quite get what is a and what is b.
Also comment will help.
# Conflicts: # core/lib/i18n/en.i18n.json
core/lib/i18n/en.i18n.json
Outdated
| "proxies_pageHeader": "Proxies", | ||
| "proxies_addProxy": "Add proxy", | ||
| "proxies_noProxiesFound": "No proxies found.", | ||
| "proxies_cannotAddMoreProxies": "You already have a Proxy available to attach your API. Please select the Proxy. You can add a new Proxy only after your have deleted the existing one.", |
There was a problem hiding this comment.
This help text is unnecessary, if we simply hide the Add Proxy button.
proxies/client/proxies.js
Outdated
|
|
||
| Template.proxies.events({ | ||
| 'click #add-proxy': function (event, instance) { | ||
| Modal.show('addProxy', { proxy: {}, isEdit: false }); |
There was a problem hiding this comment.
Be aware of changes to the addProxy form. Specifically, the template has been renamed proxyForm and used for both adding and editing proxies.
|
This is really close. Just clean up the help text, which is not necessary. Also, check linter errors for missing imports, etc. |
# Conflicts: # proxies/client/proxies.html # proxies/client/proxies.js
|
Changes are done |
Closes #1484