Removed all v2 in naming of state management logic (#13675)

This PR removes any V2 naming in state management logic and some minor
utils and hooks.

It has a lot of changes but nearly all of them were made by the rename
functionality of vscode which is deterministic, so it shouldn't
introduce any regression.

QA has been made on this PR on the main features of the app without any
noticeable issue.

Also renamed some other v2 naming related items : 
- TextInputV2 => TextInput
- TextInput => SettingsTextInput
- ObjectFilterDropdownFilterSelectMenuItemV2 =>
ObjectFilterDropdownFilterSelectMenuItem
- useInitDraftValueV2 => useInitDraftValue
- useOpenRecordTableCellV2 => useOpenRecordTableCell
This commit is contained in:
Lucas Bordeau
2025-08-06 12:09:15 +02:00
committed by GitHub
parent d8b24812b0
commit de802b1447
773 changed files with 3355 additions and 3462 deletions
@@ -7,7 +7,7 @@ import { useSetLastVisitedObjectMetadataId } from '@/navigation/hooks/useSetLast
import { useSetLastVisitedViewForObjectMetadataNamePlural } from '@/navigation/hooks/useSetLastVisitedViewForObjectMetadataNamePlural';
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { prefetchViewFromViewIdFamilySelector } from '@/prefetch/states/selector/prefetchViewFromViewIdFamilySelector';
import { useRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentStateV2';
import { useRecoilComponentState } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentState';
import { useEffect } from 'react';
import { useRecoilValue } from 'recoil';
@@ -33,13 +33,13 @@ export const MainContextStoreProviderEffect = ({
useSetLastVisitedObjectMetadataId();
const [contextStoreCurrentViewId, setContextStoreCurrentViewId] =
useRecoilComponentStateV2(
useRecoilComponentState(
contextStoreCurrentViewIdComponentState,
MAIN_CONTEXT_STORE_INSTANCE_ID,
);
const [contextStoreCurrentViewType, setContextStoreCurrentViewType] =
useRecoilComponentStateV2(
useRecoilComponentState(
contextStoreCurrentViewTypeComponentState,
MAIN_CONTEXT_STORE_INSTANCE_ID,
);
@@ -47,7 +47,7 @@ export const MainContextStoreProviderEffect = ({
const [
contextStoreCurrentObjectMetadataItemId,
setContextStoreCurrentObjectMetadataItemId,
] = useRecoilComponentStateV2(
] = useRecoilComponentState(
contextStoreCurrentObjectMetadataItemIdComponentState,
MAIN_CONTEXT_STORE_INSTANCE_ID,
);
@@ -1,11 +1,11 @@
import { contextStoreCurrentObjectMetadataItemIdComponentState } from '@/context-store/states/contextStoreCurrentObjectMetadataItemIdComponentState';
import { useObjectMetadataItemById } from '@/object-metadata/hooks/useObjectMetadataItemById';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
export const useContextStoreObjectMetadataItemOrThrow = (
contextStoreInstanceId?: string,
) => {
const objectMetadataItemId = useRecoilComponentValueV2(
const objectMetadataItemId = useRecoilComponentValue(
contextStoreCurrentObjectMetadataItemIdComponentState,
contextStoreInstanceId,
);
@@ -8,7 +8,7 @@ import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadat
import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
import { useFilterValueDependencies } from '@/object-record/record-filter/hooks/useFilterValueDependencies';
import { RecordFilterOperand } from '@/object-record/record-filter/types/RecordFilterOperand';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
import { useRecoilValue } from 'recoil';
export const useFindManyRecordsSelectedInContextStore = ({
@@ -18,7 +18,7 @@ export const useFindManyRecordsSelectedInContextStore = ({
instanceId?: string;
limit?: number;
}) => {
const contextStoreCurrentObjectMetadataItemId = useRecoilComponentValueV2(
const contextStoreCurrentObjectMetadataItemId = useRecoilComponentValue(
contextStoreCurrentObjectMetadataItemIdComponentState,
instanceId,
);
@@ -27,17 +27,17 @@ export const useFindManyRecordsSelectedInContextStore = ({
objectId: contextStoreCurrentObjectMetadataItemId ?? '',
});
const contextStoreTargetedRecordsRule = useRecoilComponentValueV2(
const contextStoreTargetedRecordsRule = useRecoilComponentValue(
contextStoreTargetedRecordsRuleComponentState,
instanceId,
);
const contextStoreFilters = useRecoilComponentValueV2(
const contextStoreFilters = useRecoilComponentValue(
contextStoreFiltersComponentState,
instanceId,
);
const contextStoreAnyFieldFilterValue = useRecoilComponentValueV2(
const contextStoreAnyFieldFilterValue = useRecoilComponentValue(
contextStoreAnyFieldFilterValueComponentState,
instanceId,
);
@@ -1,8 +1,8 @@
import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';
import { createComponentStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentStateV2';
import { createComponentState } from '@/ui/utilities/state/component-state/utils/createComponentState';
export const contextStoreAnyFieldFilterValueComponentState =
createComponentStateV2<string>({
createComponentState<string>({
key: 'contextStoreAnyFieldFilterValueComponentState',
defaultValue: '',
componentInstanceContext: ContextStoreComponentInstanceContext,
@@ -1,8 +1,8 @@
import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';
import { createComponentStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentStateV2';
import { createComponentState } from '@/ui/utilities/state/component-state/utils/createComponentState';
export const contextStoreCurrentObjectMetadataItemIdComponentState =
createComponentStateV2<string | undefined>({
createComponentState<string | undefined>({
key: 'contextStoreCurrentObjectMetadataItemIdComponentState',
defaultValue: undefined,
componentInstanceContext: ContextStoreComponentInstanceContext,
@@ -1,7 +1,7 @@
import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';
import { createComponentStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentStateV2';
import { createComponentState } from '@/ui/utilities/state/component-state/utils/createComponentState';
export const contextStoreCurrentViewIdComponentState = createComponentStateV2<
export const contextStoreCurrentViewIdComponentState = createComponentState<
string | undefined
>({
key: 'contextStoreCurrentViewIdComponentState',
@@ -1,9 +1,9 @@
import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';
import { ContextStoreViewType } from '@/context-store/types/ContextStoreViewType';
import { createComponentStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentStateV2';
import { createComponentState } from '@/ui/utilities/state/component-state/utils/createComponentState';
export const contextStoreCurrentViewTypeComponentState =
createComponentStateV2<ContextStoreViewType | null>({
createComponentState<ContextStoreViewType | null>({
key: 'contextStoreCurrentViewTypeComponentState',
defaultValue: null,
componentInstanceContext: ContextStoreComponentInstanceContext,
@@ -1,8 +1,8 @@
import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';
import { RecordFilter } from '@/object-record/record-filter/types/RecordFilter';
import { createComponentStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentStateV2';
import { createComponentState } from '@/ui/utilities/state/component-state/utils/createComponentState';
export const contextStoreFiltersComponentState = createComponentStateV2<
export const contextStoreFiltersComponentState = createComponentState<
RecordFilter[]
>({
key: 'contextStoreFiltersComponentState',
@@ -1,8 +1,8 @@
import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';
import { createComponentStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentStateV2';
import { createComponentState } from '@/ui/utilities/state/component-state/utils/createComponentState';
export const contextStoreNumberOfSelectedRecordsComponentState =
createComponentStateV2<number>({
createComponentState<number>({
key: 'contextStoreNumberOfSelectedRecordsComponentState',
defaultValue: 0,
componentInstanceContext: ContextStoreComponentInstanceContext,
@@ -2,7 +2,7 @@ import { ContextStoreComponentInstanceContext } from '@/context-store/states/con
import { RecordFilterGroup } from '@/object-record/record-filter-group/types/RecordFilterGroup';
import { RecordFilter } from '@/object-record/record-filter/types/RecordFilter';
import { RecordSort } from '@/object-record/record-sort/types/RecordSort';
import { createComponentStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentStateV2';
import { createComponentState } from '@/ui/utilities/state/component-state/utils/createComponentState';
type RecordShowParentViewComponentState = {
parentViewComponentId: string;
@@ -13,10 +13,8 @@ type RecordShowParentViewComponentState = {
};
export const contextStoreRecordShowParentViewComponentState =
createComponentStateV2<RecordShowParentViewComponentState | undefined | null>(
{
key: 'contextStoreRecordShowParentViewComponentState',
defaultValue: undefined,
componentInstanceContext: ContextStoreComponentInstanceContext,
},
);
createComponentState<RecordShowParentViewComponentState | undefined | null>({
key: 'contextStoreRecordShowParentViewComponentState',
defaultValue: undefined,
componentInstanceContext: ContextStoreComponentInstanceContext,
});
@@ -1,5 +1,5 @@
import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';
import { createComponentStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentStateV2';
import { createComponentState } from '@/ui/utilities/state/component-state/utils/createComponentState';
type ContextStoreTargetedRecordsRuleSelectionMode = {
mode: 'selection';
@@ -16,7 +16,7 @@ export type ContextStoreTargetedRecordsRule =
| ContextStoreTargetedRecordsRuleExclusionMode;
export const contextStoreTargetedRecordsRuleComponentState =
createComponentStateV2<ContextStoreTargetedRecordsRule>({
createComponentState<ContextStoreTargetedRecordsRule>({
key: 'contextStoreTargetedRecordsRuleComponentState',
defaultValue: {
mode: 'selection',