diff --git a/README.md b/README.md index 9e136a2..ba46d5e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ You are probably looking for the plugins which have been moved to their own repo - [opa-backend](https://github.com/Parsifal-M/backstage-opa-backend#opa-backend) - [opa-entity-checker](https://github.com/Parsifal-M/backstage-opa-entity-checker#opa-entity-checker) - [opa-permissions-wrapper](https://github.com/Parsifal-M/backstage-opa-permissions-wrapper#opa-permissions-wrapper-for-backstage) -- [dev-quotes-homepage](./plugins/dev-quotes-homepage/README.md) (PENDING) +- [dev-quotes-homepage](https://github.com/Parsifal-M/backstage-dev-quotes) - [gitlab-my-mr-card](./plugins/gitlab-my-mr-card/README.md) (WIP) (PENDING) - [gitlab-runners](./plugins/gitlab-runners/README.md) (WIP) (PENDING) diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index d3e1758..9c37b87 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -122,7 +122,7 @@ const overviewContent = ( - + diff --git a/packages/backend/src/plugins/permission.ts b/packages/backend/src/plugins/permission.ts index 9f40ce4..694e3e2 100644 --- a/packages/backend/src/plugins/permission.ts +++ b/packages/backend/src/plugins/permission.ts @@ -16,7 +16,7 @@ export default async function createPlugin( env: PluginEnvironment, ): Promise { const opaClient = new OpaClient(env.config, env.logger); - const genericPolicyEvaluator = policyEvaluator(opaClient, env.config); + const genericPolicyEvaluator = policyEvaluator(opaClient); class PermissionsHandler implements PermissionPolicy { async handle( request: PolicyQuery, diff --git a/plugins/dev-quotes-homepage/README.md b/plugins/dev-quotes-homepage/README.md index 901083a..259cb9e 100644 --- a/plugins/dev-quotes-homepage/README.md +++ b/plugins/dev-quotes-homepage/README.md @@ -1,55 +1,7 @@ # dev-quotes-homepage -Hello! :wave: +Please be aware this plugin has moved to its own repository: -This is just a fun little plugin that I made to display some random coding/progamming related quotes on the Backstage homepage. Although to be honest the card can be used anywhere you like! +- [dev-quotes-homepage](https://github.com/Parsifal-M/backstage-dev-quotes) -## Pre-requisites (if you want to use it on the homepage) - -If you do want to use it on the homepage, first make sure you look over the official docs on how to configure the homepage [here](https://backstage.io/docs/getting-started/homepage/#composing-your-homepage). There is also the [homepage plugin](https://github.com/backstage/backstage/tree/master/plugins/home#readme) which might be better to read first. - -## Installation - -```bash -yarn add --cwd packages/app @parsifal-m/plugin-dev-quotes-homepage -``` - -Then all you need to do is import the card as below, anywhere you like! - -```tsx -import { DevQuote } from '@parsifal-m/plugin-dev-quotes-homepage'; - -const overviewContent = ( - - {entityWarningContent} - - - - - - - - - - - - - - - - - - - - - -); -``` - -## Would you like to contribute? or add more quotes? - -Please do! I would love to see more quotes added to this plugin. If you would like to add some quotes, please open a pull request with your changes. If you would like to add a lot of quotes, please open an issue first so we can discuss it. And please keep them programming related, and keep it SFW. - -## License - -This project is released under the Apache 2.0 License. +Further development will happen there. diff --git a/plugins/dev-quotes-homepage/package.json b/plugins/dev-quotes-homepage/package.json index 5dba77f..27b9047 100644 --- a/plugins/dev-quotes-homepage/package.json +++ b/plugins/dev-quotes-homepage/package.json @@ -1,6 +1,6 @@ { "name": "@parsifal-m/plugin-dev-quotes-homepage", - "version": "2.1.3", + "version": "3.0.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/dev-quotes-homepage/src/components/QuotesCardComponent/DevQuotes.test.tsx b/plugins/dev-quotes-homepage/src/components/QuotesComponent/DevQuotes.test.tsx similarity index 100% rename from plugins/dev-quotes-homepage/src/components/QuotesCardComponent/DevQuotes.test.tsx rename to plugins/dev-quotes-homepage/src/components/QuotesComponent/DevQuotes.test.tsx diff --git a/plugins/dev-quotes-homepage/src/components/QuotesCardComponent/DevQuotes.tsx b/plugins/dev-quotes-homepage/src/components/QuotesComponent/DevQuotes.tsx similarity index 53% rename from plugins/dev-quotes-homepage/src/components/QuotesCardComponent/DevQuotes.tsx rename to plugins/dev-quotes-homepage/src/components/QuotesComponent/DevQuotes.tsx index 9a798e6..86d0ae8 100644 --- a/plugins/dev-quotes-homepage/src/components/QuotesCardComponent/DevQuotes.tsx +++ b/plugins/dev-quotes-homepage/src/components/QuotesComponent/DevQuotes.tsx @@ -1,14 +1,23 @@ -import { Typography } from '@material-ui/core'; +import { Typography, makeStyles } from '@material-ui/core'; import React from 'react'; import { quotes } from '../../quotes'; +const useStyles = makeStyles(theme => ({ + footer: { + width: '100%', + textAlign: 'center', + padding: theme.spacing(2), + }, +})); + export const DevQuote = () => { + const classes = useStyles(); const randomQuote = quotes[Math.floor(Math.random() * quotes.length)]; return ( - <> + ); }; diff --git a/plugins/dev-quotes-homepage/src/components/QuotesCardComponent/index.ts b/plugins/dev-quotes-homepage/src/components/QuotesComponent/index.ts similarity index 100% rename from plugins/dev-quotes-homepage/src/components/QuotesCardComponent/index.ts rename to plugins/dev-quotes-homepage/src/components/QuotesComponent/index.ts diff --git a/plugins/dev-quotes-homepage/src/index.ts b/plugins/dev-quotes-homepage/src/index.ts index 63bfcf8..6b003d3 100644 --- a/plugins/dev-quotes-homepage/src/index.ts +++ b/plugins/dev-quotes-homepage/src/index.ts @@ -1 +1 @@ -export * from './components/QuotesCardComponent'; +export * from './components/QuotesComponent'; diff --git a/plugins/dev-quotes-homepage/src/plugin.ts b/plugins/dev-quotes-homepage/src/plugin.ts index cc677cd..1fee9aa 100644 --- a/plugins/dev-quotes-homepage/src/plugin.ts +++ b/plugins/dev-quotes-homepage/src/plugin.ts @@ -15,7 +15,7 @@ export const DevQuotesHomepage = devQuotesHomepage.provide( createRoutableExtension({ name: 'DevQuotesHomepage', component: () => - import('./components/QuotesCardComponent').then(m => m.DevQuote), + import('./components/QuotesComponent').then(m => m.DevQuote), mountPoint: rootRouteRef, }), ); diff --git a/yarn.lock b/yarn.lock index c90bc4e..1ec7dbe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7936,7 +7936,24 @@ __metadata: languageName: unknown linkType: soft -"@parsifal-m/plugin-dev-quotes-homepage@^2.1.3, @parsifal-m/plugin-dev-quotes-homepage@workspace:plugins/dev-quotes-homepage": +"@parsifal-m/plugin-dev-quotes-homepage@npm:^2.1.3": + version: 2.1.3 + resolution: "@parsifal-m/plugin-dev-quotes-homepage@npm:2.1.3" + dependencies: + "@backstage/core-components": ^0.13.5 + "@backstage/core-plugin-api": ^1.6.0 + "@backstage/theme": ^0.4.2 + "@material-ui/core": ^4.12.2 + "@material-ui/icons": ^4.9.1 + "@material-ui/lab": 4.0.0-alpha.61 + react-use: ^17.2.4 + peerDependencies: + react: ^16.13.1 || ^17.0.0 + checksum: 25e12ba5078e6ba28fe19b7a8c4da06c02619e33106f754884f7933c8840f970ab6d45607a99d9590c56d51b2a8928e938dfb58a891c1c9b570421d3d93c40d6 + languageName: node + linkType: hard + +"@parsifal-m/plugin-dev-quotes-homepage@workspace:plugins/dev-quotes-homepage": version: 0.0.0-use.local resolution: "@parsifal-m/plugin-dev-quotes-homepage@workspace:plugins/dev-quotes-homepage" dependencies: