Upcoming topic-list changes - how to prepare themes and plugins

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