@ -11,8 +11,8 @@ export const prefetchViewsFromObjectMetadataItemFamilySelector = selectorFamily<
|
||||
({ objectMetadataItemId }) =>
|
||||
({ get }) => {
|
||||
const views = get(prefetchViewsState);
|
||||
return views.filter(
|
||||
(view) => view.objectMetadataId === objectMetadataItemId,
|
||||
);
|
||||
return views
|
||||
.filter((view) => view.objectMetadataId === objectMetadataItemId)
|
||||
.sort((a, b) => a.position - b.position);
|
||||
},
|
||||
});
|
||||
|
||||
@ -20,9 +20,9 @@ import { viewPickerReferenceViewIdComponentState } from '@/views/view-picker/sta
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { moveArrayItem } from '~/utils/array/moveArrayItem';
|
||||
import { IconPlus } from 'twenty-ui/display';
|
||||
import { MenuItem } from 'twenty-ui/navigation';
|
||||
import { moveArrayItem } from '~/utils/array/moveArrayItem';
|
||||
|
||||
const StyledBoldDropdownMenuItemsContainer = styled(DropdownMenuItemsContainer)`
|
||||
font-weight: ${({ theme }) => theme.font.weight.regular};
|
||||
@ -74,17 +74,21 @@ export const ViewPickerListContent = () => {
|
||||
};
|
||||
|
||||
const handleDragEnd = useCallback(
|
||||
(result: DropResult) => {
|
||||
async (result: DropResult) => {
|
||||
if (!result.destination) return;
|
||||
|
||||
moveArrayItem(viewsOnCurrentObject, {
|
||||
const viewsReordered = moveArrayItem(viewsOnCurrentObject, {
|
||||
fromIndex: result.source.index,
|
||||
toIndex: result.destination.index,
|
||||
}).forEach((view, index) => {
|
||||
if (view.position !== index) {
|
||||
updateView({ ...view, position: index });
|
||||
}
|
||||
});
|
||||
|
||||
Promise.all(
|
||||
viewsReordered.map(async (view, index) => {
|
||||
if (view.position !== index) {
|
||||
await updateView({ ...view, position: index });
|
||||
}
|
||||
}),
|
||||
);
|
||||
},
|
||||
[updateView, viewsOnCurrentObject],
|
||||
);
|
||||
|
||||
@ -181,6 +181,9 @@ export const ChooseYourPlan = () => {
|
||||
? BillingPlanKey.ENTERPRISE
|
||||
: BillingPlanKey.PRO;
|
||||
|
||||
const planName = plans?.plans.find((plan) => plan.planKey === currentPlan)
|
||||
?.baseProduct.name;
|
||||
|
||||
return (
|
||||
<>
|
||||
{isDefined(baseProductPrice) && isDefined(billing) ? (
|
||||
@ -191,9 +194,7 @@ export const ChooseYourPlan = () => {
|
||||
: t`Get your subscription`}
|
||||
</Title>
|
||||
{hasWithoutCreditCardTrialPeriod ? (
|
||||
<SubTitle>
|
||||
<Trans>Cancel anytime</Trans>
|
||||
</SubTitle>
|
||||
<SubTitle>{planName}</SubTitle>
|
||||
) : (
|
||||
withCreditCardTrialPeriod && (
|
||||
<SubTitle>
|
||||
|
||||
Reference in New Issue
Block a user