Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"@box/languages": "^1.0.0",
"@box/metadata-editor": "^0.122.12",
"@box/metadata-filter": "^1.19.2",
"@box/metadata-view": "^0.41.2",
"@box/metadata-view": "^0.48.1",
"@box/react-virtualized": "^9.22.3-rc-box.10",
"@box/types": "^0.2.1",
"@cfaester/enzyme-adapter-react-18": "^0.8.0",
Expand Down Expand Up @@ -303,7 +303,7 @@
"@box/item-icon": "^0.17.15",
"@box/metadata-editor": "^0.122.12",
"@box/metadata-filter": "^1.19.2",
"@box/metadata-view": "^0.41.2",
"@box/metadata-view": "^0.48.1",
"@box/react-virtualized": "^9.22.3-rc-box.10",
"@box/types": "^0.2.1",
"@hapi/address": "^2.1.4",
Expand Down
18 changes: 7 additions & 11 deletions src/elements/common/__mocks__/mockMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const mockMetadata = {
role: ['Business Owner', 'Marketing'],
$template: 'templateName',
$parent: 'file_1188899160835',
name: 'something',
industry: 'Technology',
last_contacted_at: '2023-11-16T00:00:00.000Z',
$version: 9,
Expand All @@ -31,7 +30,6 @@ const mockMetadata = {
role: ['Developer'],
$template: 'templateName',
$parent: 'file_1318276254035',
name: '1',
industry: 'Technology',
last_contacted_at: '2023-11-01T00:00:00.000Z',
$version: 3,
Expand Down Expand Up @@ -94,7 +92,6 @@ const mockMetadata = {
$scope: 'enterprise_0',
$template: 'templateName',
$parent: 'file_1812508470016',
name: 'in folder 3 that doesnt have metadata',
$version: 0,
},
},
Expand Down Expand Up @@ -154,14 +151,6 @@ const mockSchema = {
hidden: false,
copyInstanceOnItemCopy: false,
fields: [
{
id: '56b6f00e-5db3-4875-a31d-14b20f63c0ea',
type: 'string',
key: 'name',
displayName: 'Name',
hidden: false,
description: 'The customer name',
},
{
id: '07d3c06c-5db4-4f3f-821e-19219ba70ed3',
type: 'date',
Expand Down Expand Up @@ -220,6 +209,13 @@ const mockSchema = {
},
],
},
{
id: 'c3f87bb0-44df-4689-aafe-b9ed4aecbb01',
type: 'float',
key: 'number',
displayName: 'Merit Count',
hidden: false,
},
],
};

Expand Down
10 changes: 8 additions & 2 deletions src/elements/content-explorer/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ItemGrid from '../common/item-grid';
import ItemList from '../common/item-list';
import ProgressBar from '../common/progress-bar';
import MetadataBasedItemList from '../../features/metadata-based-view';
import MetadataViewContainer, { MetadataViewContainerProps } from './MetadataViewContainer';
import MetadataViewContainer, { ExternalFilterValues, MetadataViewContainerProps } from './MetadataViewContainer';
import { isFeatureEnabled, type FeatureConfig } from '../common/feature-checking';
import { VIEW_ERROR, VIEW_METADATA, VIEW_MODE_LIST, VIEW_MODE_GRID, VIEW_SELECTED } from '../../constants';
import type { ViewMode } from '../common/flowTypes';
Expand Down Expand Up @@ -37,7 +37,11 @@ export interface ContentProps extends Required<ItemEventHandlers>, Required<Item
isTouch: boolean;
itemActions?: ItemAction[];
metadataTemplate?: MetadataTemplate;
metadataViewProps?: Omit<MetadataViewContainerProps, 'currentCollection'>;
metadataViewProps?: Omit<
MetadataViewContainerProps,
'hasError' | 'currentCollection' | 'metadataTemplate' | 'onMetadataFilter'
>;
onMetadataFilter?: (fields: ExternalFilterValues) => void;
onMetadataUpdate: (
item: BoxItem,
field: string,
Expand All @@ -57,6 +61,7 @@ const Content = ({
gridColumnCount,
metadataTemplate,
metadataViewProps,
onMetadataFilter,
onMetadataUpdate,
onSortChange,
view,
Expand Down Expand Up @@ -89,6 +94,7 @@ const Content = ({
isLoading={percentLoaded !== 100}
hasError={view === VIEW_ERROR}
metadataTemplate={metadataTemplate}
onMetadataFilter={onMetadataFilter}
onSortChange={onSortChange}
{...metadataViewProps}
/>
Expand Down
Loading