mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
feat(GUI): add descriptive name to modals (#2036)
We add a descriptive name to modals for analytics and debugging. Change-Type: patch Changelog-Entry: Add descriptive name to modals for analytics and debugging.
This commit is contained in:
parent
2e1764af82
commit
bb5efb3450
@ -34,6 +34,7 @@ module.exports = function (ModalService, $q) {
|
||||
*/
|
||||
this.open = () => {
|
||||
modal = ModalService.open({
|
||||
name: 'drive-selector',
|
||||
template: './components/drive-selector/templates/drive-selector-modal.tpl.html',
|
||||
controller: 'DriveSelectorController as modal',
|
||||
size: 'drive-selector-modal'
|
||||
|
@ -34,6 +34,7 @@ module.exports = function ($uibModal, $q) {
|
||||
*
|
||||
* @example
|
||||
* ModalService.open({
|
||||
* name: 'my modal',
|
||||
* template: './path/to/modal.tpl.html',
|
||||
* controller: 'DriveSelectorController as modal',
|
||||
* });
|
||||
@ -44,7 +45,7 @@ module.exports = function ($uibModal, $q) {
|
||||
})
|
||||
|
||||
analytics.logEvent('Open modal', {
|
||||
template: options.template
|
||||
name: options.name
|
||||
})
|
||||
|
||||
const modal = $uibModal.open({
|
||||
@ -60,6 +61,7 @@ module.exports = function ($uibModal, $q) {
|
||||
result: $q((resolve, reject) => {
|
||||
modal.result.then((value) => {
|
||||
analytics.logEvent('Modal accepted', {
|
||||
name: options.name,
|
||||
value
|
||||
})
|
||||
|
||||
@ -68,6 +70,7 @@ module.exports = function ($uibModal, $q) {
|
||||
// Bootstrap doesn't 'resolve' these but cancels the dialog
|
||||
if (error === 'escape key press' || error === 'backdrop click') {
|
||||
analytics.logEvent('Modal rejected', {
|
||||
name: options.name,
|
||||
method: error
|
||||
})
|
||||
|
||||
@ -75,6 +78,7 @@ module.exports = function ($uibModal, $q) {
|
||||
}
|
||||
|
||||
analytics.logEvent('Modal rejected', {
|
||||
name: options.name,
|
||||
value: error
|
||||
})
|
||||
|
||||
|
@ -37,6 +37,7 @@ module.exports = function (ModalService) {
|
||||
*/
|
||||
this.show = (options) => {
|
||||
return ModalService.open({
|
||||
name: 'tooltip',
|
||||
template: './components/tooltip-modal/templates/tooltip-modal.tpl.html',
|
||||
controller: 'TooltipModalController as modal',
|
||||
size: 'tooltip-modal',
|
||||
|
@ -40,6 +40,7 @@ module.exports = function ($sce, ModalService) {
|
||||
this.display = (options = {}) => {
|
||||
options.description = $sce.trustAsHtml(options.description)
|
||||
return ModalService.open({
|
||||
name: 'warning',
|
||||
template: './components/warning-modal/templates/warning-modal.tpl.html',
|
||||
controller: 'WarningModalController as modal',
|
||||
size: 'warning-modal',
|
||||
|
Loading…
x
Reference in New Issue
Block a user