@@ -14,6 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { createDevApp } from '@backstage/dev-utils';
|
||||
import { gcalendarHomepagePlugin } from '../src/plugin';
|
||||
import { gcalendarPlugin } from '../src/plugin';
|
||||
|
||||
createDevApp().registerPlugin(gcalendarHomepagePlugin).render();
|
||||
createDevApp().registerPlugin(gcalendarPlugin).render();
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@backstage/plugin-gcalendar-homepage",
|
||||
"version": "0.0.0",
|
||||
"name": "@backstage/plugin-gcalendar",
|
||||
"version": "0.1.0",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
+2
-2
@@ -23,7 +23,7 @@ import {
|
||||
} from '@backstage/test-utils';
|
||||
|
||||
import { CalendarCardContainer } from '.';
|
||||
import { gcalendarApiRef, gcalendarHomepagePlugin } from '../..';
|
||||
import { gcalendarApiRef, gcalendarPlugin } from '../..';
|
||||
|
||||
describe('<CalendarCard />', () => {
|
||||
const primaryCalendar = {
|
||||
@@ -130,7 +130,7 @@ describe('<CalendarCard />', () => {
|
||||
|
||||
it('should select stored calendar', async () => {
|
||||
mockStorage
|
||||
.forBucket(gcalendarHomepagePlugin.getId())
|
||||
.forBucket(gcalendarPlugin.getId())
|
||||
.set('google_calendars_selected', [nonPrimaryCalendar.id]);
|
||||
|
||||
const rendered = await renderInTestApp(
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
import { useApi, storageApiRef } from '@backstage/core-plugin-api';
|
||||
import { useObservable } from 'react-use';
|
||||
|
||||
import { gcalendarHomepagePlugin } from '../plugin';
|
||||
import { gcalendarPlugin } from '../plugin';
|
||||
|
||||
export enum LocalStorageKeys {
|
||||
selectedCalendars = 'google_calendars_selected',
|
||||
@@ -25,7 +25,7 @@ export enum LocalStorageKeys {
|
||||
export function useStoredCalendars(
|
||||
defaultValue: string[],
|
||||
): [string[], (value: string[]) => void] {
|
||||
const storageBucket = gcalendarHomepagePlugin.getId();
|
||||
const storageBucket = gcalendarPlugin.getId();
|
||||
const storageKey = LocalStorageKeys.selectedCalendars;
|
||||
const storageApi = useApi(storageApiRef).forBucket(storageBucket);
|
||||
const setValue = (value: string[]) => {
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 265 B |
@@ -13,5 +13,5 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export { gcalendarHomepagePlugin, CalendarCard } from './plugin';
|
||||
export { gcalendarPlugin, CalendarCard } from './plugin';
|
||||
export * from './api';
|
||||
+2
-2
@@ -13,10 +13,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { gcalendarHomepagePlugin } from './plugin';
|
||||
import { gcalendarPlugin } from './plugin';
|
||||
|
||||
describe('gcalendar-homepage', () => {
|
||||
it('should export plugin', () => {
|
||||
expect(gcalendarHomepagePlugin).toBeDefined();
|
||||
expect(gcalendarPlugin).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
import { GCalendarApiClient, gcalendarApiRef } from './api';
|
||||
import { rootRouteRef } from './routes';
|
||||
|
||||
export const gcalendarHomepagePlugin = createPlugin({
|
||||
export const gcalendarPlugin = createPlugin({
|
||||
id: 'gcalendar-homepage',
|
||||
routes: {
|
||||
root: rootRouteRef,
|
||||
@@ -40,7 +40,7 @@ export const gcalendarHomepagePlugin = createPlugin({
|
||||
],
|
||||
});
|
||||
|
||||
export const CalendarCard = gcalendarHomepagePlugin.provide(
|
||||
export const CalendarCard = gcalendarPlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'CalendarCard',
|
||||
component: {
|
||||
Reference in New Issue
Block a user