-
Notifications
You must be signed in to change notification settings - Fork 35
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
Delete proxy backend #1606
Delete proxy backend #1606
Conversation
The following submit/delete button group code works properly, where clicking delete does not trigger the update event: <div id="proxy-form-buttons" class="btn-group pull-left">
<!-- submit button -->
<button
type="submit"
class="btn btn-success"
id="save-proxy-button">
{{_ "proxyBackendForm_saveButton" }}
</button>
<!-- delete button -->
<button
type="button"
class="btn btn-danger"
id="delete-proxy-button">
Delete
</button>
</div> |
You will also need to change your form.less: /* Change the following */
#save-proxy-button {
#margin-top: 1em;
}
/* to */
#proxy-form-buttons {
#argin-top: 1em;
} |
@brylie Ok, thanks. I try out. Just pushed functionality. |
@brylie Seems to work. I push also UI changes. |
@apinf/developers ready for review |
This looks good. Try to reduce the amount of nesting involved in the delete event handler. That will make the code slightly easier to read. |
// Check proxyBackend exists | ||
if (proxyBackend) { | ||
// Check if proxyBackend type is apiUmbrella & it has id | ||
if (proxyBackend.apiUmbrella && proxyBackend.apiUmbrella.id) { |
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.
Unless there is a syntactic reason to separate these statements, combine them into one if
statement. Separate each conditional on its own line:
if (proxyBackend &&
proxyBackend.apiUmbrella &&
proxyBackend.apiUmbrella.id ) {
// do something
}
(deleteError) => { | ||
if (deleteError) { | ||
const deleteErrorMessage = TAPi18n.__('proxyBackendForm_deleteErrorMessage'); | ||
sAlert.error(`${deleteErrorMessage}:\n ${deleteError}`); |
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.
Nice use of template strings 😄
Closes #1509
Proposed changes