code-corps / code-corps/code-corps-ember

Discussion: Reconsider the route/template structure for donate and thank-you

Abierto
#1,122 1 comentario 0 reacciones 0 asignados Ver en GitHub
Difficulty: Medium
Lenguaje dominante
JavaScript
Estrellas
120
Forks
75
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

# Problem

Right now, our route structure is as follows:

```
project.hbs
project/
index.hbs
settings.hbs
tasks.hbs
donate.hbs
thank-you.
```

`project.hbs` is just an `{{outlet}}`. `index`, `settings` and `tasks` share most of the same layout, but the code needs to be duplicated because `donate` and `thank-you` have a completely different layout.

This is somewhat confusing by itself. An additional, unfortunate side-effect is that the `index`, `settings` and `tasks` share the same `project-details` component, which internally, defines a `joinProject`action. This action can't be handled at route level, because it's used in 3 different routes. Instead, right now, it's handled by the component internally.

I'm really not sure what the best architecture here is, but it doesn't feel right. I think `project.hbs` should have the outlet for the varying content, but it should also have the default project layout components such as the header, etc. The subroutes should either share the layout or not be subroutes, or we should find a third way to render it.

That means that our options are either:

- `donate` and `thank-you` should not be part of the project route structure.
- `donate` and `thank-you` can be part of the project route structure, but should then share the project layout
- we should add a named outlet to our application route. "Layoutless" routes such as `donate` and `thank-you` should render directly into this named outlet. This gives us an explicit way to specify a route as layoutless. We could use the route's [`renderTemplate` hook](http://emberjs.com/api/classes/Ember.Route.html#method_renderTemplate) to achieve this behavior

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Revisa la estructura indicada de project.hbs y project/{index,settings,tasks,donate,thank-you}.hbs, centrándote en el layout duplicado y en la acción joinProject del componente project-details. Lee la documentación del hook renderTemplate de Ember y compara las tres opciones de routing del issue. Se considera terminado cuando se haya seleccionado y documentado una estructura de rutas/layout que evite el código de layout duplicado y dé a la acción un propietario claro.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
frontend
Tipo de issue
Refactorización
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
20/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.