Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c9388ea2
Commit
c9388ea2
authored
Oct 02, 2020
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add stubs for design create and update tracking
parent
81c3e33c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
4 deletions
+48
-4
app/assets/javascripts/design_management/pages/index.vue
app/assets/javascripts/design_management/pages/index.vue
+18
-1
app/assets/javascripts/design_management/utils/tracking.js
app/assets/javascripts/design_management/utils/tracking.js
+30
-3
No files found.
app/assets/javascripts/design_management/pages/index.vue
View file @
c9388ea2
...
@@ -3,6 +3,7 @@ import { GlLoadingIcon, GlButton, GlAlert } from '@gitlab/ui';
...
@@ -3,6 +3,7 @@ import { GlLoadingIcon, GlButton, GlAlert } from '@gitlab/ui';
import
VueDraggable
from
'
vuedraggable
'
;
import
VueDraggable
from
'
vuedraggable
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
getFilename
}
from
'
~/lib/utils/file_upload
'
;
import
UploadButton
from
'
../components/upload/button.vue
'
;
import
UploadButton
from
'
../components/upload/button.vue
'
;
import
DeleteButton
from
'
../components/delete_button.vue
'
;
import
DeleteButton
from
'
../components/delete_button.vue
'
;
import
Design
from
'
../components/list/item.vue
'
;
import
Design
from
'
../components/list/item.vue
'
;
...
@@ -31,7 +32,7 @@ import {
...
@@ -31,7 +32,7 @@ import {
isValidDesignFile
,
isValidDesignFile
,
moveDesignOptimisticResponse
,
moveDesignOptimisticResponse
,
}
from
'
../utils/design_management_utils
'
;
}
from
'
../utils/design_management_utils
'
;
import
{
getFilename
}
from
'
~/lib/utils/file_upload
'
;
import
{
trackDesignCreate
,
trackDesignUpdate
}
from
'
../utils/tracking
'
;
import
{
DESIGNS_ROUTE_NAME
}
from
'
../router/constants
'
;
import
{
DESIGNS_ROUTE_NAME
}
from
'
../router/constants
'
;
const
MAXIMUM_FILE_UPLOAD_LIMIT
=
10
;
const
MAXIMUM_FILE_UPLOAD_LIMIT
=
10
;
...
@@ -186,6 +187,7 @@ export default {
...
@@ -186,6 +187,7 @@ export default {
updateStoreAfterUploadDesign
(
store
,
designManagementUpload
,
this
.
projectQueryBody
);
updateStoreAfterUploadDesign
(
store
,
designManagementUpload
,
this
.
projectQueryBody
);
},
},
onUploadDesignDone
(
res
)
{
onUploadDesignDone
(
res
)
{
// display any warnings, if necessary
const
skippedFiles
=
res
?.
data
?.
designManagementUpload
?.
skippedDesigns
||
[];
const
skippedFiles
=
res
?.
data
?.
designManagementUpload
?.
skippedDesigns
||
[];
const
skippedWarningMessage
=
designUploadSkippedWarning
(
this
.
filesToBeSaved
,
skippedFiles
);
const
skippedWarningMessage
=
designUploadSkippedWarning
(
this
.
filesToBeSaved
,
skippedFiles
);
if
(
skippedWarningMessage
)
{
if
(
skippedWarningMessage
)
{
...
@@ -196,7 +198,22 @@ export default {
...
@@ -196,7 +198,22 @@ export default {
if
(
!
this
.
isLatestVersion
)
{
if
(
!
this
.
isLatestVersion
)
{
this
.
$router
.
push
({
name
:
DESIGNS_ROUTE_NAME
});
this
.
$router
.
push
({
name
:
DESIGNS_ROUTE_NAME
});
}
}
// reset state
this
.
resetFilesToBeSaved
();
this
.
resetFilesToBeSaved
();
// track design
this
.
trackUploadDesign
(
res
);
},
trackUploadDesign
(
res
)
{
// NOTE: in the future, we can add skipped and deleted design tracking here
res
.
data
.
designManagementUpload
.
designs
.
forEach
(
design
=>
{
if
(
design
.
event
===
'
CREATION
'
)
{
trackDesignCreate
();
}
else
if
(
design
.
event
===
'
MODIFICATION
'
)
{
trackDesignUpdate
();
}
});
},
},
onUploadDesignError
()
{
onUploadDesignError
()
{
this
.
resetFilesToBeSaved
();
this
.
resetFilesToBeSaved
();
...
...
app/assets/javascripts/design_management/utils/tracking.js
View file @
c9388ea2
...
@@ -3,7 +3,11 @@ import Tracking from '~/tracking';
...
@@ -3,7 +3,11 @@ import Tracking from '~/tracking';
// Tracking Constants
// Tracking Constants
const
DESIGN_TRACKING_CONTEXT_SCHEMA
=
'
iglu:com.gitlab/design_management_context/jsonschema/1-0-0
'
;
const
DESIGN_TRACKING_CONTEXT_SCHEMA
=
'
iglu:com.gitlab/design_management_context/jsonschema/1-0-0
'
;
const
DESIGN_TRACKING_PAGE_NAME
=
'
projects:issues:design
'
;
const
DESIGN_TRACKING_PAGE_NAME
=
'
projects:issues:design
'
;
const
DESIGN_TRACKING_EVENT_NAME
=
'
view_design
'
;
const
DESIGN_TRACKING_EVENTS
=
{
VIEW_DESIGN
:
'
view_design
'
,
CREATE_DESIGN
:
'
create_design
'
,
UPDATE_DESIGN
:
'
update_design
'
,
};
export
function
trackDesignDetailView
(
export
function
trackDesignDetailView
(
referer
=
''
,
referer
=
''
,
...
@@ -11,8 +15,9 @@ export function trackDesignDetailView(
...
@@ -11,8 +15,9 @@ export function trackDesignDetailView(
designVersion
=
1
,
designVersion
=
1
,
latestVersion
=
false
,
latestVersion
=
false
,
)
{
)
{
Tracking
.
event
(
DESIGN_TRACKING_PAGE_NAME
,
DESIGN_TRACKING_EVENT_NAME
,
{
const
eventName
=
DESIGN_TRACKING_EVENTS
.
VIEW_DESIGN
;
label
:
DESIGN_TRACKING_EVENT_NAME
,
Tracking
.
event
(
DESIGN_TRACKING_PAGE_NAME
,
eventName
,
{
label
:
eventName
,
context
:
{
context
:
{
schema
:
DESIGN_TRACKING_CONTEXT_SCHEMA
,
schema
:
DESIGN_TRACKING_CONTEXT_SCHEMA
,
data
:
{
data
:
{
...
@@ -24,3 +29,25 @@ export function trackDesignDetailView(
...
@@ -24,3 +29,25 @@ export function trackDesignDetailView(
},
},
});
});
}
}
export
function
trackDesignCreate
()
{
const
eventName
=
DESIGN_TRACKING_EVENTS
.
CREATE_DESIGN
;
Tracking
.
event
(
DESIGN_TRACKING_PAGE_NAME
,
eventName
,
{
label
:
eventName
,
context
:
{
schema
:
DESIGN_TRACKING_CONTEXT_SCHEMA
,
data
:
{},
},
});
}
export
function
trackDesignUpdate
()
{
const
eventName
=
DESIGN_TRACKING_EVENTS
.
UPDATE_DESIGN
;
Tracking
.
event
(
DESIGN_TRACKING_PAGE_NAME
,
eventName
,
{
label
:
eventName
,
context
:
{
schema
:
DESIGN_TRACKING_CONTEXT_SCHEMA
,
data
:
{},
},
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment