Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@cpelements/pfe-navigation-account
Advanced tools
This is a companion component with pfe-navigation, it creates an account dropdown with appropriate content based on a user's roles and permissions.
This component should be a direct child of pfe-navigation
, and should have the attribute slot="account"
<pfe-navigation-account slot="account"></pfe-navigation-account>
If it should be in logged out state:
login-link
should be set to a valid login URLIf it should be in a logged in state:
logout-link
should be set to a valid logout URL.userData
, e.g.:
document.querySelector('pfe-navigation-account').userData = howeverYouGetTheJWT('make it so');
Tip: Don't add the
login-link
attribute until the auth state of the user is known, this will prevent a login link from flashing while the user's status is being figured out.
The userData
method expects an object that at minimum should have:
{
realm_access: {
roles: []
},
REDHAT_LOGIN: "wesruv@wakka-wakka.com",
lastName: "Ruvalcaba",
account_number: "123456",
preferred_username: "wesruv@wakka-wakka.com",
firstName: "Wes",
email: "wesruv@wakka-wakka.com",
username: "wesruv@wakka-wakka.com",
fullName: "Wes Ruvalcaba"
}
realm_access.roles
is checked for two roles:
admin:org:all
portal_manage_subscriptions
If the user has these roles they should be present in the array, if not they can be left out.
@todo: update to ask users to file an issue in the repository For any questions or help, contact the CPFED group.
login-link
: Link to login user, required for anonymous users non-keycloack implementations will be put directly into an <a>
tag.logout-link
: Link to logout user, required for logged in users non-keycloack implementations will be put directly into an <a>
tag.avatar-url
: Provided by the component, used by pfe-navigation
full-name
: Provided by the component, used by pfe-navigation
pfe-shadow-dom-event
: Fires when an element is clicked inside of a dropdown in the shadow root. This is for analytics to properly categorize and report the event. event.detail
has:
target
Element clickedparent
the pfe-navigation
elementIs meant to be used inside of pfe-navigation as optional functionality.
`npm start`
`npm run test`
`npm run build`
From the PFElements root directory, run:
`npm run demo`
Navigation-account (and all PFElements) use Prettier to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can integrate your editor with Prettier to have the style rules applied on every save.
FAQs
Navigation account element for PatternFly Elements
The npm package @cpelements/pfe-navigation-account receives a total of 3 weekly downloads. As such, @cpelements/pfe-navigation-account popularity was classified as not popular.
We found that @cpelements/pfe-navigation-account demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.