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

Unify the Edit API and Add API forms #368

Closed
4 of 5 tasks
bajiat opened this issue Aug 14, 2015 · 10 comments
Closed
4 of 5 tasks

Unify the Edit API and Add API forms #368

bajiat opened this issue Aug 14, 2015 · 10 comments
Assignees
Milestone

Comments

@bajiat
Copy link
Contributor

bajiat commented Aug 14, 2015

There should be no need to maintain two separate instances of the API configuration form. Additionally, this can cause misalignment, if one of the forms gets updated. The forms should be unified with minimal conditional logic to change the form according to current form method (adding or editing).

Definition of done

  • List the differences between the two forms.
  • Choose one for the forms and rename it to API configuration form.
  • Add conditional logic to update form depending on context: adding or editing API.
    • UI text, e.g. title, button.
    • Form action or method, e.g. insert or update.
@bajiat bajiat changed the title Change button label to Update in Edit API view Unify the Edit API and Add API forms Aug 17, 2015
@bajiat bajiat added ready and removed planning labels Aug 17, 2015
@bajiat bajiat added this to the Sprint 10 milestone Aug 17, 2015
@55 55 self-assigned this Aug 18, 2015
@bajiat bajiat added the MVP label Aug 18, 2015
@55 55 added in progress and removed ready labels Aug 28, 2015
@bajiat bajiat unassigned 55 Aug 31, 2015
@bajiat bajiat added the planning label Nov 5, 2015
@bajiat bajiat removed this from the Sprint 10 milestone Nov 5, 2015
@55
Copy link
Contributor

55 commented Nov 6, 2015

Interested in this task.

@bajiat bajiat assigned 55 Nov 9, 2015
@bajiat bajiat added this to the Sprint 16 milestone Nov 9, 2015
@bajiat bajiat added ready and removed planning labels Nov 9, 2015
@55 55 added in progress and removed ready labels Nov 19, 2015
@bajiat
Copy link
Contributor Author

bajiat commented Nov 23, 2015

@elnzv What is the status of the task?

@brylie brylie modified the milestones: Sprint 17, Sprint 16 Nov 23, 2015
@55
Copy link
Contributor

55 commented Nov 24, 2015

Forms are unified now.
Need to change UI text, button text, title according to form type.
Hours updated.

Working branch:
https://github.com/apinf/api-umbrella-dashboard/tree/feature/unify-api-forms

@55
Copy link
Contributor

55 commented Nov 25, 2015

@apinf/developers need help here.
I have changed the way how we define router and now can't add new API.

Here is how I define route

Router.route("/api/:_id/edit", function () {
  this.render("apiBackendForm", {
    data: function () {
      var apiBackend = ApiBackends.findOne({_id: this.params._id});
      return { apiBackend: apiBackend }
    },
    waitOn: function() {
      return this.subscribe('apiBackend', this.params._id);
    }
  });
  this.layout("masterLayout");
}, {
  name: "editApiBackend"
});

@brylie
Copy link
Contributor

brylie commented Nov 25, 2015

This is the Edit API route. What does the Add API route look like?

On 25 November 2015 10:45:54 EET, illya nizyev notifications@github.com wrote:

@apinf/developers need help here.
I have changed the way how we define router and now can't add new API.

Here is how I define route

Router.route("/api/:_id/edit", function () {
 this.render("apiBackendForm", {
   data: function () {
     var apiBackend = ApiBackends.findOne({_id: this.params._id});
     return { apiBackend: apiBackend }
   },
   waitOn: function() {
     return this.subscribe('apiBackend', this.params._id);
   }
 });
 this.layout("masterLayout");
}, {
 name: "editApiBackend"
});

Reply to this email directly or view it on GitHub:
https://github.com/apinf/api-umbrella-dashboard/issues/368#issuecomment-159536143

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@55
Copy link
Contributor

55 commented Nov 25, 2015

Router.route("/apibackends", function () {
  this.layout("masterLayout");
  this.render("apiBackendForm");
}, {
  name: "apiBackends"
});

@brylie
Copy link
Contributor

brylie commented Nov 26, 2015

I have tested your branch, and am able to create an API Backend. Is the problem with the edit form?

@brylie
Copy link
Contributor

brylie commented Nov 26, 2015

One bug I notice is that when editing, the redirect after edit goes to api/1, which is not an ID. However, changes made on the edit form are saved.

@brylie
Copy link
Contributor

brylie commented Nov 26, 2015

I have pushed some changes to your branch. The forms seem to be working now. Please verify.

@55
Copy link
Contributor

55 commented Nov 27, 2015

@brylie, thanks for help!
Added helper to show relevant title for form. Creating PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants