Skip to content

Commit

Permalink
Updated Dev Quotes
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Macdonald <[email protected]>
  • Loading branch information
Parsifal-M committed Nov 26, 2023
1 parent 81973cf commit 4a8f86b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const overviewContent = (
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>
<Grid item md={4} xs={12}>
<Grid item md={6} xs={12}>
<DevQuote />
</Grid>

Expand Down
3 changes: 2 additions & 1 deletion packages/backend/src/plugins/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
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,
user?: BackstageIdentityResponse,
): Promise<PolicyDecision> {
return await genericPolicyEvaluator(request, user);
}

}

return await createRouter({
Expand Down
Original file line number Diff line number Diff line change
@@ -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 (
<>
<footer className={classes.footer}>
<Typography variant="h6">{randomQuote.text}</Typography>
<Typography variant="subtitle2">{randomQuote.author}</Typography>
</>
</footer>
);
};
};
2 changes: 1 addition & 1 deletion plugins/dev-quotes-homepage/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './components/QuotesCardComponent';
export * from './components/QuotesComponent';
2 changes: 1 addition & 1 deletion plugins/dev-quotes-homepage/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
);

0 comments on commit 4a8f86b

Please sign in to comment.