Skip to content

Commit f07ec29

Browse files
authored
use maxSizeMbStaticDataSources in PlanType (#2290)
* Introduce duplicated field maxSizeMbStaticDataSources in Plan to rename field * Rename all limits to match PlanType * use maxSizeMbStaticDataSources in PlanType * Rework following new names + handle remove old fields
1 parent 9c51f69 commit f07ec29

File tree

6 files changed

+15
-59
lines changed

6 files changed

+15
-59
lines changed

front/lib/auth.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,9 @@ export async function planForWorkspace(
456456
"isManagedNotionAllowed",
457457
"isManagedGoogleDriveAllowed",
458458
"isManagedGithubAllowed",
459-
"maxNbStaticDataSources",
460-
"maxNbStaticDocuments",
461-
"maxSizeStaticDataSources",
459+
"maxDataSourcesCount",
460+
"maxDataSourcesDocumentsCount",
461+
"maxDataSourcesDocumentsSizeMb",
462462
"maxUsersInWorkspace",
463463
],
464464
},
@@ -504,10 +504,10 @@ export async function planForWorkspace(
504504
isGithubAllowed: plan.isManagedGithubAllowed,
505505
},
506506
dataSources: {
507-
count: plan.maxNbStaticDataSources,
507+
count: plan.maxDataSourcesCount,
508508
documents: {
509-
count: plan.maxNbStaticDocuments,
510-
sizeMb: plan.maxSizeStaticDataSources,
509+
count: plan.maxDataSourcesDocumentsCount,
510+
sizeMb: plan.maxDataSourcesDocumentsSizeMb,
511511
},
512512
},
513513
users: {

front/lib/models/plan.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ export class Plan extends Model<
3232
declare isManagedNotionAllowed: boolean;
3333
declare isManagedGoogleDriveAllowed: boolean;
3434
declare isManagedGithubAllowed: boolean;
35-
36-
declare maxNbStaticDataSources: number;
37-
declare maxNbStaticDocuments: number;
38-
declare maxSizeStaticDataSources: number;
39-
4035
declare maxDataSourcesCount: number;
4136
declare maxDataSourcesDocumentsCount: number;
4237
declare maxDataSourcesDocumentsSizeMb: number;
@@ -98,18 +93,6 @@ Plan.init(
9893
type: DataTypes.BOOLEAN,
9994
defaultValue: false,
10095
},
101-
maxNbStaticDataSources: {
102-
type: DataTypes.INTEGER,
103-
allowNull: false,
104-
},
105-
maxNbStaticDocuments: {
106-
type: DataTypes.INTEGER,
107-
allowNull: false,
108-
},
109-
maxSizeStaticDataSources: {
110-
type: DataTypes.INTEGER,
111-
allowNull: false,
112-
},
11396
maxDataSourcesCount: {
11497
type: DataTypes.INTEGER,
11598
allowNull: false,

front/lib/plans/enterprise_plans.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ export const ENT_PLAN_FAKE_DATA: PlanAttributes = {
3232
isManagedNotionAllowed: true,
3333
isManagedGoogleDriveAllowed: true,
3434
isManagedGithubAllowed: true,
35-
// to remove
36-
maxNbStaticDataSources: -1,
37-
maxNbStaticDocuments: -1,
38-
maxSizeStaticDataSources: 2, // 2MB
39-
// to keep
4035
maxDataSourcesCount: -1,
4136
maxDataSourcesDocumentsCount: -1,
4237
maxDataSourcesDocumentsSizeMb: 2,

front/lib/plans/free_plans.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ export const FREE_TEST_PLAN_DATA: PlanAttributes = {
3535
isManagedNotionAllowed: false,
3636
isManagedGoogleDriveAllowed: false,
3737
isManagedGithubAllowed: false,
38-
39-
// to remove
40-
maxNbStaticDataSources: 10,
41-
maxNbStaticDocuments: 50,
42-
maxSizeStaticDataSources: 2, // 2MB
43-
// to keep
4438
maxDataSourcesCount: 10,
4539
maxDataSourcesDocumentsCount: 10,
4640
maxDataSourcesDocumentsSizeMb: 2,
@@ -62,12 +56,6 @@ const FREE_PLANS_DATA: PlanAttributes[] = [
6256
isManagedNotionAllowed: true,
6357
isManagedGoogleDriveAllowed: true,
6458
isManagedGithubAllowed: true,
65-
66-
// to remove
67-
maxNbStaticDataSources: -1,
68-
maxNbStaticDocuments: -1,
69-
maxSizeStaticDataSources: 2, // 2MB
70-
// to keep
7159
maxDataSourcesCount: -1,
7260
maxDataSourcesDocumentsCount: -1,
7361
maxDataSourcesDocumentsSizeMb: 2,

front/lib/plans/pro_plans.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ const PRO_PLANS_DATA: PlanAttributes[] = [
3737
isManagedNotionAllowed: true,
3838
isManagedGoogleDriveAllowed: true,
3939
isManagedGithubAllowed: true,
40-
// to remove
41-
maxNbStaticDataSources: -1,
42-
maxNbStaticDocuments: -1,
43-
maxSizeStaticDataSources: 2, // 2MB
44-
// to keep
4540
maxDataSourcesCount: -1,
4641
maxDataSourcesDocumentsCount: -1,
4742
maxDataSourcesDocumentsSizeMb: 2,
@@ -57,11 +52,6 @@ const PRO_PLANS_DATA: PlanAttributes[] = [
5752
isManagedNotionAllowed: true,
5853
isManagedGoogleDriveAllowed: true,
5954
isManagedGithubAllowed: true,
60-
// to remove
61-
maxNbStaticDataSources: -1,
62-
maxNbStaticDocuments: -1,
63-
maxSizeStaticDataSources: 2, // 2MB
64-
// to keep
6555
maxDataSourcesCount: -1,
6656
maxDataSourcesDocumentsCount: -1,
6757
maxDataSourcesDocumentsSizeMb: 2,

front/lib/plans/subscription.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ export const internalSubscribeWorkspaceToFreeTestPlan = async ({
5757
isGithubAllowed: freeTestPlan.isManagedGithubAllowed,
5858
},
5959
dataSources: {
60-
count: freeTestPlan.maxNbStaticDataSources,
60+
count: freeTestPlan.maxDataSourcesCount,
6161
documents: {
62-
count: freeTestPlan.maxNbStaticDocuments,
63-
sizeMb: freeTestPlan.maxSizeStaticDataSources,
62+
count: freeTestPlan.maxDataSourcesDocumentsCount,
63+
sizeMb: freeTestPlan.maxDataSourcesDocumentsSizeMb,
6464
},
6565
},
6666
users: {
@@ -145,10 +145,10 @@ export const internalSubscribeWorkspaceToFreeUpgradedPlan = async ({
145145
isGithubAllowed: plan.isManagedGithubAllowed,
146146
},
147147
dataSources: {
148-
count: plan.maxNbStaticDataSources,
148+
count: plan.maxDataSourcesCount,
149149
documents: {
150-
count: plan.maxNbStaticDocuments,
151-
sizeMb: plan.maxSizeStaticDataSources,
150+
count: plan.maxDataSourcesDocumentsCount,
151+
sizeMb: plan.maxDataSourcesDocumentsSizeMb,
152152
},
153153
},
154154
users: {
@@ -253,10 +253,10 @@ export const subscribeWorkspaceToPlan = async (
253253
isGithubAllowed: newPlan.isManagedGithubAllowed,
254254
},
255255
dataSources: {
256-
count: newPlan.maxNbStaticDataSources,
256+
count: newPlan.maxDataSourcesCount,
257257
documents: {
258-
count: newPlan.maxNbStaticDocuments,
259-
sizeMb: newPlan.maxSizeStaticDataSources,
258+
count: newPlan.maxDataSourcesDocumentsCount,
259+
sizeMb: newPlan.maxDataSourcesDocumentsSizeMb,
260260
},
261261
},
262262
users: {

0 commit comments

Comments
 (0)