Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
{"version":3,"sources":["webpack:///./src/views/logic/views/UseCreateSavedSearch.ts","webpack:///./src/views/logic/views/UseLoadView.ts","webpack:///./src/views/pages/NewSearchPage.tsx"],"names":["useCreateSavedSearch","streamId","useMemo","ViewActions","create","View","Type","Search","then","view","useLoadView","query","loadingViewHooks","usePluginEntities","executingViewHooks","useState","loaded","setLoaded","undefined","hookComponent","setHookComponent","useEffect","processHooks","e","Error","NewSearchPage","location","HookComponent","propTypes","withLocation"],"mappings":"2GAAA,oDAwBeA,IAHc,SAACC,GAAD,OAAuBC,mBAAQ,kBAAMC,IAAYC,OAAOC,IAAKC,KAAKC,OAAQN,GACpGO,MAAK,qBAAGC,UAAkB,CAACR,M,iiCCgCfS,IA/BK,SAACD,EAAqBE,GACxC,IAAMC,EAAmBC,YAAkB,2BACrCC,EAAqBD,YAAkB,6BAF6B,IAI9CE,oBAAS,GAJqC,GAInEC,EAJmE,KAI3DC,EAJ2D,SAKhCF,wBAASG,GALuB,GAKnEC,EALmE,KAKpDC,EALoD,KA4B1E,OArBAC,qBAAU,WACRC,YACEb,EACAG,EACAE,EACAH,GACA,WACEM,GAAU,GACVG,OAAiBF,MAPrB,OASQ,SAACK,GACP,GAAIA,aAAaC,MACf,MAAMD,EAGRH,EAAiBG,QAIrB,CAACT,EAAoBF,EAAkBH,IAEhC,CAACO,EAAQG,K,wlCCrBlB,IAAMM,EAAgB,SAAC,GAAmC,IAArBd,EAAqB,EAAjCe,SAAYf,MAC7BF,EAAOT,cAD2C,IAExBU,YAAYD,EAAME,GAFM,GAEjDK,EAFiD,KAEzCW,EAFyC,KAIxD,OAAIA,IAICX,EAIE,gBAAC,IAAD,MAHE,gBAAC,KAAD,QAMXS,EAAcG,UAAY,GAEXC,sBAAaJ","file":"NewSearchPage.11b9f72925818240e61d.js","sourcesContent":["/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport { useMemo } from 'react';\n\nimport { ViewActions } from 'views/stores/ViewStore';\nimport View from 'views/logic/views/View';\n\nconst useCreateSavedSearch = (streamId?: string) => useMemo(() => ViewActions.create(View.Type.Search, streamId)\n .then(({ view: v }) => v), [streamId]);\n\nexport default useCreateSavedSearch;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport { useEffect, useState } from 'react';\n\nimport View from './View';\nimport { processHooks } from './ViewLoader';\n\nimport usePluginEntities from '../usePluginEntities';\n\nconst useLoadView = (view: Promise, query: { [key: string]: any }) => {\n const loadingViewHooks = usePluginEntities('views.hooks.loadingView');\n const executingViewHooks = usePluginEntities('views.hooks.executingView');\n\n const [loaded, setLoaded] = useState(false);\n const [hookComponent, setHookComponent] = useState(undefined);\n\n useEffect(() => {\n processHooks(\n view,\n loadingViewHooks,\n executingViewHooks,\n query,\n () => {\n setLoaded(true);\n setHookComponent(undefined);\n },\n ).catch((e) => {\n if (e instanceof Error) {\n throw e;\n }\n\n setHookComponent(e);\n });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [executingViewHooks, loadingViewHooks, view]);\n\n return [loaded, hookComponent];\n};\n\nexport default useLoadView;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\n\nimport withLocation from 'routing/withLocation';\nimport type { Location } from 'routing/withLocation';\nimport { Spinner } from 'components/common';\nimport useLoadView from 'views/logic/views/UseLoadView';\nimport useCreateSavedSearch from 'views/logic/views/UseCreateSavedSearch';\n\nimport SearchPage from './SearchPage';\n\ntype Props = {\n location: Location,\n};\n\nconst NewSearchPage = ({ location: { query } }: Props) => {\n const view = useCreateSavedSearch();\n const [loaded, HookComponent] = useLoadView(view, query);\n\n if (HookComponent) {\n return HookComponent;\n }\n\n if (!loaded) {\n return ;\n }\n\n return ;\n};\n\nNewSearchPage.propTypes = {};\n\nexport default withLocation(NewSearchPage);\n"],"sourceRoot":""}