{"version":3,"sources":["webpack:///./src/views/configuration/components/news-article.vue?f6ec","webpack:///src/views/configuration/components/news-article.vue","webpack:///./src/views/configuration/components/news-article.vue?73a3","webpack:///./src/views/configuration/components/news-article.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","on","$event","preventDefault","onSubmit","_m","staticClass","attrs","isPageLoading","_e","directives","name","rawName","value","expression","news","class","errors","has","domProps","target","composing","$set","_v","required","url","require_protocol","_s","first","maxAllowedPerZone","Array","isArray","zoneIds","_i","$$a","$$el","$$c","checked","$$v","$$i","concat","slice","_l","zone","index","key","id","isZoneUnavailable","getZones","length","closeModal","staticRenderFns","data","initialZones","isEdit","title","summary","link","computed","methods","includes","getNewsListZoneEntriesCount","$bvModal","hide","mounted","$validator","reset","fetchZones","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,OAAO,CAACE,GAAG,CAAC,OAAS,SAASC,GAAgC,OAAxBA,EAAOC,iBAAwBR,EAAIS,SAASF,MAAW,CAACP,EAAIU,GAAG,GAAGN,EAAG,MAAM,CAACO,YAAY,cAAc,CAACP,EAAG,UAAU,CAACQ,MAAM,CAAC,OAASZ,EAAIa,eAAeP,GAAG,CAAC,gBAAgB,SAASC,GAAQP,EAAIa,cAAcN,MAAaP,EAAIa,cAAu9Ib,EAAIc,KAA58I,CAACV,EAAG,MAAM,CAACO,YAAY,YAAY,CAACP,EAAG,MAAM,CAACO,YAAY,kBAAkB,CAACX,EAAIU,GAAG,GAAGN,EAAG,QAAQ,CAACW,WAAW,CAAC,CAACC,KAAK,WAAWC,QAAQ,aAAaC,MAAM,WAAaC,WAAW,cAAc,CAACH,KAAK,QAAQC,QAAQ,UAAUC,MAAOlB,EAAIoB,KAAU,MAAED,WAAW,eAAeR,YAAY,eAAeU,MAAM,CAAE,aAAcrB,EAAIsB,OAAOC,IAAI,UAAWX,MAAM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AoB,WAAa,IAAIX,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,QAAQ,CAACQ,MAAM,CAAC,IAAM,SAAS,CAACZ,EAAI4B,GAAG,cAAcxB,EAAG,OAAO,CAACO,YAAY,oBAAoB,WAAa,IAAIX,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,QAAQ,CAACO,YAAY,QAAQ,CAACX,EAAI4B,GAAG,aAAaxB,EAAG,OAAO,CAACO,YAAY,qB,giCC8Dl6B,OACEK,KAAM,eACNyC,KAAM,WACJ,MAAO,CACLC,aAAc,GACd7C,eAAe,EACf8C,QAAQ,EACRzB,kBAAmB,EACnBd,KAAM,CACJwC,MAAO,KACPC,QAAS,KACTC,KAAM,KACNzB,QAAS,MAIf0B,SAAU,EAAZ,GACA,sEAEEC,QAAS,EAAX,CACIZ,kBADJ,SACA,GACM,OAAInD,KAAKyD,aAAaO,SAASjB,EAAKG,KAG7BlD,KAAKiE,4BAA4BlB,EAAKG,KAAOlD,KAAKiC,mBAE3D,SAPJ,WAOA,mIACA,wBADA,UACA,EADA,OAGA,EAHA,iDAMA,0CACA,iBACA,wCACA,kBAEA,kBACA,6CACA,kBAbA,8CAgBIqB,WAvBJ,WAwBMtD,KAAKkE,SAASC,KAAK,2BAEzB,2DAEEC,QAAS,WACPpE,KAAKmB,KAAO,EAAhB,iBACInB,KAAKyD,aAAezD,KAAKmB,KAAKiB,QAC9BpC,KAAK0D,SAAW1D,KAAKmB,KAAK+B,GAC1BlD,KAAKqE,WAAWC,QAChBtE,KAAKuE,aAELvE,KAAKY,eAAgB,ICrH2V,I,YCOhX4D,EAAY,eACd,EACA1E,EACAyD,GACA,EACA,KACA,KACA,MAIa,aAAAiB,E","file":"js/chunk-2d0e17d3.2420970b.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.onSubmit($event)}}},[_vm._m(0),_c('div',{staticClass:\"modal-body\"},[_c('loading',{attrs:{\"active\":_vm.isPageLoading},on:{\"update:active\":function($event){_vm.isPageLoading=$event}}}),(!_vm.isPageLoading)?[_c('div',{staticClass:\"form-row\"},[_c('div',{staticClass:\"col-md-12 mb-3\"},[_vm._m(1),_c('input',{directives:[{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"},{name:\"model\",rawName:\"v-model\",value:(_vm.news.title),expression:\"news.title\"}],staticClass:\"form-control\",class:{ 'is-invalid': _vm.errors.has('title') },attrs:{\"id\":\"title\",\"name\":\"title\",\"type\":\"text\",\"maxlength\":\"50\",\"autocomplete\":\"off\",\"placeholder\":\"Enter News Title\",\"data-vv-as\":\"News Title\"},domProps:{\"value\":(_vm.news.title)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.news, \"title\", $event.target.value)}}}),_c('div',{staticClass:\"invalid-feedback\"},[_vm._v(\"The News Title field is required.\")])]),_c('div',{staticClass:\"col-md-12 mb-3\"},[_vm._m(2),_c('input',{directives:[{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"},{name:\"model\",rawName:\"v-model\",value:(_vm.news.summary),expression:\"news.summary\"}],staticClass:\"form-control\",class:{ 'is-invalid': _vm.errors.has('summary') },attrs:{\"id\":\"summary\",\"name\":\"summary\",\"type\":\"text\",\"maxlength\":\"150\",\"autocomplete\":\"off\",\"placeholder\":\"Enter News Summary\",\"data-vv-as\":\"News Summary\"},domProps:{\"value\":(_vm.news.summary)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.news, \"summary\", $event.target.value)}}}),_c('div',{staticClass:\"invalid-feedback\"},[_vm._v(\"The News Summary field is required.\")])]),_c('div',{staticClass:\"col-md-12 mb-3\"},[_vm._m(3),_c('input',{directives:[{name:\"validate\",rawName:\"v-validate\",value:({ required: true, url: { require_protocol: true }}),expression:\"{ required: true, url: { require_protocol: true }}\"},{name:\"model\",rawName:\"v-model\",value:(_vm.news.link),expression:\"news.link\"}],staticClass:\"form-control\",class:{ 'is-invalid': _vm.errors.has('link') },attrs:{\"id\":\"link\",\"name\":\"link\",\"type\":\"text\",\"autocomplete\":\"off\",\"placeholder\":\"Enter News Link\",\"data-vv-as\":\"News Link\"},domProps:{\"value\":(_vm.news.link)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.news, \"link\", $event.target.value)}}}),_c('div',{staticClass:\"invalid-feedback\"},[_vm._v(_vm._s(_vm.errors.first('link')))])])]),_c('div',{staticClass:\"form-group\"},[_vm._m(4),_c('small',{staticClass:\"form-text text-muted mt-0 mb-1\",attrs:{\"id\":\"passwordHelpBlock\"}},[_vm._v(\" Disabled options indicate that the zones has reached capacity (\"+_vm._s(_vm.maxAllowedPerZone)+\"). \")]),_c('div',{attrs:{\"id\":\"shareWithZones\"}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.news.zoneIds),expression:\"news.zoneIds\"},{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"}],staticClass:\"d-none\",attrs:{\"id\":\"zone-d-none\",\"name\":\"zone\",\"type\":\"checkbox\"},domProps:{\"checked\":Array.isArray(_vm.news.zoneIds)?_vm._i(_vm.news.zoneIds,null)>-1:(_vm.news.zoneIds)},on:{\"change\":function($event){var $$a=_vm.news.zoneIds,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.$set(_vm.news, \"zoneIds\", $$a.concat([$$v])))}else{$$i>-1&&(_vm.$set(_vm.news, \"zoneIds\", $$a.slice(0,$$i).concat($$a.slice($$i+1))))}}else{_vm.$set(_vm.news, \"zoneIds\", $$c)}}}}),_vm._l((_vm.getZones),function(zone,index){return _c('div',{key:zone.id,staticClass:\"custom-control custom-checkbox\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.news.zoneIds),expression:\"news.zoneIds\"},{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"}],staticClass:\"custom-control-input\",class:{ 'is-invalid': _vm.errors.has('zone') },attrs:{\"id\":'zone-' + index,\"name\":\"zone\",\"type\":\"checkbox\",\"readonly\":_vm.isZoneUnavailable(zone),\"disabled\":_vm.isZoneUnavailable(zone)},domProps:{\"value\":zone.id,\"checked\":Array.isArray(_vm.news.zoneIds)?_vm._i(_vm.news.zoneIds,zone.id)>-1:(_vm.news.zoneIds)},on:{\"change\":function($event){var $$a=_vm.news.zoneIds,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=zone.id,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.$set(_vm.news, \"zoneIds\", $$a.concat([$$v])))}else{$$i>-1&&(_vm.$set(_vm.news, \"zoneIds\", $$a.slice(0,$$i).concat($$a.slice($$i+1))))}}else{_vm.$set(_vm.news, \"zoneIds\", $$c)}}}}),_c('label',{staticClass:\"custom-control-label\",attrs:{\"for\":'zone-' + index}},[_vm._v(_vm._s(zone.name))]),(index === _vm.getZones.length - 1)?_c('div',{staticClass:\"invalid-feedback\"},[_vm._v(\"Please select at least one zone.\")]):_vm._e()])})],2)])]:_vm._e()],2),_c('div',{staticClass:\"modal-footer\"},[_c('button',{staticClass:\"btn btn-success\",attrs:{\"type\":\"submit\"}},[_vm._v(\"Save\")]),_c('button',{staticClass:\"btn btn-secondary\",attrs:{\"type\":\"button\"},on:{\"click\":_vm.closeModal}},[_vm._v(\"Close\")])])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"modal-header\"},[_c('h4',{staticClass:\"modal-title\"},[_vm._v(\"Add a new news item\")])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('label',{attrs:{\"for\":\"title\"}},[_vm._v(\"News Title \"),_c('span',{staticClass:\"red-dot ml-3\"})])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('label',{attrs:{\"for\":\"summary\"}},[_vm._v(\"News Summary \"),_c('span',{staticClass:\"red-dot ml-3\"})])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('label',{attrs:{\"for\":\"link\"}},[_vm._v(\"News Link \"),_c('span',{staticClass:\"red-dot ml-3\"})])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('label',{staticClass:\"mb-0\"},[_vm._v(\"Apply To \"),_c('span',{staticClass:\"red-dot ml-3\"})])}]\n\nexport { render, staticRenderFns }","<template>\r\n  <form v-on:submit.prevent=\"onSubmit\">\r\n    <div class=\"modal-header\">\r\n      <h4 class=\"modal-title\">Add a new news item</h4>\r\n    </div>\r\n\r\n    <div class=\"modal-body\">\r\n      <loading :active.sync=\"isPageLoading\"></loading>\r\n      <template v-if=\"!isPageLoading\">\r\n        <div class=\"form-row\">\r\n          <div class=\"col-md-12 mb-3\">\r\n            <label for=\"title\">News Title <span class=\"red-dot ml-3\"></span></label>\r\n            <input id=\"title\" name=\"title\" type=\"text\" maxlength=\"50\" class=\"form-control\" :class=\"{ 'is-invalid': errors.has('title') }\"\r\n              autocomplete=\"off\" placeholder=\"Enter News Title\" v-validate=\"'required'\" v-model=\"news.title\" data-vv-as=\"News Title\" />\r\n            <div class=\"invalid-feedback\">The News Title field is required.</div>\r\n          </div>\r\n\r\n          <div class=\"col-md-12 mb-3\">\r\n            <label for=\"summary\">News Summary <span class=\"red-dot ml-3\"></span></label>\r\n            <input id=\"summary\" name=\"summary\" type=\"text\" maxlength=\"150\" class=\"form-control\" :class=\"{ 'is-invalid': errors.has('summary') }\"\r\n              autocomplete=\"off\" placeholder=\"Enter News Summary\" v-validate=\"'required'\" v-model=\"news.summary\" data-vv-as=\"News Summary\" />\r\n            <div class=\"invalid-feedback\">The News Summary field is required.</div>\r\n          </div>\r\n\r\n          <div class=\"col-md-12 mb-3\">\r\n            <label for=\"link\">News Link <span class=\"red-dot ml-3\"></span></label>\r\n            <input id=\"link\" name=\"link\" type=\"text\" class=\"form-control\" :class=\"{ 'is-invalid': errors.has('link') }\"\r\n              autocomplete=\"off\" placeholder=\"Enter News Link\" v-validate=\"{ required: true, url: { require_protocol: true }}\" v-model=\"news.link\" data-vv-as=\"News Link\" />\r\n            <div class=\"invalid-feedback\">{{ errors.first('link') }}</div>\r\n          </div>\r\n        </div>\r\n\r\n        <div class=\"form-group\">\r\n          <label class=\"mb-0\">Apply To <span class=\"red-dot ml-3\"></span></label>\r\n          <small id=\"passwordHelpBlock\" class=\"form-text text-muted mt-0 mb-1\">\r\n            Disabled options indicate that the zones has reached capacity ({{ maxAllowedPerZone }}).\r\n          </small>\r\n          <div id=\"shareWithZones\">\r\n            <input id=\"zone-d-none\" name=\"zone\" type=\"checkbox\" class=\"d-none\" v-model=\"news.zoneIds\" v-validate=\"'required'\" />\r\n            <div v-for=\"(zone, index) in getZones\" :key=\"zone.id\" class=\"custom-control custom-checkbox\">\r\n              <input :id=\"'zone-' + index\" name=\"zone\" type=\"checkbox\" class=\"custom-control-input\" :class=\"{ 'is-invalid': errors.has('zone') }\"\r\n                :value=\"zone.id\" :readonly=\"isZoneUnavailable(zone)\" :disabled=\"isZoneUnavailable(zone)\" v-model=\"news.zoneIds\" v-validate=\"'required'\">\r\n              <label class=\"custom-control-label\" :for=\"'zone-' + index\">{{ zone.name }}</label>\r\n              <div class=\"invalid-feedback\" v-if=\"index === getZones.length - 1\">Please select at least one zone.</div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n\r\n      </template>\r\n\r\n    </div>\r\n\r\n    <div class=\"modal-footer\">\r\n      <button type=\"submit\" class=\"btn btn-success\">Save</button>\r\n      <button type=\"button\" class=\"btn btn-secondary\" @click=\"closeModal\">Close</button>\r\n    </div>\r\n  </form>\r\n</template>\r\n\r\n<script>\r\nimport { mapGetters, mapActions } from \"vuex\";\r\nimport Toast from \"@/utils/toast\";\r\n\r\nexport default {\r\n  name: 'news-article',\r\n  data: function () {\r\n    return {\r\n      initialZones: [],\r\n      isPageLoading: true,\r\n      isEdit: false,\r\n      maxAllowedPerZone: 5,\r\n      news: {\r\n        title: null,\r\n        summary: null,\r\n        link: null,\r\n        zoneIds: []\r\n      }\r\n    }\r\n  },\r\n  computed: {\r\n    ...mapGetters([\"getNews\", \"getNewsListZoneEntriesCount\", \"getZones\"])\r\n  },\r\n  methods: {\r\n    isZoneUnavailable (zone) {\r\n      if (this.initialZones.includes(zone.id))\r\n        return false;\r\n\r\n      return this.getNewsListZoneEntriesCount[zone.id] >= this.maxAllowedPerZone;\r\n    },\r\n    async onSubmit() {\r\n      var isFormValid = await this.$validator.validate();\r\n\r\n      if (!isFormValid) {\r\n        return;\r\n      }\r\n      this.saveNews({ data: this.news, isEdit: this.isEdit })\r\n        .then(() => {\r\n          Toast.success(this, \"Successfully saved!\");\r\n          this.closeModal();\r\n        })\r\n        .catch(() => {\r\n          Toast.danger(this, \"Oops! There was an error.\");\r\n          this.closeModal();\r\n        });\r\n    },\r\n    closeModal() {\r\n      this.$bvModal.hide(\"bv-modal-news-article\");\r\n    },\r\n    ...mapActions([\"saveNews\", \"fetchZones\", \"fetchNewsList\"])\r\n  },\r\n  mounted: function() {\r\n    this.news = { ...this.getNews };\r\n    this.initialZones = this.news.zoneIds;\r\n    this.isEdit = !!this.news.id;\r\n    this.$validator.reset();\r\n    this.fetchZones();\r\n\r\n    this.isPageLoading = false;\r\n  },\r\n}\r\n</script>\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./news-article.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./news-article.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./news-article.vue?vue&type=template&id=77cbd710&\"\nimport script from \"./news-article.vue?vue&type=script&lang=js&\"\nexport * from \"./news-article.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports"],"sourceRoot":""}