remove apiRef register, pr fixes
Signed-off-by: Alex Rybchenko <arybchenko@box.com>
This commit is contained in:
@@ -76,7 +76,7 @@ import { hot } from 'react-hot-loader/root';
|
||||
import { Navigate, Route } from 'react-router';
|
||||
import { apis } from './apis';
|
||||
import { entityPage } from './components/catalog/EntityPage';
|
||||
import { HomePage } from './components/home/HomePage';
|
||||
import { homePage } from './components/home/HomePage';
|
||||
import { Root } from './components/Root';
|
||||
import { LowerCaseValuePickerFieldExtension } from './components/scaffolder/customScaffolderExtensions';
|
||||
import { searchPage } from './components/search/SearchPage';
|
||||
@@ -132,7 +132,7 @@ const routes = (
|
||||
<Navigate key="/" to="catalog" />
|
||||
{/* TODO(rubenl): Move this to / once its more mature and components exist */}
|
||||
<Route path="/home" element={<HomepageCompositionRoot />}>
|
||||
<HomePage />
|
||||
{homePage}
|
||||
</Route>
|
||||
<Route path="/catalog" element={<CatalogIndexPage />} />
|
||||
<Route
|
||||
|
||||
@@ -32,14 +32,8 @@ import {
|
||||
configApiRef,
|
||||
createApiFactory,
|
||||
errorApiRef,
|
||||
fetchApiRef,
|
||||
githubAuthApiRef,
|
||||
googleAuthApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import {
|
||||
GCalendarApiClient,
|
||||
gcalendarApiRef,
|
||||
} from '@backstage/plugin-gcalendar';
|
||||
|
||||
export const apis: AnyApiFactory[] = [
|
||||
createApiFactory({
|
||||
@@ -47,13 +41,8 @@ export const apis: AnyApiFactory[] = [
|
||||
deps: { configApi: configApiRef },
|
||||
factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi),
|
||||
}),
|
||||
ScmAuth.createDefaultApiFactory(),
|
||||
|
||||
createApiFactory({
|
||||
api: gcalendarApiRef,
|
||||
deps: { authApi: googleAuthApiRef, fetchApi: fetchApiRef },
|
||||
factory: deps => new GCalendarApiClient(deps),
|
||||
}),
|
||||
ScmAuth.createDefaultApiFactory(),
|
||||
|
||||
createApiFactory({
|
||||
api: graphQlBrowseApiRef,
|
||||
|
||||
@@ -48,7 +48,7 @@ const clockConfigs: ClockConfig[] = [
|
||||
},
|
||||
];
|
||||
|
||||
export const HomePage = () => (
|
||||
export const homePage = (
|
||||
<Page themeId="home">
|
||||
<Header title={<WelcomeTitle />} pageTitleOverride="Home">
|
||||
<HeaderWorldClock clockConfigs={clockConfigs} />
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
module.exports = {
|
||||
extends: [require.resolve('@backstage/cli/config/eslint')],
|
||||
};
|
||||
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
|
||||
|
||||
@@ -4,7 +4,8 @@ Plugin displays events from google calendar
|
||||
|
||||
## Getting started
|
||||
|
||||
The plugin exports a `gcalendarApiRef`. Add this to the App's `apis.ts`:
|
||||
The plugin exports `HomePageCalendar` widget for the Homepage.
|
||||
If your homepage is not static JSX add `gcalendarApiRef` to the App's `apis.ts`:
|
||||
|
||||
```ts
|
||||
import {
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "backstage-cli package start",
|
||||
"build": "backstage-cli package build",
|
||||
@@ -16,8 +19,7 @@
|
||||
"test": "backstage-cli package test",
|
||||
"lint": "backstage-cli package lint",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"diff": "backstage-cli plugin:diff"
|
||||
"postpack": "backstage-cli package postpack"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/core-components": "^0.9.1",
|
||||
|
||||
Reference in New Issue
Block a user