UNPKG

@atlaskit/editor-common

Version:

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

29 lines 1.02 kB
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID, CONFLUENCE_SEARCH_DATASOURCE_ID, JIRA_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource'; import { fg } 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'; case CONFLUENCE_SEARCH_DATASOURCE_ID: return 'confluence-search'; 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 (fg('linking_platform_datasource_assets_objects')) { return true; } return false; default: return defaultValue; } };