Skip to content

Commit

Permalink
Update the icon
Browse files Browse the repository at this point in the history
  • Loading branch information
jughosta committed Nov 20, 2023
1 parent a1c6594 commit 4b31f91
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 51 deletions.
1 change: 1 addition & 0 deletions packages/kbn-unified-field-list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export { FieldList, type FieldListProps } from './src/components/field_list';
export { FieldListGrouped, type FieldListGroupedProps } from './src/components/field_list_grouped';
export { FieldListFilters, type FieldListFiltersProps } from './src/components/field_list_filters';
export { FieldItemButton, type FieldItemButtonProps } from './src/components/field_item_button';
export { FieldItemDragHandle } from './src/components/field_item_drag_handle';
export type {
FieldTopValuesBucketProps,
FieldTopValuesBucketParams,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import React from 'react';
import { EuiIcon } from '@elastic/eui';
import { css } from '@emotion/react';

/**
* @constructor
*/
export const FieldItemDragHandle: React.FC = () => {
return (
<div
css={css`
pointer-events: none;
`}
>
<EuiIcon type="grabOmnidirectional" size="s" />
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export { FieldItemDragHandle } from './field_item_drag_handle';
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ import {
FieldPopoverFooter,
type FieldPopoverFooterProps,
} from '../../components/field_popover';
import { FieldItemDragHandle } from '../../components/field_item_drag_handle';
import {
UnifiedFieldListItemStats,
type UnifiedFieldListItemStatsProps,
} from './field_list_item_stats';
import { FieldListItemHandle } from './field_list_item_handle';
import type {
UnifiedFieldListSidebarContainerStateService,
AddFieldFilterHandler,
} from '../../types';

const DRAG_HANDLE = <FieldListItemHandle />;
const DRAG_HANDLE = <FieldItemDragHandle />;

interface GetCommonFieldItemButtonPropsParams {
stateService: UnifiedFieldListSidebarContainerStateService;
Expand Down

This file was deleted.

4 changes: 4 additions & 0 deletions x-pack/plugins/lens/public/datasources/common/field_item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
FieldPopoverHeader,
FieldPopoverFooter,
FieldItemButton,
FieldItemDragHandle,
type GetCustomFieldType,
} from '@kbn/unified-field-list';
import { DragDrop } from '@kbn/dom-drag-drop';
Expand All @@ -32,6 +33,8 @@ import { APP_ID, DOCUMENT_FIELD_NAME } from '../../../common/constants';
import { combineQueryAndFilters } from '../../app_plugin/show_underlying_data';
import { getFieldItemActions } from './get_field_item_actions';

const DRAG_HANDLE = <FieldItemDragHandle />;

type LensFieldListItem = IndexPatternField | DatatableColumn | DataViewField;

function isTextBasedColumnField(field: LensFieldListItem): field is DatatableColumn {
Expand Down Expand Up @@ -187,6 +190,7 @@ export function InnerFieldItem(props: FieldItemProps) {
isEmpty: !exists,
isActive: infoIsOpen,
fieldSearchHighlight: highlight,
dragHandle: DRAG_HANDLE,
onClick: togglePopover,
buttonAddFieldToWorkspaceProps,
onAddFieldToWorkspace,
Expand Down

0 comments on commit 4b31f91

Please sign in to comment.