badges: initial work for a powered by badge. #4457
Signed-off-by: Andreas Stenius <git@astekk.se>
This commit is contained in:
committed by
Fredrik Adelöw
parent
9570256146
commit
81846585db
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2021 Spotify AB
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { createDevApp } from '@backstage/dev-utils';
|
||||
import { badgesPlugin, EntityBadgesCard } from '../src/plugin';
|
||||
import { badgesDevPlugin, BadgesDevPage } from './plugin';
|
||||
|
||||
createDevApp()
|
||||
.registerPlugin(badgesPlugin)
|
||||
.registerPlugin(badgesDevPlugin)
|
||||
.addPage({
|
||||
element: <BadgesDevPage />,
|
||||
title: 'Dev Page',
|
||||
})
|
||||
.render();
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2021 Spotify AB
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { Typography, Grid } from '@material-ui/core';
|
||||
import { Content, Header, Page, ContentHeader } from '@backstage/core';
|
||||
import { EntityBadgesCard } from '../src';
|
||||
|
||||
export default () => {
|
||||
return (
|
||||
<Page themeId="home">
|
||||
<Header
|
||||
title="Badges Dev Page"
|
||||
subtitle="Showcasing the EntityBadgesCard component"
|
||||
/>
|
||||
<Content>
|
||||
<ContentHeader title="EntityBadgesCard" />
|
||||
<Grid container>
|
||||
<Grid item xs={12} lg={6}>
|
||||
<EntityBadgesCard />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Content>
|
||||
</Page>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2021 Spotify AB
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {
|
||||
createPlugin,
|
||||
createRoutableExtension,
|
||||
createRouteRef,
|
||||
} from '@backstage/core';
|
||||
import BadgesDevPageComponent from './page';
|
||||
|
||||
const devRouteRef = createRouteRef({
|
||||
title: 'Badges (Dev Page)',
|
||||
});
|
||||
|
||||
export const badgesDevPlugin = createPlugin({
|
||||
id: 'badges-dev',
|
||||
routes: {
|
||||
root: devRouteRef,
|
||||
},
|
||||
});
|
||||
|
||||
export const BadgesDevPage = badgesDevPlugin.provide(
|
||||
createRoutableExtension({
|
||||
component: () => import('./page').then(m => m.default),
|
||||
mountPoint: devRouteRef,
|
||||
}),
|
||||
);
|
||||
Reference in New Issue
Block a user