Commit 26da4c0e authored by Markus Koller's avatar Markus Koller

Add wiki-container-type to Snowplow tracking context

parent 93758584
......@@ -10,7 +10,7 @@ const MARKDOWN_LINK_TEXT = {
};
const TRACKING_EVENT_NAME = 'view_wiki_page';
const TRACKING_CONTEXT_SCHEMA = 'iglu:com.gitlab/wiki_page_context/jsonschema/1-0-0';
const TRACKING_CONTEXT_SCHEMA = 'iglu:com.gitlab/wiki_page_context/jsonschema/1-0-1';
export default class Wikis {
constructor() {
......
......@@ -142,7 +142,8 @@ module WikiHelper
'wiki-format' => page.format,
'wiki-title-size' => page.title.bytesize,
'wiki-content-size' => page.raw_content.bytesize,
'wiki-directory-nest-level' => page.path.scan('/').count
'wiki-directory-nest-level' => page.path.scan('/').count,
'wiki-container-type' => page.wiki.container.class.name
}
end
......
......@@ -146,7 +146,7 @@ describe('Wikis', () => {
expect(Tracking.event).toHaveBeenCalledWith(trackingPage, 'view_wiki_page', {
label: 'view_wiki_page',
context: {
schema: 'iglu:com.gitlab/wiki_page_context/jsonschema/1-0-0',
schema: 'iglu:com.gitlab/wiki_page_context/jsonschema/1-0-1',
data: trackingContext,
},
});
......
......@@ -131,7 +131,8 @@ RSpec.describe WikiHelper do
'wiki-format' => :markdown,
'wiki-title-size' => 9,
'wiki-content-size' => 4,
'wiki-directory-nest-level' => 2
'wiki-directory-nest-level' => 2,
'wiki-container-type' => 'Project'
)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment