Skip to content

Commit

Permalink
add pageprops
Browse files Browse the repository at this point in the history
  • Loading branch information
buremba committed May 18, 2024
1 parent cef05fa commit b3b7809
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/ui/packages/core/src/components/pages/exposure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ export function ExposurePage() {
}

const spread = typeof dbt == "string" ? [dbt] : (dbt || [])
const [_, package_name, version, name, action, id] = spread
const [feature, package_name, version, name, action, id] = spread

const {resource} = useResource(`exposure.${package_name}.${name}`);
const {resource} = useResource(`${feature}.${package_name}.${name}`);
debugger
const type = resource?.meta?.type;
const schemaProvider = useJinjatProvider();

Expand Down Expand Up @@ -80,12 +81,13 @@ export function ExposurePage() {
}

if (data.method == 'get') {
debugger
return <JinjatList title={resource?.meta?.label || spread[1]}
logo={resource?.meta?.jinjat.logo || <div/>} packageName={package_name}
resources={{list: analysis_name}}
enableActions={false}
version={version}
{...resource?.meta?.jinjat?.refine?.props.get} />
{...resource?.meta?.jinjat?.refine?.props?.get} />
} else {
return <JinjatCreate title={resource?.meta?.label || spread[1]}
logo={resource?.meta?.jinjat.logo || <div/>} packageName={package_name}
Expand All @@ -102,6 +104,7 @@ export function ExposurePage() {
}
}

debugger
return <div>404</div>;
}

Expand Down
10 changes: 6 additions & 4 deletions src/ui/packages/nextjs-spa/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { JinjatApp } from "@jinjatdata/core";
import { ExtendedAppProps, JinjatApp } from "@jinjatdata/core";
import { useMemo } from "react";

export default function App ({...props}) {
export default function App ({Component, pageProps} : ExtendedAppProps) {
const host = process.env.JINJAT_HOST || "http://127.0.0.1:8581"

return useMemo(
() => <JinjatApp {...props} apiUrl={process.env.JINJAT_HOST}/>,
[props]
() => <JinjatApp Component={Component} pageProps={pageProps} apiUrl={host}/>,
[pageProps]
);
}

0 comments on commit b3b7809

Please sign in to comment.