User Card Directory

How would I go about changing the default sort to “visits” rather than “likes received”?

Thanks!

1 Like

hi! this component is great! We found though a weird behavior while showing the number of followers

image

You can check yourself here: LibreCV

1 Like

I’m afraid that’s not possible at the moment

“Followers” isn’t a concept that exists in Discourse core, so I guess you must be using Official Discourse Follow Plugin. This is something that will need to be fixed in that plugin.

4 Likes

Indeed, I use that plugin - would be great that can be fixed :slight_smile:

1 Like

I could be wrong but believe the repetition of this card breaks its own Plugin Outlets, rendering them useless, but worse, they act unpredictably (or predictably bad?) if you have a dependent Theme Component or Plugin installed. I think it is essentially spamming the template with multiple, identically named plugin outlets?

Can we find a way around that?

1 Like

I don’t think multiple copies of the same plugin outlet should necessarily be an issue. For example, there are plugin outlets on every single row of a topic list, and things work fine there.

What error/issue are you seeing?

3 Likes

That’s encouraging.

So a different model is being passed to each instance?

Currently the same data seems to be repeated on each card

2 Likes

Yeah the user object should be different for each one… in theory

https://github.com/discourse/discourse/blob/65647000a13c2370036db9061f700b3daee7913f/app/assets/javascripts/discourse/app/templates/components/user-card-contents.hbs#L33-L33

Which specific outlet are you using?

1 Like

Yeah, I’m not yet convinced that’s actually happening, but would be delighted if I were wrong.

On Directory:

On solitary card clicked up from Topic list:

image

Perhaps I’m missing a best practice here, not sure.

2 Likes

I suspect it’s being caused by this:

https://github.com/paviliondev/discourse-follow/blob/master/assets/javascripts/discourse/components/follow-statistic.js.es6#L11-L16

I’m not entirely sure what this code is trying to achieve… but it looks like it’s looking up .card-content .metadata, and then appending itself? to every matching element :thinking:

If you use a standard ember computed property, I think things will work much better.

6 Likes

Aha! That’s a very helpful line of enquiry, thank you. I’ll take a look at refactoring that.

5 Likes

User Card Directory seems to have lost the ability to filter by username. When the component is enabled, typing in the search field has no effect.

When the component is disabled, filtering works as expected.

5 Likes

I am able to replicate this issue. Filtering by group works, but filtering by username has no effect.

3 Likes

This is done, Follow Plugin 👨 should now work with this TC.

4 Likes

Hey. The user cards are beautiful. Thanks for making this.
Can we add an option that hides the user statistics?

1 Like

I’m seeing—I’m guessing here—something wrong with string translations?

https://forum.moversmindset.com/u

2 Likes

Thanks @craigconstantine, we have a fix in the pipeline. I’ll let you know once it’s merged and ready for you to update.

5 Likes

The fix is now merged. @craigconstantine please can you try updating the theme component, and let us know how you get on.

@Green_Your_Lab, this recent change allows the statistics to be customized (using the :wrench: button at the top of the directory), and also adds a theme setting to disable the statistics altogether if you prefer.

3 Likes

…it’s fixed.Thanks!

2 Likes

Looks great! Nice work.

Seeing the new user list nav at the top is making me wish for a card/list toggle. Is such a thing possible?

I know this is extra icing, but I’d love some more configurability, to e.g. not show badges but to show groups. And to display/hide other user details like birthday, location and timezone. And to not show myself twice in user lists. This is dependent on the main user list functionality, however…

2 Likes