Provide implementation of the api in the app instead
Signed-off-by: Marcus Eide <eide@spotify.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
createApiFactory,
|
||||
errorApiRef,
|
||||
githubAuthApiRef,
|
||||
WebStorage,
|
||||
} from '@backstage/core';
|
||||
import {
|
||||
ScmIntegrationsApi,
|
||||
@@ -33,6 +34,10 @@ import {
|
||||
graphQlBrowseApiRef,
|
||||
GraphQLEndpoints,
|
||||
} from '@backstage/plugin-graphiql';
|
||||
import {
|
||||
LocalStoredShortcuts,
|
||||
shortcutsApiRef,
|
||||
} from '@backstage/plugin-shortcuts';
|
||||
|
||||
export const apis: AnyApiFactory[] = [
|
||||
createApiFactory({
|
||||
@@ -61,4 +66,13 @@ export const apis: AnyApiFactory[] = [
|
||||
}),
|
||||
|
||||
createApiFactory(costInsightsApiRef, new ExampleCostInsightsClient()),
|
||||
|
||||
createApiFactory({
|
||||
api: shortcutsApiRef,
|
||||
deps: { errorApi: errorApiRef },
|
||||
factory: ({ errorApi }) =>
|
||||
new LocalStoredShortcuts(
|
||||
WebStorage.create({ namespace: '@backstage/shortcuts', errorApi }),
|
||||
),
|
||||
}),
|
||||
];
|
||||
|
||||
@@ -14,27 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
createApiFactory,
|
||||
createComponentExtension,
|
||||
createPlugin,
|
||||
errorApiRef,
|
||||
WebStorage,
|
||||
} from '@backstage/core';
|
||||
import { shortcutsApiRef, LocalStoredShortcuts } from './api';
|
||||
import { createComponentExtension, createPlugin } from '@backstage/core';
|
||||
|
||||
export const shortcutsPlugin = createPlugin({
|
||||
id: 'shortcuts',
|
||||
apis: [
|
||||
createApiFactory({
|
||||
api: shortcutsApiRef,
|
||||
deps: { errorApi: errorApiRef },
|
||||
factory: ({ errorApi }) =>
|
||||
new LocalStoredShortcuts(
|
||||
WebStorage.create({ namespace: '@backstage/shortcuts', errorApi }),
|
||||
),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
export const Shortcuts = shortcutsPlugin.provide(
|
||||
|
||||
Reference in New Issue
Block a user