{"version":3,"sources":["webpack:///./packages/topology/src/redux/reducer.ts","webpack:///./packages/topology/src/utils/reducer.ts","webpack:///./packages/topology/src/topology-types.ts","webpack:///./packages/topology/src/filters/const.ts","webpack:///./packages/topology/src/redux/action.ts"],"names":["state","action","supportedFilters","map","f","id","supportedKinds","type","supportedTopologyFilters","set","payload","supportedTopologyKinds","topologyGraphModel","savedGraphModels","get","updatedGraphModels","namespace","graphModel","topology","TopologyViewType","TopologyDisplayFilterType","SHOW_GROUPING_HINT_EVENT","SHOW_POD_COUNT_FILTER_ID","SHOW_LABELS_FILTER_ID","EXPAND_APPLICATION_GROUPS_FILTER_ID","EXPAND_GROUPS_FILTER_ID","DEFAULT_TOPOLOGY_FILTERS","expand","labelKey","priority","value","show","DEFAULT_SUPPORTED_FILTER_IDS","Actions","setSupportedTopologyFilters","setSupportedTopologyKinds","setTopologyGraphModel","getTopologyGraphModel","plugins","devconsole"],"mappings":"8FAAA,gCAMe,KAACA,EAAcC,KAC5B,IAAKD,EACH,OAAO,cAAI,CACTE,iBAAkB,IAAyBC,IAAKC,GAAMA,EAAEC,IACxDC,eAAgB,KAIpB,GAAIL,EAAOM,OAAS,IAAQC,yBAC1B,OAAOR,EAAMS,IAAI,mBAAoBR,EAAOS,QAAQR,kBAGtD,GAAID,EAAOM,OAAS,IAAQI,uBAC1B,OAAOX,EAAMS,IAAI,iBAAkBR,EAAOS,QAAQJ,gBAGpD,GAAIL,EAAOM,OAAS,IAAQK,mBAAoB,CAC9C,MAAMC,EAAmBb,EAAMc,IAAI,sBAC7BC,EAAqB,OAAH,wBACnBF,GAAgB,CACnB,CAACZ,EAAOS,QAAQM,WAAYf,EAAOS,QAAQO,aAE7C,OAAOjB,EAAMS,IAAI,qBAAsBM,GAGzC,OAAOf,I,kCC/BT,+BAGe,oCAAgB,CAC7BkB,SAAU,O,kCCkCZ,IAAYC,EAyBAC,EAzBZ,+GAAYD,GACV,gBACA,cAFF,CAAYA,MAAgB,KAyB5B,SAAYC,GACV,cACA,kBACA,cAHF,CAAYA,MAAyB,KA+F9B,MAAMC,EAA2B,qB,kCC9JxC,0NAEO,MAAMC,EAA2B,iBAC3BC,EAAwB,cACxBC,EAAsC,oBACtCC,EAA0B,gBAE1BC,EAA2B,CACtC,CACEnB,KAAM,IAA0BoB,OAChCtB,GAAIoB,EAEJG,SAAU,yBACVC,SAAU,EACVC,OAAO,GAET,CACEvB,KAAM,IAA0BwB,KAChC1B,GAAIiB,EAEJM,SAAU,qBACVC,SAAU,GACVC,OAAO,GAET,CACEvB,KAAM,IAA0BwB,KAChC1B,GAAIkB,EAEJK,SAAU,kBACVC,SAAU,IACVC,OAAO,GAET,CACEvB,KAAM,IAA0BoB,OAChCtB,GAAImB,EAEJI,SAAU,iCACVC,SAAU,GACVC,OAAO,IAIEE,EAA+B,CAACV,EAA0BC,I,kCCzCvE,8KAGYU,EAHZ,SAGA,SAAYA,GACV,oCACA,sDACA,kDACA,0CAJF,CAAYA,MAAO,KAOZ,MAAMC,EAA+BhC,GACnC,iBAAO+B,EAAQzB,yBAA0B,CAAEN,qBAGvCiC,EAA6B7B,GACjC,iBAAO2B,EAAQtB,uBAAwB,CAAEL,mBAGrC8B,EAAwB,CAACpB,EAAmBC,IAChD,iBAAOgB,EAAQrB,mBAAoB,CAAEI,YAAWC,eAG5CoB,EAAwB,CAACrC,EAAkBgB,K,UACtD,MAAME,EAAqC,QAA1B,EAAc,QAAd,EAAAlB,aAAK,EAALA,EAAOsC,eAAO,eAAEC,kBAAU,eAAErB,SAC7C,OAA0C,QAAnC,EAAAA,aAAQ,EAARA,EAAUJ,IAAI,6BAAqB,eAAGE","file":"topology/code-refs/reduxReducer-chunk-45ea41ac5124c5ed0b05.min.js","sourcesContent":["import { Map } from 'immutable';\nimport { DEFAULT_TOPOLOGY_FILTERS } from '../filters/const';\nimport { TopologyAction, Actions } from './action';\n\ntype State = Map;\n\nexport default (state: State, action: TopologyAction) => {\n if (!state) {\n return Map({\n supportedFilters: DEFAULT_TOPOLOGY_FILTERS.map((f) => f.id),\n supportedKinds: {},\n });\n }\n\n if (action.type === Actions.supportedTopologyFilters) {\n return state.set('supportedFilters', action.payload.supportedFilters);\n }\n\n if (action.type === Actions.supportedTopologyKinds) {\n return state.set('supportedKinds', action.payload.supportedKinds);\n }\n\n if (action.type === Actions.topologyGraphModel) {\n const savedGraphModels = state.get('topologyGraphModel');\n const updatedGraphModels = {\n ...savedGraphModels,\n [action.payload.namespace]: action.payload.graphModel,\n };\n return state.set('topologyGraphModel', updatedGraphModels);\n }\n\n return state;\n};\n","import { combineReducers } from 'redux';\nimport filterReducer from '../redux/reducer';\n\nexport default combineReducers({\n topology: filterReducer,\n});\n","import * as React from 'react';\nimport {\n Graph,\n Node,\n Model,\n EdgeModel,\n NodeModel,\n EventListener,\n ModelKind,\n GraphElement,\n TopologyQuadrant,\n} from '@patternfly/react-topology';\nimport { WatchK8sResults } from '@console/dynamic-plugin-sdk';\nimport { K8sResourceKind, K8sResourceKindReference } from '@console/internal/module/k8s';\nimport { ExtPodKind, OverviewItem } from '@console/shared';\n\nexport type Point = [number, number];\n\nexport interface OdcNodeModel extends NodeModel {\n resource?: K8sResourceKind;\n resourceKind?: K8sResourceKindReference;\n}\n\nexport interface OdcEdgeModel extends EdgeModel {\n resource?: K8sResourceKind;\n resourceKind?: K8sResourceKindReference;\n}\n\nexport type TopologyResourcesObject = { [key: string]: K8sResourceKind[] };\n\nexport type TopologyDataResources = WatchK8sResults;\n\nexport type TopologyDataModelGetter = (\n namespace: string,\n resources: TopologyDataResources,\n workloads: K8sResourceKind[],\n) => Promise;\n\nexport enum TopologyViewType {\n graph = 'graph',\n list = 'list',\n}\nexport type ViewComponentFactory = (\n kind: ModelKind,\n type: string,\n view?: TopologyViewType,\n) => React.ComponentType<{ element: GraphElement }> | undefined;\n\nexport type TopologyDataModelDepicted = (resource: K8sResourceKind, model: Model) => boolean;\n\nexport type TopologyDataModelReconciler = (model: Model, resources: TopologyDataResources) => void;\n\nexport type CreateConnection = (\n source: Node,\n target: Node | Graph,\n) => Promise;\n\nexport type CreateConnectionGetter = (\n createHints: string[],\n source?: Node,\n target?: Node,\n) => CreateConnection;\n\nexport enum TopologyDisplayFilterType {\n show = 'show',\n expand = 'expand',\n kind = 'kind',\n}\n\nexport type TopologyDisplayOption = {\n type: TopologyDisplayFilterType;\n id: string;\n label?: string;\n labelKey?: string;\n priority: number;\n value: boolean;\n};\n\nexport type DisplayFilters = TopologyDisplayOption[];\n\n// Applies the filters on the model and returns the ids of filters that were relevant\nexport type TopologyApplyDisplayOptions = (model: Model, filters: DisplayFilters) => string[];\n\nexport type TopologyDecoratorGetter = (\n element: Node,\n radius: number,\n centerX: number,\n centerY: number,\n) => React.ReactElement;\n\nexport type TopologyDecorator = {\n id: string;\n priority: number;\n quadrant: TopologyQuadrant;\n decorator: TopologyDecoratorGetter;\n};\n\nexport interface TopologyDataObject {\n id: string;\n name: string;\n type: string;\n resources: OverviewItem;\n pods?: ExtPodKind[];\n data: D;\n resource: K8sResourceKind | null;\n groupResources?: OdcNodeModel[];\n}\n\nexport interface TopologyApplicationObject {\n id: string;\n name: string;\n resources: OdcNodeModel[];\n}\n\nexport interface WorkloadData {\n editURL?: string;\n vcsURI?: string;\n vcsRef?: string;\n builderImage?: string;\n kind?: string;\n isKnativeResource?: boolean;\n}\n\nexport type TrafficData = {\n nodes: KialiNode[];\n edges: KialiEdge[];\n};\n\nexport type KialiNode = {\n data: {\n id: string;\n nodeType: string;\n namespace: string;\n workload: string;\n app: string;\n version?: string;\n destServices?: { [key: string]: any }[];\n traffic?: { [key: string]: any }[];\n };\n};\n\nexport type KialiEdge = {\n data: {\n id: string;\n source: string;\n target: string;\n traffic: { [key: string]: any };\n };\n};\n\nexport type GraphData = {\n namespace: string;\n createResourceAccess: string[];\n eventSourceEnabled: boolean;\n createConnectorExtensions?: CreateConnectionGetter[];\n decorators?: { [key: string]: TopologyDecorator[] };\n};\n\nexport const SHOW_GROUPING_HINT_EVENT = 'show-regroup-hint';\nexport type ShowGroupingHintEventListener = EventListener<[Node, string]>;\n","import { TopologyDisplayFilterType } from '../topology-types';\n\nexport const SHOW_POD_COUNT_FILTER_ID = 'show-pod-count';\nexport const SHOW_LABELS_FILTER_ID = 'show-labels';\nexport const EXPAND_APPLICATION_GROUPS_FILTER_ID = 'expand-app-groups';\nexport const EXPAND_GROUPS_FILTER_ID = 'expand-groups';\n\nexport const DEFAULT_TOPOLOGY_FILTERS = [\n {\n type: TopologyDisplayFilterType.expand,\n id: EXPAND_GROUPS_FILTER_ID,\n // t('topology~Expand groups')\n labelKey: 'topology~Expand groups',\n priority: 1,\n value: true,\n },\n {\n type: TopologyDisplayFilterType.show,\n id: SHOW_POD_COUNT_FILTER_ID,\n // t('topology~Pod count')\n labelKey: 'topology~Pod count',\n priority: 10,\n value: false,\n },\n {\n type: TopologyDisplayFilterType.show,\n id: SHOW_LABELS_FILTER_ID,\n // t('topology~Labels')\n labelKey: 'topology~Labels',\n priority: 900,\n value: true,\n },\n {\n type: TopologyDisplayFilterType.expand,\n id: EXPAND_APPLICATION_GROUPS_FILTER_ID,\n // t('topology~Application groupings')\n labelKey: 'topology~Application groupings',\n priority: 10,\n value: true,\n },\n];\n\nexport const DEFAULT_SUPPORTED_FILTER_IDS = [SHOW_POD_COUNT_FILTER_ID, SHOW_LABELS_FILTER_ID];\n","import { GraphModel } from '@patternfly/react-topology';\nimport { action, ActionType } from 'typesafe-actions';\nimport { RootState } from '@console/internal/redux';\n\nexport enum Actions {\n topologyFilters = 'topologyFilters',\n supportedTopologyFilters = 'supportedTopologyFilters',\n supportedTopologyKinds = 'supportedTopologyKinds',\n topologyGraphModel = 'topologyGraphModel',\n}\n\nexport const setSupportedTopologyFilters = (supportedFilters: string[]) => {\n return action(Actions.supportedTopologyFilters, { supportedFilters });\n};\n\nexport const setSupportedTopologyKinds = (supportedKinds: { [key: string]: number }) => {\n return action(Actions.supportedTopologyKinds, { supportedKinds });\n};\n\nexport const setTopologyGraphModel = (namespace: string, graphModel: GraphModel) => {\n return action(Actions.topologyGraphModel, { namespace, graphModel });\n};\n\nexport const getTopologyGraphModel = (state: RootState, namespace: string): GraphModel => {\n const topology = state?.plugins?.devconsole?.topology;\n return topology?.get('topologyGraphModel')?.[namespace];\n};\n\nconst actions = {\n setSupportedTopologyFilters,\n setSupportedTopologyKinds,\n setTopologyGraphModel,\n};\n\nexport type TopologyAction = ActionType;\n"],"sourceRoot":""}