src/utils/UpdateNotification.js
function _showUpdateNotificationDialog(updates, force) {
        Dialogs.showModalDialogUsingTemplate(Mustache.render(UpdateDialogTemplate, Strings))
            .done(function (id) {
                if (id === Dialogs.DIALOG_BTN_DOWNLOAD) {
                    HealthLogger.sendAnalyticsData(
                        eventNames.AUTOUPDATE_UPDATENOW_CLICK,
                        "autoUpdate",
                        "updateNotification",
                        "updateNow",
                        "click"
                    );
                    handleUpdateProcess(updates);
                } else {
                    HealthLogger.sendAnalyticsData(
                        eventNames.AUTOUPDATE_CANCEL_CLICK,
                        "autoUpdate",
                        "updateNotification",
                        "cancel",
                        "click"
                    );
                }
            });

        // Populate the update data
        var $dlg        = $(".update-dialog.instance"),
            $updateList = $dlg.find(".update-info"),
            subTypeString = force ? "userAction" : "auto";

        // Make the update notification icon clickable again
        _addedClickHandler = false;

        updates.Strings = Strings;
        $updateList.html(Mustache.render(UpdateListTemplate, updates));
        HealthLogger.sendAnalyticsData(
            eventNames.AUTOUPDATE_UPDATE_AVAILABLE_DIALOG_BOX_RENDERED,
            "autoUpdate",
            "updateNotification",
            "render",
            subTypeString
        );
    }
function _showUpdateNotificationDialog(updates, force) {
        Dialogs.showModalDialogUsingTemplate(Mustache.render(UpdateDialogTemplate, Strings))
            .done(function (id) {
                if (id === Dialogs.DIALOG_BTN_DOWNLOAD) {
                    HealthLogger.sendAnalyticsData(
                        eventNames.AUTOUPDATE_UPDATENOW_CLICK,
                        "autoUpdate",
                        "updateNotification",
                        "updateNow",
                        "click"
                    );
                    handleUpdateProcess(updates);
                } else {
                    HealthLogger.sendAnalyticsData(
                        eventNames.AUTOUPDATE_CANCEL_CLICK,
                        "autoUpdate",
                        "updateNotification",
                        "cancel",
                        "click"
                    );
                }
            });

        // Populate the update data
        var $dlg        = $(".update-dialog.instance"),
            $updateList = $dlg.find(".update-info"),
            subTypeString = force ? "userAction" : "auto";

        // Make the update notification icon clickable again
        _addedClickHandler = false;

        updates.Strings = Strings;
        $updateList.html(Mustache.render(UpdateListTemplate, updates));
        HealthLogger.sendAnalyticsData(
            eventNames.AUTOUPDATE_UPDATE_AVAILABLE_DIALOG_BOX_RENDERED,
            "autoUpdate",
            "updateNotification",
            "render",
            subTypeString
        );
    }
function _showUpdateNotificationDialog ( updates , force ) { Dialogs . showModalDialogUsingTemplate ( Mustache . render ( UpdateDialogTemplate , Strings ) ) . done ( function ( id ) { if ( id === Dialogs . DIALOG_BTN_DOWNLOAD ) { HealthLogger . sendAnalyticsData ( eventNames . AUTOUPDATE_UPDATENOW_CLICK , "autoUpdate" , "updateNotification" , "updateNow" , "click" ) ; handleUpdateProcess ( updates ) ; } else { HealthLogger . sendAnalyticsData ( eventNames . AUTOUPDATE_CANCEL_CLICK , "autoUpdate" , "updateNotification" , "cancel" , "click" ) ; } } ) ; // Populate the update data var $dlg = $ ( ".update-dialog.instance" ) , $updateList = $dlg . find ( ".update-info" ) , subTypeString = force ? "userAction" : "auto" ; // Make the update notification icon clickable again _addedClickHandler = false ; updates . Strings = Strings ; $updateList . html ( Mustache . render ( UpdateListTemplate , updates ) ) ; HealthLogger . sendAnalyticsData ( eventNames . AUTOUPDATE_UPDATE_AVAILABLE_DIALOG_BOX_RENDERED , "autoUpdate" , "updateNotification" , "render" , subTypeString ) ; }
Show a dialog that shows the update
Show a dialog that shows the update