Skip to content

Commit

Permalink
[Gitar] Updating TypeScript files
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitar committed Oct 7, 2024
1 parent 93883b3 commit b9aabfc
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 42 deletions.
10 changes: 4 additions & 6 deletions src/lib/addons/datadog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,10 @@ export default class DatadogAddon extends Addon {
this.logger.warn(failedMessage);
}

if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'datadog',
});
}
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'datadog',
});

this.registerEvent({
integrationId,
Expand Down
10 changes: 4 additions & 6 deletions src/lib/addons/new-relic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,10 @@ export default class NewRelicAddon extends Addon {
this.logger.warn(failedMessage);
}

if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'new-relic',
});
}
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'new-relic',
});

this.registerEvent({
integrationId,
Expand Down
10 changes: 4 additions & 6 deletions src/lib/addons/slack-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,10 @@ export default class SlackAppAddon extends Addon {
stateDetails.push(errorMessage);
this.logger.warn(errorMessage, error);
} finally {
if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'slack-app',
});
}
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'slack-app',
});

this.registerEvent({
integrationId,
Expand Down
10 changes: 4 additions & 6 deletions src/lib/addons/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,10 @@ export default class SlackAddon extends Addon {
this.logger.warn(successWithErrorsMessage);
}

if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'slack',
});
}
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'slack',
});

this.registerEvent({
integrationId,
Expand Down
10 changes: 4 additions & 6 deletions src/lib/addons/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,10 @@ export default class TeamsAddon extends Addon {
this.logger.warn(failedMessage);
}

if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'teams',
});
}
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'teams',
});

this.registerEvent({
integrationId,
Expand Down
10 changes: 4 additions & 6 deletions src/lib/addons/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,10 @@ export default class Webhook extends Addon {
this.logger.warn(failedMessage);
}

if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'webhook',
});
}
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'webhook',
});

const domain = new URL(url).hostname;
this.logger.info(`Webhook invoked`, {
Expand Down
5 changes: 0 additions & 5 deletions src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export type IFlagKey =
| 'extendedMetrics'
| 'removeUnsafeInlineStyleSrc'
| 'originMiddleware'
| 'addonUsageMetrics'
| 'onboardingMetrics'
| 'onboardingUI'
| 'projectRoleAssignment'
Expand Down Expand Up @@ -270,10 +269,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_ORIGIN_MIDDLEWARE,
false,
),
addonUsageMetrics: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_ADDON_USAGE_METRICS,
false,
),
onboardingMetrics: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_ONBOARDING_METRICS,
false,
Expand Down
1 change: 0 additions & 1 deletion src/server-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ process.nextTick(async () => {
enableLegacyVariants: false,
extendedMetrics: true,
originMiddleware: true,
addonUsageMetrics: true,
onboardingMetrics: true,
onboardingUI: true,
personalDashboardUI: true,
Expand Down

0 comments on commit b9aabfc

Please sign in to comment.