remove some yarn.lock impurity in master by adjusting msw dep
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -13,7 +13,72 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { Content, Header, HeaderLabel, Page } from '@backstage/core-components';
|
||||
import { createDevApp } from '@backstage/dev-utils';
|
||||
import { EntityProvider } from '@backstage/plugin-catalog-react';
|
||||
import { TestApiProvider } from '@backstage/test-utils';
|
||||
import { Box, Typography } from '@material-ui/core';
|
||||
import SomeIcon from '@material-ui/icons/Storage';
|
||||
import React from 'react';
|
||||
import { VaultApi, vaultApiRef } from '../src/api';
|
||||
import { EntityVaultCard } from '../src/components/EntityVaultCard';
|
||||
import { EntityVaultTable } from '../src/components/EntityVaultTable';
|
||||
import { VAULT_SECRET_PATH_ANNOTATION } from '../src/constants';
|
||||
import { vaultPlugin } from '../src/plugin';
|
||||
|
||||
createDevApp().registerPlugin(vaultPlugin).render();
|
||||
const entity: Entity = {
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'Component',
|
||||
metadata: {
|
||||
name: 'backstage',
|
||||
annotations: { [VAULT_SECRET_PATH_ANNOTATION]: 'a/b' },
|
||||
},
|
||||
spec: {
|
||||
type: 'service',
|
||||
},
|
||||
};
|
||||
|
||||
const mockedApi: VaultApi = {
|
||||
async listSecrets() {
|
||||
return [
|
||||
{
|
||||
name: 'a::b',
|
||||
editUrl: 'https://example.com',
|
||||
showUrl: 'https://example.com',
|
||||
},
|
||||
{
|
||||
name: 'c::d',
|
||||
editUrl: 'https://example.com',
|
||||
showUrl: 'https://example.com',
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
createDevApp()
|
||||
.registerPlugin(vaultPlugin)
|
||||
.addPage({
|
||||
element: (
|
||||
<TestApiProvider apis={[[vaultApiRef, mockedApi]]}>
|
||||
<EntityProvider entity={entity}>
|
||||
<Page themeId="service">
|
||||
<Header title="Mocked Vault">
|
||||
<HeaderLabel label="Mode" value="Development" />
|
||||
</Header>
|
||||
<Content>
|
||||
<Typography variant="h3">As a card</Typography>
|
||||
<EntityVaultCard />
|
||||
<Box mt={4} />
|
||||
<Typography variant="h3">As a table</Typography>
|
||||
<EntityVaultTable entity={entity} />
|
||||
</Content>
|
||||
</Page>
|
||||
</EntityProvider>
|
||||
</TestApiProvider>
|
||||
),
|
||||
title: 'Vault',
|
||||
icon: SomeIcon,
|
||||
})
|
||||
.render();
|
||||
|
||||
Reference in New Issue
Block a user