[ESLint rule]: recoil value and setter should be named after their at… (#1402)

* Override unwanted changes

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Toledodev <rafael.toledo@engenharia.ufjf.br>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>

* Fix the tests

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Toledodev <rafael.toledo@engenharia.ufjf.br>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>

---------

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Toledodev <rafael.toledo@engenharia.ufjf.br>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>
Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
This commit is contained in:
gitstart-twenty
2023-09-05 11:34:11 +03:00
committed by GitHub
parent 0ec4b78aee
commit 878302dd31
52 changed files with 400 additions and 281 deletions

View File

@ -27,22 +27,19 @@ export const useTableViews = <Entity, SortField>({
objectId: 'company' | 'person';
columnDefinitions: ColumnDefinition<ViewFieldMetadata>[];
}) => {
const currentViewId = useRecoilScopedValue(
const currentTableViewId = useRecoilScopedValue(
currentTableViewIdState,
TableRecoilScopeContext,
);
const currentColumns = useRecoilScopedValue(
const tableColumns = useRecoilScopedValue(
tableColumnsScopedState,
TableRecoilScopeContext,
);
const selectedFilters = useRecoilScopedValue(
const filters = useRecoilScopedValue(
filtersScopedState,
TableRecoilScopeContext,
);
const selectedSorts = useRecoilScopedValue(
sortsScopedState,
TableRecoilScopeContext,
);
const sorts = useRecoilScopedValue(sortsScopedState, TableRecoilScopeContext);
const { createViewFields, persistColumns } = useTableViewFields({
objectId,
@ -50,28 +47,28 @@ export const useTableViews = <Entity, SortField>({
});
const { createViewFilters, persistFilters } = useViewFilters({
availableFilters,
currentViewId,
currentViewId: currentTableViewId,
scopeContext: TableRecoilScopeContext,
});
const { createViewSorts, persistSorts } = useViewSorts({
availableSorts,
currentViewId,
currentViewId: currentTableViewId,
scopeContext: TableRecoilScopeContext,
});
const handleViewCreate = useCallback(
async (viewId: string) => {
await createViewFields(currentColumns, viewId);
await createViewFilters(selectedFilters, viewId);
await createViewSorts(selectedSorts, viewId);
await createViewFields(tableColumns, viewId);
await createViewFilters(filters, viewId);
await createViewSorts(sorts, viewId);
},
[
createViewFields,
createViewFilters,
createViewSorts,
currentColumns,
selectedFilters,
selectedSorts,
filters,
sorts,
tableColumns,
],
);