Aankomende wijzigingen in de onderwerplijst - hoe thema's en plugins voor te bereiden

Sorry to eat into your weekend David, yes, just saw the API, thanks

3 likes

Hi, I’ve tried to use value transformer for ā€œtopic-list-columnsā€ like this:

export default {
    name: "assignment-topic-list-column-modifier",

    initialize(container) {
        const router = container.lookup("service:router");

        withPluginApi("1.39.0", (api) => {
            api.registerValueTransformer(
                "topic-list-columns",
                ({ value: columns }) => {
                    if (ASSIGN_LIST_ROUTES.includes(router.currentRouteName)) {
                        columns.add("posters-recent", {
                            header: AssignHeaderCell,
                            item: AssignCell,
                            after: "posters",
                        });
                    }
                    return columns;
                }
            );
        });
    },
};

The goal is to insert new column item and header after ā€œpostersā€ column, it works for the item, but the header still not in the right place, it was placed after ā€œactivityā€ column.

Is there something missing in my code? and is there any documentation that explain how to do this correctly?

There is a new guide:

However, it may not be very useful in this case.

@NateDhaliwal thanks for the info, i will check it.

I think the code should look like:

columns.add(
  "posters-recent", 
  { header: AssignHeaderCell, item: AssignCell }
  { after: "posters"}
});

And you might need to specify a before:

{after: "posters", before: "replies"}
1 like

@Arkshine thanks a lot, your code works !!! awesome :+1:

1 like

We’ve now enabled the warning banner for these deprecations, so community admins will be notified about any themes or plugins which still need to be updated.

We’ve also published a reference guide with signposts to all the different ways you can customize the new topic list:

I’ve added a link to that from the OP.

6 likes

David, not sure if you prefer this Topic or the other, but here goes:

My new compliant (I think) component is failing when Enable Glimmer Topic List is set to Auto …

It suggests the new API is not being activated on Auto … is there something I need to do to sign-post the Theme Component so Discourse uses the new Glimmer API when on Auto?

3 likes

I’ve noticed the warning here:

But it’s still not messing anything up despite the date you provided above has passed and I’m on the latest build…?

Things are delayed a little bit, but we hope to finish dropping the old code in the next 1-2 weeks

So would that completely break themes who aren’t up to date yet? Should we avoid updating? or is there anything we can do simply if we fork the theme?

1 like

It will prevent their customizations to the topic-list from being applied, yes.

I wouldn’t recommend that. Discourse core updates often include security fixes, and your community may be vulnerable if you stop updating.

Sounds like you got it figured out in the other topic :chefs_kiss:

2 likes

The legacy topic-list and ā€œraw handlebarsā€ systems have now been removed from Discourse core. Thanks to everyone who helped to update plugins and themes for this change! :rocket:

5 likes

That’s fantastic! Congrats to the CDCK team who worked on this. :partying_face:

Also thanks to you and the team for being very receptive to feature requests and so thoughtful on the design of the new API :heart_eyes:

I had feared we would lose some capabilities. But what actually happened was we got many more whilst at the same time being significantly easier to work with! :rocket:

6 likes

Regarding raw templates, do I understand correctly that using components in the template with the autocomplete function is no longer possible (e.g., emoji)?

this.textManipulation.autocomplete({
      template: renderEmojiAutocomplete,

It seems that you can only return HTML now.
I think you said autocomplete will be reworked at some point, but it’s likely not anytime soon.

Do you see a workaround here? (Trying to fix Emoji Fluff TC)

3 likes

Unfortunately we didn’t get a proper deprecation message in place for autocomplete, sorry! But there is a path forwards - check out: Autocomplete still using Raw Templates - #4 by david

2 likes