2020-10-08 09:08:40 +00:00
|
|
|
/* eslint-disable @gitlab/require-i18n-strings */
|
2021-07-15 18:09:37 +00:00
|
|
|
import marked from 'marked';
|
|
|
|
import { sanitize } from '~/lib/dompurify';
|
|
|
|
import { markdownConfig } from '~/lib/utils/text_utility';
|
2020-10-08 09:08:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tracks snowplow event when User toggles timeline view
|
|
|
|
* @param {Boolean} enabled that will be send as a property for the event
|
|
|
|
*/
|
2020-12-23 21:10:24 +00:00
|
|
|
export const trackToggleTimelineView = (enabled) => ({
|
2020-10-08 09:08:40 +00:00
|
|
|
category: 'Incident Management',
|
|
|
|
action: 'toggle_incident_comments_into_timeline_view',
|
|
|
|
label: 'Status',
|
|
|
|
property: enabled,
|
|
|
|
});
|
2021-07-15 18:09:37 +00:00
|
|
|
|
|
|
|
export const renderMarkdown = (rawMarkdown) => {
|
|
|
|
return sanitize(marked(rawMarkdown), markdownConfig);
|
|
|
|
};
|