0.4.0 • Published 12 months ago

@tduniec/backstage-plugin-time-saver-common v0.4.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
12 months ago

Time Saver - common

This plugin provides an implementation of charts and statistics related to your time savings that are coming from usage of your templates. Plugins is built from frontend and backend part. Backend plugin is responsible for scheduled stats parsing process and data storage.

Dependencies

Code

https://github.com/tduniec/backstage-timesaver-plugin.git

Installation

  1. Install the plugin package in your Backstage app:
# From your Backstage root directory
yarn add --cwd packages/backend @tduniec/backstage-plugin-time-saver-common

or

# From your Backstage root directory
yarn add --cwd packages/app @tduniec/backstage-plugin-time-saver-common
  1. Wire up the API implementation to your packages/app/src/App.tsx:
import { timeSaverPermission } from '@tduniec/backstage-plugin-time-saver-common';

...

    <Route
      path="/time-saver"
      element={
        <RequirePermission permission={timeSaverPermission}>
          <TimeSaverPage />
        </RequirePermission>
      }
    />
  1. Wire up in the navigation pane the in packages/app/src/component/Root/Root.tsx:
import { timeSaverPermission } from '@tduniec/backstage-plugin-time-saver-common';

...

        <RequirePermission
          permission={timeSaverPermission}
          errorPage={<></>}
        >
          <SidebarItem
            icon={Timelapse}
            to="time-saver"
            text="TimeSaver"
          />
        </RequirePermission>
  1. Wire up in the permissions backend in packages/backend/src/plugins/permission.ts:
...
import { timeSaverPermission } from '@tduniec/backstage-plugin-time-saver-common';
...

    if (isPermission(request.permission, timeSaverPermission)) {
      if (isAdmin) { //example condition
        return {
          result: AuthorizeResult.ALLOW,
        };
      }
      return {
        result: AuthorizeResult.DENY,
      };
    }
0.3.0

12 months ago

0.2.0

1 year ago

0.4.0

12 months ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago