UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

27 lines 943 B
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID, JIRA_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource'; import { getBooleanFF } from '@atlaskit/platform-feature-flags'; export var getDatasourceType = function getDatasourceType(datasourceId) { switch (datasourceId) { case JIRA_LIST_OF_LINKS_DATASOURCE_ID: return 'jira'; case ASSETS_LIST_OF_LINKS_DATASOURCE_ID: return 'assets'; default: return undefined; } }; export var canRenderDatasource = function canRenderDatasource(datasourceId) { var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var datasourceType = getDatasourceType(datasourceId); switch (datasourceType) { case 'jira': return true; case 'assets': if (getBooleanFF('platform.linking-platform.datasource-assets_objects')) { return true; } return false; default: return defaultValue; } };