Brave Linux, tema Meta. Non sono sicuro se sia intenzionale, ma non sembra corretto
2 Mi Piace
bryce
(Bryce Huhtala)
13 Agosto 2024, 12:53am
2
Hmm, vedo la stessa cosa nel tema predefinito.
C’è un elemento per il nome, ma è vuoto!
Questo non mi sembra intenzionale, quindi per ora lo sposto in Bug .
5 Mi Piace
Ecco una rapida occhiata per aiutare a capire il problema prima di andare a letto.
https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/helpers/category-link.js#L159
displayName non esiste. C’è invece un campo name.
Le modifiche avvengono in questo 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"
);
```
Sembra che manchino i getter nel contesto del riepilogo utente poiché i dati vengono recuperati da /summary.json.
https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/models/user.js#L1068-L1073
Forse mappare top_categories con Category.create() o una classe specifica di base andrebbe bene.
4 Mi Piace
Moin
13 Agosto 2024, 5:20am
4
Questo mi fa pensare a Category names missing on group permissions page . Entrambi hanno perso il testo, quindi forse è lo stesso problema.
2 Mi Piace
Sembra che possa essere il risultato dello stesso problema, ma si trova in un’area diversa. Non ho intenzione di fingere di sapere come funziona Discourse, quindi non posso esprimere un parere in merito.
1 Mi Piace
@j.jaffeux questo e Category names missing on group permissions page sembrano regressioni da DEV: allows to alter category name/description (#28263) · discourse/discourse@c197daa · GitHub
categoryName sta restituendo una stringa vuota, sembra che questi due posti non funzionino con il nuovo getter displayName?
4 Mi Piace
j.jaffeux
(Joffrey Jaffeux)
13 Agosto 2024, 10:05pm
7
Dovrebbe risolvere il problema:
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 Mi Piace
j.jaffeux
(Joffrey Jaffeux)
Chiuso
16 Agosto 2024, 10:05pm
8
Questo argomento è stato chiuso automaticamente 3 giorni dopo l’ultima risposta. Non sono più ammessi nuovi messaggi.