-
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
Change in API name with proxy setting displays correct Api Name … #2240
Conversation
Template.apiSelectPicker.helpers({ | ||
// TODO: Update api Umbrella Admin case for multiple instance | ||
apiName (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.
Instead of using a template helper, lets make this a collection helper. Collection helper functions are attached to a collection document, e.g.:
// in the file: '/proxy_backends/collection/helpers.js'
ProxyBackends.helpers({
// Use full 'function' notation here:
apiName: function () {
// Get API ID
const apiId = this.apiId;
// Get API
const api = Apis.findOne(apiId);
// Return API Name
return api.name;
}
});
Moving the apiName
function to a collection helper, would result in the following code in your template:
<option value="{{ backend._id }}" >
{{ backend.apiName }}
</option>
import { Roles } from 'meteor/alanning:roles'; | ||
|
||
// Apinf collection import(s) | ||
import Apis from '/apis/collection'; | ||
>>>>>>> 3553fa6d29346e17ec08ad99042869152d07f24e |
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.
Remove this line.
@@ -4,17 +4,17 @@ import { Template } from 'meteor/templating'; | |||
|
|||
// Meteor contributed packages imports | |||
import { FlowRouter } from 'meteor/kadira:flow-router'; | |||
<<<<<<< HEAD | |||
|
|||
======= |
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.
Remove this line.
@@ -4,17 +4,17 @@ import { Template } from 'meteor/templating'; | |||
|
|||
// Meteor contributed packages imports | |||
import { FlowRouter } from 'meteor/kadira:flow-router'; | |||
<<<<<<< HEAD |
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.
Remove this line.
proxy_backends/collection/helpers.js
Outdated
|
||
ProxyBackends.helpers({ | ||
/* eslint object-shorthand: "error"*/ | ||
/* eslint-env es6*/ |
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.
Try doing this instead:
// eslint-disable-next-line object-shorthand
Does that work?
When the Api name having the proxy setting is changed , the new name was not reflecting in the dashboard dropdown list . Fixed this.
Closes #2092