From e814f0c41122026118afc46bad03fc69469153b7 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Wed, 7 Nov 2018 12:18:04 +1300 Subject: [PATCH] Fix no messages appearing --- client/dist/js/queuedjobprogressfield.js | 7 +++---- client/dist/js/queuedjobprogressfield.js.map | 2 +- client/src/bundles/queuedjobprogressfield.js | 2 +- package.json | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/client/dist/js/queuedjobprogressfield.js b/client/dist/js/queuedjobprogressfield.js index bd22a18..0313b46 100644 --- a/client/dist/js/queuedjobprogressfield.js +++ b/client/dist/js/queuedjobprogressfield.js @@ -63,12 +63,11 @@ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 1); +/******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ([ -/* 0 */, -/* 1 */ +/* 0 */ /***/ (function(module, exports) { @@ -136,7 +135,7 @@ window.jQuery.entwine('ss', function ($) { $('body').trigger('queuedjob-finished'); } - $(self).find('.messages').val(resp.Messages); + $(self).parents('.field').find('.messages').html(resp.Messages); if (changed) { progress.popover('hide').popover('dispose'); diff --git a/client/dist/js/queuedjobprogressfield.js.map b/client/dist/js/queuedjobprogressfield.js.map index 5a0bdfb..ec6beb9 100644 --- a/client/dist/js/queuedjobprogressfield.js.map +++ b/client/dist/js/queuedjobprogressfield.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 04fc3982e47280e5635c","webpack:///./client/src/bundles/queuedjobprogressfield.js"],"names":["window","jQuery","entwine","$","onmatch","find","popover","container","parents","get","placement","on","removeClass","addClass","link","data","self","setTimeout","fetchData","getInterval","_super","onunmatch","interval","progress","getJSON","resp","Percentage","changed","text","Title","Content","css","hasClass","Status","Animated","trigger","val","Messages","attr"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;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GAA1B,CAA8BX,KAAKY,QAAnC;;AAEA,wBAAIV,OAAJ,EAAa;AACTJ,iCAASjB,OAAT,CAAiB,MAAjB,EAAyBA,OAAzB,CAAiC,SAAjC;;AAEAH,0BAAEa,IAAF,EAAQR,OAAR,CAAgB,QAAhB,EAA0BH,IAA1B,CAA+B,iBAA/B,EAAkDuB,IAAlD,CAAuDH,KAAKI,KAA5D;AACA1B,0BAAEa,IAAF,EAAQR,OAAR,CAAgB,QAAhB,EAA0BH,IAA1B,CAA+B,eAA/B,EAAgDuB,IAAhD,CAAqDH,KAAKK,OAA1D;AACA3B,0BAAEa,IAAF,EAAQX,IAAR,CAAa,eAAb,EACKiC,IADL,CACU,OADV,EACmBb,KAAKI,KADxB,EAEKd,IAFL,CAEU,OAFV,EAEmBU,KAAKI,KAFxB,EAGKd,IAHL,CAGU,SAHV,EAGqBU,KAAKK,OAH1B,EAIKQ,IAJL,CAIU,cAJV,EAI0Bb,KAAKK,OAJ/B;;AAMAP,iCAASjB,OAAT,CAAiB,MAAjB;AACH,qBAZD,MAYO;AACHiB,iCAASjB,OAAT,CAAiB,MAAjB;AACH;;AAED,wBAAImB,KAAKQ,MAAL,KAAgB,YAApB,EAAkC;AAC9BhB,mCAAW,YAAW;AAClBD,iCAAKE,SAAL;AACH,yBAFD,EAEGF,KAAKG,WAAL,EAFH;AAGH;AACJ;AACJ,aAjDD;AAkDH;AA/F+B,KAAlC;AAiGD,CAlGD,E","file":"js/queuedjobprogressfield.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 04fc3982e47280e5635c","// import 'bootstrap';\nwindow.jQuery.entwine('ss', ($) => {\n $('.queuedjob__progress').entwine({\n onmatch() {\n $(this).find('.progress-bar')\n .popover({\n container: $(this).parents('.field').get(0),\n placement: 'top'\n })\n .popover(\"show\")\n .on('hide.bs.popover', function () {\n return false;\n });\n\n $(this).find('.bs-popover-bottom').removeClass('bs-popover-bottom').addClass('bs-popover-top')\n\n var link = $(this).data('live'),\n self = $(this);\n\n if (link) {\n setTimeout(function() {\n self.fetchData()\n }, self.getInterval())\n }\n\n this._super();\n },\n onunmatch() {\n this._super()\n\n $(this).find('.progress-bar').popover('dispose')\n },\n getInterval () {\n var interval = $(this).data('interval');\n\n if (!interval || interval < 5000) {\n interval = 5000\n }\n\n return interval\n },\n fetchData () {\n var self = this\n var progress = $(this).find('.progress-bar'),\n popover = progress.data('bs.popover'),\n link = $(this).data('live');\n\n $.getJSON(link, function(resp) {\n if (resp && resp.Percentage) {\n var changed = (\n $(self).parents('.field').find('.popover-header').text() !== resp.Title ||\n $(self).parents('.field').find('.popover-body').text() !== resp.Content\n )\n\n progress.css('width', resp.Percentage +'%')\n\n if (!progress.hasClass(resp.Status)) {\n progress.removeClass('bg-info bg-success bg-danger bg-warning')\n progress.addClass(resp.Status)\n\n changed = true\n }\n\n if (resp.Animated) {\n progress.addClass('progress-bar-animated')\n } else {\n progress.removeClass('progress-bar-animated')\n\n // fire a global window event for listeners\n $('body').trigger('queuedjob-finished')\n }\n\n $(self).find('.messages').val(resp.Messages);\n\n if (changed) {\n progress.popover('hide').popover('dispose')\n\n $(self).parents('.field').find('.popover-header').text(resp.Title)\n $(self).parents('.field').find('.popover-body').text(resp.Content)\n $(self).find('.progress-bar')\n .attr('title', resp.Title)\n .data('title', resp.Title)\n .data('content', resp.Content)\n .attr('data-content', resp.Content)\n\n progress.popover('show')\n } else {\n progress.popover('show');\n }\n\n if (resp.Status !== 'bg-success') {\n setTimeout(function() {\n self.fetchData()\n }, self.getInterval())\n }\n }\n })\n }\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/queuedjobprogressfield.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap d38910632d1b92142e5e","webpack:///./client/src/bundles/queuedjobprogressfield.js"],"names":["window","jQuery","entwine","$","onmatch","find","popover","container","parents","get","placement","on","removeClass","addClass","link","data","self","setTimeout","fetchData","getInterval","_super","onunmatch","interval","progress","getJSON","resp","Percentage","changed","text","Title","Content","css","hasClass","Status","Animated","trigger","html","Messages","attr"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA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OAAR,CAAgB,QAAhB,EAA0BH,IAA1B,CAA+B,WAA/B,EAA4C+B,IAA5C,CAAiDX,KAAKY,QAAtD;;AAEA,wBAAIV,OAAJ,EAAa;AACTJ,iCAASjB,OAAT,CAAiB,MAAjB,EAAyBA,OAAzB,CAAiC,SAAjC;;AAEAH,0BAAEa,IAAF,EAAQR,OAAR,CAAgB,QAAhB,EAA0BH,IAA1B,CAA+B,iBAA/B,EAAkDuB,IAAlD,CAAuDH,KAAKI,KAA5D;AACA1B,0BAAEa,IAAF,EAAQR,OAAR,CAAgB,QAAhB,EAA0BH,IAA1B,CAA+B,eAA/B,EAAgDuB,IAAhD,CAAqDH,KAAKK,OAA1D;AACA3B,0BAAEa,IAAF,EAAQX,IAAR,CAAa,eAAb,EACKiC,IADL,CACU,OADV,EACmBb,KAAKI,KADxB,EAEKd,IAFL,CAEU,OAFV,EAEmBU,KAAKI,KAFxB,EAGKd,IAHL,CAGU,SAHV,EAGqBU,KAAKK,OAH1B,EAIKQ,IAJL,CAIU,cAJV,EAI0Bb,KAAKK,OAJ/B;;AAMAP,iCAASjB,OAAT,CAAiB,MAAjB;AACH,qBAZD,MAYO;AACHiB,iCAASjB,OAAT,CAAiB,MAAjB;AACH;;AAED,wBAAImB,KAAKQ,MAAL,KAAgB,YAApB,EAAkC;AAC9BhB,mCAAW,YAAW;AAClBD,iCAAKE,SAAL;AACH,yBAFD,EAEGF,KAAKG,WAAL,EAFH;AAGH;AACJ;AACJ,aAjDD;AAkDH;AA/F+B,KAAlC;AAiGD,CAlGD,E","file":"js/queuedjobprogressfield.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d38910632d1b92142e5e","// import 'bootstrap';\nwindow.jQuery.entwine('ss', ($) => {\n $('.queuedjob__progress').entwine({\n onmatch() {\n $(this).find('.progress-bar')\n .popover({\n container: $(this).parents('.field').get(0),\n placement: 'top'\n })\n .popover(\"show\")\n .on('hide.bs.popover', function () {\n return false;\n });\n\n $(this).find('.bs-popover-bottom').removeClass('bs-popover-bottom').addClass('bs-popover-top')\n\n var link = $(this).data('live'),\n self = $(this);\n\n if (link) {\n setTimeout(function() {\n self.fetchData()\n }, self.getInterval())\n }\n\n this._super();\n },\n onunmatch() {\n this._super()\n\n $(this).find('.progress-bar').popover('dispose')\n },\n getInterval () {\n var interval = $(this).data('interval');\n\n if (!interval || interval < 5000) {\n interval = 5000\n }\n\n return interval\n },\n fetchData () {\n var self = this\n var progress = $(this).find('.progress-bar'),\n popover = progress.data('bs.popover'),\n link = $(this).data('live');\n\n $.getJSON(link, function(resp) {\n if (resp && resp.Percentage) {\n var changed = (\n $(self).parents('.field').find('.popover-header').text() !== resp.Title ||\n $(self).parents('.field').find('.popover-body').text() !== resp.Content\n )\n\n progress.css('width', resp.Percentage +'%')\n\n if (!progress.hasClass(resp.Status)) {\n progress.removeClass('bg-info bg-success bg-danger bg-warning')\n progress.addClass(resp.Status)\n\n changed = true\n }\n\n if (resp.Animated) {\n progress.addClass('progress-bar-animated')\n } else {\n progress.removeClass('progress-bar-animated')\n\n // fire a global window event for listeners\n $('body').trigger('queuedjob-finished')\n }\n\n $(self).parents('.field').find('.messages').html(resp.Messages);\n\n if (changed) {\n progress.popover('hide').popover('dispose')\n\n $(self).parents('.field').find('.popover-header').text(resp.Title)\n $(self).parents('.field').find('.popover-body').text(resp.Content)\n $(self).find('.progress-bar')\n .attr('title', resp.Title)\n .data('title', resp.Title)\n .data('content', resp.Content)\n .attr('data-content', resp.Content)\n\n progress.popover('show')\n } else {\n progress.popover('show');\n }\n\n if (resp.Status !== 'bg-success') {\n setTimeout(function() {\n self.fetchData()\n }, self.getInterval())\n }\n }\n })\n }\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/queuedjobprogressfield.js"],"sourceRoot":""} \ No newline at end of file diff --git a/client/src/bundles/queuedjobprogressfield.js b/client/src/bundles/queuedjobprogressfield.js index 8d828ee..7b76080 100644 --- a/client/src/bundles/queuedjobprogressfield.js +++ b/client/src/bundles/queuedjobprogressfield.js @@ -70,7 +70,7 @@ window.jQuery.entwine('ss', ($) => { $('body').trigger('queuedjob-finished') } - $(self).find('.messages').val(resp.Messages); + $(self).parents('.field').find('.messages').html(resp.Messages); if (changed) { progress.popover('hide').popover('dispose') diff --git a/package.json b/package.json index 16c156f..1ca89d2 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,6 @@ "popper.js": "^1.14.3" }, "engines": { - "node": "^9.x" + "node": "^8.x" } }