Ok so this solution is impressive, but you can do this @Don:
api
.modifySelectKit("category-drop")
.replaceContent((component, content) => {
let newContent = [];
content.forEach((item) => {
if (
component.category?.slug === "general" &&
item.id === "all-categories"
) {
item.name = "jojo";
}
newContent.push(item);
});
return newContent;
});
https://github.com/discourse/discourse/blob/main/app/assets/javascripts/select-kit/addon/mixins/plugin-api.js lists all the actions you can make:
- appendContent
- prependContent
- replaceContent
- onChange
Let me know if you have troubles using this. It should probably be better documented, but Im here if you have any question.
