mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-01 13:47:27 +02:00
fix: make sure we have a user in event store
This commit is contained in:
parent
f716d87c62
commit
211f388d3f
@ -1331,7 +1331,7 @@ class FeatureToggleService {
|
||||
featureName: string,
|
||||
environment: string,
|
||||
newVariants: IVariant[],
|
||||
createdBy: string,
|
||||
user: User,
|
||||
oldVariants?: IVariant[],
|
||||
): Promise<IVariant[]> {
|
||||
await variantsArraySchema.validateAsync(newVariants);
|
||||
@ -1350,7 +1350,7 @@ class FeatureToggleService {
|
||||
featureName,
|
||||
environment,
|
||||
project: projectId,
|
||||
createdBy,
|
||||
createdBy: user.email || user.username,
|
||||
oldVariants: theOldVariants,
|
||||
newVariants: fixedVariants,
|
||||
}),
|
||||
@ -1383,7 +1383,7 @@ class FeatureToggleService {
|
||||
featureName,
|
||||
environment,
|
||||
newVariants,
|
||||
user.username,
|
||||
user,
|
||||
oldVariants,
|
||||
);
|
||||
}
|
||||
@ -1405,7 +1405,7 @@ class FeatureToggleService {
|
||||
featureName,
|
||||
environments,
|
||||
newVariants,
|
||||
user.username,
|
||||
user,
|
||||
);
|
||||
}
|
||||
|
||||
@ -1414,7 +1414,7 @@ class FeatureToggleService {
|
||||
featureName: string,
|
||||
environments: string[],
|
||||
newVariants: IVariant[],
|
||||
createdBy: string,
|
||||
user: User,
|
||||
): Promise<IVariant[]> {
|
||||
await variantsArraySchema.validateAsync(newVariants);
|
||||
const fixedVariants = this.fixVariantWeights(newVariants);
|
||||
@ -1436,7 +1436,7 @@ class FeatureToggleService {
|
||||
featureName,
|
||||
environment,
|
||||
project: projectId,
|
||||
createdBy,
|
||||
createdBy: user.email || user.username,
|
||||
oldVariants: oldVariants[environment],
|
||||
newVariants: fixedVariants,
|
||||
}),
|
||||
|
@ -433,6 +433,7 @@ test('If change requests are enabled, cannot change variants without going via C
|
||||
});
|
||||
|
||||
test('If CRs are protected for any environment in the project stops bulk update of variants', async () => {
|
||||
const user = { email: 'test@example.com', username: 'test-user' } as User;
|
||||
const project = await stores.projectStore.create({
|
||||
id: 'crOnVariantsProject',
|
||||
name: 'crOnVariantsProject',
|
||||
@ -476,7 +477,7 @@ test('If CRs are protected for any environment in the project stops bulk update
|
||||
const toggle = await service.createFeatureToggle(
|
||||
project.id,
|
||||
{ name: 'crOnVariantToggle' },
|
||||
'test-user',
|
||||
user.username,
|
||||
);
|
||||
|
||||
const variant: IVariant = {
|
||||
@ -495,7 +496,7 @@ test('If CRs are protected for any environment in the project stops bulk update
|
||||
toggle.name,
|
||||
[enabledEnv.name, disabledEnv.name],
|
||||
[variant],
|
||||
'test-user',
|
||||
user,
|
||||
);
|
||||
|
||||
const newVariants = [
|
||||
|
Loading…
Reference in New Issue
Block a user