diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/CallDetails.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/CallDetails.tsx index b5e00374d37..8a9c011b5de 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/CallDetails.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/CallDetails.tsx @@ -71,7 +71,13 @@ export const CallSchemaLink = ({call}: {call: CallSchema}) => { ); }; -const SHOWN_COLS = ['op_name', 'status', 'inputs.*', 'output', 'output.*']; +const ALLOWED_COLUMN_PATTERNS = [ + 'op_name', + 'status', + 'inputs.*', + 'output', + 'output.*', +]; export const CallDetails: FC<{ call: CallSchema; @@ -178,7 +184,7 @@ export const CallDetails: FC<{ }} entity={call.entity} project={call.project} - shownCols={SHOWN_COLS} + allowedColumnPatterns={ALLOWED_COLUMN_PATTERNS} /> ); if (isPeeking) { diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/CallsTable.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/CallsTable.tsx index 6e6ccd2605b..f3fcd36a49b 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/CallsTable.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/CallsTable.tsx @@ -142,7 +142,7 @@ export const CallsTable: FC<{ setPaginationModel?: (newModel: GridPaginationModel) => void; // Can include glob for prefix match, e.g. "inputs.*" - shownCols?: string[]; + allowedColumnPatterns?: string[]; }> = ({ entity, project, @@ -161,7 +161,7 @@ export const CallsTable: FC<{ setSortModel, paginationModel, setPaginationModel, - shownCols, + allowedColumnPatterns, }) => { const {loading: loadingUserInfo, userInfo} = useViewerInfo(); @@ -307,7 +307,7 @@ export const CallsTable: FC<{ onCollapse, onExpand, columnIsRefExpanded, - shownCols, + allowedColumnPatterns, onAddFilter ); diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/callsTableColumns.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/callsTableColumns.tsx index 35f72372818..15ee895af3a 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/callsTableColumns.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/callsTableColumns.tsx @@ -54,7 +54,7 @@ export const useCallsTableColumns = ( onCollapse: (col: string) => void, onExpand: (col: string) => void, columnIsRefExpanded: (col: string) => boolean, - shownCols?: string[], + allowedColumnPatterns?: string[], onAddFilter?: (field: string, operator: string | null, value: any) => void ) => { const [userDefinedColumnWidths, setUserDefinedColumnWidths] = useState< @@ -130,7 +130,7 @@ export const useCallsTableColumns = ( onExpand, columnIsRefExpanded, userDefinedColumnWidths, - shownCols, + allowedColumnPatterns, onAddFilter ), [ @@ -146,7 +146,7 @@ export const useCallsTableColumns = ( onExpand, columnIsRefExpanded, userDefinedColumnWidths, - shownCols, + allowedColumnPatterns, onAddFilter, ] ); @@ -171,7 +171,7 @@ function buildCallsTableColumns( onExpand: (col: string) => void, columnIsRefExpanded: (col: string) => boolean, userDefinedColumnWidths: Record, - shownCols?: string[], + allowedColumnPatterns?: string[], onAddFilter?: (field: string, operator: string | null, value: any) => void ): { cols: Array>; @@ -455,8 +455,8 @@ function buildCallsTableColumns( // TODO: It would be better to build up the cols rather than throwing away // some at the end, but making simpler change for now. let orderedCols = cols; - if (shownCols !== undefined) { - orderedCols = shownCols.flatMap(shownCol => { + if (allowedColumnPatterns !== undefined) { + orderedCols = allowedColumnPatterns.flatMap(shownCol => { if (shownCol.includes('*')) { const regex = new RegExp('^' + shownCol.replace('*', '.*') + '$'); return cols.filter(col => regex.test(col.field));