diff --git a/frontend/src/component/integrations/IntegrationForm/IntegrationParameters/IntegrationParameter/IntegrationParameter.tsx b/frontend/src/component/integrations/IntegrationForm/IntegrationParameters/IntegrationParameter/IntegrationParameter.tsx index 18da956586..42ee921abe 100644 --- a/frontend/src/component/integrations/IntegrationForm/IntegrationParameters/IntegrationParameter/IntegrationParameter.tsx +++ b/frontend/src/component/integrations/IntegrationForm/IntegrationParameters/IntegrationParameter/IntegrationParameter.tsx @@ -2,7 +2,6 @@ import { ChangeEventHandler } from 'react'; import { StyledAddonParameterContainer } from '../../IntegrationForm.styles'; import type { AddonParameterSchema, AddonSchema } from 'openapi'; import { IntegrationParameterTextField } from './IntegrationParameterTextField'; -import { useUiFlag } from 'hooks/useUiFlag'; export interface IIntegrationParameterProps { parametersErrors: Record; @@ -17,15 +16,6 @@ export const IntegrationParameter = ({ parametersErrors, setParameterValue, }: IIntegrationParameterProps) => { - const datadogJson = useUiFlag('datadogJsonTemplate'); - if ( - config.provider === 'datadog' && - definition.name === 'bodyTemplate' && - !datadogJson - ) { - return null; - } - return ( { const addon = new DatadogAddon({ getLogger: noLogger, unleashUrl: 'http://some-url.com', - flagResolver: { - getAll: jest.fn().mockReturnValue([]), - getVariant: jest.fn(), - isEnabled: jest.fn().mockReturnValue(false), - }, }); const event: IEvent = { id: 1, @@ -73,11 +68,6 @@ test('Should call datadog webhook for archived toggle', async () => { const addon = new DatadogAddon({ getLogger: noLogger, unleashUrl: 'http://some-url.com', - flagResolver: { - getAll: jest.fn().mockReturnValue([]), - getVariant: jest.fn(), - isEnabled: jest.fn().mockReturnValue(false), - }, }); const event: IEvent = { id: 2, @@ -105,11 +95,6 @@ test('Should call datadog webhook for archived toggle with project info', async const addon = new DatadogAddon({ getLogger: noLogger, unleashUrl: 'http://some-url.com', - flagResolver: { - getAll: jest.fn().mockReturnValue([]), - getVariant: jest.fn(), - isEnabled: jest.fn().mockReturnValue(false), - }, }); const event: IEvent = { id: 2, @@ -138,11 +123,6 @@ test('Should call datadog webhook for toggled environment', async () => { const addon = new DatadogAddon({ getLogger: noLogger, unleashUrl: 'http://some-url.com', - flagResolver: { - getAll: jest.fn().mockReturnValue([]), - getVariant: jest.fn(), - isEnabled: jest.fn().mockReturnValue(false), - }, }); const event: IEvent = { id: 2, @@ -173,11 +153,6 @@ test('Should include customHeaders in headers when calling service', async () => const addon = new DatadogAddon({ getLogger: noLogger, unleashUrl: 'http://some-url.com', - flagResolver: { - getAll: jest.fn().mockReturnValue([]), - getVariant: jest.fn(), - isEnabled: jest.fn().mockReturnValue(false), - }, }); const event: IEvent = { id: 2, @@ -209,11 +184,6 @@ test('Should not include source_type_name when included in the config', async () const addon = new DatadogAddon({ getLogger: noLogger, unleashUrl: 'http://some-url.com', - flagResolver: { - getAll: jest.fn().mockReturnValue([]), - getVariant: jest.fn(), - isEnabled: jest.fn().mockReturnValue(false), - }, }); const event: IEvent = { id: 2, @@ -248,11 +218,6 @@ test('Should call datadog webhook with JSON when template set', async () => { const addon = new DatadogAddon({ getLogger: noLogger, unleashUrl: 'http://some-url.com', - flagResolver: { - getAll: jest.fn().mockReturnValue([]), - getVariant: jest.fn(), - isEnabled: jest.fn().mockReturnValue(true), - }, }); const event: IEvent = { id: 1, diff --git a/src/lib/addons/datadog.ts b/src/lib/addons/datadog.ts index 6835aa8d19..8081734132 100644 --- a/src/lib/addons/datadog.ts +++ b/src/lib/addons/datadog.ts @@ -26,22 +26,15 @@ interface DDRequestBody { source_type_name?: string; } -export interface IDatadogAddonConfig extends IAddonConfig { - flagResolver: IFlagResolver; -} - export default class DatadogAddon extends Addon { private msgFormatter: FeatureEventFormatter; - private flagResolver: IFlagResolver; - - constructor(config: IDatadogAddonConfig) { + constructor(config: IAddonConfig) { super(definition, config); this.msgFormatter = new FeatureEventFormatterMd( config.unleashUrl, LinkStyle.MD, ); - this.flagResolver = config.flagResolver; } async handleEvent( @@ -61,11 +54,7 @@ export default class DatadogAddon extends Addon { }; let text; - if ( - this.flagResolver.isEnabled('datadogJsonTemplate') && - typeof bodyTemplate === 'string' && - bodyTemplate.length > 1 - ) { + if (typeof bodyTemplate === 'string' && bodyTemplate.length > 1) { text = Mustache.render(bodyTemplate, context); } else { text = `%%% \n ${this.msgFormatter.format(event).text} \n %%% `; diff --git a/src/lib/addons/index.ts b/src/lib/addons/index.ts index 9f88f33faa..9276c71772 100644 --- a/src/lib/addons/index.ts +++ b/src/lib/addons/index.ts @@ -21,7 +21,7 @@ export const getAddons: (args: { new SlackAddon({ getLogger, unleashUrl }), new SlackAppAddon({ getLogger, unleashUrl }), new TeamsAddon({ getLogger, unleashUrl }), - new DatadogAddon({ getLogger, unleashUrl, flagResolver }), + new DatadogAddon({ getLogger, unleashUrl }), ]; return addons.reduce((map, addon) => { diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 8a26967151..51dcba8294 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -29,7 +29,6 @@ export type IFlagKey = | 'accessOverview' | 'privateProjects' | 'dependentFeatures' - | 'datadogJsonTemplate' | 'disableMetrics' | 'useLastSeenRefactor' | 'banners' @@ -141,10 +140,6 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_ACCESS_OVERVIEW, false, ), - datadogJsonTemplate: parseEnvVarBoolean( - process.env.UNLEASH_EXPERIMENTAL_DATADOG_JSON_TEMPLATE, - false, - ), disableMetrics: parseEnvVarBoolean( process.env.UNLEASH_EXPERIMENTAL_DISABLE_METRICS, false, diff --git a/src/server-dev.ts b/src/server-dev.ts index 10a3db9294..926d5e9c35 100644 --- a/src/server-dev.ts +++ b/src/server-dev.ts @@ -43,7 +43,6 @@ process.nextTick(async () => { variantTypeNumber: true, privateProjects: true, accessOverview: true, - datadogJsonTemplate: true, dependentFeatures: true, useLastSeenRefactor: true, disableEnvsOnRevive: true,