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

@sec-authorize/mfe-resources

v0.1.8

Published

[//]: # ([![npm version](https://img.shields.io/npm/v/@alx_rajic_auth/resources.svg)](https://www.npmjs.com/package/@alx_rajic_auth/resources)) [//]: # ([![Build Status](https://img.shields.io/travis/your-username/your-package-name.svg

Readme

A Resources management micro-frontend, with creation, listing, editing and removal.

Installation

Install the package using npm or yarn:

npm install @sec-authorize/resources
# or
yarn add @sec-authorize/resources

Usage

Basic ussage

import Resources from '@sec-authorize/resources';
import { BrowserRouter } from 'react-router-dom';

const ParentComponent = () => (
    <BrowserRouter>
        <Resources />
    </BrowserRouter>
);

Props

routePaths: ResourcesRoutesConfig

An optional configuration to set routes' pages paths.

home: string

Sets home page path. Default: /

list: string

Sets table of resources page path. Default: /resources

create: string

Sets create resource page path. Default: /resources/create

edit: string

Sets edit resource page path. Default: /resources/:id

events?: ResourcesEvents

Event handlers.

onCreateEvent?: (record: Partial<Resource>) => Promise<void>

Event that will be triggered once resource creation form is submit;

onEditEvent?: (id: string, record: Partial<Resource>) => Promise<void>

Event that will be triggered once resource edit form is submit

onDeleteEvent?: (ids: string[]) =>Promise <void>

Event that will be triggered once resource delete button is pressed;

formConfig?: ResourceFormConfig

Configuration of create and edit forms.

navigateBackOnCreate?: boolean

Navigate back on create success if flag is true.

navigateBackOnEdit?: boolean

Navigate back on edit success if flag is true.

navigateOnCreateTo?: string

Navigate to the provided url on create success. Overrides navigateBackOnCreate.

navigateOnEditTo?: string

Navigate to the provided url on edit success. Overrides navigateBackOnEdit.

notificationsConfig?: ResourceNotificationsConfig

Configure notifications.

placement?: NotificationPlacement

Defines placement of the notification on screen. Enum: topRight, topLeft, bottomRight, bottomLeft

editSuccessMessage?: string

Message that is shown on create success. Default: Resource successfully created..

createSuccessMessage?: string

Message that is shown on edit success. Default: Resource successfully edited..

deleteSuccessMessage?: string

Message that is shown on delete success. Default: Resource successfully deleted..

serviceConfig?: ResourceService

Defines backend configuration to connect to.

baseUrl?: string

Base url of the backed application. Default: http://localhost:3000.

createResourcePath?: string

Path of the create resource POST route. Default: /resources.

loadResourcesPath?: string

Path of the load resources GET route. Default: /resources.

loadResourceByIdPath?: string

Path of the load resource by id GET route. Default: /resources/:id.

deleteResourceByIdPath?: string

Path of the delete resource DELETE route. Default: /resources/:id.

bulkDeleteResourcesPath?: string

Path of the bulk delete resources DELETE route. Default: /resources.

updateResourceActionsByIdPath?: string

Path of the update resource's actions PATCH route. Default: /resources/:id/actions.

updateResourceActionScopesByIdAndActionIdPath?: string

Path of the update resource's action's scopes PATCH route. Default: /resources/:id/actions/:actionId/scopes.

Required Dependencies

  • react
  • react-dom
  • react-router-dom
  • react/jsx-runtime

License

This project is released under the MIT licence.