Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
assets.5970.9bf1d89926b9972b5b0a.js Maven / Gradle / Ivy
"use strict";(self.webpackChunkopen_metadata=self.webpackChunkopen_metadata||[]).push([[5970],{35970:function(e,t,n){n.r(t);var r=n(70655),i=n(71230),s=n(15746),u=n(34901),a=n(96486),c=n(67294),o=n(68432),l=n(15137),f=n(26396),p=n(35850),d=n(36169),m=n(83306),E=n(76709),v=n(62761),h=n(46481),y=n(7161),b=n(61105),q=n(64632),w=n(66537),S=n(57112),U=n(77427),B=n(24671),G=n(12981),R=n(46321);t.default=function(){var e=(0,l.UO)().queryId,t=(0,w.f)().fqn,n=(0,o.$)().t,Z=(0,r.CR)((0,c.useState)([]),2),C=Z[0],_=Z[1],g=(0,r.CR)((0,c.useState)({permission:!0,query:!0}),2),k=g[0],I=g[1],T=(0,r.CR)((0,c.useState)(G.Bd),2),V=T[0],A=T[1],J=(0,r.CR)((0,c.useState)(),2),N=J[0],Q=J[1],x=(0,h.BL)().getEntityPermission,L=(0,c.useMemo)((function(){return V.ViewAll||V.ViewBasic||V.ViewQueries}),[V]);return(0,c.useEffect)((function(){e?(0,r.mG)(void 0,void 0,void 0,(function(){var t;return(0,r.Jh)(this,(function(i){switch(i.label){case 0:I((function(e){return(0,r.pi)((0,r.pi)({},e),{permission:!0})})),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,x(y.A.QUERY,e||"")];case 2:return t=i.sent(),A(t),[3,5];case 3:return i.sent(),(0,R.Eo)(n("server.fetch-entity-permissions-error",{entity:n("label.resource-permission-lowercase")})),[3,5];case 4:return I((function(e){return(0,r.pi)((0,r.pi)({},e),{permission:!1})})),[7];case 5:return[2]}}))})):I((function(e){return(0,r.pi)((0,r.pi)({},e),{permission:!1})}))}),[e]),(0,c.useEffect)((function(){t&&(0,r.mG)(void 0,void 0,void 0,(function(){var e,i;return(0,r.Jh)(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,(0,U.gs)(t)];case 1:return e=s.sent(),_((0,r.ev)((0,r.ev)([],(0,r.CR)((0,B.W7)(e,q.py.TABLE))),[{name:(0,B.C_)(e),url:(0,v.EK)(q.py.TABLE,t,"table_queries")},{name:n("label.query"),url:"",activeTitle:!0}])),[3,3];case 2:return i=s.sent(),(0,R.Eo)(i),[3,3];case 3:return[2]}}))}))}),[t]),(0,c.useEffect)((function(){e&&L?(0,r.mG)(void 0,void 0,void 0,(function(){var t,n;return(0,r.Jh)(this,(function(i){switch(i.label){case 0:I((function(e){return(0,r.pi)((0,r.pi)({},e),{query:!0})})),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,(0,S.rc)(e,{fields:[q.GB.VOTES,q.GB.QUERY_USED_IN]})];case 2:return t=i.sent(),Q(t),[3,5];case 3:return n=i.sent(),(0,R.Eo)(n),[3,5];case 4:return I((function(e){return(0,r.pi)((0,r.pi)({},e),{query:!1})})),[7];case 5:return[2]}}))})):I((function(e){return(0,r.pi)((0,r.pi)({},e),{query:!1})}))}),[e,V]),k.permission||k.query?c.createElement(p.Z,null):L?(0,a.isUndefined)(N)?c.createElement("div",{className:"flex-center font-medium","data-testid":"no-queries"},c.createElement(f.Z,null)):c.createElement(E.Z,{pageTitle:n("label.query")},c.createElement(i.Z,{className:"p-x-lg",gutter:[0,16]},c.createElement(s.Z,{span:24},c.createElement(d.Z,{titleLinks:C})),c.createElement(s.Z,{span:24},c.createElement(m.Z,{isExpanded:!0,afterDeleteAction:function(){history.back()},permission:V,query:N,onQueryUpdate:function(e,t){return(0,r.mG)(void 0,void 0,void 0,(function(){var n,i,s;return(0,r.Jh)(this,(function(c){switch(c.label){case 0:if((0,a.isUndefined)(N))return[2];n=(0,u.qu)(N,e),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,(0,S.Id)(N.id||"",n)];case 2:return i=c.sent(),Q((function(e){var n;return e?(0,r.pi)((0,r.pi)({},e),((n={})[t]=i[t],n)):i})),[3,4];case 3:return s=c.sent(),(0,R.Eo)(s),[3,4];case 4:return[2]}}))}))},onUpdateVote:function(t,n){return(0,r.mG)(void 0,void 0,void 0,(function(){var i,s;return(0,r.Jh)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,(0,S.gq)(n||"",t)];case 1:return r.sent(),[4,(0,S.rc)(e||"",{fields:[q.GB.VOTES,q.GB.QUERY_USED_IN]})];case 2:return i=r.sent(),Q(i),[3,4];case 3:return s=r.sent(),(0,R.Eo)(s),[3,4];case 4:return[2]}}))}))}})))):c.createElement(f.Z,{type:b.Wx.PERMISSION})}}}]);