text: webpackJsonp([8],{132:function(t,e,i){"use strict";var s={data:function(){return{id:""}},created:function(){this.$store.dispatch("getProductsByUser",this.user)},i18n:{messages:{en:{"field.first":"Title","field.second":"Description","field.third":"Price","field.fourth":"Actions","button.first":"Edit","button.second":"Remove","product.removed":"Product removed"},de:{"field.first":"Titel","field.second":"Beschreibung","field.third":"Preis","field.fourth":"Aktionen","button.first":"Bearbeiten","button.second":"Entfernen","product.removed":"Produkt entfernt"}}},computed:{fields:function(){return{title:{label:this.$t("field.first")},description:{label:this.$t("field.second")},price:{label:this.$t("field.third")},actions:{label:this.$t("field.fourth")}}},products:{get:function(){return this.$store.state.Products.products}},user:{get:function(){return this.$store.state.User.user}},isEditProductVisible:{get:function(){return this.$store.state.Product.product.meta.isEditProductVisible},set:function(t){this.$store.commit("SET_IS_EDIT_PRODUCT_VISIBLE",t)}}}};e.a=s},133:function(t,e,i){"use strict";var s={props:["id"],i18n:{messages:{en:{"template.first.title":"Patch product","description.first":"Define a title","label.first":"Title","description.second":"Define a price","label.second":"Price","description.third":"Define a description","label.third":"Description","button.first":"Cancel","button.second":"Patch","product.patched":"Product patched"},de:{"template.first.title":"Bearbeite Produkt","description.first":"Definiere einen Titel","label.first":"Titel","description.second":"Definiere einen Preis","label.second":"Preis","description.third":"Definiere eine Beschreibung","label.third":"Beschreibung","button.first":"Abbrechen","button.second":"Speichern","product.patched":"Produkt bearbeitet"}}},computed:{user:{get:function(){return this.$store.state.User.user}},title:{get:function(){return this.$store.state.Product.product.title},set:function(t){this.$store.commit("SET_PRODUCT_TITLE",t)}},description:{get:function(){return this.$store.state.Product.product.description},set:function(t){this.$store.commit("SET_PRODUCT_DESCRIPTION",t)}},price:{get:function(){return this.$store.state.Product.product.price},set:function(t){this.$store.commit("SET_PRODUCT_PRICE",t)}},isEditProductVisible:{get:function(){return this.$store.state.Product.product.meta.isEditProductVisible},set:function(t){this.$store.commit("SET_IS_EDIT_PRODUCT_VISIBLE",t)}}}};e.a=s},194:function(t,e,i){var s=i(5)(i(195),i(199),null,null);t.exports=s.exports},195:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(132),r=i(196),o=i.n(r);e.default={mixins:[s.a],components:{ProductPatch:o.a},methods:{showPatchForm:function(t){this.$set(this,"id",t),this.$store.commit("SET_IS_EDIT_PRODUCT_VISIBLE",!0)},deleteProduct:function(t){var e=this;this.$store.dispatch("deleteProduct",t).then(function(){e.$store.dispatch("getProductsByUser",e.user)})}}}},196:function(t,e,i){var s=i(5)(i(197),i(198),null,null);t.exports=s.exports},197:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(133);e.default={mixins:[s.a],created:function(){var t=this;this.$store.dispatch("getProduct",this.id).then(function(e){t.$root.$emit("show::modal","patch-product"),t.$store.commit("SET_PRODUCT_TITLE",e.title),t.$store.commit("SET_PRODUCT_DESCRIPTION",e.description),t.$store.commit("SET_PRODUCT_PRICE",e.price)},function(){})},methods:{patchProduct:function(){var t=this;this.$store.dispatch("patchProduct",{id:this.id,title:this.title,price:this.price,description:this.description}).then(function(){t.$store.dispatch("getProductsByUser",t.user),t.$store.commit("SET_IS_EDIT_PRODUCT_VISIBLE",!1),t.$store.commit("RESET_PRODUCT")},function(){})},cancel:function(){this.$store.commit("SET_IS_EDIT_PRODUCT_VISIBLE",!1),this.$root.$emit("hide::modal","patch-product")}},destroyed:function(){this.$root.$emit("hide::modal","patch-product"),this.$store.commit("RESET_PRODUCT")}}},198:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("b-modal",{attrs:{size:"lg",id:"patch-product","hide-header-close":!0}},[i("template",{attrs:{slot:"modal-title"},slot:"modal-title"},[t._v(t._s(t.$t("template.first.title")))]),t._v(" "),i("div",{staticClass:"row"},[i("div",{staticClass:"col-8"},[i("b-form-fieldset",{attrs:{description:t.$t("description.first"),label:t.$t("label.first"),"label-size":1}},[i("b-form-input",{model:{value:t.title,callback:function(e){t.title=e},expression:"title"}})],1)],1),t._v(" "),i("div",{staticClass:"col-4"},[i("b-form-fieldset",{attrs:{description:t.$t("description.second"),label:t.$t("label.second"),"label-size":1}},[i("b-form-input",{model:{value:t.price,callback:function(e){t.price=e},expression:"price"}})],1)],1)]),t._v(" "),i("b-form-fieldset",{attrs:{description:t.$t("description.third"),label:t.$t("label.third"),"label-size":1}},[i("b-form-input",{attrs:{textarea:""},model:{value:t.description,callback:function(e){t.description=e},expression:"description"}})],1),t._v(" "),i("template",{attrs:{slot:"modal-footer"},slot:"modal-footer"},[i("b-button",{attrs:{size:"sm",variant:"outline-primary"},on:{click:t.cancel}},[t._v(t._s(t.$t("button.first")))]),t._v(" "),i("b-button",{attrs:{size:"sm",variant:"outline-success"},on:{click:t.patchProduct}},[t._v(t._s(t.$t("button.second")))])],1)],2)},staticRenderFns:[]}},199:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[t.isEditProductVisible?i("product-patch",{attrs:{id:t.id}}):t._e(),t._v(" "),t.products.length>0?i("b-table",{attrs:{items:t.products,fields:t.fields},scopedSlots:t._u([{key:"price",fn:function(e){return[t._v("\n      $"+t._s(e.item.price)+"\n    ")]}},{key:"actions",fn:function(e){return[i("b-button",{attrs:{size:"sm",variant:"outline-primary"},on:{click:function(i){t.showPatchForm(e.item.id)}}},[t._v(t._s(t.$t("button.first"))+"\n      ")]),t._v(" "),i("b-button",{attrs:{size:"sm",variant:"outline-warning"},on:{click:function(i){t.deleteProduct(e.item.id)}}},[t._v(t._s(t.$t("button.second")))])]}}])}):i("p",[t._v("No products yet, you should create one.")])],1)},staticRenderFns:[]}}});