Brave Linux, tema Meta. No estoy seguro si esto es intencional, pero no se ve bien
2 Me gusta
bryce
(Bryce Huhtala)
13 Agosto, 2024 00:53
2
Hmm, estoy viendo lo mismo en el tema predeterminado.
Hay un elemento para el nombre, ¡pero está vacío!
Esto no parece intencional, así que lo moveré a Bug por ahora.
5 Me gusta
Aquí tienes un vistazo rápido para ayudar a resolver el problema antes de ir a dormir.
https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/helpers/category-link.js#L159
displayName no existe. En su lugar, hay un campo name.
Los cambios ocurren en este commit:
committed 03:33PM - 08 Aug 24 UTC
This commit adds two new getters to the category model:
- `displayName`
- `des… criptionText`
These getters are used instead of `name` and `description_text` where appropriate.
On top of this two transformers have been added to allow plugins to alter these getters:
```javascript
api.registerValueTransformer(
"category-display-name",
({ value, context }) =>
value + "-" + context.category.id + "-transformed"
);
```
```javascript
api.registerValueTransformer(
"category-description-text",
({ value, context }) =>
value + "-" + context.category.id + "-transformed"
);
```
Parece que faltan los getters en el contexto del resumen de usuario, ya que los datos se obtienen de /summary.json.
https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/models/user.js#L1068-L1073
Quizás mapear top_categories con Category.create() o una clase específica básica estaría bien.
4 Me gusta
Moin
13 Agosto, 2024 05:20
4
Esto me recuerda a Category names missing on group permissions page . Ambos perdieron el texto, así que tal vez sea el mismo problema.
2 Me gusta
Parece que podría ser el resultado del mismo problema, pero está en un área diferente. No voy a fingir que sé cómo funciona Discourse, así que no puedo opinar sobre eso realmente.
1 me gusta
@j.jaffeux esto y Category names missing on group permissions page parecen regresiones de DEV: allows to alter category name/description (#28263) · discourse/discourse@c197daa · GitHub
categoryName está devolviendo una cadena vacía, ¿parece que estos dos lugares no funcionan con el nuevo getter displayName?
4 Me gusta
j.jaffeux
(Joffrey Jaffeux)
13 Agosto, 2024 22:05
7
Eso debería solucionarlo:
main ← jjaffeux:name-description
opened 09:37PM - 13 Aug 24 UTC
`defaultCategoryLinkRenderer` is using a fake category object which doesn’t have… access to the functions and getters of category model.
This had been incorrectly set in https://github.com/discourse/discourse/commit/c197daa04c3114184cbd3ec2f1cfade1b5701793
As we don't get a real category object, we have to call the transformers manually and also pass the fake category object as context, this is not ideal as people might try to access properties in the transformer which are not available on the category object given they will be different based on the context. Hopefully one day this helper and all the chain can be refactored to use a real category model.
This commit also adds tests for these two properties in the category-link helper.
6 Me gusta
j.jaffeux
(Joffrey Jaffeux)
Cerrado
16 Agosto, 2024 22:05
8
Este tema se cerró automáticamente 3 días después de la última respuesta. Ya no se permiten nuevas respuestas.