Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] [Sustainable Kibana Architecture] Address `security` group dependencies' issues (#197480) #197785

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/plugins/saved_objects_tagging_oss/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
export type {
Tag,
TagAttributes,
CreateTagOptions,
GetAllTagsOptions,
ITagsClient,
TagWithOptionalId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { v5 as uuidv5 } from 'uuid';
import { uniqBy } from 'lodash';
import type { SavedObjectsImportSuccess } from '@kbn/core-saved-objects-common';
import { taggableTypes } from '@kbn/saved-objects-tagging-plugin/common/constants';
import type { IAssignmentService, ITagsClient } from '@kbn/saved-objects-tagging-plugin/server';
import type { IAssignmentService } from '@kbn/saved-objects-tagging-plugin/server';
import type { ITagsClient } from '@kbn/saved-objects-tagging-plugin/common/types';

import type { KibanaAssetType } from '../../../../../common';
import type { PackageSpecTags } from '../../../../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* 2.0.
*/

import React, { FC } from 'react';
import React, { type FC } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiBadge } from '@elastic/eui';
import type { Tag } from '@kbn/saved-objects-tagging-plugin/public';
import type { Tag } from '@kbn/saved-objects-tagging-oss-plugin/common';

const MAX_TAGS_TO_SHOW = 3;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import type { GlobalSearchResult } from '@kbn/global-search-plugin/common/types';
import { Tag } from '@kbn/saved-objects-tagging-plugin/public';
import type { Tag } from '@kbn/saved-objects-tagging-oss-plugin/common';
import { resultToOption } from './result_to_option';

const createSearchResult = (parts: Partial<GlobalSearchResult> = {}): GlobalSearchResult => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import React from 'react';
import type { EuiSelectableTemplateSitewideOption } from '@elastic/eui';
import type { GlobalSearchResult } from '@kbn/global-search-plugin/common/types';
import type { SavedObjectTaggingPluginStart, Tag } from '@kbn/saved-objects-tagging-plugin/public';
import type { SavedObjectTaggingPluginStart } from '@kbn/saved-objects-tagging-plugin/public';
import type { Tag } from '@kbn/saved-objects-tagging-oss-plugin/common';
import { ResultTagList } from '../components/result_tag_list';

const cleanMeta = (str: string) => (str.charAt(0).toUpperCase() + str.slice(1)).replace(/-/g, ' ');
Expand Down
8 changes: 0 additions & 8 deletions x-pack/plugins/saved_objects_tagging/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
export type { TagsCapabilities } from './capabilities';
export { getTagsCapabilities } from './capabilities';
export { tagFeatureId, tagSavedObjectTypeName, tagManagementSectionId } from './constants';
export type {
TagWithRelations,
TagAttributes,
Tag,
ITagsClient,
TagSavedObject,
TagWithOptionalId,
} from './types';
export type { TagValidation } from './validation';
export {
validateTagColor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* 2.0.
*/

import { SavedObject, SavedObjectReference } from '@kbn/core/types';
import { Tag, TagAttributes } from '../types';
import { TagsCapabilities } from '../capabilities';
import { AssignableObject } from '../assignments';
import type { SavedObject, SavedObjectReference } from '@kbn/core/types';
import type { Tag, TagAttributes } from '../types';
import type { TagsCapabilities } from '../capabilities';
import type { AssignableObject } from '../assignments';

export const createReference = (type: string, id: string): SavedObjectReference => ({
type,
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/saved_objects_tagging/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { SavedObject } from '@kbn/core/types';
import type { SavedObject } from '@kbn/core/types';
import type { Tag, TagAttributes } from '@kbn/saved-objects-tagging-oss-plugin/common';

export type TagSavedObject = SavedObject<TagAttributes>;
Expand All @@ -20,6 +20,7 @@ export type TagWithRelations = Tag & {
// re-export types from oss definition
export type {
Tag,
CreateTagOptions,
TagAttributes,
TagWithOptionalId,
GetAllTagsOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { i18n } from '@kbn/i18n';
import { Tag } from './types';
import type { Tag } from './types';

export const tagNameMinLength = 2;
export const tagNameMaxLength = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* 2.0.
*/

import React, { ReactElement } from 'react';
import React, { type ReactElement } from 'react';
import { EuiBadge } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { TagAttributes } from '../../../common/types';
import type { TagAttributes } from '../../../common/types';

export interface TagBadgeProps<T> {
tag: T;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* 2.0.
*/

import React, { FC } from 'react';
import React, { type FC } from 'react';
import { EuiBadgeGroup } from '@elastic/eui';
import { TagWithOptionalId } from '../../../common/types';
import type { TagWithOptionalId } from '../../../common/types';
import { TagBadge } from './tag_badge';

export interface TagListProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* 2.0.
*/

import React, { FC } from 'react';
import React, { type FC } from 'react';
import { EuiHealth, EuiText } from '@elastic/eui';
import { Tag } from '../../../common';
import type { Tag } from '../../../common/types';
import { testSubjFriendly } from '../../utils';

export interface TagSearchBarOptionProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import React, { FC, useMemo, useCallback, useState } from 'react';
import React, { type FC, useMemo, useCallback, useState } from 'react';
import {
EuiComboBox,
EuiHealth,
Expand All @@ -17,9 +17,9 @@ import {
EuiComboBoxProps,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { Tag } from '../../../common';
import type { Tag } from '../../../common/types';
import { testSubjFriendly } from '../../utils';
import { CreateModalOpener } from '../edition_modal';
import type { CreateModalOpener } from '../edition_modal';

interface CreateOption {
type: '__create_option__';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* 2.0.
*/

import React, { FC, useMemo } from 'react';
import React, { type FC, useMemo } from 'react';
import useObservable from 'react-use/lib/useObservable';
import { SavedObjectReference } from '@kbn/core/types';
import { TagListComponentProps } from '@kbn/saved-objects-tagging-oss-plugin/public';
import { Tag, TagWithOptionalId } from '../../../common/types';
import type { SavedObjectReference } from '@kbn/core/types';
import type { TagListComponentProps } from '@kbn/saved-objects-tagging-oss-plugin/public';
import type { Tag, TagWithOptionalId } from '../../../common/types';
import { getObjectTags } from '../../utils';
import { TagList } from '../base';
import { ITagsCache } from '../../services';
import type { ITagsCache } from '../../services';
import { byNameTagSorter } from '../../utils';

interface SavedObjectTagListProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* 2.0.
*/

import React, { FC } from 'react';
import React, { type FC } from 'react';
import useObservable from 'react-use/lib/useObservable';
import { TagSelectorComponentProps } from '@kbn/saved-objects-tagging-oss-plugin/public';
import { TagsCapabilities } from '../../../common';
import type { TagSelectorComponentProps } from '@kbn/saved-objects-tagging-oss-plugin/public';
import type { TagsCapabilities } from '../../../common';
import { TagSelector } from '../base';
import { ITagsCache } from '../../services';
import { CreateModalOpener } from '../edition_modal';
import type { ITagsCache } from '../../services';
import type { CreateModalOpener } from '../edition_modal';

interface GetConnectedTagSelectorOptions {
cache: ITagsCache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import { CreateTagModal } from './create_modal';
import { IToasts, NotificationsStart } from '@kbn/core-notifications-browser';
import { ITagsClient, Tag } from '@kbn/saved-objects-tagging-oss-plugin/common';
import type { IToasts, NotificationsStart } from '@kbn/core-notifications-browser';
import type { ITagsClient, Tag } from '../../../common/types';
import { I18nProvider } from '@kbn/i18n-react';
import userEvent from '@testing-library/user-event';
import { duplicateTagNameErrorMessage, managedTagConflictMessage } from './utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* 2.0.
*/

import React, { FC, useState, useCallback } from 'react';
import React, { type FC, useState, useCallback } from 'react';
import { first, lastValueFrom } from 'rxjs';
import { i18n } from '@kbn/i18n';
import type { NotificationsStart } from '@kbn/core/public';

import { ITagsClient, Tag, TagAttributes } from '../../../common/types';
import type { ITagsClient, Tag, TagAttributes } from '../../../common/types';
import { isServerValidationError } from '../../services/tags';
import { getRandomColor, validateTag } from './utils';
import { CreateOrEditModal } from './create_or_edit_modal';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import React, { FC, useState, useCallback, useMemo, useRef } from 'react';
import React, { type FC, useState, useCallback, useMemo, useRef } from 'react';
import {
EuiButtonEmpty,
EuiButton,
Expand All @@ -28,9 +28,9 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import useDebounce from 'react-use/lib/useDebounce';
import type { TagAttributes } from '../../../common/types';
import {
TagAttributes,
TagValidation,
type TagValidation,
validateTagColor,
tagNameMaxLength,
tagDescriptionMaxLength,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* 2.0.
*/

import React, { FC, useState, useCallback } from 'react';
import React, { type FC, useState, useCallback } from 'react';
import { i18n } from '@kbn/i18n';
import type { NotificationsStart } from '@kbn/core/public';
import { first, lastValueFrom } from 'rxjs';
import { ITagsClient, Tag, TagAttributes } from '../../../common/types';
import type { ITagsClient, Tag, TagAttributes } from '../../../common/types';
import { isServerValidationError } from '../../services/tags';
import { CreateOrEditModal } from './create_or_edit_modal';
import { validateTag } from './utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import React from 'react';
import { EuiDelayRender, EuiLoadingSpinner } from '@elastic/eui';
import type { OverlayRef } from '@kbn/core/public';
import { toMountPoint } from '@kbn/react-kibana-mount';
import { Tag, TagAttributes } from '../../../common/types';
import { ITagInternalClient } from '../../services';
import { StartServices } from '../../types';
import type { Tag, TagAttributes } from '../../../common/types';
import type { ITagInternalClient } from '../../services';
import type { StartServices } from '../../types';

interface GetModalOpenerOptions extends StartServices {
tagClient: ITagInternalClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { BehaviorSubject } from 'rxjs';
import useObservable from 'react-use/lib/useObservable';

import { type TagValidation, validateTagName } from '../../../common';
import type { ITagsClient, TagAttributes } from '../../../common/types';
import { type TagValidation, validateTagName } from '../../../common';
import { duplicateTagNameErrorMessage, managedTagConflictMessage, validateTag } from './utils';

const initialValidation: TagValidation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import { useCallback, useEffect, useRef } from 'react';
import { i18n } from '@kbn/i18n';

import type { TagAttributes } from '../../../common/types';
import {
TagAttributes,
TagValidation,
type TagValidation,
validateTagColor,
validateTagName,
validateTagDescription,
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/saved_objects_tagging/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { PluginInitializerContext } from '@kbn/core/public';
import { SavedObjectTaggingPlugin } from './plugin';

export type { SavedObjectTaggingPluginStart } from './types';
export type { Tag } from '../common';

export const plugin = (initializerContext: PluginInitializerContext) =>
new SavedObjectTaggingPlugin(initializerContext);
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { i18n } from '@kbn/i18n';
import { Observable, from, takeUntil } from 'rxjs';
import { TagWithRelations } from '../../../common';
import { TagWithRelations } from '../../../common/types';
import { getAssignFlyoutOpener } from '../../components/assign_flyout';
import { ITagAssignmentService } from '../../services/assignments';
import { ITagsCache } from '../../services/tags';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { i18n } from '@kbn/i18n';
import { NotificationsStart, OverlayStart } from '@kbn/core/public';
import { TagWithRelations } from '../../../common';
import { TagWithRelations } from '../../../common/types';
import { ITagInternalClient } from '../../services/tags';
import { TagAction } from './types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { i18n } from '@kbn/i18n';
import { TagWithRelations } from '../../../common';
import { TagWithRelations } from '../../../common/types';
import { getEditModalOpener } from '../../components/edition_modal';
import { ITagInternalClient } from '../../services/tags';
import { StartServices } from '../../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { Action as EuiTableAction } from '@elastic/eui/src/components/basic_table/action_types';
import { TagWithRelations } from '../../../common';
import { TagWithRelations } from '../../../common/types';

export type TagAction = EuiTableAction<TagWithRelations> & {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { EuiInMemoryTable, EuiBasicTableColumn, EuiLink, Query, EuiIconTip } fro
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { euiThemeVars } from '@kbn/ui-theme';
import { TagsCapabilities, TagWithRelations } from '../../../common';
import { TagsCapabilities } from '../../../common';
import type { TagWithRelations } from '../../../common/types';
import { TagBadge } from '../../components';
import { TagAction } from '../actions';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import { Query } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { ChromeBreadcrumb, CoreStart } from '@kbn/core/public';
import { EuiSpacer } from '@elastic/eui';
import { TagWithRelations, TagsCapabilities } from '../../common';
import { TagsCapabilities } from '../../common';
import type { TagWithRelations } from '../../common/types';
import { getCreateModalOpener } from '../components/edition_modal';
import { ITagInternalClient, ITagAssignmentService, ITagsCache } from '../services';
import { TagBulkAction } from './types';
import type { TagBulkAction } from './types';
import { Header, TagTable, ActionBar } from './components';
import { getTableActions } from './actions';
import { getBulkActions } from './bulk_actions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { httpServiceMock } from '@kbn/core/public/mocks';
import { getTagConnectionsUrl } from './get_tag_connections_url';
import { TagWithRelations } from '../../../common/types';
import type { TagWithRelations } from '../../../common/types';

const createTag = (name: string): TagWithRelations => ({
id: 'tag-id',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import { IBasePath } from '@kbn/core/public';
import { TagWithRelations } from '../../../common/types';
import type { IBasePath } from '@kbn/core/public';
import type { TagWithRelations } from '../../../common/types';

/**
* Returns the url to use to redirect to the SavedObject management section with given tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import moment from 'moment';
import { Tag, TagAttributes } from '../../../common/types';
import { TagsCache, CacheRefreshHandler } from './tags_cache';
import type { Tag, TagAttributes } from '../../../common/types';
import { TagsCache, type CacheRefreshHandler } from './tags_cache';

const createTag = (parts: Partial<Tag>): Tag => ({
id: 'tag-id',
Expand Down
Loading
Loading