All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.StreamSearchPage.11b9f72925818240e61d.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
{"version":3,"sources":["webpack:///./src/views/logic/views/UseCreateSavedSearch.ts","webpack:///./src/views/pages/StreamSearchPage.tsx","webpack:///./src/views/logic/views/UseLoadView.ts"],"names":["useCreateSavedSearch","streamId","useMemo","ViewActions","create","View","Type","Search","then","view","withParams","withLocation","params","query","location","newView","useLoadView","loaded","HookComponent","_loadNewView","useCallback","loadNewViewForStream","Error","loadNewView","loadingViewHooks","usePluginEntities","executingViewHooks","useState","setLoaded","undefined","hookComponent","setHookComponent","useEffect","processHooks","e"],"mappings":"2GAAA,oDAwBeA,IAHc,SAACC,GAAD,OAAuBC,mBAAQ,kBAAMC,IAAYC,OAAOC,IAAKC,KAAKC,OAAQN,GACpGO,MAAK,qBAAGC,UAAkB,CAACR,M,wnCCqCfS,sBAAWC,aAvBD,SAAC,GAAyD,IAA7CV,EAA6C,EAAvDW,OAAUX,SAAwBY,EAAqB,EAAjCC,SAAYD,MACtDE,EAAUf,YAAqBC,GAD4C,IAEjDe,YAAYD,EAASF,GAF4B,GAE1EI,EAF0E,KAElEC,EAFkE,KAI3EC,EAAeC,uBAAY,WAC/B,GAAInB,EACF,OAAOoB,YAAqBpB,GAG9B,MAAM,IAAIqB,MAAM,6BACf,CAACrB,IAEJ,OAAIiB,IAICD,EAIE,gBAAC,IAAD,CAAYM,YAAaJ,IAHvB,gBAAC,IAAD,Y,iiCCCIH,IA/BK,SAACP,EAAqBI,GACxC,IAAMW,EAAmBC,YAAkB,2BACrCC,EAAqBD,YAAkB,6BAF6B,IAI9CE,oBAAS,GAJqC,GAInEV,EAJmE,KAI3DW,EAJ2D,SAKhCD,wBAASE,GALuB,GAKnEC,EALmE,KAKpDC,EALoD,KA4B1E,OArBAC,qBAAU,WACRC,YACExB,EACAe,EACAE,EACAb,GACA,WACEe,GAAU,GACVG,OAAiBF,MAPrB,OASQ,SAACK,GACP,GAAIA,aAAaZ,MACf,MAAMY,EAGRH,EAAiBG,QAIrB,CAACR,EAAoBF,EAAkBf,IAEhC,CAACQ,EAAQa","file":"StreamSearchPage.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 * as React from 'react';\nimport { useCallback } from 'react';\n\nimport Spinner from 'components/common/Spinner';\nimport withParams from 'routing/withParams';\nimport useLoadView from 'views/logic/views/UseLoadView';\nimport useCreateSavedSearch from 'views/logic/views/UseCreateSavedSearch';\nimport withLocation from 'routing/withLocation';\nimport type { Location } from 'routing/withLocation';\nimport { loadNewViewForStream } from 'views/logic/views/Actions';\n\nimport SearchPage from './SearchPage';\n\ntype Props = {\n  location: Location,\n  params: {\n    streamId?: string,\n  },\n};\n\nconst StreamSearchPage = ({ params: { streamId }, location: { query } }: Props) => {\n  const newView = useCreateSavedSearch(streamId);\n  const [loaded, HookComponent] = useLoadView(newView, query);\n\n  const _loadNewView = useCallback(() => {\n    if (streamId) {\n      return loadNewViewForStream(streamId);\n    }\n\n    throw new Error('No stream id specified!');\n  }, [streamId]);\n\n  if (HookComponent) {\n    return HookComponent;\n  }\n\n  if (!loaded) {\n    return ;\n  }\n\n  return ;\n};\n\nexport default withParams(withLocation(StreamSearchPage));\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"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy