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iB,CACtD,CACF,GACCJ,GAAA,YAAAA,EAAY,SAAU,GACrB,gBAAC,KAAe,KAAC,yCAEjB,EAED,CAAC,EAAC/C,GAAA,MAAAA,EAAM,SACP,gBAACwD,EAAA,GAA0C,KAAMxD,EACN,eAAgBkC,EAAa,oBAC7B,aAAcR,EAAe,aAC7B,gBAAAmB,GACA,aAAAF,GACA,WAAYT,EAAa,KACzB,SAAUhD,EAAa,SACvB,iBAAAuD,GACA,iBAAkB,IAClB,gBAAiBa,GACjB,kBAAmB9D,EACnB,yBAAA6D,GACA,WAAY,GAAgB,CAE3E,CAEJ,ECzHA,GAN4B,IAC1B,gBAAC,IAAa,CAAC,GAAIpC,EAAA,GAAO,OAAO,QAAQ,oBAAoB,QAC3D,gBAAC,SAAM,CAAC,QAAQ,WAAU,gBAAc,CAC1C,E,sCCwCF,SArCsC,IAAM,CAC1C,MAAMwC,KAAW,eAAY,EACvBC,KAAuBC,GAAA,GAA4B,EAEzD,sBAAU,IAAM,CACTD,EAGH,KAAiB,KAAK,EAAK,EAF3BD,EAASxC,EAAA,GAAO,QAAQ,CAI5B,EAAG,CAACyC,EAAsBD,CAAQ,CAAC,EAGjC,gBAAC,KAAa,CAAC,MAAM,iCACnB,gBAAC,MAAqB,IAAC,EACvB,gBAAC,MAAW,MAAM,gCACN,kBAAmB,CACjB,MAAO,4BACP,KAAMG,EAAA,EAAW,MAAM,WACzB,EACA,QAAS,gBAAC,GAAmB,IAAC,GACxC,gBAAC,YAAK,uMAIN,CACF,EAEA,gBAAC,MAAG,CAAC,UAAU,WACb,gBAAC,MAAG,CAAC,GAAI,IACP,gBAAC,GAAY,IAAC,CAChB,CACF,CACF,CAEJ,C","sources":["webpack://graylog-web-interface/./src/components/common/EntityDataTable/MoreActions.tsx","webpack://graylog-web-interface/./src/components/indices/IndexSetFieldTypeProfiles/hooks/useProfileMutations.ts","webpack://graylog-web-interface/./src/components/indices/IndexSetFieldTypeProfiles/hooks/useProfiles.ts","webpack://graylog-web-interface/./src/components/indices/IndexSetFieldTypeProfiles/CustomFieldTypesList.tsx","webpack://graylog-web-interface/./src/components/indices/IndexSetFieldTypeProfiles/ExpandedCustomFieldTypes.tsx","webpack://graylog-web-interface/./src/components/indices/IndexSetFieldTypeProfiles/ExpandedSectionsRenderer.tsx","webpack://graylog-web-interface/./src/components/indices/IndexSetFieldTypeProfiles/cells/CustomFieldMappingsCell.tsx","webpack://graylog-web-interface/./src/components/indices/IndexSetFieldTypeProfiles/cells/IndexSetsCell.tsx","webpack://graylog-web-interface/./src/components/indices/IndexSetFieldTypeProfiles/helpers/useCustomColumnRenderers.tsx","webpack://graylog-web-interface/./src/components/indices/IndexSetFieldTypeProfiles/ProfileActions.tsx","webpack://graylog-web-interface/./src/components/indices/IndexSetFieldTypeProfiles/helpers/profileActions.tsx","webpack://graylog-web-interface/./src/components/indices/IndexSetFieldTypeProfiles/ProfilesList.tsx","webpack://graylog-web-interface/./src/components/indices/IndexSetFieldTypeProfiles/CreateProfileButton.tsx","webpack://graylog-web-interface/./src/pages/IndexSetFieldTypeProfilesPage.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 * as React from 'react';\n\nimport DropdownButton from 'components/bootstrap/DropdownButton';\n\nimport { MORE_ACTIONS_TITLE, MORE_ACTIONS_HOVER_TITLE } from './Constants';\n\ntype Props = React.PropsWithChildren<{\n disabled?: boolean,\n}>\nconst MoreActions = ({ children, disabled }: Props) => (\n \n {children}\n \n);\n\nMoreActions.defaultProps = {\n disabled: false,\n};\n\nexport default MoreActions;\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 { useMutation, useQueryClient } from '@tanstack/react-query';\n\nimport { qualifyUrl } from 'util/URLUtils';\nimport fetch from 'logic/rest/FetchProvider';\nimport UserNotification from 'util/UserNotification';\nimport type {\n IndexSetFieldTypeProfileForm,\n IndexSetFieldTypeProfileRequestJson,\n} from 'components/indices/IndexSetFieldTypeProfiles/types';\n\nexport const urlPrefix = '/system/indices/index_sets/profiles';\n\nconst putProfile = async ({ profile, id }: { profile: IndexSetFieldTypeProfileForm, id: string }) => {\n const url = qualifyUrl(urlPrefix);\n const body: IndexSetFieldTypeProfileRequestJson = {\n id,\n name: profile.name,\n description: profile.description,\n custom_field_mappings: profile.customFieldMappings,\n };\n\n return fetch('PUT', url, body);\n};\n\nconst postProfile = async (profile: IndexSetFieldTypeProfileForm) => {\n const url = qualifyUrl(urlPrefix);\n const body: IndexSetFieldTypeProfileRequestJson = {\n name: profile.name,\n description: profile.description,\n custom_field_mappings: profile.customFieldMappings,\n };\n\n return fetch('POST', url, body);\n};\n\nconst deleteProfile = async (id: string) => {\n const url = qualifyUrl(`${urlPrefix}/${id}`);\n\n return fetch('DELETE', url);\n};\n\nconst useProfileMutation = () => {\n const queryClient = useQueryClient();\n\n const post = useMutation(postProfile, {\n onError: (errorThrown) => {\n UserNotification.error(`Creating index set field type profile failed with status: ${errorThrown}`,\n 'Could not create index set field type profile');\n },\n onSuccess: () => {\n UserNotification.success('Index set field type profile has been successfully created.', 'Success!');\n\n return queryClient.refetchQueries({ queryKey: ['indexSetFieldTypeProfiles'], type: 'active' });\n },\n });\n const put = useMutation(putProfile, {\n onError: (errorThrown) => {\n UserNotification.error(`Updating index set field type profile failed with status: ${errorThrown}`,\n 'Could not update index set field type profile');\n },\n onSuccess: () => {\n UserNotification.success('Index set field type profile has been successfully updated.', 'Success!');\n\n return queryClient.refetchQueries({ queryKey: ['indexSetFieldTypeProfiles'], type: 'active' });\n },\n });\n const remove = useMutation(deleteProfile, {\n onError: (errorThrown) => {\n UserNotification.error(`Deleting index set field type profile failed with status: ${errorThrown}`,\n 'Could not delete index set field type profile');\n },\n onSuccess: () => {\n UserNotification.success('Index set field type profile has been successfully deleted.', 'Success!');\n\n return queryClient.refetchQueries({ queryKey: ['indexSetFieldTypeProfiles'], type: 'active' });\n },\n });\n\n return ({\n editProfile: put.mutateAsync,\n isEditLoading: put.isLoading,\n createProfile: post.mutateAsync,\n isCreateLoading: post.isLoading,\n isLoading: post.mutateAsync || post.isLoading || remove.isLoading,\n deleteProfile: remove.mutateAsync,\n });\n};\n\nexport default useProfileMutation;\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 fetch from 'logic/rest/FetchProvider';\nimport { qualifyUrl } from 'util/URLUtils';\nimport type { Attribute, SearchParams } from 'stores/PaginationTypes';\nimport PaginationURL from 'util/PaginationURL';\nimport FiltersForQueryParams from 'components/common/EntityFilters/FiltersForQueryParams';\nimport type {\n IndexSetFieldTypeProfileJson,\n IndexSetFieldTypeProfile,\n} from 'components/indices/IndexSetFieldTypeProfiles/types';\n\nconst INITIAL_DATA = {\n pagination: { total: 0 },\n list: [],\n attributes: [],\n};\n\nconst fetchIndexSetFieldTypeProfiles = async (searchParams: SearchParams) => {\n const indexSetFieldTypeUrl = qualifyUrl('/system/indices/index_sets/profiles/paginated');\n const url = PaginationURL(\n indexSetFieldTypeUrl,\n searchParams.page,\n searchParams.pageSize,\n searchParams.query,\n { filters: FiltersForQueryParams(searchParams.filters), sort: searchParams.sort.attributeId, order: searchParams.sort.direction });\n\n return fetch('GET', url).then(\n ({ elements, total, attributes }) => ({\n list: elements.map((profile: IndexSetFieldTypeProfileJson) => ({\n id: profile.id,\n name: profile.name,\n description: profile.description,\n customFieldMappings: profile.custom_field_mappings,\n indexSetIds: profile.index_set_ids,\n })),\n pagination: { total },\n attributes: [...attributes, {\n id: 'index_set_ids',\n searchable: false,\n sortable: false,\n title: 'Used in',\n type: 'STRING',\n }],\n }));\n};\n\nconst useProfiles = (searchParams: SearchParams, { enabled }): {\n data: {\n list: Readonly>,\n pagination: { total: number },\n attributes: Array\n },\n isLoading: boolean,\n refetch: () => void,\n} => {\n const { data, isLoading, refetch } = useQuery(\n ['indexSetFieldTypeProfiles', searchParams],\n () => fetchIndexSetFieldTypeProfiles(searchParams),\n {\n onError: (errorThrown) => {\n UserNotification.error(`Loading index field type profiles failed with status: ${errorThrown}`,\n 'Could not load index field type profiles');\n },\n keepPreviousData: true,\n enabled,\n },\n );\n\n return ({\n data: data ?? INITIAL_DATA,\n isLoading,\n refetch,\n });\n};\n\nexport default useProfiles;\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 { CustomFieldMapping } from 'components/indices/IndexSetFieldTypeProfiles/types';\nimport type { FieldTypes } from 'views/logic/fieldactions/ChangeFieldType/types';\n\nconst Item = styled.div`\n display: flex;\n gap: 5px;\n flex-wrap: wrap;\n`;\n\nconst List = styled.div`\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1em;\n`;\nconst CustomFieldTypesList = ({ list, fieldTypes }: { list: Array, fieldTypes: FieldTypes }) => (\n \n {list.map(({ field, type }) => (\n - \n {field}:{fieldTypes[type]}\n
\n ))}\n
\n);\n\nexport default CustomFieldTypesList;\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 { IndexSetFieldTypeProfile } from 'components/indices/IndexSetFieldTypeProfiles/types';\nimport CustomFieldTypesList from 'components/indices/IndexSetFieldTypeProfiles/CustomFieldTypesList';\nimport useFieldTypesForMappings from 'views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypesForMappings';\n\ntype Props = {\n customFieldMappings: IndexSetFieldTypeProfile['customFieldMappings'],\n}\n\nconst ExpandedCustomFieldTypes = ({ customFieldMappings }: Props) => {\n const { data: { fieldTypes } } = useFieldTypesForMappings();\n\n return (\n \n );\n};\n\nexport default ExpandedCustomFieldTypes;\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 { IndexSetFieldTypeProfile } from 'components/indices/IndexSetFieldTypeProfiles/types';\nimport ExpandedCustomFieldTypes from 'components/indices/IndexSetFieldTypeProfiles/ExpandedCustomFieldTypes';\n\nconst useExpandedSectionsRenderer = () => ({\n customFieldMapping: {\n title: 'Custom Field Mappings',\n content: ({ customFieldMappings }: IndexSetFieldTypeProfile) => (\n \n ),\n },\n});\n\nexport default useExpandedSectionsRenderer;\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 { CustomFieldMapping, IndexSetFieldTypeProfile } from 'components/indices/IndexSetFieldTypeProfiles/types';\nimport useExpandedSections from 'components/common/EntityDataTable/hooks/useExpandedSections';\nimport { CountBadge } from 'components/common';\n\nconst StyledCountBadge = styled(CountBadge)`\n cursor: pointer;\n`;\n\nconst CustomFieldMappingsCell = ({ customFieldTypes, profile }: { customFieldTypes : Array, profile: IndexSetFieldTypeProfile }) => {\n const { toggleSection } = useExpandedSections();\n\n return (\n toggleSection(profile.id, 'customFieldMapping')}>{customFieldTypes.length} \n );\n};\n\nexport default CustomFieldMappingsCell;\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 { Link } from 'components/common/router';\nimport Routes from 'routing/Routes';\nimport useCurrentUser from 'hooks/useCurrentUser';\nimport { isPermitted } from 'util/PermissionsMixin';\n\nconst List = styled.div`\n display: flex;\n flex-wrap: wrap;\n`;\n\nconst IndexSetsCell = ({ indexSetIds, normalizedIndexSetsTitles }: { indexSetIds : Array, normalizedIndexSetsTitles: Record }) => {\n const currentUser = useCurrentUser();\n\n if (!isPermitted(currentUser.permissions, ['indexsets:read'])) {\n return null;\n }\n\n return (\n \n {indexSetIds\n .map((indexSetId, index) => {\n const isLast = index === indexSetIds.length - 1;\n\n return (\n <>\n \n {normalizedIndexSetsTitles[indexSetId]}\n \n {!isLast && ', '}\n >\n );\n },\n )}\n
\n );\n};\n\nexport default IndexSetsCell;\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, { useMemo } from 'react';\n\nimport type { CustomFieldMapping, IndexSetFieldTypeProfile } from 'components/indices/IndexSetFieldTypeProfiles/types';\nimport CustomFieldMappingsCell from 'components/indices/IndexSetFieldTypeProfiles/cells/CustomFieldMappingsCell';\nimport IndexSetsCell from 'components/indices/IndexSetFieldTypeProfiles/cells/IndexSetsCell';\n\nconst useCustomColumnRenderers = (normalizedIndexSetsTitles: Record) => useMemo(() => ({\n attributes: {\n custom_field_mappings: {\n renderCell: (customFieldTypes: Array, profile: IndexSetFieldTypeProfile) => (\n \n ),\n staticWidth: 200,\n },\n index_set_ids: {\n renderCell: (indexSetIds: Array) => ,\n },\n },\n}), [normalizedIndexSetsTitles]);\n\nexport default useCustomColumnRenderers;\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 { Button, ButtonToolbar, MenuItem } from 'components/bootstrap';\nimport Routes from 'routing/Routes';\nimport { LinkContainer } from 'components/common/router';\nimport MoreActions from 'components/common/EntityDataTable/MoreActions';\nimport useSelectedEntities from 'components/common/EntityDataTable/hooks/useSelectedEntities';\nimport useProfileMutations from 'components/indices/IndexSetFieldTypeProfiles/hooks/useProfileMutations';\n\nconst ProfileActions = ({ profileId, profileName }: { profileId: string, profileName: string }) => {\n const { deselectEntity } = useSelectedEntities();\n const { deleteProfile } = useProfileMutations();\n\n const onDelete = () => {\n // eslint-disable-next-line no-alert\n if (window.confirm(`You are about to delete profile: \"${profileName}\". Are you sure?`)) {\n deleteProfile(profileId).then(() => {\n deselectEntity(profileId);\n });\n }\n };\n\n return (\n \n \n \n \n \n \n \n \n );\n};\n\nexport default ProfileActions;\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 { IndexSetFieldTypeProfile } from 'components/indices/IndexSetFieldTypeProfiles/types';\nimport ProfileActions from 'components/indices/IndexSetFieldTypeProfiles/ProfileActions';\n\nconst profileActions = ({ id, name }: IndexSetFieldTypeProfile) => ;\n\nexport default profileActions;\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, useMemo } from 'react';\nimport { useQueryParam, StringParam } from 'use-query-params';\nimport keyBy from 'lodash/keyBy';\nimport mapValues from 'lodash/mapValues';\n\nimport {\n NoEntitiesExist,\n PaginatedList, SearchForm,\n Spinner,\n} from 'components/common';\nimport EntityDataTable from 'components/common/EntityDataTable';\nimport useTableLayout from 'components/common/EntityDataTable/hooks/useTableLayout';\nimport type { Sort } from 'stores/PaginationTypes';\nimport useUpdateUserLayoutPreferences from 'components/common/EntityDataTable/hooks/useUpdateUserLayoutPreferences';\nimport EntityFilters from 'components/common/EntityFilters';\nimport useUrlQueryFilters from 'components/common/EntityFilters/hooks/useUrlQueryFilters';\nimport type { UrlQueryFilters } from 'components/common/EntityFilters/types';\nimport usePaginationQueryParameter from 'hooks/usePaginationQueryParameter';\nimport type {\n IndexSetFieldTypeProfile,\n} from 'components/indices/IndexSetFieldTypeProfiles/types';\nimport useProfiles\n from 'components/indices/IndexSetFieldTypeProfiles/hooks/useProfiles';\nimport useExpandedSectionsRenderer from 'components/indices/IndexSetFieldTypeProfiles/ExpandedSectionsRenderer';\nimport useCustomColumnRenderers from 'components/indices/IndexSetFieldTypeProfiles/helpers/useCustomColumnRenderers';\nimport profileActions from 'components/indices/IndexSetFieldTypeProfiles/helpers/profileActions';\nimport { useStore } from 'stores/connect';\nimport { IndexSetsStore } from 'stores/indices/IndexSetsStore';\n\nexport const ENTITY_TABLE_ID = 'index-set-field-type-profiles';\nexport const DEFAULT_LAYOUT = {\n pageSize: 20,\n sort: { attributeId: 'name', direction: 'asc' } as Sort,\n displayedColumns: ['name', 'description', 'custom_field_mappings', 'index_set_ids'],\n columnsOrder: ['name', 'description', 'custom_field_mappings', 'index_set_ids'],\n};\n\nconst ProfilesList = () => {\n const [urlQueryFilters, setUrlQueryFilters] = useUrlQueryFilters();\n const { indexSets } = useStore(IndexSetsStore);\n const [query, setQuery] = useQueryParam('query', StringParam);\n const { layoutConfig, isInitialLoading: isLoadingLayoutPreferences } = useTableLayout({\n entityTableId: ENTITY_TABLE_ID,\n defaultPageSize: DEFAULT_LAYOUT.pageSize,\n defaultDisplayedAttributes: DEFAULT_LAYOUT.displayedColumns,\n defaultSort: DEFAULT_LAYOUT.sort,\n });\n const paginationQueryParameter = usePaginationQueryParameter(undefined, layoutConfig.pageSize, false);\n const searchParams = useMemo(() => ({\n query,\n page: paginationQueryParameter.page,\n pageSize: layoutConfig.pageSize,\n sort: layoutConfig.sort,\n filters: urlQueryFilters,\n }), [paginationQueryParameter.page, layoutConfig.pageSize, layoutConfig.sort, query, urlQueryFilters]);\n const { mutate: updateTableLayout } = useUpdateUserLayoutPreferences(ENTITY_TABLE_ID);\n\n const onPageSizeChange = useCallback((newPageSize: number) => {\n paginationQueryParameter.resetPage();\n updateTableLayout({ perPage: newPageSize });\n }, [paginationQueryParameter, updateTableLayout]);\n\n const onSortChange = useCallback((newSort: Sort) => {\n paginationQueryParameter.resetPage();\n updateTableLayout({ sort: newSort });\n }, [paginationQueryParameter, updateTableLayout]);\n\n const onColumnsChange = useCallback((displayedAttributes: Array) => {\n updateTableLayout({ displayedAttributes });\n }, [updateTableLayout]);\n const {\n isLoading,\n data: { list, pagination, attributes },\n } = useProfiles(\n searchParams,\n { enabled: !isLoadingLayoutPreferences },\n );\n\n const onSearch = useCallback((val: string) => {\n paginationQueryParameter.resetPage();\n setQuery(val);\n }, [paginationQueryParameter, setQuery]);\n const onSearchReset = useCallback(() => setQuery(''), [setQuery]);\n const onChangeFilters = useCallback((newUrlQueryFilters: UrlQueryFilters) => {\n paginationQueryParameter.resetPage();\n setUrlQueryFilters(newUrlQueryFilters);\n }, [paginationQueryParameter, setUrlQueryFilters]);\n\n const expandedSectionsRenderer = useExpandedSectionsRenderer();\n\n const normalizedIndexSetsTitles = useMemo(() => mapValues(keyBy(indexSets, 'id'), 'title'), [indexSets]);\n\n const customColumnRenderers = useCustomColumnRenderers(normalizedIndexSetsTitles);\n\n if (isLoadingLayoutPreferences || isLoading) {\n return ;\n }\n\n return (\n \n \n \n \n \n \n {pagination?.total === 0 && (\n \n No field type profiles have been found.\n \n )}\n {!!list?.length && (\n data={list}\n visibleColumns={layoutConfig.displayedAttributes}\n columnsOrder={DEFAULT_LAYOUT.columnsOrder}\n onColumnsChange={onColumnsChange}\n onSortChange={onSortChange}\n activeSort={layoutConfig.sort}\n pageSize={searchParams.pageSize}\n onPageSizeChange={onPageSizeChange}\n actionsCellWidth={120}\n columnRenderers={customColumnRenderers}\n columnDefinitions={attributes}\n expandedSectionsRenderer={expandedSectionsRenderer}\n rowActions={profileActions} />\n )}\n \n );\n};\n\nexport default ProfilesList;\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 * as React from 'react';\n\nimport { Button } from 'components/bootstrap';\nimport Routes from 'routing/Routes';\nimport { LinkContainer } from 'components/common/router';\n\nconst CreateProfileButton = () => (\n \n \n \n);\n\nexport default CreateProfileButton;\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, { useEffect } from 'react';\nimport { useNavigate } from 'react-router-dom';\n\nimport { DocumentTitle, PageHeader } from 'components/common';\nimport { Row, Col } from 'components/bootstrap';\nimport DocsHelper from 'util/DocsHelper';\nimport Routes from 'routing/Routes';\nimport ProfilesList from 'components/indices/IndexSetFieldTypeProfiles/ProfilesList';\nimport CreateProfileButton from 'components/indices/IndexSetFieldTypeProfiles/CreateProfileButton';\nimport { IndicesPageNavigation } from 'components/indices';\nimport useHasTypeMappingPermission from 'hooks/useHasTypeMappingPermission';\nimport { IndexSetsActions } from 'stores/indices/IndexSetsStore';\n\nconst IndexSetFieldTypeProfilesPage = () => {\n const navigate = useNavigate();\n const hasMappingPermission = useHasTypeMappingPermission();\n\n useEffect(() => {\n if (!hasMappingPermission) {\n navigate(Routes.NOTFOUND);\n } else {\n IndexSetsActions.list(false);\n }\n }, [hasMappingPermission, navigate]);\n\n return (\n \n \n }>\n \n With index set field type profiles you can bundle up custom field types into profiles.\n Then you can assign this profile to any index set.\n You can view and edit existing profiles or create new ones.\n \n \n\n \n \n \n \n
\n \n );\n};\n\nexport default IndexSetFieldTypeProfilesPage;\n"],"names":["MoreActions","children","disabled","urlPrefix","putProfile","profile","id","url","body","postProfile","deleteProfile","queryClient","post","errorThrown","put","remove","INITIAL_DATA","fetchIndexSetFieldTypeProfiles","searchParams","indexSetFieldTypeUrl","PaginationURL","FiltersForQueryParams","elements","total","attributes","enabled","data","isLoading","refetch","UserNotification","Item","List","list","fieldTypes","field","type","customFieldMappings","useFieldTypesForMappings","StyledCountBadge","customFieldTypes","toggleSection","useExpandedSections","indexSetIds","normalizedIndexSetsTitles","currentUser","useCurrentUser","indexSetId","index","isLast","Routes","profileId","profileName","deselectEntity","useSelectedEntities","useProfileMutations","onDelete","name","ENTITY_TABLE_ID","DEFAULT_LAYOUT","urlQueryFilters","setUrlQueryFilters","useUrlQueryFilters","indexSets","IndexSetsStore","query","setQuery","layoutConfig","isLoadingLayoutPreferences","useTableLayout","paginationQueryParameter","usePaginationQueryParameter","updateTableLayout","useUpdateUserLayoutPreferences","onPageSizeChange","newPageSize","onSortChange","newSort","onColumnsChange","displayedAttributes","pagination","onSearch","val","onSearchReset","onChangeFilters","newUrlQueryFilters","expandedSectionsRenderer","customColumnRenderers","EntityFilters","EntityDataTable","navigate","hasMappingPermission","useHasTypeMappingPermission","DocsHelper"],"sourceRoot":""}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy