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 fb598fd04..c95913826 100644 --- a/vuu-ui/packages/vuu-data/src/remote-data-source.ts +++ b/vuu-ui/packages/vuu-data/src/remote-data-source.ts @@ -3,6 +3,7 @@ import { Selection } from "@finos/vuu-datagrid-types"; import { ClientToServerEditRpc, ClientToServerMenuRPC, + ClientToServerViewportRpcCall, LinkDescriptorWithLabel, VuuAggregation, VuuDataRowDto, @@ -35,6 +36,7 @@ import { DataSourceStatus, isDataSourceConfigMessage, OptimizeStrategy, + RpcResponse, SubscribeCallback, SubscribeProps, vanillaConfig, @@ -646,9 +648,11 @@ export class RemoteDataSource } } - async rpcCall(rpcRequest: Omit) { + async rpcCall( + rpcRequest: Omit + ) { if (this.viewport) { - return this.server?.rpcCall({ + return this.server?.rpcCall({ vpId: this.viewport, ...rpcRequest, } as ClientToServerViewportRpcCall); diff --git a/vuu-ui/packages/vuu-shell/src/feature/Loader.tsx b/vuu-ui/packages/vuu-shell/src/feature/Loader.tsx index b69f28004..8afcea8e9 100644 --- a/vuu-ui/packages/vuu-shell/src/feature/Loader.tsx +++ b/vuu-ui/packages/vuu-shell/src/feature/Loader.tsx @@ -1,2 +1,2 @@ // TODO -export const Loader = () =>
loading
; +export const Loader = () =>
; diff --git a/vuu-ui/sample-apps/feature-basket-trading/package.json b/vuu-ui/sample-apps/feature-basket-trading/package.json index 1048ffa0d..af623fc3b 100644 --- a/vuu-ui/sample-apps/feature-basket-trading/package.json +++ b/vuu-ui/sample-apps/feature-basket-trading/package.json @@ -56,8 +56,8 @@ "table": "basketTradingConstituentJoin" }, { - "module": "SIMUL", - "table": "instruments" + "module": "BASKET", + "table": "basketConstituent" } ] }, diff --git a/vuu-ui/sample-apps/feature-basket-trading/src/VuuBasketTradingFeature.tsx b/vuu-ui/sample-apps/feature-basket-trading/src/VuuBasketTradingFeature.tsx index abf5e53da..b677fd5a6 100644 --- a/vuu-ui/sample-apps/feature-basket-trading/src/VuuBasketTradingFeature.tsx +++ b/vuu-ui/sample-apps/feature-basket-trading/src/VuuBasketTradingFeature.tsx @@ -18,7 +18,7 @@ export interface BasketTradingFeatureProps { basketSchema: TableSchema; basketTradingSchema: TableSchema; basketTradingConstituentJoinSchema: TableSchema; - instrumentsSchema: TableSchema; + basketConstituentSchema: TableSchema; } const VuuBasketTradingFeature = (props: BasketTradingFeatureProps) => { @@ -26,7 +26,7 @@ const VuuBasketTradingFeature = (props: BasketTradingFeatureProps) => { basketSchema, basketTradingSchema, basketTradingConstituentJoinSchema, - instrumentsSchema, + basketConstituentSchema, } = props; const { @@ -46,7 +46,7 @@ const VuuBasketTradingFeature = (props: BasketTradingFeatureProps) => { basketSchema, basketTradingSchema, basketTradingConstituentJoinSchema, - instrumentsSchema, + basketConstituentSchema, }); if (basketCount === -1) { diff --git a/vuu-ui/sample-apps/feature-basket-trading/src/useBasketContextMenus.ts b/vuu-ui/sample-apps/feature-basket-trading/src/useBasketContextMenus.ts index b370a1d1b..2339e4735 100644 --- a/vuu-ui/sample-apps/feature-basket-trading/src/useBasketContextMenus.ts +++ b/vuu-ui/sample-apps/feature-basket-trading/src/useBasketContextMenus.ts @@ -9,9 +9,9 @@ import { DataSource } from "@finos/vuu-data"; import { useMemo } from "react"; export const useBasketContextMenus = ({ - dataSourceInstruments, + dataSourceBasketConstituent, }: { - dataSourceInstruments: DataSource; + dataSourceBasketConstituent: DataSource; }) => { const dispatchLayoutAction = useLayoutProviderDispatch(); @@ -47,7 +47,7 @@ export const useBasketContextMenus = ({ allowDragDrop: "drag-copy", id: "basket-instruments", }, - dataSource: dataSourceInstruments, + dataSource: dataSourceBasketConstituent, }, }, title: "Add Ticker", @@ -57,5 +57,5 @@ export const useBasketContextMenus = ({ return false; }, ]; - }, [dataSourceInstruments, dispatchLayoutAction]); + }, [dataSourceBasketConstituent, dispatchLayoutAction]); }; diff --git a/vuu-ui/sample-apps/feature-basket-trading/src/useBasketTrading.tsx b/vuu-ui/sample-apps/feature-basket-trading/src/useBasketTrading.tsx index c7ba328e5..28aae02e1 100644 --- a/vuu-ui/sample-apps/feature-basket-trading/src/useBasketTrading.tsx +++ b/vuu-ui/sample-apps/feature-basket-trading/src/useBasketTrading.tsx @@ -46,7 +46,7 @@ export type BasketTradingHookProps = Pick< | "basketSchema" | "basketTradingSchema" | "basketTradingConstituentJoinSchema" - | "instrumentsSchema" + | "basketConstituentSchema" >; const toDataDto = (dataSourceRow: VuuDataRow, columnMap: ColumnMap) => { @@ -67,7 +67,7 @@ export const useBasketTrading = ({ basketSchema, basketTradingSchema, basketTradingConstituentJoinSchema, - instrumentsSchema, + basketConstituentSchema, }: BasketTradingHookProps) => { const { load, save } = useViewContext(); @@ -81,7 +81,7 @@ export const useBasketTrading = ({ dataSourceBasketTradingControl, dataSourceBasketTradingSearch, dataSourceBasketTradingConstituentJoin, - dataSourceInstruments, + dataSourceBasketConstituent, onSendToMarket, onTakeOffMarket, } = useBasketTradingDataSources({ @@ -89,7 +89,7 @@ export const useBasketTrading = ({ basketSchema, basketTradingSchema, basketTradingConstituentJoinSchema, - instrumentsSchema, + basketConstituentSchema, }); const [basket, setBasket] = useState(); @@ -121,9 +121,6 @@ export const useBasketTrading = ({ ); useMemo(() => { - console.log( - `subscribe to BT Control ${dataSourceBasketTradingControl.status}` - ); dataSourceBasketTradingControl.subscribe( { range: { from: 0, to: 1 }, @@ -215,7 +212,7 @@ export const useBasketTrading = ({ ); const [menuBuilder, menuActionHandler] = useBasketContextMenus({ - dataSourceInstruments, + dataSourceBasketConstituent, }); const handleRpcResponse = useCallback((response) => { diff --git a/vuu-ui/sample-apps/feature-basket-trading/src/useBasketTradingDatasources.ts b/vuu-ui/sample-apps/feature-basket-trading/src/useBasketTradingDatasources.ts index dad547ed0..aa640636d 100644 --- a/vuu-ui/sample-apps/feature-basket-trading/src/useBasketTradingDatasources.ts +++ b/vuu-ui/sample-apps/feature-basket-trading/src/useBasketTradingDatasources.ts @@ -15,7 +15,7 @@ export type basketDataSourceKey = | "data-source-basket-trading-control" | "data-source-basket-trading-search" | "data-source-basket-trading-constituent-join" - | "data-source-instruments"; + | "data-source-basket-constituent"; const NO_FILTER = { filter: "" }; @@ -24,7 +24,7 @@ export const useBasketTradingDataSources = ({ basketInstanceId, basketTradingSchema, basketTradingConstituentJoinSchema, - instrumentsSchema, + basketConstituentSchema, }: BasketTradingFeatureProps & { basketInstanceId: string }) => { const { notify } = useNotifications(); const { id, loadSession, saveSession, title } = useViewContext(); @@ -34,7 +34,7 @@ export const useBasketTradingDataSources = ({ dataSourceBasketTradingControl, dataSourceBasketTradingSearch, dataSourceBasketTradingConstituentJoin, - dataSourceInstruments, + dataSourceBasketConstituent, ] = useMemo(() => { const basketFilter: VuuFilter = basketInstanceId ? { @@ -61,7 +61,7 @@ export const useBasketTradingDataSources = ({ 100, basketFilter, ], - ["data-source-instruments", instrumentsSchema, 100], + ["data-source-basket-constituent", basketConstituentSchema, 100], ]; const dataSources: DataSource[] = []; @@ -86,7 +86,7 @@ export const useBasketTradingDataSources = ({ basketTradingSchema, basketInstanceId, basketTradingConstituentJoinSchema, - instrumentsSchema, + basketConstituentSchema, loadSession, id, title, @@ -125,7 +125,7 @@ export const useBasketTradingDataSources = ({ dataSourceBasketTradingControl, dataSourceBasketTradingSearch, dataSourceBasketTradingConstituentJoin, - dataSourceInstruments, + dataSourceBasketConstituent, onSendToMarket: handleSendToMarket, onTakeOffMarket: handleTakeOffMarket, }; diff --git a/vuu-ui/sample-apps/feature-instrument-tiles/package.json b/vuu-ui/sample-apps/feature-instrument-tiles/package.json index 6227baecb..f13325c2d 100644 --- a/vuu-ui/sample-apps/feature-instrument-tiles/package.json +++ b/vuu-ui/sample-apps/feature-instrument-tiles/package.json @@ -42,10 +42,12 @@ }, "vuu": { "featureProps": { - "schemas": { - "module": "SIMUL", - "table": "instrumentPrices" - } + "schemas": [ + { + "module": "SIMUL", + "table": "instrumentPrices" + } + ] }, "leftNavLocation": "vuu-features" } diff --git a/vuu-ui/sample-apps/feature-instrument-tiles/src/VuuInstrumentTilesFeature.tsx b/vuu-ui/sample-apps/feature-instrument-tiles/src/VuuInstrumentTilesFeature.tsx index df4488fd9..7ec85c666 100644 --- a/vuu-ui/sample-apps/feature-instrument-tiles/src/VuuInstrumentTilesFeature.tsx +++ b/vuu-ui/sample-apps/feature-instrument-tiles/src/VuuInstrumentTilesFeature.tsx @@ -10,7 +10,6 @@ import { buildColumnMap, metadataKeys } from "@finos/vuu-utils"; import { useCallback, useEffect, useMemo } from "react"; import { InstrumentTile } from "./InstrumentTile"; import { InstrumentTileContainer } from "./InstrumentTileContainer"; -// import { useDataSource } from "@finos/vuu-data-react"; import { useDataSource } from "./useDataSource"; import "./VuuInstrumentTilesFeature.css"; @@ -18,13 +17,13 @@ import "./VuuInstrumentTilesFeature.css"; const classBase = "VuuInstrumentTilesFeature"; export interface InstrumentTilesFeatureProps { - tableSchema: TableSchema; + instrumentPricesSchema: TableSchema; } const { KEY } = metadataKeys; const VuuInstrumentTilesFeature = ({ - tableSchema, + instrumentPricesSchema, }: InstrumentTilesFeatureProps) => { const { id, save, loadSession, saveSession, title } = useViewContext(); @@ -65,8 +64,8 @@ const VuuInstrumentTilesFeature = ({ ds = new RemoteDataSource({ bufferSize: 200, viewport: id, - table: tableSchema.table, - columns: tableSchema.columns.map((col) => col.name), + table: instrumentPricesSchema.table, + columns: instrumentPricesSchema.columns.map((col) => col.name), filter, title, }); @@ -79,8 +78,8 @@ const VuuInstrumentTilesFeature = ({ id, loadSession, saveSession, - tableSchema.columns, - tableSchema.table, + instrumentPricesSchema.columns, + instrumentPricesSchema.table, title, ]);