fix: custom views tabs.

This commit is contained in:
a.bouhuolia
2021-08-04 16:55:50 +02:00
parent 4eb20162bb
commit 400281fdfd
18 changed files with 184 additions and 164 deletions

View File

@@ -516,12 +516,12 @@ export function getPagesCountFromPaginationMeta(pagination) {
* Transformes the table state to url query.
*/
export function transformTableStateToQuery(tableState) {
const { pageSize, pageIndex, customViewId, sortBy } = tableState;
const { pageSize, pageIndex, viewSlug, sortBy } = tableState;
const query = {
pageSize,
page: pageIndex + 1,
...(customViewId ? { customViewId } : {}),
...(viewSlug ? { viewSlug } : {}),
...(Array.isArray(sortBy) && sortBy.length > 0
? {
column_sort_by: sortBy[0].id,
@@ -680,4 +680,8 @@ export const ensureEntriesHasEmptyLine = R.curry(
}
return entries;
},
);
);
export const transfromViewsToTabs = (views) => {
return views.map(view => ({ ..._.pick(view, ['slug', 'name']) }))
}