@oat-sa/tao-core-ui 1.58.1 → 1.58.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actionbar.js +386 -395
- package/dist/adder.js +21 -19
- package/dist/animable/absorbable/absorbable.js +204 -213
- package/dist/animable/absorbable/css/absorb.css +1 -0
- package/dist/animable/absorbable/css/absorb.css.map +1 -1
- package/dist/animable/pulsable/pulsable.js +168 -177
- package/dist/autocomplete/css/autocomplete.css +1 -0
- package/dist/autocomplete/css/autocomplete.css.map +1 -1
- package/dist/autocomplete.js +68 -66
- package/dist/badge/badge.js +188 -197
- package/dist/badge/css/badge.css +1 -0
- package/dist/badge/css/badge.css.map +1 -1
- package/dist/breadcrumbs.js +275 -284
- package/dist/btngrouper.js +5 -5
- package/dist/bulkActionPopup.js +490 -495
- package/dist/button.js +283 -291
- package/dist/cascadingComboBox.js +249 -258
- package/dist/ckeditor/ckConfigurator.js +26 -19
- package/dist/ckeditor/dtdHandler.js +11 -9
- package/dist/class/selector.js +441 -450
- package/dist/component/resizable.js +1 -1
- package/dist/component/windowed.js +285 -294
- package/dist/component.js +419 -428
- package/dist/contextualPopup.js +417 -426
- package/dist/dashboard.js +300 -309
- package/dist/datalist.js +753 -762
- package/dist/datatable/filterStrategy/multiple.js +1 -1
- package/dist/datatable/filterStrategy/single.js +1 -1
- package/dist/datatable.js +1527 -1550
- package/dist/dateRange/dateRange.js +393 -402
- package/dist/datetime/picker.js +665 -672
- package/dist/deleter.js +368 -377
- package/dist/destination/selector.js +286 -295
- package/dist/dialog/alert.js +3 -3
- package/dist/dialog/confirm.js +1 -1
- package/dist/dialog/confirmDelete.js +216 -225
- package/dist/dialog.js +650 -654
- package/dist/disabler.js +8 -8
- package/dist/documentViewer/providers/pdfViewer/fallback/viewer.js +166 -175
- package/dist/documentViewer/providers/pdfViewer/pdfjs/findBar.js +518 -527
- package/dist/documentViewer/providers/pdfViewer/pdfjs/pageView.js +380 -389
- package/dist/documentViewer/providers/pdfViewer/pdfjs/searchEngine.js +539 -548
- package/dist/documentViewer/providers/pdfViewer/pdfjs/viewer.js +369 -378
- package/dist/documentViewer/providers/pdfViewer.js +184 -193
- package/dist/documentViewer.js +292 -301
- package/dist/dropdown.js +383 -392
- package/dist/durationer.js +5 -5
- package/dist/dynamicComponent.js +597 -598
- package/dist/feedback.js +356 -362
- package/dist/figure/FigureStateActive.js +117 -108
- package/dist/filesender.js +2 -2
- package/dist/filter.js +230 -239
- package/dist/form/dropdownForm.js +355 -357
- package/dist/form/form.js +919 -690
- package/dist/form/simpleForm.js +1 -1
- package/dist/form/validator/renderer.js +233 -235
- package/dist/form/validator/validator.js +257 -189
- package/dist/form/widget/definitions.js +1 -1
- package/dist/form/widget/providers/checkBox.js +254 -259
- package/dist/form/widget/providers/comboBox.js +187 -192
- package/dist/form/widget/providers/default.js +8 -9
- package/dist/form/widget/providers/hidden.js +170 -179
- package/dist/form/widget/providers/hiddenBox.js +262 -267
- package/dist/form/widget/providers/radioBox.js +216 -225
- package/dist/form/widget/providers/textArea.js +187 -196
- package/dist/form/widget/providers/textBox.js +2 -3
- package/dist/form/widget/widget.js +473 -475
- package/dist/formValidator/formValidator.js +1 -1
- package/dist/formValidator/highlighters/message.js +1 -1
- package/dist/generis/form/form.js +314 -323
- package/dist/generis/validator/validator.js +209 -218
- package/dist/generis/widget/checkBox/checkBox.js +218 -227
- package/dist/generis/widget/comboBox/comboBox.js +179 -188
- package/dist/generis/widget/hiddenBox/hiddenBox.js +220 -229
- package/dist/generis/widget/textBox/textBox.js +169 -178
- package/dist/generis/widget/widget.js +246 -255
- package/dist/groupedComboBox.js +222 -231
- package/dist/groupvalidator.js +2 -2
- package/dist/highlighter.js +967 -958
- package/dist/image/ImgStateActive/helper.js +7 -5
- package/dist/image/ImgStateActive/initHelper.js +49 -43
- package/dist/image/ImgStateActive/initMediaEditor.js +24 -20
- package/dist/image/ImgStateActive/mediaSizer.js +14 -12
- package/dist/image/ImgStateActive.js +72 -70
- package/dist/incrementer.js +6 -6
- package/dist/inplacer.js +6 -6
- package/dist/itemButtonList/css/item-button-list.css +1 -0
- package/dist/itemButtonList/css/item-button-list.css.map +1 -1
- package/dist/itemButtonList.js +439 -435
- package/dist/keyNavigation/navigableDomElement.js +51 -38
- package/dist/keyNavigation/navigator.js +85 -70
- package/dist/listbox.js +460 -469
- package/dist/liststyler.js +8 -8
- package/dist/loadingButton/loadingButton.js +209 -218
- package/dist/lock.js +476 -485
- package/dist/login/login.js +475 -484
- package/dist/maths/calculator/basicCalculator.js +235 -244
- package/dist/maths/calculator/calculatorComponent.js +3 -3
- package/dist/maths/calculator/core/board.js +772 -781
- package/dist/maths/calculator/core/expression.js +476 -485
- package/dist/maths/calculator/core/labels.js +228 -237
- package/dist/maths/calculator/core/tokenizer.js +1 -1
- package/dist/maths/calculator/core/tokens.js +163 -170
- package/dist/maths/calculator/plugins/keyboard/templateKeyboard/templateKeyboard.js +244 -253
- package/dist/maths/calculator/plugins/screen/simpleScreen/simpleScreen.js +279 -288
- package/dist/maths/calculator/scientificCalculator.js +327 -336
- package/dist/mediaEditor/mediaEditorComponent.js +238 -245
- package/dist/mediaEditor/plugins/mediaAlignment/helper.js +7 -7
- package/dist/mediaEditor/plugins/mediaAlignment/mediaAlignmentComponent.js +229 -235
- package/dist/mediaEditor/plugins/mediaDimension/mediaDimensionComponent.js +580 -589
- package/dist/mediaplayer/players/html5.js +666 -675
- package/dist/mediaplayer/players/youtube.js +419 -424
- package/dist/mediaplayer/support.js +11 -10
- package/dist/mediaplayer/utils/reminder.js +14 -13
- package/dist/mediaplayer/utils/timeObserver.js +10 -11
- package/dist/mediaplayer/youtubeManager.js +164 -145
- package/dist/mediaplayer.js +1565 -1520
- package/dist/mediasizer.js +669 -678
- package/dist/modal.js +10 -17
- package/dist/pageSizeSelector.js +219 -228
- package/dist/pagination/providers/pages.js +280 -289
- package/dist/pagination/providers/simple.js +192 -201
- package/dist/previewer.js +30 -30
- package/dist/progressbar.js +4 -4
- package/dist/report.js +347 -356
- package/dist/resource/filters.js +271 -280
- package/dist/resource/list.js +1264 -1273
- package/dist/resource/selector.js +865 -874
- package/dist/resource/tree.js +1483 -1492
- package/dist/resourcemgr/fileBrowser.js +564 -569
- package/dist/resourcemgr/filePreview.js +16 -16
- package/dist/resourcemgr/fileSelector.js +515 -524
- package/dist/resourcemgr/util/updatePermissions.js +2 -2
- package/dist/resourcemgr.js +306 -315
- package/dist/searchModal/advancedSearch.js +796 -767
- package/dist/searchModal.js +114 -91
- package/dist/switch/switch.js +298 -307
- package/dist/tabs.js +598 -575
- package/dist/taskQueue/status.js +312 -321
- package/dist/taskQueue/table.js +375 -384
- package/dist/taskQueue/taskQueueModel.js +488 -472
- package/dist/taskQueueButton/taskable.js +264 -273
- package/dist/taskQueueButton/treeButton.js +189 -198
- package/dist/themeLoader.js +24 -23
- package/dist/themes.js +1 -1
- package/dist/toggler.js +3 -3
- package/dist/tooltip.js +295 -304
- package/dist/transformer.js +2 -2
- package/dist/tristateCheckboxGroup.js +311 -320
- package/dist/uploader.js +687 -696
- package/dist/validator/Report.js +1 -1
- package/dist/validator/Validator.js +3 -3
- package/dist/validator/validators.js +9 -9
- package/dist/validator.js +240 -230
- package/dist/waitForMedia.js +1 -1
- package/package.json +3 -3
- package/src/animable/absorbable/css/absorb.css +1 -0
- package/src/animable/absorbable/css/absorb.css.map +1 -1
- package/src/autocomplete/css/autocomplete.css +1 -0
- package/src/autocomplete/css/autocomplete.css.map +1 -1
- package/src/badge/css/badge.css +1 -0
- package/src/badge/css/badge.css.map +1 -1
- package/src/ckeditor/ckConfigurator.js +4 -0
- package/src/itemButtonList/css/item-button-list.css +1 -0
- package/src/itemButtonList/css/item-button-list.css.map +1 -1
- package/src/.DS_Store +0 -0
- package/src/css/basic.css +0 -7826
- package/src/css/basic.css.map +0 -1
- package/src/css/ckeditor/skins/tao/css/dialog.css +0 -950
- package/src/css/ckeditor/skins/tao/css/dialog.css.map +0 -1
- package/src/css/ckeditor/skins/tao/css/editor.css +0 -1850
- package/src/css/ckeditor/skins/tao/css/editor.css.map +0 -1
- package/src/scss/.DS_Store +0 -0
- package/src/scss/basic.scss +0 -16
- package/src/scss/ckeditor/skins/tao/scss/dialog.scss +0 -763
- package/src/scss/ckeditor/skins/tao/scss/editor.scss +0 -111
- package/src/scss/ckeditor/skins/tao/scss/inc/_ck-icons.scss +0 -59
- package/src/scss/ckeditor/skins/tao/scss/inc/_colorpanel.scss +0 -118
- package/src/scss/ckeditor/skins/tao/scss/inc/_elementspath.scss +0 -69
- package/src/scss/ckeditor/skins/tao/scss/inc/_mainui.scss +0 -194
- package/src/scss/ckeditor/skins/tao/scss/inc/_menu.scss +0 -181
- package/src/scss/ckeditor/skins/tao/scss/inc/_panel.scss +0 -200
- package/src/scss/ckeditor/skins/tao/scss/inc/_presets.scss +0 -32
- package/src/scss/ckeditor/skins/tao/scss/inc/_reset.scss +0 -101
- package/src/scss/ckeditor/skins/tao/scss/inc/_richcombo.scss +0 -213
- package/src/scss/ckeditor/skins/tao/scss/inc/_tao.scss +0 -59
- package/src/scss/ckeditor/skins/tao/scss/inc/_toolbar.scss +0 -301
- package/src/scss/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-italic.eot.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-italic.woff.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-regular.eot.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-regular.woff.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.eot +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.eot.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.woff +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.woff.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold.eot.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold.woff.b64 +0 -1
- package/src/scss/font/tao/tao.eot +0 -0
- package/src/scss/font/tao/tao.svg +0 -235
- package/src/scss/font/tao/tao.ttf +0 -0
- package/src/scss/font/tao/tao.woff +0 -0
- package/src/scss/inc/_base.scss +0 -496
- package/src/scss/inc/_bootstrap.scss +0 -6
- package/src/scss/inc/_buttons.scss +0 -114
- package/src/scss/inc/_colors.scss +0 -88
- package/src/scss/inc/_feedback.scss +0 -150
- package/src/scss/inc/_flex-grid.scss +0 -15
- package/src/scss/inc/_fonts.scss +0 -4
- package/src/scss/inc/_forms.scss +0 -827
- package/src/scss/inc/_functions.scss +0 -283
- package/src/scss/inc/_grid.scss +0 -66
- package/src/scss/inc/_jquery.nouislider.scss +0 -254
- package/src/scss/inc/_normalize.scss +0 -528
- package/src/scss/inc/_report.scss +0 -68
- package/src/scss/inc/_secondary-properties.scss +0 -89
- package/src/scss/inc/_select2.scss +0 -634
- package/src/scss/inc/_toolbars.scss +0 -155
- package/src/scss/inc/_tooltip.scss +0 -312
- package/src/scss/inc/_variables.scss +0 -21
- package/src/scss/inc/base/_highlight.scss +0 -5
- package/src/scss/inc/base/_list-style.scss +0 -59
- package/src/scss/inc/base/_svg.scss +0 -3
- package/src/scss/inc/base/_table.scss +0 -63
- package/src/scss/inc/fonts/_source-sans-pro.scss +0 -29
- package/src/scss/inc/fonts/_tao-icon-classes.scss +0 -226
- package/src/scss/inc/fonts/_tao-icon-def.scss +0 -12
- package/src/scss/inc/fonts/_tao-icon-vars.scss +0 -240
package/dist/taskQueue/table.js
CHANGED
|
@@ -1,447 +1,438 @@
|
|
|
1
1
|
define(['jquery', 'lodash', 'i18n', 'moment', 'ui/taskQueue', 'ui/component', 'ui/taskQueue/status', 'handlebars', 'lib/dompurify/purify', 'ui/datatable', 'ui/modal', 'jquery.fileDownload'], function ($$1, _, __, moment, taskQueueApi, component, taskQueueStatusFactory, Handlebars, DOMPurify, datatable, modal, jquery_fileDownload) { 'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
$$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
|
|
4
|
+
_ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
|
|
5
|
+
__ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
|
|
6
|
+
moment = moment && Object.prototype.hasOwnProperty.call(moment, 'default') ? moment['default'] : moment;
|
|
7
|
+
taskQueueApi = taskQueueApi && Object.prototype.hasOwnProperty.call(taskQueueApi, 'default') ? taskQueueApi['default'] : taskQueueApi;
|
|
8
|
+
component = component && Object.prototype.hasOwnProperty.call(component, 'default') ? component['default'] : component;
|
|
9
|
+
taskQueueStatusFactory = taskQueueStatusFactory && Object.prototype.hasOwnProperty.call(taskQueueStatusFactory, 'default') ? taskQueueStatusFactory['default'] : taskQueueStatusFactory;
|
|
10
|
+
Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
|
|
11
|
+
DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
|
|
12
|
+
|
|
13
|
+
function _typeof(obj) {
|
|
14
|
+
"@babel/helpers - typeof";
|
|
15
|
+
|
|
16
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
17
|
+
return typeof obj;
|
|
18
|
+
} : function (obj) {
|
|
19
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
20
|
+
}, _typeof(obj);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function Helpers0 (hb) {
|
|
24
|
+
//register a i18n helper
|
|
25
|
+
hb.registerHelper('__', function (key) {
|
|
26
|
+
return __(key);
|
|
27
|
+
});
|
|
13
28
|
/**
|
|
14
|
-
*
|
|
15
|
-
* modify it under the terms of the GNU General Public License
|
|
16
|
-
* as published by the Free Software Foundation; under version 2
|
|
17
|
-
* of the License (non-upgradable).
|
|
18
|
-
*
|
|
19
|
-
* This program is distributed in the hope that it will be useful,
|
|
20
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
21
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
22
|
-
* GNU General Public License for more details.
|
|
23
|
-
*
|
|
24
|
-
* You should have received a copy of the GNU General Public License
|
|
25
|
-
* along with this program; if not, write to the Free Software
|
|
26
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
27
|
-
*
|
|
28
|
-
* Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
|
|
29
|
-
*
|
|
29
|
+
* Register dompurify helper
|
|
30
30
|
*
|
|
31
|
+
* https://github.com/cure53/DOMPurify
|
|
32
|
+
* with config SAFE_FOR_TEMPLATES: true
|
|
33
|
+
* to make output safe for template systems
|
|
31
34
|
*/
|
|
32
|
-
function Helpers0 (hb) {
|
|
33
|
-
//register a i18n helper
|
|
34
|
-
hb.registerHelper('__', function (key) {
|
|
35
|
-
return __(key);
|
|
36
|
-
});
|
|
37
|
-
/**
|
|
38
|
-
* Register dompurify helper
|
|
39
|
-
*
|
|
40
|
-
* https://github.com/cure53/DOMPurify
|
|
41
|
-
* with config SAFE_FOR_TEMPLATES: true
|
|
42
|
-
* to make output safe for template systems
|
|
43
|
-
*/
|
|
44
35
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
36
|
+
hb.registerHelper('dompurify', function (context) {
|
|
37
|
+
return DOMPurify.sanitize(context);
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Register join helper
|
|
41
|
+
*
|
|
42
|
+
* Example :
|
|
43
|
+
* var values = {a:v1, b:v2, c:v3};
|
|
44
|
+
* Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
|
|
45
|
+
* Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
|
|
46
|
+
*/
|
|
56
47
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
|
|
49
|
+
var fragments = [];
|
|
50
|
+
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
51
|
+
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
52
|
+
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
62
53
|
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
_.forIn(arr, function (value, key) {
|
|
55
|
+
var fragment = '';
|
|
65
56
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
} else {
|
|
73
|
-
value = '';
|
|
57
|
+
if (value !== null || value !== undefined) {
|
|
58
|
+
if (typeof value === 'boolean') {
|
|
59
|
+
value = value ? 'true' : 'false';
|
|
60
|
+
} else if (_typeof(value) === 'object') {
|
|
61
|
+
value = _.values(value).join(' ');
|
|
74
62
|
}
|
|
75
|
-
|
|
76
|
-
if (keyValueGlue !== undefined) {
|
|
77
|
-
fragment += key + keyValueGlue;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
fragment += wrapper + value + wrapper;
|
|
81
|
-
fragments.push(fragment);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
return fragments.join(fragmentGlue);
|
|
85
|
-
}); //register a classic "for loop" helper
|
|
86
|
-
//it also adds a local variable "i" as the index in each iteration loop
|
|
87
|
-
|
|
88
|
-
hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
|
|
89
|
-
var ret = '';
|
|
90
|
-
startIndex = parseInt(startIndex);
|
|
91
|
-
stopIndex = parseInt(stopIndex);
|
|
92
|
-
increment = parseInt(increment);
|
|
93
|
-
|
|
94
|
-
for (var i = startIndex; i < stopIndex; i += increment) {
|
|
95
|
-
ret += options.fn(_.extend({}, this, {
|
|
96
|
-
i: i
|
|
97
|
-
}));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return ret;
|
|
101
|
-
});
|
|
102
|
-
hb.registerHelper('equal', function (var1, var2, options) {
|
|
103
|
-
if (var1 == var2) {
|
|
104
|
-
return options.fn(this);
|
|
105
63
|
} else {
|
|
106
|
-
|
|
64
|
+
value = '';
|
|
107
65
|
}
|
|
108
|
-
}); // register a "get property" helper
|
|
109
|
-
// it gets the named property from the provided context
|
|
110
|
-
|
|
111
|
-
hb.registerHelper('property', function (name, context) {
|
|
112
|
-
return context[name] || '';
|
|
113
|
-
}); // register an 'includes' helper
|
|
114
|
-
// it checks if value is in array
|
|
115
66
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return options.fn(this);
|
|
67
|
+
if (keyValueGlue !== undefined) {
|
|
68
|
+
fragment += key + keyValueGlue;
|
|
119
69
|
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
70
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
Helpers0.__initialized = true;
|
|
126
|
-
}
|
|
127
|
-
var Template = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
|
128
|
-
this.compilerInfo = [4,'>= 1.0.0'];
|
|
129
|
-
helpers = this.merge(helpers, Handlebars.helpers);
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return "<div class=\"report-container\"></div>";
|
|
71
|
+
fragment += wrapper + value + wrapper;
|
|
72
|
+
fragments.push(fragment);
|
|
133
73
|
});
|
|
134
|
-
function reportTpl(data, options, asString) {
|
|
135
|
-
var html = Template(data, options);
|
|
136
|
-
return (asString || true) ? html : $(html);
|
|
137
|
-
}
|
|
138
74
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
* as published by the Free Software Foundation; under version 2
|
|
143
|
-
* of the License (non-upgradable).
|
|
144
|
-
*
|
|
145
|
-
* This program is distributed in the hope that it will be useful,
|
|
146
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
147
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
148
|
-
* GNU General Public License for more details.
|
|
149
|
-
*
|
|
150
|
-
* You should have received a copy of the GNU General Public License
|
|
151
|
-
* along with this program; if not, write to the Free Software
|
|
152
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
153
|
-
*
|
|
154
|
-
* Copyright (c) 2017 (original work) Open Assessment Technologies SA ;
|
|
155
|
-
*
|
|
156
|
-
*/
|
|
157
|
-
var _defaults = {
|
|
158
|
-
context: '',
|
|
159
|
-
urls: {
|
|
160
|
-
listing: '',
|
|
161
|
-
remove: '',
|
|
162
|
-
download: ''
|
|
163
|
-
},
|
|
164
|
-
status: {
|
|
165
|
-
loading: __('Loading status'),
|
|
166
|
-
created: __('Not started'),
|
|
167
|
-
running: __('In progress'),
|
|
168
|
-
finished: __('Completed'),
|
|
169
|
-
finishedSuccess: __('Completed'),
|
|
170
|
-
finishedError: __('Completed - Error')
|
|
171
|
-
},
|
|
172
|
-
statusFilter: ['loading', 'created', 'running', 'finished', 'finishedSuccess', 'finishedError']
|
|
173
|
-
};
|
|
174
|
-
/**
|
|
175
|
-
* Format the input timestamp into a user friendly format
|
|
176
|
-
*
|
|
177
|
-
* @param {String} date
|
|
178
|
-
* @returns {String}
|
|
179
|
-
*/
|
|
75
|
+
return fragments.join(fragmentGlue);
|
|
76
|
+
}); //register a classic "for loop" helper
|
|
77
|
+
//it also adds a local variable "i" as the index in each iteration loop
|
|
180
78
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
*
|
|
187
|
-
* @param {Object} report
|
|
188
|
-
* @returns {boolean}
|
|
189
|
-
*/
|
|
79
|
+
hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
|
|
80
|
+
var ret = '';
|
|
81
|
+
startIndex = parseInt(startIndex);
|
|
82
|
+
stopIndex = parseInt(stopIndex);
|
|
83
|
+
increment = parseInt(increment);
|
|
190
84
|
|
|
85
|
+
for (var i = startIndex; i < stopIndex; i += increment) {
|
|
86
|
+
ret += options.fn(_.extend({}, this, {
|
|
87
|
+
i: i
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
191
90
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
91
|
+
return ret;
|
|
92
|
+
});
|
|
93
|
+
hb.registerHelper('equal', function (var1, var2, options) {
|
|
94
|
+
if (var1 == var2) {
|
|
95
|
+
return options.fn(this);
|
|
96
|
+
} else {
|
|
97
|
+
return options.inverse(this);
|
|
98
|
+
}
|
|
99
|
+
}); // register a "get property" helper
|
|
100
|
+
// it gets the named property from the provided context
|
|
200
101
|
|
|
102
|
+
hb.registerHelper('property', function (name, context) {
|
|
103
|
+
return context[name] || '';
|
|
104
|
+
}); // register an 'includes' helper
|
|
105
|
+
// it checks if value is in array
|
|
201
106
|
|
|
202
|
-
|
|
203
|
-
if (
|
|
204
|
-
return
|
|
107
|
+
hb.registerHelper('includes', function (haystack, needle, options) {
|
|
108
|
+
if (_.contains(haystack, needle)) {
|
|
109
|
+
return options.fn(this);
|
|
205
110
|
}
|
|
206
|
-
};
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (!Helpers0.__initialized) {
|
|
115
|
+
Helpers0(Handlebars);
|
|
116
|
+
Helpers0.__initialized = true;
|
|
117
|
+
}
|
|
118
|
+
var Template = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
|
119
|
+
this.compilerInfo = [4,'>= 1.0.0'];
|
|
120
|
+
helpers = this.merge(helpers, Handlebars.helpers);
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
return "<div class=\"report-container\"></div>";
|
|
124
|
+
});
|
|
125
|
+
function reportTpl(data, options, asString) {
|
|
126
|
+
var html = Template(data, options);
|
|
127
|
+
return (asString || true) ? html : $(html);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/*
|
|
131
|
+
* This program is free software; you can redistribute it and/or
|
|
132
|
+
* modify it under the terms of the GNU General Public License
|
|
133
|
+
* as published by the Free Software Foundation; under version 2
|
|
134
|
+
* of the License (non-upgradable).
|
|
135
|
+
*
|
|
136
|
+
* This program is distributed in the hope that it will be useful,
|
|
137
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
138
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
139
|
+
* GNU General Public License for more details.
|
|
140
|
+
*
|
|
141
|
+
* You should have received a copy of the GNU General Public License
|
|
142
|
+
* along with this program; if not, write to the Free Software
|
|
143
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
144
|
+
*
|
|
145
|
+
* Copyright (c) 2017 (original work) Open Assessment Technologies SA ;
|
|
146
|
+
*
|
|
147
|
+
*/
|
|
148
|
+
var _defaults = {
|
|
149
|
+
context: '',
|
|
150
|
+
urls: {
|
|
151
|
+
listing: '',
|
|
152
|
+
remove: '',
|
|
153
|
+
download: ''
|
|
154
|
+
},
|
|
155
|
+
status: {
|
|
156
|
+
loading: __('Loading status'),
|
|
157
|
+
created: __('Not started'),
|
|
158
|
+
running: __('In progress'),
|
|
159
|
+
finished: __('Completed'),
|
|
160
|
+
finishedSuccess: __('Completed'),
|
|
161
|
+
finishedError: __('Completed - Error')
|
|
162
|
+
},
|
|
163
|
+
statusFilter: ['loading', 'created', 'running', 'finished', 'finishedSuccess', 'finishedError']
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Format the input timestamp into a user friendly format
|
|
167
|
+
*
|
|
168
|
+
* @param {String} date
|
|
169
|
+
* @returns {String}
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
var formatDate = function formatDate(date) {
|
|
173
|
+
return moment.unix(date).fromNow();
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* Check if the object is a report
|
|
177
|
+
*
|
|
178
|
+
* @param {Object} report
|
|
179
|
+
* @returns {boolean}
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
var isReport = function isReport(report) {
|
|
184
|
+
return _.isPlainObject(report) && report.type && report.message;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Check if the report is of a error type
|
|
188
|
+
* @param {Object} report
|
|
189
|
+
* @returns {boolean}
|
|
190
|
+
*/
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
var isTaskErrorReport = function isTaskErrorReport(report) {
|
|
194
|
+
if (isReport(report) && _.isArray(report.children) && isReport(report.children[0])) {
|
|
195
|
+
return report.children[0].type === 'error';
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Creates the taskQueueTable component
|
|
200
|
+
*
|
|
201
|
+
* @param {String} testCenterId - the test center URI
|
|
202
|
+
* @returns {taskQueueTable} the component
|
|
203
|
+
* @throws {TypeError} when the task queue context (type) is absent in the config
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
function taskQueueTableFactory(config) {
|
|
208
|
+
var tasks, errorRows;
|
|
209
|
+
config = _.defaults(config, _defaults);
|
|
210
|
+
|
|
211
|
+
if (_.isEmpty(config.context)) {
|
|
212
|
+
throw new TypeError('The task queue provider needs to be initalized with a context');
|
|
213
|
+
}
|
|
207
214
|
/**
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
* @
|
|
211
|
-
* @
|
|
212
|
-
* @
|
|
215
|
+
* The task queue table component
|
|
216
|
+
* @typedef taskQueueTable
|
|
217
|
+
* @see ui/component
|
|
218
|
+
* @fires taskQueueTable#loading when the table is loading
|
|
219
|
+
* @fires taskQueueTable#loaded when the data is loaded
|
|
220
|
+
* @fires taskQueueTable#refresh when refreshing table content
|
|
213
221
|
*/
|
|
214
222
|
|
|
215
223
|
|
|
216
|
-
|
|
217
|
-
var tasks, errorRows;
|
|
218
|
-
config = _.defaults(config, _defaults);
|
|
219
|
-
|
|
220
|
-
if (_.isEmpty(config.context)) {
|
|
221
|
-
throw new TypeError('The task queue provider needs to be initalized with a context');
|
|
222
|
-
}
|
|
224
|
+
return component({
|
|
223
225
|
/**
|
|
224
|
-
*
|
|
225
|
-
* @
|
|
226
|
-
* @
|
|
227
|
-
* @fires taskQueueTable#loading when the table is loading
|
|
228
|
-
* @fires taskQueueTable#loaded when the data is loaded
|
|
229
|
-
* @fires taskQueueTable#refresh when refreshing table content
|
|
226
|
+
* Display a report for a task
|
|
227
|
+
* @param taskId
|
|
228
|
+
* @returns {taskQueueTable}
|
|
230
229
|
*/
|
|
230
|
+
showReport: function showReport(taskId) {
|
|
231
|
+
var status, data;
|
|
232
|
+
var $report = this.$component.find('.report-container');
|
|
233
|
+
var $dataTable = this.$component.find('.datatable-wrapper');
|
|
231
234
|
|
|
235
|
+
if (!$report.length) {
|
|
236
|
+
$report = $$1(reportTpl());
|
|
237
|
+
this.$component.append($report);
|
|
238
|
+
} //toggle display fo queue table
|
|
232
239
|
|
|
233
|
-
return component({
|
|
234
|
-
/**
|
|
235
|
-
* Display a report for a task
|
|
236
|
-
* @param taskId
|
|
237
|
-
* @returns {taskQueueTable}
|
|
238
|
-
*/
|
|
239
|
-
showReport: function showReport(taskId) {
|
|
240
|
-
var status, data;
|
|
241
|
-
var $report = this.$component.find('.report-container');
|
|
242
|
-
var $dataTable = this.$component.find('.datatable-wrapper');
|
|
243
240
|
|
|
244
|
-
|
|
245
|
-
$report = $$1(reportTpl());
|
|
246
|
-
this.$component.append($report);
|
|
247
|
-
} //toggle display fo queue table
|
|
241
|
+
$dataTable.hide();
|
|
248
242
|
|
|
243
|
+
var task = _.find(tasks, {
|
|
244
|
+
id: taskId
|
|
245
|
+
});
|
|
249
246
|
|
|
250
|
-
|
|
247
|
+
if (task && task.status === 'finished' && task.report) {
|
|
248
|
+
data = task;
|
|
249
|
+
}
|
|
251
250
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
251
|
+
status = taskQueueStatusFactory({
|
|
252
|
+
replace: true,
|
|
253
|
+
taskId: taskId,
|
|
254
|
+
serviceUrl: this.config.statusUrl,
|
|
255
|
+
showDetailsButton: false,
|
|
256
|
+
actions: [{
|
|
257
|
+
id: 'back',
|
|
258
|
+
icon: 'backward',
|
|
259
|
+
title: __('Back to listing'),
|
|
260
|
+
label: __('Back')
|
|
261
|
+
}],
|
|
262
|
+
data: data
|
|
263
|
+
}).on('action-back', function () {
|
|
264
|
+
status.destroy();
|
|
265
|
+
$dataTable.show();
|
|
266
|
+
}).render($report).start();
|
|
267
|
+
return this;
|
|
268
|
+
},
|
|
255
269
|
|
|
256
|
-
|
|
257
|
-
|
|
270
|
+
/**
|
|
271
|
+
* Remove a task from the datatable
|
|
272
|
+
* @param taskId
|
|
273
|
+
* @returns {taskQueueTable}
|
|
274
|
+
* @fires taskQueueTable#removed
|
|
275
|
+
* @fires taskQueueTable#error
|
|
276
|
+
*/
|
|
277
|
+
remove: function remove(taskId) {
|
|
278
|
+
var self = this;
|
|
279
|
+
this.taskQueueApi.remove(taskId).then(function () {
|
|
280
|
+
self.$component.datatable('refresh');
|
|
281
|
+
self.trigger('removed', taskId);
|
|
282
|
+
}).catch(function (err) {
|
|
283
|
+
self.trigger('error', err);
|
|
284
|
+
});
|
|
285
|
+
return this;
|
|
286
|
+
},
|
|
287
|
+
download: function download(taskId) {
|
|
288
|
+
var self = this;
|
|
289
|
+
$$1.fileDownload(this.config.downloadUrl, {
|
|
290
|
+
data: {
|
|
291
|
+
taskId: taskId
|
|
292
|
+
},
|
|
293
|
+
failCallback: function failCallback() {
|
|
294
|
+
self.trigger('error', __('File download failed'));
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
return this;
|
|
298
|
+
}
|
|
299
|
+
}, config).on('init', function () {
|
|
300
|
+
this.taskQueueApi = taskQueueApi({
|
|
301
|
+
url: {
|
|
302
|
+
status: this.config.serviceUrl,
|
|
303
|
+
remove: this.config.removeUrl
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
}).on('render', function () {
|
|
307
|
+
var self = this;
|
|
308
|
+
var $component = this.getElement();
|
|
309
|
+
var actions = [{
|
|
310
|
+
id: 'delete',
|
|
311
|
+
icon: 'bin',
|
|
312
|
+
title: __('Remove'),
|
|
313
|
+
disabled: function disabled() {
|
|
314
|
+
if (this.status === config.status.finished || this.status === config.status.finishedError || this.status === config.status.finishedSuccess) {
|
|
315
|
+
return false;
|
|
258
316
|
}
|
|
259
317
|
|
|
260
|
-
|
|
261
|
-
replace: true,
|
|
262
|
-
taskId: taskId,
|
|
263
|
-
serviceUrl: this.config.statusUrl,
|
|
264
|
-
showDetailsButton: false,
|
|
265
|
-
actions: [{
|
|
266
|
-
id: 'back',
|
|
267
|
-
icon: 'backward',
|
|
268
|
-
title: __('Back to listing'),
|
|
269
|
-
label: __('Back')
|
|
270
|
-
}],
|
|
271
|
-
data: data
|
|
272
|
-
}).on('action-back', function () {
|
|
273
|
-
status.destroy();
|
|
274
|
-
$dataTable.show();
|
|
275
|
-
}).render($report).start();
|
|
276
|
-
return this;
|
|
318
|
+
return true;
|
|
277
319
|
},
|
|
320
|
+
action: function action(id) {
|
|
321
|
+
self.remove(id);
|
|
322
|
+
}
|
|
323
|
+
}, {
|
|
324
|
+
id: 'report',
|
|
325
|
+
icon: 'templates',
|
|
326
|
+
title: __('View report'),
|
|
327
|
+
disabled: function disabled() {
|
|
328
|
+
if (this.status !== config.status.created) {
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
278
331
|
|
|
279
|
-
|
|
280
|
-
* Remove a task from the datatable
|
|
281
|
-
* @param taskId
|
|
282
|
-
* @returns {taskQueueTable}
|
|
283
|
-
* @fires taskQueueTable#removed
|
|
284
|
-
* @fires taskQueueTable#error
|
|
285
|
-
*/
|
|
286
|
-
remove: function remove(taskId) {
|
|
287
|
-
var self = this;
|
|
288
|
-
this.taskQueueApi.remove(taskId).then(function () {
|
|
289
|
-
self.$component.datatable('refresh');
|
|
290
|
-
self.trigger('removed', taskId);
|
|
291
|
-
}).catch(function (err) {
|
|
292
|
-
self.trigger('error', err);
|
|
293
|
-
});
|
|
294
|
-
return this;
|
|
332
|
+
return true;
|
|
295
333
|
},
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
$$1.fileDownload(this.config.downloadUrl, {
|
|
299
|
-
data: {
|
|
300
|
-
taskId: taskId
|
|
301
|
-
},
|
|
302
|
-
failCallback: function () {
|
|
303
|
-
self.trigger('error', __('File download failed'));
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
return this;
|
|
334
|
+
action: function action(id) {
|
|
335
|
+
self.showReport(id);
|
|
307
336
|
}
|
|
308
|
-
}
|
|
309
|
-
this.taskQueueApi = taskQueueApi({
|
|
310
|
-
url: {
|
|
311
|
-
status: this.config.serviceUrl,
|
|
312
|
-
remove: this.config.removeUrl
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
}).on('render', function () {
|
|
316
|
-
var self = this;
|
|
317
|
-
var $component = this.getElement();
|
|
318
|
-
var actions = [{
|
|
319
|
-
id: 'delete',
|
|
320
|
-
icon: 'bin',
|
|
321
|
-
title: __('Remove'),
|
|
322
|
-
disabled: function disabled() {
|
|
323
|
-
if (this.status === config.status.finished || this.status === config.status.finishedError || this.status === config.status.finishedSuccess) {
|
|
324
|
-
return false;
|
|
325
|
-
}
|
|
337
|
+
}];
|
|
326
338
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}, {
|
|
333
|
-
id: 'report',
|
|
334
|
-
icon: 'templates',
|
|
335
|
-
title: __('View report'),
|
|
339
|
+
if (typeof this.config.downloadUrl !== 'undefined' && this.config.downloadUrl !== '') {
|
|
340
|
+
actions.push({
|
|
341
|
+
id: 'download',
|
|
342
|
+
icon: 'download',
|
|
343
|
+
title: __('Download'),
|
|
336
344
|
disabled: function disabled() {
|
|
337
|
-
if (this.status
|
|
345
|
+
if (this.status === config.status.finished || this.status === config.status.finishedSuccess) {
|
|
338
346
|
return false;
|
|
339
347
|
}
|
|
340
348
|
|
|
341
349
|
return true;
|
|
342
350
|
},
|
|
343
351
|
action: function action(id) {
|
|
344
|
-
self.
|
|
352
|
+
self.download(id);
|
|
345
353
|
}
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
if (typeof this.config.downloadUrl !== 'undefined' && this.config.downloadUrl !== '') {
|
|
349
|
-
actions.push({
|
|
350
|
-
id: 'download',
|
|
351
|
-
icon: 'download',
|
|
352
|
-
title: __('Download'),
|
|
353
|
-
disabled: function disabled() {
|
|
354
|
-
if (this.status === config.status.finished || this.status === config.status.finishedSuccess) {
|
|
355
|
-
return false;
|
|
356
|
-
}
|
|
354
|
+
});
|
|
355
|
+
} //set up the ui/datatable
|
|
357
356
|
|
|
358
|
-
return true;
|
|
359
|
-
},
|
|
360
|
-
action: function action(id) {
|
|
361
|
-
self.download(id);
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
} //set up the ui/datatable
|
|
365
357
|
|
|
358
|
+
$component.addClass('task-queue-table').on('beforeload.datatable', function (e, dataSet) {
|
|
359
|
+
if (dataSet && dataSet.data) {
|
|
360
|
+
tasks = dataSet.data;
|
|
361
|
+
}
|
|
362
|
+
}).on('query.datatable', function () {
|
|
363
|
+
errorRows = [];
|
|
364
|
+
self.trigger('loading');
|
|
365
|
+
}).on('load.datatable', function () {
|
|
366
|
+
// highlight rows
|
|
367
|
+
if (_.isArray(errorRows) && errorRows.length) {
|
|
368
|
+
_.forEach(errorRows, function (id) {
|
|
369
|
+
$component.datatable('addRowClass', id, 'error');
|
|
370
|
+
});
|
|
371
|
+
}
|
|
366
372
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
373
|
+
self.trigger('loaded');
|
|
374
|
+
}).datatable({
|
|
375
|
+
url: this.config.dataUrl,
|
|
376
|
+
rows: this.config.rows,
|
|
377
|
+
sortorder: 'desc',
|
|
378
|
+
filtercolumns: {
|
|
379
|
+
type: this.config.context,
|
|
380
|
+
status: this.config.statusFilter
|
|
381
|
+
},
|
|
382
|
+
status: {
|
|
383
|
+
empty: __('No Task yet'),
|
|
384
|
+
available: __('Task Listing'),
|
|
385
|
+
loading: __('Loading')
|
|
386
|
+
},
|
|
387
|
+
tools: [{
|
|
388
|
+
id: 'refresh',
|
|
389
|
+
icon: 'reset',
|
|
390
|
+
title: __('Refresh'),
|
|
391
|
+
label: __('Refresh'),
|
|
392
|
+
action: function action() {
|
|
393
|
+
self.$component.datatable('refresh');
|
|
394
|
+
self.trigger('refresh');
|
|
370
395
|
}
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
396
|
+
}],
|
|
397
|
+
model: [{
|
|
398
|
+
id: 'label',
|
|
399
|
+
label: __('Task Name')
|
|
400
|
+
}, {
|
|
401
|
+
id: 'creationDate',
|
|
402
|
+
label: __('Created'),
|
|
403
|
+
transform: function transform(value) {
|
|
404
|
+
return formatDate(value, self.config);
|
|
380
405
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
status: this.config.statusFilter
|
|
390
|
-
},
|
|
391
|
-
status: {
|
|
392
|
-
empty: __('No Task yet'),
|
|
393
|
-
available: __('Task Listing'),
|
|
394
|
-
loading: __('Loading')
|
|
395
|
-
},
|
|
396
|
-
tools: [{
|
|
397
|
-
id: 'refresh',
|
|
398
|
-
icon: 'reset',
|
|
399
|
-
title: __('Refresh'),
|
|
400
|
-
label: __('Refresh'),
|
|
401
|
-
action: function () {
|
|
402
|
-
self.$component.datatable('refresh');
|
|
403
|
-
self.trigger('refresh');
|
|
404
|
-
}
|
|
405
|
-
}],
|
|
406
|
-
model: [{
|
|
407
|
-
id: 'label',
|
|
408
|
-
label: __('Task Name')
|
|
409
|
-
}, {
|
|
410
|
-
id: 'creationDate',
|
|
411
|
-
label: __('Created'),
|
|
412
|
-
transform: function (value) {
|
|
413
|
-
return formatDate(value, self.config);
|
|
414
|
-
}
|
|
415
|
-
}, {
|
|
416
|
-
id: 'status',
|
|
417
|
-
label: __('Status'),
|
|
418
|
-
transform: function (value, row) {
|
|
419
|
-
if (row.status === 'finished') {
|
|
420
|
-
if (isTaskErrorReport(row.report)) {
|
|
421
|
-
errorRows.push(row.id);
|
|
422
|
-
return config.status.finishedError;
|
|
423
|
-
} else {
|
|
424
|
-
return config.status.finishedSuccess;
|
|
425
|
-
}
|
|
406
|
+
}, {
|
|
407
|
+
id: 'status',
|
|
408
|
+
label: __('Status'),
|
|
409
|
+
transform: function transform(value, row) {
|
|
410
|
+
if (row.status === 'finished') {
|
|
411
|
+
if (isTaskErrorReport(row.report)) {
|
|
412
|
+
errorRows.push(row.id);
|
|
413
|
+
return config.status.finishedError;
|
|
426
414
|
} else {
|
|
427
|
-
return config.status
|
|
415
|
+
return config.status.finishedSuccess;
|
|
428
416
|
}
|
|
417
|
+
} else {
|
|
418
|
+
return config.status[row.status] || '';
|
|
429
419
|
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
}).on('reload', function () {
|
|
439
|
-
if (this.$component) {
|
|
440
|
-
this.$component.datatable('refresh');
|
|
441
|
-
}
|
|
420
|
+
}
|
|
421
|
+
}, {
|
|
422
|
+
id: 'actions',
|
|
423
|
+
label: __('Actions'),
|
|
424
|
+
type: 'actions',
|
|
425
|
+
actions: actions
|
|
426
|
+
}],
|
|
427
|
+
selectable: false
|
|
442
428
|
});
|
|
443
|
-
}
|
|
429
|
+
}).on('reload', function () {
|
|
430
|
+
if (this.$component) {
|
|
431
|
+
this.$component.datatable('refresh');
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
}
|
|
444
435
|
|
|
445
|
-
|
|
436
|
+
return taskQueueTableFactory;
|
|
446
437
|
|
|
447
438
|
});
|