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

fix: only add strategies to addon texts when available

This commit is contained in:
Ivar Conradi Østhus 2021-08-27 10:15:56 +02:00
parent aab4602029
commit cecdd96863
No known key found for this signature in database
GPG Key ID: 31AC596886B0BD09
4 changed files with 9 additions and 4 deletions

View File

@ -96,7 +96,7 @@ This was changed by ${createdBy}.`;
)}\`\`\``;
return `${createdBy} ${action} feature toggle ${feature}
${enabled}${stale} | ${typeStr} | ${project}
${strategies}`;
${data.strategies ? strategies : ''}`;
}
getAction(type: string): string {

View File

@ -129,7 +129,7 @@ This was changed by ${createdBy}.`;
)}\`\`\``;
return `${createdBy} ${action} feature toggle ${feature}
${enabled}${stale} | ${typeStr} | ${project}
${strategies}`;
${data.strategies ? strategies : ''}`;
}
getAction(type: string): string {

View File

@ -113,7 +113,9 @@ export default class TeamsAddon extends Addon {
data.strategies,
{ skipInvalid: true },
)}`;
return `Feature toggle ${data.name} | ${typeStr} | ${project} <br /> ${strategies}`;
return `Feature toggle ${data.name} | ${typeStr} | ${project} <br /> ${
data.strategies ? strategies : ''
}`;
}
getAction(type: string): string {

View File

@ -243,10 +243,13 @@ class FeatureToggleServiceV2 {
featureData.name,
projectId,
);
const data = { featureData, projectId };
await this.eventStore.store({
type: FEATURE_CREATED,
createdBy: userName,
data: featureData,
data,
});
return createdToggle;