plugins: restore dev setups

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-06-19 15:01:32 +02:00
parent d719926d25
commit 9b9a8f3925
5 changed files with 58 additions and 13 deletions
+11 -6
View File
@@ -30,6 +30,13 @@ import graphqlApiEntity from './graphql-example-api.yaml';
import openapiApiEntity from './openapi-example-api.yaml';
import otherApiEntity from './other-example-api.yaml';
const mockEntities = ([
openapiApiEntity,
asyncapiApiEntity,
graphqlApiEntity,
otherApiEntity,
] as unknown) as Entity[];
createDevApp()
.registerApi({
api: catalogApiRef,
@@ -38,14 +45,12 @@ createDevApp()
(({
async getEntities() {
return {
items: [
openapiApiEntity,
asyncapiApiEntity,
graphqlApiEntity,
otherApiEntity,
],
items: mockEntities.slice(),
};
},
async getEntityByName(name: string) {
return mockEntities.find(e => e.metadata.name === name);
},
} as unknown) as typeof catalogApiRef.T),
})
.registerApi({
+20 -1
View File
@@ -13,10 +13,17 @@
* 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 { ExampleCostInsightsClient } from '../src/example';
import { costInsightsApiRef } from '../src/api';
import { costInsightsPlugin } from '../src/plugin';
import {
costInsightsPlugin,
CostInsightsPage,
CostInsightsProjectGrowthInstructionsPage,
CostInsightsLabelDataflowInstructionsPage,
} from '../src/plugin';
createDevApp()
.registerPlugin(costInsightsPlugin)
@@ -25,4 +32,16 @@ createDevApp()
deps: {},
factory: () => new ExampleCostInsightsClient(),
})
.addPage({
title: 'Cost Insights',
element: <CostInsightsPage />,
})
.addPage({
title: 'Growth',
element: <CostInsightsProjectGrowthInstructionsPage />,
})
.addPage({
title: 'Labelling',
element: <CostInsightsLabelDataflowInstructionsPage />,
})
.render();
+9 -2
View File
@@ -14,7 +14,14 @@
* limitations under the License.
*/
import React from 'react';
import { createDevApp } from '@backstage/dev-utils';
import { gcpProjectsPlugin } from '../src/plugin';
import { gcpProjectsPlugin, GcpProjectsPage } from '../src/plugin';
createDevApp().registerPlugin(gcpProjectsPlugin).render();
createDevApp()
.registerPlugin(gcpProjectsPlugin)
.addPage({
title: 'GCP Projects',
element: <GcpProjectsPage />,
})
.render();
+9 -2
View File
@@ -14,7 +14,14 @@
* limitations under the License.
*/
import React from 'react';
import { createDevApp } from '@backstage/dev-utils';
import { newRelicPlugin } from '../src/plugin';
import { newRelicPlugin, NewRelicPage } from '../src/plugin';
createDevApp().registerPlugin(newRelicPlugin).render();
createDevApp()
.registerPlugin(newRelicPlugin)
.addPage({
title: 'New Relic',
element: <NewRelicPage />,
})
.render();
+9 -2
View File
@@ -14,7 +14,14 @@
* limitations under the License.
*/
import React from 'react';
import { createDevApp } from '@backstage/dev-utils';
import { welcomePlugin } from '../src/plugin';
import { welcomePlugin, WelcomePage } from '../src/plugin';
createDevApp().registerPlugin(welcomePlugin).render();
createDevApp()
.registerPlugin(welcomePlugin)
.addPage({
title: 'Welcome',
element: <WelcomePage />,
})
.render();