npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

role-maintenance

v0.0.73

Published

Role Maintainence Custom component to help the managers to create roles for providing access to different content in the application based on the permission. The roles are assigned to users while creating a user in user maintenance. The user can login and

Downloads

2

Readme

RoleMaintenance

Role Maintainence Custom component to help the managers to create roles for providing access to different content in the application based on the permission. The roles are assigned to users while creating a user in user maintenance. The user can login and get access to content which is only assigned to the particular role. The so created roles can be modified, deleted, enabled, or disabled for Angular 4+.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Note: Don't forget to add --project template or else it will be added to the default project in your angular.json file.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Publishing

After building your library with ng build template, go to the dist folder cd dist/template and run npm publish.

Features

  • Create Roles
  • Modify and delete roles.
  • Sort and filter roles.
  • Supports pagination (10 records per page).
  • Provide access to different content based on permission.
  • Select composite roles.

Installation

  • npm install @latitudenpm/role-maintainance

Other Packages Used

"npm i @latitudenpm/uam-components"

// main.ts
import { defineCustomElements } from '@latitudenpm/uam-components/loader';
platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.error(err));
  defineCustomElements();

// app.module.ts
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@latitudenpm/uam-components';
schemas: [CUSTOM_ELEMENTS_SCHEMA]
npm i moment

Using with webpack and tsc builds/ angular-cli builds

  • import RoleMaintenanceModule into your app.module;
import { RoleMaintenanceModule } from '@latitudenpm/role-maintainance';
  • add RoleMaintenanceModule to the imports of your NgModule:
@NgModule({
  imports: [
    ...,
    RoleMaintenanceModule,
  ],
  ...
})
class YourModule { ... }
  • use <lib-role-maintenance></lib-role-maintenance> in your templates to add the custom role-maintainance in your view like below
<lib-role-maintenance [tableHeaders]="tableHeaders" [popUpMessage]="popUpMessage" [tableListing]="tableListing" [tWidth]="tWidth"
    [isLoading]="isLoading" [pageCount]="pageCount" [activeView]="activeView" [addRoleActive]="addRoleActive"
    [addTabHeader]="addTabHeader" [imageUrl]="image" [applicationList]="applicationList"
    [permissionCard]="permissionCard" [compositeRoles]="compositeRoles" [permissionTableHeader]="permissionTableHeader"
    [editTabHeader]="editTabHeader" [editRole]="editRole" [editRoleView]="editRoleView" [editData]="editData"
    [alertContent]="alertContent" [selectedApplicationData]="selectedApplicationData" [totalCount]="totalCount"
    [itemsPerPage]="itemsPerPage" [dropDownArray]="dropDownArray" (handleSortEvent)="handleSort($event)"
    (paginationEvent)="handlePagination($event)" (addRoleEvent)="handleAddRole($event)"
    (deleteRoleEvent)="handleDeleteRole($event)" (backToListEvent)="handleBackToList($event)"
    (getApplicationEvent)="handleGetApplication($event)" (getApplicationCardEvent)="handleGetPermissionCard($event)"
    (getCompositeEvent)="handleGetComposite()" (submitRoleEvent)="handleAddRoleSubmit($event)"
    (editRoleEvent)="handleEditRole($event)" (updateRoleEvent)="handleUpdateRole($event)"
    (searchEvent)="handleSearch($event)" (searchResetEvent)="handleSearchReset()"
    (itemsPerPageEvent)="handleItemsPerPage($event)">
</lib-role-maintenance>

Default Style (style.scss)

html{
    background-color: #f6f6f6;
}
body, h1, h2, h3, h4, h5, h6, ul, li, p{
    margin: 0;
}

li{
    list-style: none;
}

ul{
    padding: 0;
}

img{
    max-width: 100%;
    vertical-align: top;
}

Config

Input

  • tableHeaders : any - Table header for user listing table.
  • popUpMessage : any - Message for the popups.
  • tableListing : any - Table data for user listing as per itemsPerPage.
  • tWidth : any - Dynamic table width.
  • isLoading : any - Show hide loader
  • pageCount : any - Total page count for pagination.
  • activeView : any - Handle tab click while adding represent active tab.
  • addRoleActive : any - Add Role Active.
  • addTabHeader : any - Tab details for add user and edit user.
  • imageUrl : any - Application list image url.
  • applicationList : any - Application list.
  • permissionCard : any - Permission Card Data.
  • compositeRoles : any - Composite Roles List.
  • permissionTableHeader : any - Headers for Permission Table.
  • editTabHeader : any - Tab details for add user and edit user.
  • editRole : any - Edit Role Data.
  • editRoleView : any - Edit role view data.
  • editData : any - Edit Data.
  • alertContent : any - Data for alert message.
  • selectedApplicationData : any - Selected Application Data.
  • totalCount : any - Total record count.
  • itemsPerPage : any - Records per page.
  • dropDownArray : any - Data for dropdown.

Output

  • handleSortEvent : Event - sort the record based on ascending or descending.
  • paginationEvent : Event - pagination next/previous click.
  • addRoleEvent : Event - Add Role Event.
  • deleteRoleEvent : Event - Delete Role Event.
  • backToListEvent : Event - Back to Listing Event.
  • getApplicationEvent : Event - Get Application Event.
  • getApplicationCardEvent : Event - Get Application Card Event.
  • getCompositeEvent : Event - Get composite Data Event.
  • submitRoleEvent : Event - Submit Add Role Event.
  • editRoleEvent : Event - Edit Role Event.
  • updateRoleEvent : Event - Update Role Event.
  • searchEvent : Event - search record event.
  • searchResetEvent : Event - search reset event.
  • itemsPerPageEvent : Event - records per page event.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.