Skip to content

Commit

Permalink
import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
heswell committed Nov 1, 2023
1 parent 958f64d commit 969913f
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 51 deletions.
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions vuu-ui/packages/vuu-data-ag-grid/src/useViewportRowModel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {
DataSourceConfig,
isViewportMenusAction,
isVisualLinksAction,
MenuRpcResponse,
RemoteDataSource,
VuuFeatureMessage,
Expand All @@ -8,8 +10,6 @@ import {
} from "@finos/vuu-data";

import {
isViewportMenusAction,
isVisualLinksAction,
MenuActionConfig,
SuggestionFetcher,
useTypeaheadSuggestions,
Expand Down
28 changes: 0 additions & 28 deletions vuu-ui/packages/vuu-data-react/src/hooks/useVuuMenuActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 3 additions & 2 deletions vuu-ui/packages/vuu-data/src/remote-data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
40 changes: 38 additions & 2 deletions vuu-ui/packages/vuu-data/src/vuuUIMessageTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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";
2 changes: 1 addition & 1 deletion vuu-ui/packages/vuu-table/src/table-next/useDataSource.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
7 changes: 2 additions & 5 deletions vuu-ui/packages/vuu-table/src/table/useDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { VuuFeatureMessage } from "@finos/vuu-data";
import { isViewportMenusAction } from "@finos/vuu-data-react";
import {
ClientToServerMenuRPC,
VuuMenu,
Expand All @@ -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;
Expand Down
11 changes: 4 additions & 7 deletions vuu-ui/sample-apps/feature-vuu-blotter/src/VuuBlotter.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down

0 comments on commit 969913f

Please sign in to comment.