Skip to content

Commit fb7f2a1

Browse files
committed
Merge branch 'dev' of https://github.com/zenml-io/zenml-dashboard into feat/ahsan-v2
2 parents 9669f9f + 821c672 commit fb7f2a1

File tree

3 files changed

+47
-20
lines changed

3 files changed

+47
-20
lines changed

src/ui/components/Filters/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -692,13 +692,12 @@ const FilterComponent = ({
692692
className="text-muted h5"
693693
>
694694
{/* Filter your stack */}
695-
{!applyFilter && !filters[0]?.column?.selectedValue?.label ? (
695+
{!applyFilter && !filters[0]?.filterValue ? (
696696
<Paragraph className={styles.filterplaceholder}>
697697
Filter list
698+
{console.log(filters, 'filters1')}
698699
</Paragraph>
699-
) : filters[0]?.column?.selectedValue.label &&
700-
!applyFilter &&
701-
!searchText ? (
700+
) : filters[0]?.filterValue && !applyFilter && !searchText ? (
702701
filters.map((filter: any, index: number) => {
703702
return (
704703
<FlexBox.Row key={index} className={styles.tile}>
@@ -730,8 +729,7 @@ const FilterComponent = ({
730729
Filter list
731730
</Paragraph>
732731
)}
733-
{!applyFilter &&
734-
!filters[0]?.column?.selectedValue?.label ? null : filters[0]
732+
{!applyFilter && !filters[0]?.filterValue ? null : filters[0]
735733
?.column?.selectedValue.label &&
736734
!applyFilter &&
737735
!searchText ? (

src/ui/layouts/common/Table/index.tsx

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -183,42 +183,63 @@ export const Table: React.FC<TableProps> = ({
183183
// console.log(check, '333');
184184
useEffect(() => {
185185
// console.log(locationPath.pathname.split('/')[4], 'locationPath1');
186-
setItemPerPage(DEFAULT_ITEMS_PER_PAGE);
186+
setItemPerPage(itemPerPage);
187+
if (filters) {
188+
setPageIndex(0);
189+
}
187190
switch (componentName) {
188191
case 'stacks':
189192
if (CheckIfRun) {
190-
dispatchStackRunsData(id, 1, 5, filters as any, activeSorting);
193+
dispatchStackRunsData(
194+
id,
195+
1,
196+
itemPerPage,
197+
filters as any,
198+
activeSorting,
199+
);
191200
break;
192201
} else {
193-
dispatchStackData(1, 5, filters as any, activeSorting);
202+
dispatchStackData(1, itemPerPage, filters as any, activeSorting);
194203
break;
195204
}
196205
case 'components':
197206
if (CheckIfRun) {
198207
dispatchStackComponentRunsData(
199208
id,
200209
1,
201-
5,
210+
itemPerPage,
202211
filters as any,
203212
activeSorting,
204213
);
205214
break;
206215
} else {
207-
dispatchStackComponentsData(1, 5, filters as any, activeSorting);
216+
dispatchStackComponentsData(
217+
1,
218+
itemPerPage,
219+
filters as any,
220+
activeSorting,
221+
);
208222
break;
209223
}
210224
case 'pipelines':
211225
if (CheckIfRun) {
212-
dispatchPipelineRunsData(id, 1, 5, filters as any, activeSorting);
226+
dispatchPipelineRunsData(
227+
id,
228+
1,
229+
itemPerPage,
230+
filters as any,
231+
activeSorting,
232+
);
213233
break;
214234
} else {
235+
console.log(itemPerPage, 'itemPerPage');
215236
if (!renderAfterRow) break;
216-
dispatchPipelineData(1, 5, filters as any, activeSorting);
237+
dispatchPipelineData(1, itemPerPage, filters as any, activeSorting);
217238
break;
218239
}
219240

220241
case 'all-runs':
221-
dispatchAllrunsData(1, 5, filters as any, activeSorting);
242+
dispatchAllrunsData(1, itemPerPage, filters as any, activeSorting);
222243
break;
223244

224245
default:
@@ -252,7 +273,7 @@ export const Table: React.FC<TableProps> = ({
252273
<tr className={showHeader ? styles.tableHeaderRow : ''}>
253274
{headerCols.map((headerCol: HeaderCol, index: number, i) => (
254275
<th
255-
className={styles.tableHeadingTh}
276+
className={styles.tableHeadingTh}
256277
style={{
257278
width: headerCol.width,
258279
color: '#424240',
@@ -261,8 +282,12 @@ export const Table: React.FC<TableProps> = ({
261282
}}
262283
key={index}
263284
>
264-
<Box style={{ backgroundColor: '#f6f67' }} paddingVertical={showHeader ? 'sm' : null} paddingLeft="lg">
265-
{headerCol.render && headerCol.render()}
285+
<Box
286+
style={{ backgroundColor: '#f6f67' }}
287+
paddingVertical={showHeader ? 'sm' : null}
288+
paddingLeft="lg"
289+
>
290+
{headerCol.render && headerCol.render()}
266291
</Box>
267292
</th>
268293
))}
@@ -284,7 +309,9 @@ export const Table: React.FC<TableProps> = ({
284309
styles.tableRow,
285310
trOnClick && styles.clickableTableRow,
286311
)}
287-
style={{ backgroundColor: index % 2 !== 0 ? '#F5F3F9' : 'white' }}
312+
style={{
313+
backgroundColor: index % 2 !== 0 ? '#F5F3F9' : 'white',
314+
}}
288315
key={index}
289316
>
290317
{headerCols.map((headerCol: HeaderCol, index: number) => (
@@ -295,7 +322,7 @@ export const Table: React.FC<TableProps> = ({
295322
>
296323
<Box paddingVertical="sm" paddingLeft="lg">
297324
<Truncate maxLines={1}>
298-
{headerCol.renderRow(headerRow)}
325+
{headerCol.renderRow(headerRow)}
299326
</Truncate>
300327
</Box>
301328
</td>

src/ui/layouts/pipelines/RunsTable/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ export const RunsTable: React.FC<{
6969
});
7070

7171
useEffect(() => {
72-
getSorted(activeSorting, activeSortingDirection);
72+
if (getSorted) {
73+
getSorted(activeSorting, activeSortingDirection);
74+
}
7375
// eslint-disable-next-line react-hooks/exhaustive-deps
7476
}, [getSorted]);
7577

0 commit comments

Comments
 (0)