Commit 62104dfd authored by Sean McGivern's avatar Sean McGivern

Merge branch '247522-snowplow-add-wiki-container-type' into 'master'

Add wiki-container-type to Snowplow tracking context

See merge request gitlab-org/gitlab!44292
parents 9f52b46f 26da4c0e
...@@ -10,7 +10,7 @@ const MARKDOWN_LINK_TEXT = { ...@@ -10,7 +10,7 @@ const MARKDOWN_LINK_TEXT = {
}; };
const TRACKING_EVENT_NAME = 'view_wiki_page'; 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 { export default class Wikis {
constructor() { constructor() {
......
...@@ -142,7 +142,8 @@ module WikiHelper ...@@ -142,7 +142,8 @@ module WikiHelper
'wiki-format' => page.format, 'wiki-format' => page.format,
'wiki-title-size' => page.title.bytesize, 'wiki-title-size' => page.title.bytesize,
'wiki-content-size' => page.raw_content.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 end
......
...@@ -146,7 +146,7 @@ describe('Wikis', () => { ...@@ -146,7 +146,7 @@ describe('Wikis', () => {
expect(Tracking.event).toHaveBeenCalledWith(trackingPage, 'view_wiki_page', { expect(Tracking.event).toHaveBeenCalledWith(trackingPage, 'view_wiki_page', {
label: 'view_wiki_page', label: 'view_wiki_page',
context: { 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, data: trackingContext,
}, },
}); });
......
...@@ -135,7 +135,8 @@ RSpec.describe WikiHelper do ...@@ -135,7 +135,8 @@ RSpec.describe WikiHelper do
'wiki-format' => :markdown, 'wiki-format' => :markdown,
'wiki-title-size' => 9, 'wiki-title-size' => 9,
'wiki-content-size' => 4, 'wiki-content-size' => 4,
'wiki-directory-nest-level' => 2 'wiki-directory-nest-level' => 2,
'wiki-container-type' => 'Project'
) )
end 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