-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
462 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Integrations } from '@segment/analytics-core' | ||
import { LegacyIntegrationConfiguration } from '../..' | ||
|
||
export const isInstallableIntegration = ( | ||
name: string, | ||
integrationSettings: LegacyIntegrationConfiguration | ||
) => { | ||
const { type, bundlingStatus, versionSettings } = integrationSettings | ||
// We use `!== 'unbundled'` (versus `=== 'bundled'`) to be inclusive of | ||
// destinations without a defined value for `bundlingStatus` | ||
const deviceMode = | ||
bundlingStatus !== 'unbundled' && | ||
(type === 'browser' || versionSettings?.componentTypes?.includes('browser')) | ||
|
||
// checking for iterable is a quick fix we need in place to prevent | ||
// errors showing Iterable as a failed destiantion. Ideally, we should | ||
// fix the Iterable metadata instead, but that's a longer process. | ||
return (deviceMode || name === 'Segment.io') && name !== 'Iterable' | ||
} | ||
|
||
export const isDisabledIntegration = ( | ||
integrationName: string, | ||
globalIntegrations: Integrations | ||
) => { | ||
const allDisableAndNotDefined = | ||
globalIntegrations.All === false && | ||
globalIntegrations[integrationName] === undefined | ||
|
||
return ( | ||
integrationName.startsWith('Segment') || | ||
globalIntegrations[integrationName] === false || | ||
allDisableAndNotDefined | ||
) | ||
} |
Oops, something went wrong.