Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3679a2661b | |||
| 0c957c5eb1 | |||
| 0561ebbd74 | |||
| a41fc38d87 | |||
| 7c889d2125 | |||
| a42ddfd0bb |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-e2e-testing",
|
||||
"version": "0.40.0-canary",
|
||||
"version": "0.35.6",
|
||||
"description": "",
|
||||
"author": "",
|
||||
"private": true,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-emails",
|
||||
"version": "0.40.0-canary",
|
||||
"version": "0.35.6",
|
||||
"description": "",
|
||||
"author": "",
|
||||
"private": true,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-front",
|
||||
"version": "0.40.0-canary",
|
||||
"version": "0.35.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
+7
-4
@@ -13,7 +13,8 @@ import { SelectableItem } from '@/object-record/select/types/SelectableItem';
|
||||
import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';
|
||||
import { useGetCurrentView } from '@/views/hooks/useGetCurrentView';
|
||||
import { RelationFilterValue } from '@/views/view-filter-value/types/RelationFilterValue';
|
||||
import { relationFilterValueSchema } from '@/views/view-filter-value/validation-schemas/relationFilterValueSchema';
|
||||
import { jsonRelationFilterValueSchema } from '@/views/view-filter-value/validation-schemas/jsonRelationFilterValueSchema';
|
||||
import { simpleRelationFilterValueSchema } from '@/views/view-filter-value/validation-schemas/simpleRelationFilterValueSchema';
|
||||
import { IconUserCircle } from 'twenty-ui';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
@@ -55,14 +56,16 @@ export const ObjectFilterDropdownRecordSelect = ({
|
||||
const objectFilterDropdownSelectedRecordIds = useRecoilValue(
|
||||
objectFilterDropdownSelectedRecordIdsState,
|
||||
);
|
||||
const [fieldId] = useState(v4());
|
||||
|
||||
const selectedFilter = useRecoilValue(selectedFilterState);
|
||||
const [fieldId] = useState(v4());
|
||||
|
||||
const { isCurrentWorkspaceMemberSelected } = relationFilterValueSchema
|
||||
const { isCurrentWorkspaceMemberSelected } = jsonRelationFilterValueSchema
|
||||
.catch({
|
||||
isCurrentWorkspaceMemberSelected: false,
|
||||
selectedRecordIds: [],
|
||||
selectedRecordIds: simpleRelationFilterValueSchema.parse(
|
||||
selectedFilter?.value,
|
||||
),
|
||||
})
|
||||
.parse(selectedFilter?.value);
|
||||
|
||||
|
||||
+10
-2
@@ -34,7 +34,8 @@ import { ViewFilterGroup } from '@/views/types/ViewFilterGroup';
|
||||
import { ViewFilterGroupLogicalOperator } from '@/views/types/ViewFilterGroupLogicalOperator';
|
||||
import { resolveDateViewFilterValue } from '@/views/view-filter-value/utils/resolveDateViewFilterValue';
|
||||
import { resolveSelectViewFilterValue } from '@/views/view-filter-value/utils/resolveSelectViewFilterValue';
|
||||
import { relationFilterValueSchema } from '@/views/view-filter-value/validation-schemas/relationFilterValueSchema';
|
||||
import { jsonRelationFilterValueSchema } from '@/views/view-filter-value/validation-schemas/jsonRelationFilterValueSchema';
|
||||
import { simpleRelationFilterValueSchema } from '@/views/view-filter-value/validation-schemas/simpleRelationFilterValueSchema';
|
||||
import { endOfDay, roundToNearestMinutes, startOfDay } from 'date-fns';
|
||||
import { z } from 'zod';
|
||||
|
||||
@@ -305,7 +306,14 @@ const computeFilterRecordGqlOperationFilter = (
|
||||
case 'RELATION': {
|
||||
if (!isEmptyOperand) {
|
||||
const { isCurrentWorkspaceMemberSelected, selectedRecordIds } =
|
||||
relationFilterValueSchema.parse(filter.value);
|
||||
jsonRelationFilterValueSchema
|
||||
.catch({
|
||||
isCurrentWorkspaceMemberSelected: false,
|
||||
selectedRecordIds: simpleRelationFilterValueSchema.parse(
|
||||
filter.value,
|
||||
),
|
||||
})
|
||||
.parse(filter.value);
|
||||
|
||||
const recordIds = isCurrentWorkspaceMemberSelected
|
||||
? [
|
||||
|
||||
@@ -10,7 +10,8 @@ import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/component-sta
|
||||
import { useGetCurrentView } from '@/views/hooks/useGetCurrentView';
|
||||
import { useUpsertCombinedViewFilters } from '@/views/hooks/useUpsertCombinedViewFilters';
|
||||
import { availableFilterDefinitionsComponentState } from '@/views/states/availableFilterDefinitionsComponentState';
|
||||
import { relationFilterValueSchema } from '@/views/view-filter-value/validation-schemas/relationFilterValueSchema';
|
||||
import { jsonRelationFilterValueSchema } from '@/views/view-filter-value/validation-schemas/jsonRelationFilterValueSchema';
|
||||
import { simpleRelationFilterValueSchema } from '@/views/view-filter-value/validation-schemas/simpleRelationFilterValueSchema';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
type ViewBarFilterEffectProps = {
|
||||
@@ -70,10 +71,12 @@ export const ViewBarFilterEffect = ({
|
||||
filterDefinitionUsedInDropdown?.fieldMetadataId,
|
||||
);
|
||||
|
||||
const { selectedRecordIds } = relationFilterValueSchema
|
||||
const { selectedRecordIds } = jsonRelationFilterValueSchema
|
||||
.catch({
|
||||
isCurrentWorkspaceMemberSelected: false,
|
||||
selectedRecordIds: [],
|
||||
selectedRecordIds: simpleRelationFilterValueSchema.parse(
|
||||
viewFilterUsedInDropdown?.value,
|
||||
),
|
||||
})
|
||||
.parse(viewFilterUsedInDropdown?.value);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { generateFindManyRecordsQuery } from '@/object-record/utils/generateFindManyRecordsQuery';
|
||||
import { ViewFilter } from '@/views/types/ViewFilter';
|
||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||
import { relationFilterValueSchemaObject } from '@/views/view-filter-value/validation-schemas/relationFilterValueSchema';
|
||||
import { relationFilterValueSchemaObject } from '@/views/view-filter-value/validation-schemas/jsonRelationFilterValueSchema';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { relationFilterValueSchema } from '@/views/view-filter-value/validation-schemas/relationFilterValueSchema';
|
||||
import { jsonRelationFilterValueSchema } from '@/views/view-filter-value/validation-schemas/jsonRelationFilterValueSchema';
|
||||
import { z } from 'zod';
|
||||
|
||||
export type RelationFilterValue = z.infer<typeof relationFilterValueSchema>;
|
||||
export type RelationFilterValue = z.infer<typeof jsonRelationFilterValueSchema>;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ export const relationFilterValueSchemaObject = z.object({
|
||||
selectedRecordIds: z.array(z.string()),
|
||||
});
|
||||
|
||||
export const relationFilterValueSchema = z
|
||||
export const jsonRelationFilterValueSchema = z
|
||||
.string()
|
||||
.transform((value, ctx) => {
|
||||
try {
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const simpleRelationFilterValueSchema = z
|
||||
.preprocess((value) => {
|
||||
try {
|
||||
return typeof value === 'string' ? JSON.parse(value) : [];
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}, z.array(z.string().uuid()))
|
||||
.catch([]);
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-server",
|
||||
"version": "0.40.0-canary",
|
||||
"version": "0.35.6",
|
||||
"description": "",
|
||||
"author": "",
|
||||
"private": true,
|
||||
|
||||
@@ -44,7 +44,7 @@ export class BillingResolver {
|
||||
) {
|
||||
return {
|
||||
url: await this.billingPortalWorkspaceService.computeBillingPortalSessionURLOrThrow(
|
||||
workspace.id,
|
||||
workspace,
|
||||
returnUrlPath,
|
||||
),
|
||||
};
|
||||
|
||||
+8
-4
@@ -34,7 +34,9 @@ export class BillingPortalWorkspaceService {
|
||||
plan?: BillingPlanKey,
|
||||
requirePaymentMethod?: boolean,
|
||||
): Promise<string> {
|
||||
const frontBaseUrl = this.domainManagerService.getBaseUrl();
|
||||
const frontBaseUrl = this.domainManagerService.buildWorkspaceURL({
|
||||
subdomain: workspace.subdomain,
|
||||
});
|
||||
const cancelUrl = frontBaseUrl.toString();
|
||||
|
||||
if (successUrlPath) {
|
||||
@@ -70,13 +72,13 @@ export class BillingPortalWorkspaceService {
|
||||
}
|
||||
|
||||
async computeBillingPortalSessionURLOrThrow(
|
||||
workspaceId: string,
|
||||
workspace: Workspace,
|
||||
returnUrlPath?: string,
|
||||
) {
|
||||
const currentSubscription =
|
||||
await this.billingSubscriptionService.getCurrentBillingSubscriptionOrThrow(
|
||||
{
|
||||
workspaceId,
|
||||
workspaceId: workspace.id,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -90,7 +92,9 @@ export class BillingPortalWorkspaceService {
|
||||
throw new Error('Error: missing stripeCustomerId');
|
||||
}
|
||||
|
||||
const frontBaseUrl = this.domainManagerService.getBaseUrl();
|
||||
const frontBaseUrl = this.domainManagerService.buildWorkspaceURL({
|
||||
subdomain: workspace.subdomain,
|
||||
});
|
||||
|
||||
if (returnUrlPath) {
|
||||
frontBaseUrl.pathname = returnUrlPath;
|
||||
|
||||
+2
@@ -81,6 +81,8 @@ export class GmailGetMessagesService {
|
||||
response.error,
|
||||
messageIds[index],
|
||||
);
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return parseAndFormatGmailMessage(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-ui",
|
||||
"version": "0.40.0-canary",
|
||||
"version": "0.35.6",
|
||||
"type": "module",
|
||||
"main": "./src/index.ts",
|
||||
"exports": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-website",
|
||||
"version": "0.40.0-canary",
|
||||
"version": "0.35.6",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"nx": "NX_DEFAULT_PROJECT=twenty-website node ../../node_modules/nx/bin/nx.js",
|
||||
|
||||
Reference in New Issue
Block a user