Created
July 31, 2018 18:48
-
-
Save theredpea/3f96371c54c2068acbb76d849333e424 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define("text!client.services/export-dialog/export-dialog.ng.html", [], function() { | |
return '<lui-dialog id="export-dialog">\n\t<div ng-if="state === states.PENDING">\n\t\t<lui-dialog-header q-translation="Export.Exporting"></lui-dialog-header>\n\t\t<lui-dialog-body class="export-dialog-body">\n\t\t\t<div class="qv-loader pb-10"></div>\n\t\t</lui-dialog-body>\n\t\t<lui-dialog-footer>\n\t\t\t<lui-button qva-activate="cancel()" q-translation="Common.Cancel"></lui-button>\n\t\t</lui-dialog-footer>\n\t</div>\n\t<div ng-if="state === states.COMPLETED">\n\t\t<lui-dialog-header q-translation="Export.Completed"></lui-dialog-header>\n\t\t<lui-dialog-body class="export-dialog-body">\n\t\t\t<p class="pb-10">\n\t\t\t\t<span q-translation="Export.CompletedDescription"></span>\n\t\t\t\t<span q-translation="Export.WarningDataTruncated" ng-if="dataIsTruncated"></span>\n\t\t\t</p>\n\t\t\t<p class="pb-10">\n\t\t\t\t<a ng-href="{{exportUrl}}" target="_blank" q-translation="Export.CompletedLink"></a>\n\t\t\t</p>\n\t\t</lui-dialog-body>\n\t\t<lui-dialog-footer>\n\t\t\t<lui-button qva-activate="close()" q-translation="Common.Close"></lui-button>\n\t\t</lui-dialog-footer>\n\t</div>\n\t<div ng-if="state === states.FAILED">\n\t\t<lui-dialog-header q-translation="Export.Failed"></lui-dialog-header>\n\t\t<lui-dialog-body class="export-dialog-body">\n\t\t\t<p class="pb-10" q-translation="{{errorTranslation}}"></p>\n\t\t</lui-dialog-body>\n\t\t<lui-dialog-footer>\n\t\t\t<lui-button qva-activate="close()" q-translation="Common.Close"></lui-button>\n\t\t</lui-dialog-footer>\n\t</div>\n</lui-dialog>\n' | |
}), | |
define("client.services/export-dialog/export-dialog", ["qvangular", "text!./export-dialog.ng.html", "assets/client/dialogs/directives/dialog-directives"], function(a, b) { | |
a.service("$exportDialog", ["luiDialog", function(a) { | |
return { | |
show: function(c, d) { | |
return a.show({ | |
controller: ["$scope", function(a) { | |
a.states = { | |
FAILED: -1, | |
IDLE: 0, | |
PENDING: 1, | |
COMPLETED: 2 | |
}, | |
a.state = a.states.PENDING, | |
c.getLayout().then(function(b) { | |
var e = c.exportData(null, d, b.title || null); | |
a.rpcId = e.requestId, | |
e.then(function(b) { | |
a.exportUrl = require.toUrl(".." + b.qUrl), | |
a.state = a.states.COMPLETED, | |
b.qWarnings && 1e3 === b.qWarnings[0] && (a.dataIsTruncated = !0) | |
}, function(b) { | |
a.state = a.states.FAILED, | |
a.errorTranslation = "ErrorCode." + b.code, | |
b.isHandled = !0 | |
}) | |
}), | |
a.openExportWindow = function() { | |
window.open(a.exportUrl) | |
} | |
, | |
a.cancel = function() { | |
a.rpcId ? c.app.global.cancelRequest(a.rpcId).finally(a.close) : a.close() | |
} | |
, | |
a.close = function() { | |
a.destroyComponent() | |
} | |
} | |
], | |
template: b | |
}) | |
} | |
} | |
} | |
]) | |
}), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment