Skip to content

Commit

Permalink
integrate central config into storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Tilsch committed May 29, 2024
1 parent 368bf3d commit a5a72cf
Showing 1 changed file with 3 additions and 44 deletions.
47 changes: 3 additions & 44 deletions apps/exhibition-live/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
import theme from "../components/theme/berry-theme";
import { schema } from "@slub/exhibition-schema";
import { CssBaseline, ThemeProvider } from "@mui/material";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

import {
createNewIRI,
defaultJsonldContext,
defaultPrefix,
defaultQueryBuilderOptions,
sladb,
} from "../components/config/formConfigs";
import {
BASE_IRI,
declarativeMappings,
lobidTypemap,
primaryFieldsRegistry,
PUBLIC_BASE_PATH,
rendererRegistry,
makeDefaultUiSchemaForAllDefinitions,
} from "../components/config";
import { BASE_IRI, PUBLIC_BASE_PATH } from "../components/config";
import { AdbProvider, store } from "@slub/edb-state-hooks";
import { EntityDetailModal } from "../components/form/show";
import { EditEntityModal } from "../components/form/edit/EditEntityModal";
import { Provider } from "react-redux";
import { AppRouterContext } from "next/dist/shared/lib/app-router-context.shared-runtime";
import SemanticJsonForm from "../components/form/SemanticJsonForm";
import { materialCells } from "@jsonforms/material-renderers";
import { exhibitionConfig } from "../components/config/exhibitionAppConfig";

export const parameters = {
nextRouter: {
Expand Down Expand Up @@ -68,32 +52,7 @@ export const withMuiTheme = (Story) => {
return (
<Provider store={store}>
<AdbProvider
queryBuildOptions={defaultQueryBuilderOptions}
typeNameToTypeIRI={(name) => sladb(name).value}
propertyNameToIRI={(name) => sladb(name).value}
typeIRIToTypeName={(iri) => iri?.substring(BASE_IRI.length, iri.length)}
propertyIRIToPropertyName={(iri) =>
iri?.substring(BASE_IRI.length, iri.length)
}
createEntityIRI={createNewIRI}
jsonLDConfig={{
defaultPrefix: defaultPrefix,
jsonldContext: defaultJsonldContext,
allowUnsafeSourceIRIs: false,
}}
normDataMapping={{
gnd: {
mapping: declarativeMappings,
typeToTypeMap: lobidTypemap,
},
}}
schema={schema}
uiSchemaDefaultRegistry={makeDefaultUiSchemaForAllDefinitions(schema)}
rendererRegistry={rendererRegistry}
cellRendererRegistry={materialCells}
primaryFieldRendererRegistry={(typeIRI) =>
primaryFieldsRegistry(typeIRI, (name) => sladb(name).value)
}
{...exhibitionConfig}
env={{
publicBasePath: PUBLIC_BASE_PATH,
baseIRI: BASE_IRI,
Expand Down

0 comments on commit a5a72cf

Please sign in to comment.