HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Where is the controller for the new profile card when you click on a user in 2021.012?

I want to add Yaga badges to the profile card that pops up when you click on a users icon. Is a controller I can tap into for this car to add them at the bottom of the window?

Comments

  • Sorry I guess its called a handler. I am looking for the handler for the UserCard

  • A long time power user of Vanilla has the following sentence in his signature "grep is your friend" ;-)

    So grep -ril usercards gives the following results:

    library/src/scripts/addons/AddonList.story.tsx
    library/src/scripts/features/users/ui/InviteUserCard.tsx
    library/src/scripts/features/userCard/UserCard.compat.tsx
    library/src/scripts/features/userCard/UserCard.tsx
    library/src/scripts/features/userCard/UserCard.story.tsx
    library/src/scripts/features/userCard/UserCard.views.tsx
    library/Vanilla/Theme/ThemeFeatures.php
    applications/dashboard/src/scripts/pages/VanillaLabsPage.tsx
    applications/dashboard/src/scripts/labs/UserCardsLabItem.tsx
    applications/dashboard/src/scripts/entries/forum.tsx
    applications/dashboard/src/scripts/compatibilityStyles/pages/Discussion.compat.styles.ts
    applications/dashboard/openapi/config.yml
    dist/admin/addons/dashboard.3440e6784c921fefe573.min.js
    dist/admin/manifest.json
    dist/forum/addons/dashboard-1fdf87e3.ec24002e696496be5b22.min.js
    

    *.tsx are a hint for React components - welcome to hell...

    "Funny" side note: I wanted to enable that feature and wasn't able to find out how to. I have no clue where in the settings to find that. Then, when reading the list of files for the 5th time, I saw "VanillaLabsPage" and I remembered there is a settings menu item "Labs". Well, if you want to change something there you

    - need to understand the React build chain

    - find out if you can simply override that page somehow without messing up the core files or

    - recompile your changes on every update


    React has scoped css which means you cannot simply style it with additional css, you cannot add or remove content to components on the fly. It's a dead end for simple extendability. Every change you want to have requires you to duplicate the complete theme. A "view-only" plugin which adds some content somewhere has been super easy with php based themes, but is messy with React.

  • So there are no built in handlers so that a plugin can add to the user card before or after its render?

  • Nothing that I know of. JavaScript has a way of dispatching events and a script could use event listeners, but I'm not sure that the new Vanilla React components are build up with this intention. There has been a post some time which showed what the new theme will require from addon developers:

    https://open.vanillaforums.com/discussion/37871/poll-potential-new-installation-requirements-for-enhanced-addon-capabilities

Sign In or Register to comment.