-
-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import limit validation #4669
Import limit validation #4669
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -86,6 +90,38 @@ export class ImportTogglesStore implements IImportTogglesStore { | |||
return rows.map((row) => row.name); | |||
} | |||
|
|||
async getProjectFeaturesLimit( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the main algorithm
const existingFeaturesCount = await this.db(T.features) | ||
.whereIn('name', featureNames) | ||
.andWhere('project', project) | ||
.where('archived_at', null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exclude archived features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 😄 But I remember that @sjaanus talked about limits and archived features at the offsite, so you should probably have him look over it too. That said, I suspect you've done the right thing here.
This is the result of this 😄 |
featureLimitResult.limit | ||
) { | ||
errors.push({ | ||
message: `We detected you want to create ${featureLimitResult.newFeaturesCount} new features in a project with ${featureLimitResult.currentFeaturesCount} current features and a limit of ${featureLimitResult.limit}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to read this 3 times, something is off. Better wording
We detected you want to create ${featureLimitResult.newFeaturesCount} new features to a project that already has ${featureLimitResult.currentFeaturesCount} existing features, exceeding the maximum limit of ${featureLimitResult.limit}.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One wording issue, other than that looks good
About the changes
Validate if the features limit will not be exceeded
Important files
Discussion points