Add survey feedback toast and button (#610)

This commit is contained in:
Michael Irwin
2024-02-23 12:46:52 -05:00
committed by GitHub
parent a07bc20f06
commit 3935d3ef92
2 changed files with 62 additions and 9 deletions

View File

@@ -847,6 +847,44 @@
return "None";
}
}])
.controller("SurveyToastController", function($mdToast) {
var ctrl = this;
ctrl.openSurvey = function() {
$mdToast.hide("ok");
}
ctrl.closeToast = function() {
$mdToast.hide();
}
})
.component('surveyRequest', {
template : "<md-button class='md-mini' ng-click='$ctrl.openSurvey()'>Give feedback</md-button>",
controller : function($mdToast, $timeout) {
var $ctrl = this;
$ctrl.$onInit = function() {
window.$mdToast = $mdToast;
$timeout(function() {
$mdToast.show({
hideDelay: 0,
position: 'bottom right',
controller: "SurveyToastController",
controllerAs: "ctrl",
bindToControlller: true,
templateUrl: "survey-toast.html"
}).then(function (result) {
if (result === "ok") {
$ctrl.openSurvey();
}
});
}, 300000); // Display toast after five minutes
}
$ctrl.openSurvey = function() {
window.open("https://docker.qualtrics.com/jfe/form/SV_267blbhIjjf3Mma", "_blank");
}
},
})
.service('TerminalService', ['$window', '$rootScope', function($window, $rootScope) {
var fullscreen;
var fontSize = getFontSize();