1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00

feat: Limit exclude archived features (#4680)

This commit is contained in:
Mateusz Kwasniewski 2023-09-13 11:48:22 +02:00 committed by GitHub
parent 392beee114
commit 14423c5870
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -104,7 +104,7 @@ class ProjectStore implements IProjectStore {
`SELECT EXISTS(SELECT 1 `SELECT EXISTS(SELECT 1
FROM project_settings FROM project_settings
LEFT JOIN features ON project_settings.project = features.project LEFT JOIN features ON project_settings.project = features.project
WHERE project_settings.project = ? WHERE project_settings.project = ? AND features.archived_at IS NULL
GROUP BY project_settings.project GROUP BY project_settings.project
HAVING project_settings.feature_limit <= COUNT(features.project)) AS present`, HAVING project_settings.feature_limit <= COUNT(features.project)) AS present`,
[id], [id],

View File

@ -170,7 +170,7 @@ export default class ArchiveController extends Controller {
): Promise<void> { ): Promise<void> {
const userName = extractUsername(req); const userName = extractUsername(req);
const { featureName } = req.params; const { featureName } = req.params;
await this.featureService.reviveToggle(featureName, userName); await this.featureService.reviveFeature(featureName, userName);
res.status(200).end(); res.status(200).end();
} }
} }

View File

@ -1823,7 +1823,7 @@ class FeatureToggleService {
} }
// TODO: add project id. // TODO: add project id.
async reviveToggle(featureName: string, createdBy: string): Promise<void> { async reviveFeature(featureName: string, createdBy: string): Promise<void> {
const toggle = await this.featureToggleStore.revive(featureName); const toggle = await this.featureToggleStore.revive(featureName);
const tags = await this.tagStore.getAllTagsForFeature(featureName); const tags = await this.tagStore.getAllTagsForFeature(featureName);
await this.eventStore.store( await this.eventStore.store(