UNPKG

@europeana/portal

Version:
2 lines 1.79 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[122],{1115:function(t,e,n){"use strict";n.r(e);var o=n(16),c=n(254),r={name:"RecommendationButtons",mixins:[n(255).a,c.a],props:{identifier:{type:String,required:!0},enableAcceptButton:{type:Boolean,default:!0},enableRejectButton:{type:Boolean,default:!0}},data(){return{toastMsg:this.$t("set.notifications.updated")}},methods:{acceptRecommendation(){var t=this;return Object(o.a)((function*(){t.$auth.loggedIn?(t.$store.dispatch("set/reviewRecommendation",{setId:"/".concat(t.$route.params.pathMatch),itemIds:[t.identifier],action:"accept"}),yield t.$store.dispatch("set/addItem",{setId:"http://data.europeana.eu/set/".concat(t.$route.params.pathMatch),itemId:t.identifier}),t.$store.dispatch("set/refreshSet"),t.makeToast(t.toastMsg)):t.keycloakLogin()}))()},rejectRecommendation(){this.$auth.loggedIn?this.$store.dispatch("set/reviewRecommendation",{setId:"/".concat(this.$route.params.pathMatch),itemIds:[this.identifier],action:"reject"}):this.keycloakLogin()}}},d=n(40),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=11983ab.modern.js.map