@object-ui/plugin-list 3.1.3 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +16 -10
- package/CHANGELOG.md +23 -0
- package/dist/index.js +79671 -97735
- package/dist/index.umd.cjs +52 -123
- package/dist/plugin-list.css +3 -1
- package/dist/src/ListView.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/ListView.tsx +2 -0
- package/src/__tests__/DataFetch.test.tsx +29 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/plugin-list",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "ListView plugin for Object UI - unified view component with view type switching",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"lucide-react": "^0.577.0",
|
|
28
|
-
"@object-ui/components": "3.1.
|
|
29
|
-
"@object-ui/core": "3.1.
|
|
30
|
-
"@object-ui/i18n": "3.1.
|
|
31
|
-
"@object-ui/mobile": "3.1.
|
|
32
|
-
"@object-ui/react": "3.1.
|
|
33
|
-
"@object-ui/types": "3.1.
|
|
28
|
+
"@object-ui/components": "3.1.5",
|
|
29
|
+
"@object-ui/core": "3.1.5",
|
|
30
|
+
"@object-ui/i18n": "3.1.5",
|
|
31
|
+
"@object-ui/mobile": "3.1.5",
|
|
32
|
+
"@object-ui/react": "3.1.5",
|
|
33
|
+
"@object-ui/types": "3.1.5"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/react": "19.2.14",
|
|
41
41
|
"@types/react-dom": "19.2.3",
|
|
42
|
-
"@vitejs/plugin-react": "^
|
|
42
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
43
43
|
"typescript": "^5.9.3",
|
|
44
|
-
"vite": "^
|
|
44
|
+
"vite": "^8.0.1",
|
|
45
45
|
"vite-plugin-dts": "^4.5.4",
|
|
46
|
-
"vitest": "^4.0
|
|
46
|
+
"vitest": "^4.1.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "vite build",
|
package/src/ListView.tsx
CHANGED
|
@@ -661,6 +661,8 @@ export const ListView: React.FC<ListViewProps> = ({
|
|
|
661
661
|
items = (results as any).data;
|
|
662
662
|
} else if (Array.isArray((results as any).records)) {
|
|
663
663
|
items = (results as any).records;
|
|
664
|
+
} else if (Array.isArray((results as any).value)) {
|
|
665
|
+
items = (results as any).value;
|
|
664
666
|
}
|
|
665
667
|
}
|
|
666
668
|
|
|
@@ -113,6 +113,35 @@ describe('ListView Data Fetch', () => {
|
|
|
113
113
|
});
|
|
114
114
|
});
|
|
115
115
|
|
|
116
|
+
// =========================================================================
|
|
117
|
+
// OData { value: [] } response format handling
|
|
118
|
+
// =========================================================================
|
|
119
|
+
describe('OData value response format', () => {
|
|
120
|
+
it('should extract records from { value: [] } OData response', async () => {
|
|
121
|
+
const items = [
|
|
122
|
+
{ id: '1', name: 'Alice' },
|
|
123
|
+
{ id: '2', name: 'Bob' },
|
|
124
|
+
];
|
|
125
|
+
mockDataSource.find.mockResolvedValue({ value: items, '@odata.count': 2 });
|
|
126
|
+
|
|
127
|
+
const schema: ListViewSchema = {
|
|
128
|
+
type: 'list-view',
|
|
129
|
+
objectName: 'contacts',
|
|
130
|
+
viewType: 'grid',
|
|
131
|
+
fields: ['name'],
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
renderWithProvider(<ListView schema={schema} dataSource={mockDataSource} />);
|
|
135
|
+
|
|
136
|
+
await vi.waitFor(() => {
|
|
137
|
+
expect(screen.getByTestId('record-count-bar')).toBeInTheDocument();
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// Records should be extracted and rendered (not empty)
|
|
141
|
+
expect(screen.queryByTestId('empty-state')).not.toBeInTheDocument();
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
116
145
|
// =========================================================================
|
|
117
146
|
// $expand race condition fix (Issue #939 Bug 1)
|
|
118
147
|
// =========================================================================
|