diff --git a/vuu-ui/packages/vuu-data-ag-grid/src/ViewportRowModelDataSource.ts b/vuu-ui/packages/vuu-data-ag-grid/src/ViewportRowModelDataSource.ts index e5c120594..3bb7f2c4a 100644 --- a/vuu-ui/packages/vuu-data-ag-grid/src/ViewportRowModelDataSource.ts +++ b/vuu-ui/packages/vuu-data-ag-grid/src/ViewportRowModelDataSource.ts @@ -1,10 +1,10 @@ import { DataSource, DataSourceConfig, + isVuuFeatureAction, SubscribeCallback, VuuFeatureMessage, } from "@finos/vuu-data"; -import { isVuuFeatureAction } from "@finos/vuu-data-react"; import { Filter } from "@finos/vuu-filter-types"; import { VuuGroupBy, VuuSort } from "@finos/vuu-protocol-types"; import { diff --git a/vuu-ui/packages/vuu-data-ag-grid/src/useViewportRowModel.ts b/vuu-ui/packages/vuu-data-ag-grid/src/useViewportRowModel.ts index e072af403..e793185d2 100644 --- a/vuu-ui/packages/vuu-data-ag-grid/src/useViewportRowModel.ts +++ b/vuu-ui/packages/vuu-data-ag-grid/src/useViewportRowModel.ts @@ -1,5 +1,7 @@ import { DataSourceConfig, + isViewportMenusAction, + isVisualLinksAction, MenuRpcResponse, RemoteDataSource, VuuFeatureMessage, @@ -8,8 +10,6 @@ import { } from "@finos/vuu-data"; import { - isViewportMenusAction, - isVisualLinksAction, MenuActionConfig, SuggestionFetcher, useTypeaheadSuggestions, diff --git a/vuu-ui/packages/vuu-data-react/src/hooks/useVuuMenuActions.ts b/vuu-ui/packages/vuu-data-react/src/hooks/useVuuMenuActions.ts index d05560179..b9b324fae 100644 --- a/vuu-ui/packages/vuu-data-react/src/hooks/useVuuMenuActions.ts +++ b/vuu-ui/packages/vuu-data-react/src/hooks/useVuuMenuActions.ts @@ -53,34 +53,6 @@ const { KEY } = metadataKeys; const NO_CONFIG: MenuActionConfig = {}; -export const isVisualLinksAction = ( - action: GridAction -): action is DataSourceVisualLinksMessage => action.type === "vuu-links"; - -export const isVisualLinkCreatedAction = ( - action: GridAction -): action is DataSourceVisualLinkCreatedMessage => - action.type === "vuu-link-created"; - -export const isVisualLinkRemovedAction = ( - action: GridAction -): action is DataSourceVisualLinkRemovedMessage => - action.type === "vuu-link-removed"; - -export const isViewportMenusAction = ( - action: GridAction -): action is DataSourceMenusMessage => action.type === "vuu-menu"; - -export const isVuuFeatureAction = ( - action: GridAction -): action is VuuFeatureMessage => - isViewportMenusAction(action) || isVisualLinksAction(action); - -export const isVuuFeatureInvocation = ( - action: GridAction -): action is VuuFeatureInvocationMessage => - action.type === "vuu-link-created" || action.type === "vuu-link-removed"; - const isMenuItem = (menu: VuuMenuItem | VuuMenu): menu is VuuMenuItem => "rpcName" in menu; diff --git a/vuu-ui/packages/vuu-data/src/remote-data-source.ts b/vuu-ui/packages/vuu-data/src/remote-data-source.ts index 40a885e80..2ef7a477a 100644 --- a/vuu-ui/packages/vuu-data/src/remote-data-source.ts +++ b/vuu-ui/packages/vuu-data/src/remote-data-source.ts @@ -40,11 +40,12 @@ import { withConfigDefaults, WithFullConfig, } from "./data-source"; -import { MenuRpcResponse } from "./vuuUIMessageTypes"; + import { isViewportMenusAction, isVisualLinksAction, -} from "packages/vuu-data-react/src"; + MenuRpcResponse, +} from "./vuuUIMessageTypes"; type RangeRequest = (range: VuuRange) => void; diff --git a/vuu-ui/packages/vuu-data/src/vuuUIMessageTypes.ts b/vuu-ui/packages/vuu-data/src/vuuUIMessageTypes.ts index 0080afd3b..35d702753 100644 --- a/vuu-ui/packages/vuu-data/src/vuuUIMessageTypes.ts +++ b/vuu-ui/packages/vuu-data/src/vuuUIMessageTypes.ts @@ -14,8 +14,16 @@ import { } from "@finos/vuu-protocol-types"; import { DataSourceFilter } from "@finos/vuu-data-types"; import { TableSchema, WithRequestId } from "./message-utils"; -import { WithFullConfig } from "./data-source"; -import { Selection } from "@finos/vuu-datagrid-types"; +import { + DataSourceMenusMessage, + DataSourceVisualLinkCreatedMessage, + DataSourceVisualLinkRemovedMessage, + DataSourceVisualLinksMessage, + VuuFeatureInvocationMessage, + VuuFeatureMessage, + WithFullConfig, +} from "./data-source"; +import { GridAction, Selection } from "@finos/vuu-datagrid-types"; import { WebSocketProtocol } from "./websocket-connection"; export interface OpenDialogAction { @@ -347,3 +355,31 @@ export const isSessionTable = (table?: unknown) => { } return false; }; + +export const isVisualLinksAction = ( + action: GridAction +): action is DataSourceVisualLinksMessage => action.type === "vuu-links"; + +export const isVisualLinkCreatedAction = ( + action: GridAction +): action is DataSourceVisualLinkCreatedMessage => + action.type === "vuu-link-created"; + +export const isVisualLinkRemovedAction = ( + action: GridAction +): action is DataSourceVisualLinkRemovedMessage => + action.type === "vuu-link-removed"; + +export const isViewportMenusAction = ( + action: GridAction +): action is DataSourceMenusMessage => action.type === "vuu-menu"; + +export const isVuuFeatureAction = ( + action: GridAction +): action is VuuFeatureMessage => + isViewportMenusAction(action) || isVisualLinksAction(action); + +export const isVuuFeatureInvocation = ( + action: GridAction +): action is VuuFeatureInvocationMessage => + action.type === "vuu-link-created" || action.type === "vuu-link-removed"; diff --git a/vuu-ui/packages/vuu-table/src/table-next/useDataSource.ts b/vuu-ui/packages/vuu-table/src/table-next/useDataSource.ts index 917aa8da9..c89c2a550 100644 --- a/vuu-ui/packages/vuu-table/src/table-next/useDataSource.ts +++ b/vuu-ui/packages/vuu-table/src/table-next/useDataSource.ts @@ -1,10 +1,10 @@ import { DataSource, DataSourceSubscribedMessage, + isVuuFeatureInvocation, SubscribeCallback, VuuFeatureInvocationMessage, } from "@finos/vuu-data"; -import { isVuuFeatureInvocation } from "@finos/vuu-data-react/src"; import { DataSourceRow } from "@finos/vuu-data-types"; import { VuuRange } from "@finos/vuu-protocol-types"; import { getFullRange, NULL_RANGE } from "@finos/vuu-utils"; diff --git a/vuu-ui/packages/vuu-table/src/table/useDataSource.ts b/vuu-ui/packages/vuu-table/src/table/useDataSource.ts index d018100e3..8599987bf 100644 --- a/vuu-ui/packages/vuu-table/src/table/useDataSource.ts +++ b/vuu-ui/packages/vuu-table/src/table/useDataSource.ts @@ -2,22 +2,19 @@ import { DataSource, DataSourceConfigMessage, DataSourceSubscribedMessage, + isVuuFeatureAction, + isVuuFeatureInvocation, SubscribeCallback, VuuFeatureInvocationMessage, VuuFeatureMessage, } from "@finos/vuu-data"; import { DataSourceRow } from "@finos/vuu-data-types"; -import { - isVuuFeatureAction, - isVuuFeatureInvocation, -} from "@finos/vuu-data-react"; import { VuuRange, VuuSortCol } from "@finos/vuu-protocol-types"; import { getFullRange, isRowSelectedLast, metadataKeys, - RowSelected, WindowRange, } from "@finos/vuu-utils"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; diff --git a/vuu-ui/sample-apps/feature-basket-trading/src/new-basket-panel/useNewBasketPanel.ts b/vuu-ui/sample-apps/feature-basket-trading/src/new-basket-panel/useNewBasketPanel.ts index a7384ce73..fb49d4296 100644 --- a/vuu-ui/sample-apps/feature-basket-trading/src/new-basket-panel/useNewBasketPanel.ts +++ b/vuu-ui/sample-apps/feature-basket-trading/src/new-basket-panel/useNewBasketPanel.ts @@ -1,5 +1,3 @@ -import { VuuFeatureMessage } from "@finos/vuu-data"; -import { isViewportMenusAction } from "@finos/vuu-data-react"; import { ClientToServerMenuRPC, VuuMenu, @@ -8,7 +6,7 @@ import { import { TableRowSelectHandler } from "@finos/vuu-table"; import { Commithandler, OpenChangeHandler } from "@finos/vuu-ui-controls"; import { buildColumnMap, metadataKeys } from "@finos/vuu-utils"; -import { useCallback, useRef, useState } from "react"; +import { useCallback, useState } from "react"; import { NewBasketPanelProps } from "./NewBasketPanel"; const { KEY } = metadataKeys; diff --git a/vuu-ui/sample-apps/feature-vuu-blotter/src/VuuBlotter.tsx b/vuu-ui/sample-apps/feature-vuu-blotter/src/VuuBlotter.tsx index 02b08e50e..dbd16ab7a 100644 --- a/vuu-ui/sample-apps/feature-vuu-blotter/src/VuuBlotter.tsx +++ b/vuu-ui/sample-apps/feature-vuu-blotter/src/VuuBlotter.tsx @@ -1,17 +1,14 @@ import { ConfigChangeMessage, DataSourceVisualLinkCreatedMessage, - RemoteDataSource, - TableSchema, -} from "@finos/vuu-data"; -import { isViewportMenusAction, isVisualLinkCreatedAction, isVisualLinkRemovedAction, isVisualLinksAction, - MenuActionConfig, - useVuuMenuActions, -} from "@finos/vuu-data-react"; + RemoteDataSource, + TableSchema, +} from "@finos/vuu-data"; +import { MenuActionConfig, useVuuMenuActions } from "@finos/vuu-data-react"; import { Grid, GridProvider } from "@finos/vuu-datagrid"; import { GridAction, KeyedColumnDescriptor } from "@finos/vuu-datagrid-types"; import { Filter, FilterState } from "@finos/vuu-filter-types";