3157 refactor scoped states to move to v3 (#3180)

* renaming

* renaming

* create getDropdownScopeInjectors

* update useDropdown

* create internal hooks folder

* update record-table states to be scoped states

* update record-table selectors to be scoped selectors

* create utils scope injector

* refactor record-table wip

* refactor record-table wip

* wip

* inject scopeId in selectors

* update intenal hooks

* update intenal hooks

* update intenal hooks

* update intenal hooks

* update intenal hooks

* update intenal hooks

* update internal hooks

* update internal hooks

* update internal hooks

* update internal hooks

* update useTableColumns

* update states and hooks

* refactoring

* refactoring

* refactoring

* refactoring

* refactoring

* refactoring

* refactoring

* refactoring

* refactoring

* fix scopeId not in context

* fix lint errors

* fix error in story

* fix errors: wip

* fix errors

* fix error

* fix jest test

* fix scopeId not defined

* fix jest test

* Bug fixes

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
bosiraphael
2024-01-03 19:45:14 +01:00
committed by GitHub
parent 65250839fb
commit b0d3e6d8d3
112 changed files with 1447 additions and 716 deletions

View File

@ -24,7 +24,7 @@ export const SettingsAccountsRowDropdownMenu = ({
const dropdownScopeId = `settings-account-row-${account.uuid}`;
const navigate = useNavigate();
const { closeDropdown } = useDropdown({ dropdownScopeId });
const { closeDropdown } = useDropdown(dropdownScopeId);
return (
<DropdownScope dropdownScopeId={dropdownScopeId}>

View File

@ -68,12 +68,12 @@ export const SettingsObjectFieldSelectFormOptionRow = ({
return { color: `${baseScopeId}-color`, actions: `${baseScopeId}-actions` };
}, []);
const { closeDropdown: closeColorDropdown } = useDropdown({
dropdownScopeId: dropdownScopeIds.color,
});
const { closeDropdown: closeActionsDropdown } = useDropdown({
dropdownScopeId: dropdownScopeIds.actions,
});
const { closeDropdown: closeColorDropdown } = useDropdown(
dropdownScopeIds.color,
);
const { closeDropdown: closeActionsDropdown } = useDropdown(
dropdownScopeIds.actions,
);
return (
<StyledRow className={className}>

View File

@ -57,7 +57,7 @@ export const SettingsAboutSection = ({
const { getIcon } = useIcons();
const Icon = getIcon(iconKey);
const { closeDropdown } = useDropdown({ dropdownScopeId });
const { closeDropdown } = useDropdown(dropdownScopeId);
const handleEdit = () => {
onEdit();

View File

@ -27,7 +27,7 @@ export const SettingsObjectFieldActiveActionDropdown = ({
}: SettingsObjectFieldActiveActionDropdownProps) => {
const dropdownScopeId = `${scopeKey}-settings-field-active-action-dropdown`;
const { closeDropdown } = useDropdown({ dropdownScopeId });
const { closeDropdown } = useDropdown(dropdownScopeId);
const handleEdit = () => {
onEdit();

View File

@ -20,7 +20,7 @@ export const SettingsObjectFieldDisabledActionDropdown = ({
}: SettingsObjectFieldDisabledActionDropdownProps) => {
const dropdownScopeId = `${scopeKey}-settings-field-disabled-action-dropdown`;
const { closeDropdown } = useDropdown({ dropdownScopeId });
const { closeDropdown } = useDropdown(dropdownScopeId);
const handleActivate = () => {
onActivate();

View File

@ -22,7 +22,7 @@ export const SettingsObjectDisabledMenuDropDown = ({
}: SettingsObjectDisabledMenuDropDownProps) => {
const dropdownScopeId = `${scopeKey}-settings-object-disabled-menu-dropdown`;
const { closeDropdown } = useDropdown({ dropdownScopeId });
const { closeDropdown } = useDropdown(dropdownScopeId);
const handleActivate = () => {
onActivate();