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,"file":"bb8c8232-6486.4b2f65aa0218cd364901.js","mappings":"wMA8BA,QAV4B,IAAM,CAChC,MAAMA,KAAc,cAAW,GAA+B,EAE9D,GAAI,CAACA,EACH,MAAM,IAAI,MAAM,2EAA2E,EAG7F,OAAOA,CACT,C,wCCCA,QAV+BC,GAA6B,CAC1D,GAAKA,EAIL,OAAOA,EAAQ,SAAS,EAAE,QAAQ,CAAC,CAACC,EAAaC,CAAY,IAC3DA,EAAa,IAAKC,GAAU,GAAGF,CAAW,IAAIE,CAAK,EAAE,CACtD,EAAE,QAAQ,CACb,C,mGCeA,QApB2B,IAA6D,CACtF,KAAM,CAACC,EAAqBC,CAAsB,KAAI,iBAAc,UAAW,YAAU,EAEnFC,KAAmB,WAAQ,KAAOF,GAAA,KAAAA,EAAuB,CAAC,GAAG,OAAO,CAACG,EAAKC,IAAW,CAzB7F,MA0BI,KAAM,CAACP,EAAaQ,CAAW,EAAID,EAAO,MAAM,OAAO,EAEvD,OAAOD,EAAI,IAAIN,EAAa,CAAC,IAAI,EAAAM,EAAI,IAAIN,CAAW,IAAnB,OAAwB,CAAC,EAAIQ,CAAW,CAAC,CAC5E,KAAG,cAAkC,CAAC,EAAG,CAACL,CAAmB,CAAC,EAExDM,KAAkB,eAAaC,GAAgC,CACnE,MAAMC,EAAyBD,EAAW,SAAS,EAAE,OAAO,CAACJ,EAAK,CAACN,EAAaD,CAAO,IACrF,CAAC,GAAGO,EAAK,GAAGP,EAAQ,IAAKG,GAAU,GAAGF,CAAW,IAAIE,CAAK,EAAE,CAAC,EAC5D,CAAC,CAAC,EAELE,EAAuBO,CAAsB,CAC/C,EAAG,CAACP,CAAsB,CAAC,EAE3B,MAAO,CAACC,EAAkBI,CAAe,CAC3C,C,2ICtBO,MAAMG,EAAkB,CAAC,CAAE,KAAAC,CAAK,IAAiBA,IAAS,OACpDC,EAA+B,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AAAL,EACA,qBAAAI,CAAA,CAA4C,CAEpE,EACCJ,GACC,gBAAC,IAAc,QAASA,EACT,WAAAF,EACA,eAAAiB,EACA,eAAAM,EACA,qBAAAjB,CAAA,CAA4C,CAE/D,EApBO,IAsBX,EAEA6D,GAAc,aAAe,CAC3B,qBAAsB,MACxB,EC1GA,SD4GeA,E,0GEvFf,MAAMxD,EAAwB,CAAC,CAC7B,gBAAAmE,EACA,OAAAC,EACA,YAAAC,EACA,SAAAC,EACA,cAAAC,EACA,SAAAtK,EACA,eAAAuK,EACA,SAAUC,EACV,MAAAzK,CACF,IAAa,CACX,KAAM,CAACuG,EAAMC,CAAe,KAAI,YAAS,EAAK,EAExCC,EAAY,IAAM,CAClB,OAAOgE,GAAiB,YAC1BA,EAAa,CAAClE,CAAI,EAGpBC,EAAiBrE,GAAQ,CAACA,CAAG,CAC/B,EAEA,OACE,gBAAC,KAAgB,KAAAoE,EACA,cAAAgE,EACA,eAAAC,EACA,gBAAAL,EACA,YACE,gBAAC,OAAI,UAAW,sBAAsB5D,EAAO,OAAS,EAAE,IACtD,gBAAC,KAAO,OAAA6D,EACA,UAAU,kBACV,aAAYC,EACZ,MAAOA,EACP,SAAApK,CAAA,EACLD,EAAM,IAAC,gBAAC,KAAI,CAAC,KAAK,iBAAkB,EACvC,CACF,EAEF,UAAU,SACV,SAAUyG,CAAA,EACxB,OAAO6D,GAAa,WAAaA,EAAS,CAAE,eAAgB7D,CAAU,CAAC,EAAI6D,CAC9E,CAEJ,EAEAtE,EAAsB,aAAe,CACnC,gBAAiB,GACjB,OAAQ,OACR,YAAa,OACb,cAAe,GACf,SAAU,GACV,eAAgB,OAChB,SAAU,MACZ,EAEA,QAAeA,C","sources":["webpack://graylog-web-interface/./src/components/common/EntityDataTable/hooks/useExpandedSections.ts","webpack://graylog-web-interface/./src/components/common/EntityFilters/FiltersForQueryParams.ts","webpack://graylog-web-interface/./src/components/common/EntityFilters/hooks/useUrlQueryFilters.ts","webpack://graylog-web-interface/./src/components/common/EntityFilters/helpers/AttributeIdentification.ts","webpack://graylog-web-interface/./src/components/common/EntityFilters/FilterConfiguration/StaticOptionsList.tsx","webpack://graylog-web-interface/./src/hooks/useIsKeyHeld.ts","webpack://graylog-web-interface/./src/components/common/EntityFilters/hooks/useFilterValueSuggestions.ts","webpack://graylog-web-interface/./src/components/common/EntityFilters/FilterConfiguration/SuggestionsList.tsx","webpack://graylog-web-interface/./src/components/common/EntityFilters/helpers/timeRange.ts","webpack://graylog-web-interface/./src/components/common/EntityFilters/FilterConfiguration/DateRangeForm.tsx","webpack://graylog-web-interface/./src/components/common/EntityFilters/FilterConfiguration/FilterConfiguration.tsx","webpack://graylog-web-interface/./src/components/common/EntityFilters/FilterConfiguration/index.ts","webpack://graylog-web-interface/./src/components/common/EntityFilters/CreateFilterDropdown.tsx","webpack://graylog-web-interface/./src/components/common/EntityFilters/ActiveFilter.tsx","webpack://graylog-web-interface/./src/components/common/EntityFilters/Constants.ts","webpack://graylog-web-interface/./src/components/common/EntityFilters/ActiveFilters.tsx","webpack://graylog-web-interface/./src/components/common/EntityFilters/hooks/useFiltersWithTitle.ts","webpack://graylog-web-interface/./src/components/common/EntityFilters/EntityFilters.tsx","webpack://graylog-web-interface/./src/components/common/EntityFilters/index.ts","webpack://graylog-web-interface/./src/components/common/OverlayDropdownButton.tsx"],"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 { useContext } from 'react';\n\nimport ExpandedEntitiesSectionsContext from '../contexts/ExpandedSectionsContext';\n\nconst useExpandedSections = () => {\n const currentUser = useContext(ExpandedEntitiesSectionsContext);\n\n if (!currentUser) {\n throw new Error('useExpandedSections hook needs to be used inside ExpandedSectionsProvider');\n }\n\n return currentUser;\n};\n\nexport default useExpandedSections;\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 type { UrlQueryFilters } from 'components/common/EntityFilters/types';\n\n// Transform filters, so they can be used as URL query params, for example for the PaginationURL helper.\nconst FiltersForQueryParams = (filters: UrlQueryFilters) => {\n if (!filters) {\n return undefined;\n }\n\n return filters.entrySeq().flatMap(([attributeId, filterValues]) => (\n filterValues.map((value) => `${attributeId}:${value}`)\n )).toArray();\n};\n\nexport default FiltersForQueryParams;\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 { useQueryParam, ArrayParam } from 'use-query-params';\nimport { useMemo, useCallback } from 'react';\nimport { OrderedMap } from 'immutable';\n\nimport type { UrlQueryFilters } from 'components/common/EntityFilters/types';\n\nconst useUrlQueryFilters = (): [UrlQueryFilters, (filters: UrlQueryFilters) => void] => {\n const [pureUrlQueryFilters, setPureUrlQueryFilters] = useQueryParam('filters', ArrayParam);\n\n const filtersFromQuery = useMemo(() => (pureUrlQueryFilters ?? []).reduce((col, filter) => {\n const [attributeId, filterValue] = filter.split(/=(.*)/);\n\n return col.set(attributeId, [...(col.get(attributeId) ?? []), filterValue]);\n }, OrderedMap>()), [pureUrlQueryFilters]);\n\n const setFilterValues = useCallback((newFilters: UrlQueryFilters) => {\n const newPureUrlQueryFilters = newFilters.entrySeq().reduce((col, [attributeId, filters]) => (\n [...col, ...filters.map((value) => `${attributeId}=${value}`)]\n ), []);\n\n setPureUrlQueryFilters(newPureUrlQueryFilters);\n }, [setPureUrlQueryFilters]);\n\n return [filtersFromQuery, setFilterValues];\n};\n\nexport default useUrlQueryFilters;\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 type { Attribute } from 'stores/PaginationTypes';\n\nexport const isDateAttribute = ({ type }: Attribute) => type === 'DATE';\nexport const isAttributeWithFilterOptions = ({ filter_options }: Attribute) => !!filter_options?.length;\nexport const isAttributeWithRelatedCollection = ({ related_collection }: Attribute) => !!related_collection;\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 React from 'react';\n\nimport type { Attribute } from 'stores/PaginationTypes';\nimport MenuItem from 'components/bootstrap/MenuItem';\nimport { defaultCompare } from 'logic/DefaultCompare';\nimport type { Filters } from 'components/common/EntityFilters/types';\n\ntype Props = {\n allActiveFilters: Filters | undefined,\n attribute: Attribute,\n filterValueRenderer: (value: unknown, title: string) => React.ReactNode | undefined,\n onSubmit: (filter: { title: string, value: string }) => void,\n}\n\nconst StaticOptionsList = ({ allActiveFilters, attribute, filterValueRenderer, onSubmit }: Props) => (\n <>\n {attribute.filter_options\n .sort(({ title: title1 }, { title: title2 }) => defaultCompare(title1.toLowerCase(), title2.toLowerCase()))\n .map(({ title, value }) => {\n const disabled = !!allActiveFilters?.get(attribute.id)?.find(({ value: filterValue }) => value === filterValue);\n\n return (\n \n );\n })}\n >\n);\n\nexport default StaticOptionsList;\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 */\n\nimport { useState, useEffect } from 'react';\n\nconst useIsKeyHeld = (buttonKey: string) => {\n const [shiftHeld, setShiftHeld] = useState(false);\n\n useEffect(() => {\n function downHandler({ key }) {\n if (key === buttonKey) {\n setShiftHeld(true);\n }\n }\n\n function upHandler({ key }) {\n if (key === buttonKey) {\n setShiftHeld(false);\n }\n }\n\n window.addEventListener('keydown', downHandler);\n window.addEventListener('keyup', upHandler);\n\n return () => {\n window.removeEventListener('keydown', downHandler);\n window.removeEventListener('keyup', upHandler);\n };\n }, [setShiftHeld, buttonKey]);\n\n return shiftHeld;\n};\n\nexport default useIsKeyHeld;\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 { useQuery } from '@tanstack/react-query';\n\nimport UserNotification from 'util/UserNotification';\nimport PaginationURL from 'util/PaginationURL';\nimport fetch from 'logic/rest/FetchProvider';\nimport { qualifyUrl } from 'util/URLUtils';\n\nconst DEFAULT_DATA = {\n pagination: {\n total: 0,\n },\n suggestions: [],\n};\n\ntype SearchParams = {\n page: number,\n pageSize: number,\n query: string,\n}\n\ntype PaginatedSuggestions = {\n pagination: { total: number }\n suggestions: Array<{ id: string, value: string }>,\n}\n\nconst fetchFilterValueSuggestions = async (collection: string, { query, page, pageSize }: SearchParams): Promise => {\n const additional = {\n collection,\n column: 'title',\n };\n const url = PaginationURL('entity_suggestions', page, pageSize, query, additional);\n\n return fetch('GET', qualifyUrl(url));\n};\n\nconst useFilterValueSuggestions = (\n attributeId: string,\n collection: string,\n searchParams: SearchParams,\n): {\n data: PaginatedSuggestions | undefined\n isInitialLoading: boolean\n} => {\n if (!collection) {\n throw Error(`Attribute meta data for attribute \"${attributeId}\" is missing related collection.`);\n }\n\n const { data, isInitialLoading } = useQuery(['filters', 'suggestions', searchParams], () => fetchFilterValueSuggestions(collection, searchParams), {\n onError: (errorThrown) => {\n UserNotification.error(`Loading suggestions for filter failed with status: ${errorThrown}`,\n 'Could not load filter suggestions');\n },\n retry: 0,\n keepPreviousData: true,\n });\n\n return {\n data: data ?? DEFAULT_DATA,\n isInitialLoading,\n };\n};\n\nexport default useFilterValueSuggestions;\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 React, { useState, useCallback } from 'react';\nimport debounce from 'lodash/debounce';\nimport styled, { css } from 'styled-components';\n\nimport { Input, ListGroupItem } from 'components/bootstrap';\nimport type { Attribute } from 'stores/PaginationTypes';\nimport type { Filters, Filter } from 'components/common/EntityFilters/types';\nimport { PaginatedList, NoSearchResult } from 'components/common';\nimport useIsKeyHeld from 'hooks/useIsKeyHeld';\nimport useFilterValueSuggestions from 'components/common/EntityFilters/hooks/useFilterValueSuggestions';\nimport Spinner from 'components/common/Spinner';\n\nconst DEFAULT_SEARCH_PARAMS = {\n query: '',\n pageSize: 10,\n page: 1,\n};\n\nconst Container = styled.div(({ theme }) => css`\n color: ${theme.colors.global.textDefault};\n padding: 3px 10px;\n`);\n\nconst SearchInput = styled(Input)`\n margin-bottom: 6px;\n`;\n\nconst StyledListGroup = styled.div`\n margin-bottom: 0;\n`;\n\nconst Hint = styled.div(({ theme }) => css`\n margin-top: 9px;\n font-size: ${theme.fonts.size.small};\n`);\n\ntype Props = {\n allActiveFilters: Filters | undefined,\n attribute: Attribute,\n filter: Filter | undefined\n filterValueRenderer: (value: unknown, title: string) => React.ReactNode | undefined,\n onSubmit: (filter: { title: string, value: string }, closeDropdown: boolean) => void,\n}\n\nconst SuggestionsList = ({ attribute, filterValueRenderer, onSubmit, allActiveFilters, filter }: Props) => {\n const isShiftHeld = useIsKeyHeld('Shift');\n const [searchParams, setSearchParams] = useState(DEFAULT_SEARCH_PARAMS);\n const { data: { pagination, suggestions }, isInitialLoading } = useFilterValueSuggestions(attribute.id, attribute.related_collection, searchParams);\n const handleSearchChange = useCallback((newSearchQuery: string) => {\n setSearchParams((cur) => ({ ...cur, page: DEFAULT_SEARCH_PARAMS.page, query: newSearchQuery }));\n }, [setSearchParams]);\n\n const handlePaginationChange = useCallback((page: number) => {\n setSearchParams((cur) => ({ ...cur, page }));\n }, []);\n\n const debounceOnSearch = debounce((value: string) => handleSearchChange(value), 1000);\n\n return (\n \n debounceOnSearch(value)} />\n {isInitialLoading && }\n\n {!!suggestions?.length && (\n \n \n {suggestions.map((suggestion) => {\n const disabled = !!allActiveFilters?.get(attribute.id)?.find(({ value }) => value === suggestion.id);\n\n const onClick = () => {\n if (disabled) {\n return;\n }\n\n onSubmit({\n value: suggestion.id,\n title: suggestion.value,\n }, !isShiftHeld);\n };\n\n return (\n \n {filterValueRenderer ? filterValueRenderer(suggestion.id, suggestion.value) : suggestion.value}\n \n );\n })}\n \n \n )}\n\n {!suggestions?.length && No entities found}\n\n {!filter && (\n \n \n Hold Shift to select multiple\n \n \n )}\n \n );\n};\n\nexport default SuggestionsList;\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 */\nexport const DATE_SEPARATOR = '><';\nexport const extractRangeFromString = (timeRange: string) => timeRange.split(DATE_SEPARATOR);\n// from and until need to be in the user time zone.\nexport const timeRangeTitle = (from: string, until: string) => `${from || 'All time'} - ${until || 'Now'}`;\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 React from 'react';\nimport styled, { css } from 'styled-components';\nimport { Formik, Form, Field } from 'formik';\nimport moment from 'moment/moment';\n\nimport useUserDateTime from 'hooks/useUserDateTime';\nimport AbsoluteDateInput from 'views/components/searchbar/time-range-filter/time-range-picker/AbsoluteDateInput';\nimport { ModalSubmit } from 'components/common';\nimport { Checkbox } from 'components/bootstrap';\nimport { isValidDate, toUTCFromTz, adjustFormat } from 'util/DateTime';\nimport { DATE_SEPARATOR, extractRangeFromString, timeRangeTitle } from 'components/common/EntityFilters/helpers/timeRange';\n\nimport type { Filter } from '../types';\n\ntype FormValues = {\n from: string | undefined,\n until: string | undefined,\n}\n\nconst Container = styled.div`\n padding: 3px 10px;\n max-width: 250px;\n`;\n\nconst Info = styled.p(({ theme }) => css`\n font-size: ${theme.fonts.size.small};\n margin: 0 0 10px;\n`);\n\nconst Sections = styled.div`\n margin-bottom: 10px;\n`;\n\nconst Section = styled.div`\n &:not(:last-child) {\n margin-bottom: 10px;\n }\n`;\n\nconst SectionHeader = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 3px;\n`;\n\nconst StyledLabel = styled.label`\n margin: 0;\n`;\n\nconst StyledCheckbox = styled(Checkbox)`\n &.checkbox {\n margin: 0;\n }\n`;\n\nconst DateTimeFormat = styled.code`\n padding: 0;\n`;\n\nconst ErrorMessage = styled.span(({ theme }) => css`\n color: ${theme.colors.variant.dark.danger};\n font-size: ${theme.fonts.size.small};\n font-style: italic;\n padding: 3px 3px 9px;\n height: 1.5em;\n`);\n\nconst DateConfiguration = ({ name: fieldName, label, checkboxLabel }: {\n name: string,\n label: string,\n checkboxLabel: string\n}) => {\n const { formatTime } = useUserDateTime();\n\n return (\n \n {({ field: { value, onChange, name }, meta: { error } }) => {\n const _onChange = (newValue: string) => onChange({ target: { name, value: newValue } });\n const onChangeAllTime = () => _onChange(value ? undefined : formatTime(new Date(), 'complete'));\n\n return (\n
\n );\n }}\n \n );\n};\n\nconst useInitialValues = (filter: Filter | undefined) => {\n const { formatTime } = useUserDateTime();\n\n if (filter) {\n const [from, until] = extractRangeFromString(filter.value);\n\n return ({\n from: from ? formatTime(from, 'complete') : undefined,\n until: until ? formatTime(until, 'complete') : undefined,\n });\n }\n\n return {\n from: formatTime(moment().subtract(5, 'minutes'), 'complete'),\n until: undefined,\n };\n};\n\nconst formatError = 'Format must be: YYYY-MM-DD [HH:mm:ss[.SSS]].';\nconst rangeError = 'The \"Until\" date must come after the \"From\" date.';\n\nconst validate = (values: FormValues) => {\n let errors: {\n from?: string,\n until?: string,\n } = {};\n\n if (values.from && !isValidDate(values.from)) {\n errors = { ...errors, from: formatError };\n }\n\n if (values.until && !isValidDate(values.until)) {\n errors = { ...errors, until: formatError };\n }\n\n if (values.from >= values.until) {\n errors = { ...errors, until: rangeError };\n }\n\n if (values.from === undefined && values.until === undefined) {\n errors = { ...errors, from: 'Remove filter to search from \"All time\" until \"Now\".' };\n }\n\n return errors;\n};\n\ntype Props = {\n onSubmit: (filter: { title: string, value: string }) => void,\n filter: Filter | undefined,\n}\n\nconst DateRangeForm = ({ filter, onSubmit }: Props) => {\n const { userTimezone } = useUserDateTime();\n const initialValues = useInitialValues(filter);\n\n const _onSubmit = (formValues: FormValues) => {\n const toInternalTime = (date: string) => adjustFormat(toUTCFromTz(date, userTimezone), 'internal');\n const utcFrom = formValues.from ? toInternalTime(formValues.from) : '';\n const utcUntil = formValues.until ? toInternalTime(formValues.until) : '';\n\n onSubmit({\n title: timeRangeTitle(formValues.from, formValues.until),\n value: `${utcFrom}${DATE_SEPARATOR}${utcUntil}`,\n });\n };\n\n return (\n \n \n {({ isValid }) => (\n \n )}\n \n \n );\n};\n\nexport default DateRangeForm;\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 type { Attribute } from 'stores/PaginationTypes';\nimport type { Filters, Filter } from 'components/common/EntityFilters/types';\nimport MenuItem from 'components/bootstrap/MenuItem';\nimport {\n isAttributeWithFilterOptions,\n isAttributeWithRelatedCollection, isDateAttribute,\n} from 'components/common/EntityFilters/helpers/AttributeIdentification';\n\nimport StaticOptionsList from './StaticOptionsList';\nimport SuggestionsList from './SuggestionsList';\nimport DateRangeForm from './DateRangeForm';\n\ntype Props = {\n attribute: Attribute,\n filter?: Filter,\n filterValueRenderer: (value: Filter['value'], title: string) => React.ReactNode | undefined,\n onSubmit: (filter: { title: string, value: string }, closeDropdown?: boolean) => void,\n allActiveFilters: Filters | undefined,\n}\n\nexport const FilterConfiguration = ({\n allActiveFilters,\n attribute,\n filter,\n filterValueRenderer,\n onSubmit,\n}: Props) => (\n <>\n \n {isAttributeWithFilterOptions(attribute) && (\n \n )}\n {isAttributeWithRelatedCollection(attribute) && (\n \n )}\n {isDateAttribute(attribute) && (\n \n )}\n >\n);\n\nFilterConfiguration.defaultProps = {\n filter: undefined,\n};\n\nexport default FilterConfiguration;\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 FilterConfiguration from './FilterConfiguration';\n\nexport default FilterConfiguration;\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 React, { useState } from 'react';\nimport styled from 'styled-components';\n\nimport OverlayDropdownButton from 'components/common/OverlayDropdownButton';\nimport MenuItem from 'components/bootstrap/MenuItem';\nimport { HoverForHelp, Icon } from 'components/common';\nimport type { Attributes } from 'stores/PaginationTypes';\nimport type { Filters, Filter } from 'components/common/EntityFilters/types';\nimport FilterConfiguration from 'components/common/EntityFilters/FilterConfiguration';\n\nconst Container = styled.div`\n margin-left: 5px;\n`;\n\nconst AttributeSelect = ({\n attributes,\n setSelectedAttributeId,\n activeFilters,\n}: {\n attributes: Attributes,\n activeFilters: Filters | undefined,\n setSelectedAttributeId: React.Dispatch>\n}) => (\n <>\n \n {attributes.map(({ id, title, type }) => {\n const hasActiveFilter = !!activeFilters?.get(id)?.length;\n const disabled = type === 'BOOLEAN' ? hasActiveFilter : false;\n\n return (\n \n );\n })}\n >\n);\n\ntype Props = {\n filterableAttributes: Attributes,\n activeFilters: Filters | undefined,\n onCreateFilter: (attributeId: string, filter: Filter) => void,\n filterValueRenderers: { [attributeId: string]: (value: Filter['value'], title: string) => React.ReactNode } | undefined;\n}\n\nconst CreateFilterDropdown = ({ filterableAttributes, filterValueRenderers, onCreateFilter, activeFilters }: Props) => {\n const [selectedAttributeId, setSelectedAttributeId] = useState();\n const selectedAttribute = filterableAttributes.find(({ id }) => id === selectedAttributeId);\n const onToggleDropdown = () => setSelectedAttributeId(undefined);\n\n return (\n \n }\n bsSize=\"small\"\n buttonTitle=\"Create Filter\"\n onToggle={onToggleDropdown}\n closeOnSelect={false}\n dropdownZIndex={1000}>\n {({ toggleDropdown }) => {\n const _onCreateFilter = (filter: { title: string, value: string }, closeDropdown = true) => {\n if (closeDropdown) {\n toggleDropdown();\n }\n\n onCreateFilter(selectedAttributeId, { value: filter.value, title: filter.title });\n };\n\n if (!selectedAttributeId) {\n return (\n \n );\n }\n\n return (\n \n );\n }}\n \n \n );\n};\n\nexport default CreateFilterDropdown;\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 React, { useState } from 'react';\nimport styled from 'styled-components';\n\nimport { Button } from 'components/bootstrap';\nimport type { Attribute } from 'stores/PaginationTypes';\nimport { Icon } from 'components/common';\nimport type { Filter, Filters } from 'components/common/EntityFilters/types';\nimport OverlayDropdown from 'components/common/OverlayDropdown';\nimport FilterConfiguration from 'components/common/EntityFilters/FilterConfiguration';\n\nconst Container = styled.div`\n display: flex;\n`;\n\nconst CenteredButton = styled(Button)`\n display: flex;\n align-items: center;\n`;\n\ntype FilterValueDropdownProps = {\n attribute: Attribute,\n allActiveFilters: Filters | undefined,\n filter: Filter,\n filterValueRenderer: (value: Filter['value'], title: string) => React.ReactNode | undefined,\n onChangeFilter: (attributeId: string, prevValue: string, newFilter: Filter) => void,\n}\n\nconst FilterValueDropdown = ({ attribute, allActiveFilters, onChangeFilter, filterValueRenderer, filter }: FilterValueDropdownProps) => {\n const [show, setShowDropdown] = useState(false);\n const { value, title } = filter;\n\n const _onToggle = () => {\n setShowDropdown((cur) => !cur);\n };\n\n const onSubmit = (newFilter: { title: string, value: string }) => {\n onChangeFilter(attribute.id, value, { value: newFilter.value, title: newFilter.title });\n _onToggle();\n };\n\n return (\n \n {filterValueRenderer ? filterValueRenderer(value, title) : title}\n \n )}\n placement=\"bottom\"\n onToggle={_onToggle}>\n \n \n );\n};\n\ntype Props = {\n attribute: Attribute,\n filter: Filter,\n allActiveFilters: Filters | undefined\n filterValueRenderer: (value: string, title: string) => React.ReactNode | undefined,\n onChangeFilter: (attributeId: string, prevValue: string, newFilter: Filter) => void,\n onDeleteFilter: (attributeId: string, filterId: string) => void,\n}\n\nconst ActiveFilter = ({\n attribute,\n allActiveFilters,\n filter,\n filterValueRenderer,\n onDeleteFilter,\n onChangeFilter,\n}: Props) => {\n const { value, title } = filter;\n\n const onChangeBooleanValue = () => {\n if (attribute.type === 'BOOLEAN') {\n const oppositeFilterOption = attribute.filter_options.find(({ value: optionVal }) => optionVal !== value);\n onChangeFilter(attribute.id, value, { value: oppositeFilterOption.value, title: oppositeFilterOption.title });\n }\n };\n\n return (\n \n {attribute.type === 'BOOLEAN' && (\n \n {filterValueRenderer ? filterValueRenderer(value, title) : title}\n \n )}\n {attribute.type !== 'BOOLEAN' && (\n \n )}\n onDeleteFilter(attribute.id, value)} title=\"Delete filter\">\n \n \n \n );\n};\n\nexport default ActiveFilter;\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 */\n\n// eslint-disable-next-line import/prefer-default-export\nexport const ROW_MIN_HEIGHT = 34;\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 React from 'react';\nimport styled from 'styled-components';\n\nimport type { Filters, Filter } from 'components/common/EntityFilters/types';\nimport type { Attributes } from 'stores/PaginationTypes';\nimport ActiveFilter from 'components/common/EntityFilters/ActiveFilter';\nimport { ROW_MIN_HEIGHT } from 'components/common/EntityFilters/Constants';\n\nconst FilterGroup = styled.div`\n display: inline-flex;\n align-items: center;\n min-height: ${ROW_MIN_HEIGHT}px;\n gap: 3px;\n flex-wrap: wrap;\n`;\n\nconst FilterGroupTitle = styled.div`\n margin-right: 3px;\n`;\n\ntype Props = {\n attributes: Attributes,\n filterValueRenderers: { [attributeId: string]: (value: unknown, title: string) => React.ReactNode } | undefined,\n filters: Filters,\n onChangeFilter: (attributeId: string, prevValue: string, newFilter: Filter) => void,\n onDeleteFilter: (attributeId: string, filterValue: string) => void,\n}\n\nconst ActiveFilters = ({ attributes = [], filters, filterValueRenderers, onDeleteFilter, onChangeFilter }: Props) => (\n <>\n {filters.entrySeq().map(([attributeId, filterValues]) => {\n const attribute = attributes.find(({ id }) => id === attributeId);\n\n return (\n \n \n {attribute.title}:\n \n {filterValues.map((filter) => (\n \n ))}\n \n );\n })}\n >\n);\n\nexport default ActiveFilters;\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 { useQuery, useQueryClient } from '@tanstack/react-query';\nimport { useCallback } from 'react';\nimport { OrderedMap } from 'immutable';\n\nimport fetch from 'logic/rest/FetchProvider';\nimport URLUtils from 'util/URLUtils';\nimport UserNotification from 'util/UserNotification';\nimport useUserDateTime from 'hooks/useUserDateTime';\nimport type { UrlQueryFilters, Filters, Filter } from 'components/common/EntityFilters/types';\nimport type { Attributes, Attribute } from 'stores/PaginationTypes';\nimport type { DateTime } from 'util/DateTime';\nimport {\n isDateAttribute,\n isAttributeWithFilterOptions,\n isAttributeWithRelatedCollection,\n} from 'components/common/EntityFilters/helpers/AttributeIdentification';\nimport { timeRangeTitle, extractRangeFromString } from 'components/common/EntityFilters/helpers/timeRange';\n\ntype CollectionsByAttributeId = {\n [attributeId: string]: string | undefined\n}\n\ntype RequestedFilterTitles = Array<{\n id: string,\n title; string,\n type: string,\n}>\n\nconst _collectionsByAttributeId = (attributesMetaData: Attributes) => attributesMetaData?.reduce(\n (col, { id, related_collection }) => {\n if (!related_collection) {\n return col;\n }\n\n return {\n ...col,\n [id]: related_collection,\n };\n }, {});\n\nconst _urlQueryFiltersWithoutTitle = (filters: UrlQueryFilters, collectionsByAttributeId: CollectionsByAttributeId) => (\n filters.entrySeq().reduce((col, [attributeId, filterValues]) => {\n const relatedCollection = collectionsByAttributeId?.[attributeId];\n\n if (!relatedCollection) {\n return col;\n }\n\n return col.set(attributeId, filterValues);\n }, OrderedMap>())\n);\n\nconst filtersWithoutTitlePayload = (filtersWithoutTitle: UrlQueryFilters, collectionsByAttributeId: CollectionsByAttributeId) => ({\n entities: filtersWithoutTitle.entrySeq().reduce((col, [attributeId, filterValues]) => {\n const relatedCollection = collectionsByAttributeId[attributeId];\n\n return [\n ...col,\n ...filterValues.map((value) => ({\n id: value,\n type: relatedCollection,\n })),\n ];\n }, []),\n});\n\nconst filterTitle = (\n attribute: Attribute,\n requestedFilterTitles,\n filterValue: string,\n formatTime: (dateTime: DateTime) => string,\n notPermittedEntities: Array | undefined,\n isErrorFetchingTitles: boolean,\n) => {\n if (isDateAttribute(attribute)) {\n const [from, until] = extractRangeFromString(filterValue);\n\n const fromDate = from ? formatTime(from) : undefined;\n const untilDate = until ? formatTime(until) : undefined;\n\n return timeRangeTitle(fromDate, untilDate);\n }\n\n if (isAttributeWithFilterOptions(attribute)) {\n const relatedOption = attribute.filter_options.find(({ value }) => value === filterValue);\n\n return relatedOption?.title ?? filterValue;\n }\n\n if (isAttributeWithRelatedCollection(attribute)) {\n if (isErrorFetchingTitles || notPermittedEntities?.includes(filterValue)) {\n return filterValue;\n }\n\n const fetchedTitle = requestedFilterTitles?.find(({ id, type }) => (type === attribute.related_collection && id === filterValue))?.title;\n\n return fetchedTitle ?? 'Loading...';\n }\n\n return filterValue;\n};\n\nconst _allFiltersWithTitle = (\n urlQueryFilters: UrlQueryFilters,\n requestedFilterTitles: RequestedFilterTitles,\n attributesMetaData: Attributes,\n formatTime: (dateTime: DateTime) => string,\n notPermittedEntities: Array | undefined,\n isErrorFetchingTitles: boolean,\n): Filters => (\n urlQueryFilters.entrySeq().reduce((col, [attributeId, filterValues]) => {\n const relatedAttribute = attributesMetaData?.find(({ id }) => id === attributeId);\n const filtersWithTitle: Array = filterValues.map((value) => {\n const title = filterTitle(relatedAttribute, requestedFilterTitles, value, formatTime, notPermittedEntities, isErrorFetchingTitles);\n\n return ({\n title,\n value,\n });\n });\n\n return col.set(attributeId, filtersWithTitle);\n }, OrderedMap>())\n);\n\nconst filtersWithTitleToResponse = (filtersWithTitle: Filters, attributesMetaData: Attributes) => filtersWithTitle.entrySeq().reduce(\n (col, [_attributeId, filters]) => {\n const relatedCollection = attributesMetaData?.find(({ id }) => id === _attributeId)?.related_collection;\n\n if (!relatedCollection) {\n return col;\n }\n\n return [\n ...col,\n ...filters.map(({ value, title }) => ({ id: value, type: relatedCollection, title })),\n ];\n }, []);\n\nconst fetchFilterTitles = (payload: { entities: Array<{ id: string, type: string }> }) => (\n fetch('POST', URLUtils.qualifyUrl('/system/catalog/entities/titles'), payload)\n);\n\nconst useFiltersWithTitle = (\n urlQueryFilters: UrlQueryFilters,\n attributesMetaData: Attributes,\n enabled: boolean = true,\n): {\n data: Filters\n onChange: (newFiltersWithTitle: Filters, newUrlQueryFilters: UrlQueryFilters) => void,\n isInitialLoading: boolean,\n} => {\n const queryClient = useQueryClient();\n const { formatTime } = useUserDateTime();\n const collectionsByAttributeId = _collectionsByAttributeId(attributesMetaData);\n const urlQueryFiltersWithoutTitle = _urlQueryFiltersWithoutTitle(urlQueryFilters, collectionsByAttributeId);\n const payload = filtersWithoutTitlePayload(urlQueryFiltersWithoutTitle, collectionsByAttributeId);\n const { data, isInitialLoading, isError } = useQuery(\n ['entity_titles', payload],\n () => fetchFilterTitles(payload),\n {\n onError: (errorThrown) => {\n UserNotification.error(`Loading filter titles failed with status: ${errorThrown}`,\n 'Could not load streams');\n },\n keepPreviousData: true,\n enabled: enabled && !!payload.entities.length,\n },\n );\n\n const cachedResponse = queryClient.getQueryData(['entity_titles', payload]);\n const requestedFilterTitles = (cachedResponse ?? data)?.entities;\n const allFiltersWithTitle = _allFiltersWithTitle(urlQueryFilters, requestedFilterTitles, attributesMetaData, formatTime, data?.not_permitted_to_view, isError);\n\n const onChange = useCallback((newFiltersWithTitle: Filters, newUrlQueryFilters: UrlQueryFilters) => {\n const newURLQueryFiltersWithoutTitle = _urlQueryFiltersWithoutTitle(newUrlQueryFilters, collectionsByAttributeId);\n const newPayload = filtersWithoutTitlePayload(newURLQueryFiltersWithoutTitle, collectionsByAttributeId);\n const newResponse = filtersWithTitleToResponse(newFiltersWithTitle, attributesMetaData);\n\n queryClient.setQueryData(['entity_titles', newPayload], { entities: newResponse });\n }, [attributesMetaData, collectionsByAttributeId, queryClient]);\n\n return ({\n data: allFiltersWithTitle,\n isInitialLoading,\n onChange,\n });\n};\n\nexport default useFiltersWithTitle;\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 React, { useCallback } from 'react';\nimport styled from 'styled-components';\nimport { OrderedMap } from 'immutable';\n\nimport CreateFilterDropdown from 'components/common/EntityFilters/CreateFilterDropdown';\nimport type { Attributes } from 'stores/PaginationTypes';\nimport type { Filters, Filter, UrlQueryFilters } from 'components/common/EntityFilters/types';\nimport ActiveFilters from 'components/common/EntityFilters/ActiveFilters';\nimport useFiltersWithTitle from 'components/common/EntityFilters/hooks/useFiltersWithTitle';\n\nimport { ROW_MIN_HEIGHT } from './Constants';\n\nconst SUPPORTED_ATTRIBUTE_TYPES = ['STRING', 'BOOLEAN', 'DATE'];\n\nconst FilterCreation = styled.div`\n display: inline-flex;\n height: ${ROW_MIN_HEIGHT}px;\n align-items: center;\n margin-left: 5px;\n \n && {\n margin-right: 10px;\n }\n`;\n\ntype Props = {\n attributes: Attributes,\n\n urlQueryFilters: UrlQueryFilters | undefined,\n setUrlQueryFilters: (urlQueryFilters: UrlQueryFilters) => void,\n filterValueRenderers?: { [attributeId: string]: (value: Filter['value'], title: string) => React.ReactNode };\n}\n\nconst EntityFilters = ({ attributes = [], filterValueRenderers, urlQueryFilters, setUrlQueryFilters }: Props) => {\n const {\n data: activeFilters,\n onChange: onChangeFiltersWithTitle,\n } = useFiltersWithTitle(\n urlQueryFilters,\n attributes,\n !!attributes,\n );\n\n const filterableAttributes = attributes.filter(({ filterable, type }) => filterable && SUPPORTED_ATTRIBUTE_TYPES.includes(type));\n\n const onChangeFilters = useCallback((newFilters: Filters) => {\n const newUrlQueryFilters = newFilters.entrySeq().reduce((col, [attributeId, filterCol]) => (\n col.set(attributeId, [...col.get(attributeId) ?? [], ...filterCol.map(({ value }) => value)])\n ), OrderedMap>());\n\n onChangeFiltersWithTitle(newFilters, newUrlQueryFilters);\n setUrlQueryFilters(newUrlQueryFilters);\n }, [onChangeFiltersWithTitle, setUrlQueryFilters]);\n\n const onCreateFilter = useCallback((attributeId: string, filter: Filter) => {\n onChangeFilters(OrderedMap(activeFilters).set(\n attributeId,\n [...(activeFilters?.get(attributeId) ?? []), filter],\n ));\n }, [activeFilters, onChangeFilters]);\n\n const onDeleteFilter = useCallback((attributeId: string, filterId: string) => {\n const filterGroup = activeFilters.get(attributeId);\n const updatedFilterGroup = filterGroup.filter(({ value }) => value !== filterId);\n\n if (updatedFilterGroup.length) {\n return onChangeFilters(activeFilters.set(attributeId, updatedFilterGroup));\n }\n\n return onChangeFilters(activeFilters.remove(attributeId));\n }, [activeFilters, onChangeFilters]);\n\n const onChangeFilter = useCallback((attributeId: string, prevValue: string, newFilter: Filter) => {\n const filterGroup = activeFilters.get(attributeId);\n const targetFilterIndex = filterGroup.findIndex(({ value }) => value === prevValue);\n const updatedFilterGroup = [...filterGroup];\n updatedFilterGroup[targetFilterIndex] = newFilter;\n\n onChangeFilters(activeFilters.set(attributeId, updatedFilterGroup));\n }, [activeFilters, onChangeFilters]);\n\n if (!filterableAttributes.length) {\n return null;\n }\n\n return (\n <>\n \n Filters\n \n\n \n {activeFilters && (\n \n )}\n >\n );\n};\n\nEntityFilters.defaultProps = {\n filterValueRenderers: undefined,\n};\n\nexport default EntityFilters;\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 EntityFilters from './EntityFilters';\n\nexport default EntityFilters;\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 { useState } from 'react';\n\nimport Button from 'components/bootstrap/Button';\nimport OverlayDropdown from 'components/common/OverlayDropdown';\nimport type { BsSize } from 'components/bootstrap/types';\nimport { Icon } from 'components/common/index';\n\ntype Props = {\n alwaysShowCaret?: boolean,\n bsSize?: BsSize,\n buttonTitle?: string,\n children: React.ReactNode | ((payload: { toggleDropdown: () => void }) => React.ReactNode),\n closeOnSelect?: boolean,\n disabled?: boolean\n dropdownZIndex?: number,\n onToggle?: (isOpen: boolean) => void,\n title: React.ReactNode,\n};\n\n/**\n * This component is an alternative to the `DropdownButton` component and displays the dropdown in a portal.\n */\nconst OverlayDropdownButton = ({\n alwaysShowCaret,\n bsSize,\n buttonTitle,\n children,\n closeOnSelect,\n disabled,\n dropdownZIndex,\n onToggle: onToggleProp,\n title,\n}: Props) => {\n const [show, setShowDropdown] = useState(false);\n\n const _onToggle = () => {\n if (typeof onToggleProp === 'function') {\n onToggleProp(!show);\n }\n\n setShowDropdown((cur) => !cur);\n };\n\n return (\n \n \n