Skip to content
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

Merged
merged 6 commits into from
Mar 8, 2017

Conversation

snittoor
Copy link

@snittoor snittoor commented Mar 6, 2017

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

Template.apiSelectPicker.helpers({
// TODO: Update api Umbrella Admin case for multiple instance
apiName (id) {
Copy link
Contributor

@brylie brylie Mar 7, 2017

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
Copy link
Contributor

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

=======
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line.


ProxyBackends.helpers({
/* eslint object-shorthand: "error"*/
/* eslint-env es6*/
Copy link
Contributor

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?

@brylie brylie added this to the Sprint 38 milestone Mar 8, 2017
@brylie brylie merged commit ed3e90f into develop Mar 8, 2017
@brylie brylie deleted the apiDashBoardListName branch March 8, 2017 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants