Update Link->Leafcutter integration
This commit is contained in:
parent
baa1b32737
commit
495e8338b9
31 changed files with 239 additions and 343 deletions
|
|
@ -4,7 +4,6 @@ import { Client } from "@opensearch-project/opensearch";
|
|||
import Head from "next/head";
|
||||
import { Layout } from "components/Layout";
|
||||
import { VisualizationDetail } from "components/VisualizationDetail";
|
||||
import { checkAuth } from "lib/checkAuth";
|
||||
|
||||
type VisualizationProps = {
|
||||
visualization: any;
|
||||
|
|
@ -24,12 +23,6 @@ export default Visualization;
|
|||
export const getServerSideProps: GetServerSideProps = async (
|
||||
context: GetServerSidePropsContext
|
||||
) => {
|
||||
const res: any = await checkAuth(context);
|
||||
|
||||
if (res.redirect) {
|
||||
return res;
|
||||
}
|
||||
|
||||
const { visualizationID } = context.query;
|
||||
|
||||
const node = `https://${process.env.OPENSEARCH_USERNAME}:${process.env.OPENSEARCH_PASSWORD}@${process.env.OPENSEARCH_URL}`;
|
||||
|
|
@ -51,7 +44,7 @@ export const getServerSideProps: GetServerSideProps = async (
|
|||
(hit: any) => hit._id.split(":")[1] === visualizationID[0]
|
||||
);
|
||||
const hit = hits[0];
|
||||
res.props.visualization = {
|
||||
const visualization = {
|
||||
id: hit._id.split(":")[1],
|
||||
title: hit._source.visualization.title,
|
||||
description: hit._source.visualization.description,
|
||||
|
|
@ -60,5 +53,5 @@ export const getServerSideProps: GetServerSideProps = async (
|
|||
}?embed=true`,
|
||||
};
|
||||
|
||||
return res;
|
||||
return { props: { visualization } };
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue