UNPKG

@europeana/portal

Version:
2 lines 2.02 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[123],{1186:function(t,e,n){"use strict";n.r(e);var o=n(23),c=(n(75),n(317)),r={name:"RecommendationButtons",mixins:[n(320).a,c.a],props:{identifier:{type:String,required:!0},enableAcceptButton:{type:Boolean,default:!0},enableRejectButton:{type:Boolean,default:!0}},data:function(){return{toastMsg:this.$t("set.notifications.updated")}},methods:{acceptRecommendation:function(){var t=this;return Object(o.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.$auth.loggedIn){e.next=8;break}return t.$store.dispatch("set/reviewRecommendation",{setId:"/".concat(t.$route.params.pathMatch),itemIds:[t.identifier],action:"accept"}),e.next=4,t.$store.dispatch("set/addItem",{setId:"http://data.europeana.eu/set/".concat(t.$route.params.pathMatch),itemId:t.identifier});case 4:t.$store.dispatch("set/refreshSet"),t.makeToast(t.toastMsg),e.next=9;break;case 8:t.keycloakLogin();case 9:case"end":return e.stop()}}),e)})))()},rejectRecommendation:function(){this.$auth.loggedIn?this.$store.dispatch("set/reviewRecommendation",{setId:"/".concat(this.$route.params.pathMatch),itemIds:[this.identifier],action:"reject"}):this.keycloakLogin()}}},d=n(59),component=Object(d.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"user-buttons",attrs:{"data-qa":"recommendation buttons"}},[t.enableAcceptButton?n("b-button",{staticClass:"button-icon-only recommendation-button icon-accept",attrs:{variant:"outline-light","data-qa":"accept button","aria-label":t.$t("actions.accept")},on:{click:t.acceptRecommendation}}):t._e(),t._v(" "),t.enableRejectButton?n("b-button",{staticClass:"button-icon-only recommendation-button icon-reject",attrs:{variant:"outline-light","data-qa":"reject button","aria-label":t.$t("actions.reject")},on:{click:t.rejectRecommendation}}):t._e()],1)}),[],!1,null,null,null);e.default=component.exports}}]); //# sourceMappingURL=d337aff.js.map