dixplo / BigBrainsBoard-Project

Heroku: https://board-leotexier.herokuapp.com/
0 stars 0 forks source link

Story sort de nulle part #35

Closed jcheron closed 4 years ago

jcheron commented 4 years ago

https://github.com/dixplo/BigBrainsBoard-Project/blob/3dd0c60f5eb3ca71d65f18340e660cf7d97c82bf/app/routes/projects/stories/tags/index.js#L7-L19

Remplacer param par story

 model(story) { 

   return RSVP.hash({ 
     //Informations story 
     story: story, 
     code: get(story, "code"), 
     description: get(story, "description"), 
     id: get(story,"project"), 
     //Informations tags 
     tags: this.get('store').findAll('tag'), 
     tag: EmberObject.create() 
       }); 
     }, 
LeoTexier commented 4 years ago

C'est modifier. Cependant j'ai toujours l'erreur: index.js:163 Uncaught Error: Assertion Failed: You attempted to generate a link for the "projects.stories.tags.index" route, but did not pass the models required for generating its dynamic segments. There is no route named projects.stories.tags.index

jcheron commented 4 years ago

J'ai mis le linkTo comme ça:

<LinkTo class="ui vertical animated green button" @route="projects.stories.tags" @model={{story.id}} style="float: right;">
LeoTexier commented 4 years ago

J'ai la même erreur hélas.

jcheron commented 4 years ago

J'ai aussi modifié le routage:

import EmberRouter from '@ember/routing/router';
import config from './config/environment';

const Router = EmberRouter.extend({
  location: config.locationType,
  rootURL: config.rootURL
});

Router.map(function() {
  this.route('developers', function() {
    this.route('new');
    this.route('edit', {path: 'developer/:developer_id'});
  });
  this.route('projects', function() {
    this.route('new');
    this.route('edit', {path: 'project/:project_id'});
    this.route('stories', {path: 'project/stories/:project_id'}, function() {
      this.route('new');
      this.route('edit', {path: 'edit/:story_id'});
      this.route('tags',{path: 'tags/:story_id'} ,function(){
        this.route('index',{path: 'index/:story_id'});
        this.route('new',{path: 'new/:story_id'});
      });
    });
  });
  this.route('home');
});

export default Router;

Faudrait éviter de faire des routes trop complexes, la story n'a pas besoin d'être une sous route du projet (puisqu'on a son id)...

LeoTexier commented 4 years ago

Problème résolu merci beaucoup.