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.962.9bf1d89926b9972b5b0a.js Maven / Gradle / Ivy
"use strict";(self.webpackChunkopen_metadata=self.webpackChunkopen_metadata||[]).push([[962],{41643:function(e,t,a){a.d(t,{Z:function(){return P}});var n,s=a(70655),l=a(53014),i=a(56256),r=a(94199),u=a(19650),o=a(94184),c=a.n(o),m=a(67294),d=a(38780),p=a(62761),v=a(46481),f=a(7161),E=a(72819),y=a(53429),C=a(24671),b=a(12981),h=a(66219),g=a(49409),S=a(50146),T=a(34041),Z=a(96486),N=a(68432),R=a(97359),x=a(64632);!function(e){e.Duplicates="Duplicates",e.FalsePositive="FalsePositive",e.MissingData="MissingData",e.Other="Other",e.OutOfBounds="OutOfBounds"}(n||(n={}));var w=a(50953),D=a(91054),A=a(8764),I=a(86385),k=a(46321),O=a(48794),F=function(e){var t,a,l=e.open,i=e.data,r=e.testCaseFqn,u=e.onSubmit,o=e.onCancel,c=e.usersList,d=(0,N.$)().t,v=(0,O.N)().currentUser,f=(0,s.CR)(g.Z.useForm(),1)[0],E=(0,m.useRef)(),y=(0,s.CR)((0,m.useState)(!1),2),b=y[0],h=y[1],F=(0,s.CR)((0,m.useState)([]),2),P=F[0],_=F[1],L=(0,m.useMemo)((function(){var e,t=(null===(e=null==i?void 0:i.testCaseResolutionStatusDetails)||void 0===e?void 0:e.assignee)?(0,I.uu)([i.testCaseResolutionStatusDetails.assignee]):[];return{initialAssignees:t,assigneeOptions:(0,Z.unionBy)((0,s.ev)((0,s.ev)([],(0,s.CR)(t)),(0,s.CR)((0,I.uu)(null!=c?c:[]))),"value")}}),[i,c]).assigneeOptions,M=g.Z.useWatch("testCaseResolutionStatusType",f),q=g.Z.useWatch(["testCaseResolutionStatusDetails","assignee"],f),U=(0,m.useMemo)((function(){return((null==i?void 0:i.testCaseResolutionStatusType)===w.IK.Assigned?[w.IK.Assigned,w.IK.Resolved]:Object.values(w.IK)).map((function(e){return{label:e,value:e}}))}),[i]);return(0,m.useEffect)((function(){var e,t=null===(e=null==i?void 0:i.testCaseResolutionStatusDetails)||void 0===e?void 0:e.assignee;(null==i?void 0:i.testCaseResolutionStatusType)===w.IK.Assigned&&t&&f.setFieldValue(["testCaseResolutionStatusDetails","assignee"],[t.id]),_(L)}),[i,L]),m.createElement(S.Z,{cancelText:d("label.cancel"),closable:!1,okButtonProps:{id:"update-status-button",form:"update-status-form",htmlType:"submit",loading:b},okText:d("label.submit"),open:l,title:d("label.update-entity",{entity:d("label.status")}),width:750,onCancel:o},m.createElement(g.Z,{"data-testid":"update-status-form",form:f,id:"update-status-form",initialValues:i,layout:"vertical",validateMessages:p.NG,onFinish:function(e){return(0,s.mG)(void 0,void 0,void 0,(function(){var t,a,n;return(0,s.Jh)(this,(function(l){switch(l.label){case 0:switch(h(!0),t=(0,s.pi)((0,s.pi)({},e),{testCaseReference:r}),e.testCaseResolutionStatusType){case w.IK.Resolved:t.testCaseResolutionStatusDetails=(0,s.pi)((0,s.pi)({},e.testCaseResolutionStatusDetails),{resolvedBy:v?(0,C.hL)(v,x.py.USER):void 0});break;case w.IK.Assigned:q.length>0&&(t.testCaseResolutionStatusDetails=(0,s.pi)((0,s.pi)({},e.testCaseResolutionStatusDetails),{assignee:{name:q[0].name,displayName:q[0].displayName,id:q[0].value,type:x.py.USER}}))}l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,(0,A.Jw)(t)];case 2:return a=l.sent(),u(a),o(),[3,5];case 3:return n=l.sent(),(0,k.Eo)(n),[3,5];case 4:return h(!1),[7];case 5:return[2]}}))}))}},m.createElement(g.Z.Item,{label:d("label.status"),name:"testCaseResolutionStatusType",rules:[{required:!0}]},m.createElement(T.Z,{"data-testid":"test-case-resolution-status-type",options:U,placeholder:d("label.please-select-entity",{entity:d("label.status")})})),M===w.IK.Resolved&&m.createElement(m.Fragment,null,m.createElement(g.Z.Item,{label:d("label.reason"),name:["testCaseResolutionStatusDetails","testCaseFailureReason"],rules:[{required:!0}]},m.createElement(T.Z,{"data-testid":"test-case-failure-reason",placeholder:d("label.please-select-entity",{entity:d("label.reason")})},Object.values(n).map((function(e){return m.createElement(T.Z.Option,{key:e},(0,Z.startCase)(e))})))),m.createElement(g.Z.Item,{label:d("label.comment"),name:["testCaseResolutionStatusDetails","testCaseFailureComment"],rules:[{required:!0}]},m.createElement(R.Z,{height:"200px",initialValue:null!==(a=null===(t=null==i?void 0:i.testCaseResolutionStatusDetails)||void 0===t?void 0:t.testCaseFailureComment)&&void 0!==a?a:"",placeHolder:d("message.write-your-text",{text:d("label.comment")}),ref:E,onTextChange:function(e){return f.setFieldValue(["testCaseResolutionStatusDetails","testCaseFailureComment"],e)}}))),M===w.IK.Assigned&&m.createElement(g.Z.Item,{label:d("label.assignee"),name:["testCaseResolutionStatusDetails","assignee"],rules:[{required:!0}]},m.createElement(D.Z,{allowClear:!0,isSingleSelect:!0,options:P,value:q,onChange:function(e){return f.setFieldValue(["testCaseResolutionStatusDetails","assignee"],e)},onSearch:function(e){return(0,I.Od)({query:e,setOptions:_,onlyUsers:!0,initialOptions:L})}}))))},P=(a(29970),function(e){var t,a,n,o=e.data,g=e.onSubmit,S=e.usersList,T=(0,s.CR)((0,m.useState)(!1),2),Z=T[0],N=T[1],R=(0,m.useMemo)((function(){return o.testCaseResolutionStatusType}),[o]),x=(0,v.BL)().permissions,w=(0,m.useMemo)((function(){return(0,b.P_)(E.OX.EditAll,f.A.TEST_CASE,x)}),[x]),D=(0,m.useCallback)((function(){return N(!0)}),[]),A=(0,m.useCallback)((function(){return N(!1)}),[]);return R?m.createElement(m.Fragment,null,m.createElement(r.Z,{placement:"bottom",title:(null==o?void 0:o.updatedAt)&&(0,y.p6)(o.updatedAt)+"\n "+(o.updatedBy?"by "+(0,C.C_)(o.updatedBy):"")},m.createElement(u.Z,{align:"center","data-testid":(null===(t=o.testCaseReference)||void 0===t?void 0:t.name)+"-status"},m.createElement(h.Z,{className:c()("resolution",R.toLocaleLowerCase()),label:R}),w&&m.createElement(l.Z,(0,s.pi)({},p.K$,{component:d.ReactComponent,"data-testid":"edit-resolution-icon",style:{color:p.MJ},onClick:D})))),Z&&m.createElement(F,{data:o,open:Z,testCaseFqn:null!==(n=null===(a=o.testCaseReference)||void 0===a?void 0:a.fullyQualifiedName)&&void 0!==n?n:"",usersList:S,onCancel:A,onSubmit:g})):m.createElement(i.Z.Text,null,p.lH)})},20962:function(e,t,a){a.r(t),a.d(t,{default:function(){return ne}});var n=a(70655),s=a(71230),l=a(15746),i=a(25499),r=a(34901),u=a(96486),o=a(67294),c=a(68432),m=a(15137),d=a(47466),p=a(62748),v=a(44654),f=a(26396),E=a(35850),y=a(36169),C=a(19586),b=a(27049),h=a(56256),g=a(19650),S=a(94199),T=a(80129),Z=a.n(T),N=a(76),R=a(62761),x=a(46481),w=a(7161),D=a(64632),A=a(59583),I=a(31615),k=a(72819),O=a(50953),F=a(8764),P=a(93895),_=a(24671),L=a(31982),M=a(12981),q=a(40734),U=a(86385),K=a(46321),B=a(50404),G=a(20642),J=a(64827),V=a(41643),Q=function(e){var t=e.onOwnerUpdate,a=e.testCaseData,s=e.fetchTaskCount,l=(0,c.$)().t,i=(0,n.CR)((0,o.useState)(),2),d=i[0],v=i[1],f=(0,n.CR)((0,o.useState)(),2),E=f[0],y=f[1],T=(0,n.CR)((0,o.useState)(!0),2),Q=T[0],X=T[1],$=(0,m.UO)().fqn,H=(0,q.p2)($),j=(0,p.$J)(),W=j.setActiveThread,Y=j.entityThread,z=j.getFeedData,ee=j.testCaseResolutionStatus,te=j.updateTestCaseIncidentStatus,ae=j.initialAssignees,ne=(0,o.useMemo)((function(){var e;return(0,L.ku)(null!==(e=null==a?void 0:a.entityLink)&&void 0!==e?e:"")}),[a]),se=function(e){return(0,n.mG)(void 0,void 0,void 0,(function(){var t,a,s,l;return(0,n.Jh)(this,(function(i){switch(i.label){case 0:if((0,u.isUndefined)(E))return[2];t=(0,n.pi)((0,n.pi)({},E),{severity:e}),a=(0,r.qu)(E,t),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,(0,F.nO)(null!==(l=E.id)&&void 0!==l?l:"",a)];case 2:return i.sent(),y(t),te((0,n.ev)((0,n.ev)([],(0,n.CR)(ee.slice(0,-1))),[t])),[3,4];case 3:return s=i.sent(),(0,K.Eo)(s),[3,4];case 4:return[2]}}))}))},le=function(e){y(e),te((0,n.ev)((0,n.ev)([],(0,n.CR)(ee)),[e]))};(0,o.useEffect)((function(){H?(X(!0),z(void 0,void 0,A.T.Task,D.py.TEST_CASE,H).finally((function(){return X(!1)}))):X(!1)}),[H]),(0,o.useEffect)((function(){var e=Y.find((function(e){var t;return(null===(t=e.task)||void 0===t?void 0:t.status)===I.aq.Open}));v(e),W(e)}),[Y]),(0,o.useEffect)((function(){var e,t=(0,u.last)(ee);(null==t?void 0:t.stateId)===(null===(e=null==d?void 0:d.task)||void 0===e?void 0:e.testCaseResolutionStatusId)&&((null==t?void 0:t.testCaseResolutionStatusType)===O.IK.Resolved?(y(void 0),s()):y(t))}),[ee]),(0,o.useEffect)((function(){var e;(null==a?void 0:a.incidentId)&&(e=a.incidentId,(0,n.mG)(void 0,void 0,void 0,(function(){var t;return(0,n.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,(0,F.TO)(e)];case 1:return t=a.sent().data,y((0,u.first)(t)),[3,3];case 2:return a.sent(),y(void 0),[3,3];case 3:return[2]}}))})))}),[a]);var ie=(0,x.BL)().permissions,re=(0,o.useMemo)((function(){return(0,M.P_)(k.OX.EditAll,w.A.TEST_CASE,ie)}),[ie]),ue=(0,o.useMemo)((function(){var e,t;if(Q)return o.createElement(C.Z.Input,{size:"small"});if((0,u.isUndefined)(E))return o.createElement(o.Fragment,null,o.createElement(b.Z,{className:"self-center m-x-sm",type:"vertical"}),o.createElement(h.Z.Text,{className:"d-flex items-center gap-2 text-xs whitespace-nowrap"},o.createElement("span",{className:"text-grey-muted"},l("label.incident-status")+": "),o.createElement("span",null,l("label.no-entity",{entity:l("label.incident")}))));var a=null==E?void 0:E.testCaseResolutionStatusDetails;return o.createElement(o.Fragment,null,d&&o.createElement(o.Fragment,null,o.createElement(b.Z,{className:"self-center m-x-sm",type:"vertical"}),o.createElement(h.Z.Text,{className:"d-flex items-center gap-2 text-xs whitespace-nowrap"},o.createElement("span",{className:"text-grey-muted"},l("label.incident")+": "),o.createElement(N.Link,{className:"font-medium","data-testid":"table-name",to:(0,U.yv)(d)},null!==(t="#"+(null===(e=null==d?void 0:d.task)||void 0===e?void 0:e.id))&&void 0!==t?t:"--"))),o.createElement(b.Z,{className:"self-center m-x-sm",type:"vertical"}),o.createElement(h.Z.Text,{className:"d-flex items-center gap-2 text-xs whitespace-nowrap"},o.createElement("span",{className:"text-grey-muted"},l("label.incident-status")+": "),o.createElement(V.Z,{data:E,usersList:ae,onSubmit:le})),o.createElement(b.Z,{className:"self-center m-x-sm",type:"vertical"}),o.createElement(h.Z.Text,{className:"d-flex items-center gap-2 text-xs whitespace-nowrap"},o.createElement("span",{className:"text-grey-muted"},l("label.assignee")+": "),o.createElement(B.V,{owners:(null==a?void 0:a.assignee)?[a.assignee]:[],placeHolder:l("label.no-entity",{entity:l("label.assignee")})})),o.createElement(b.Z,{className:"self-center m-x-sm",type:"vertical"}),o.createElement(h.Z.Text,{className:"d-flex items-center gap-2 text-xs whitespace-nowrap"},o.createElement("span",{className:"text-grey-muted"},l("label.severity")+": "),o.createElement(J.Z,{severity:E.severity,onSubmit:se})))}),[E,Q,d,ae]);return o.createElement(g.Z,{wrap:!0,align:"center"},o.createElement(B.V,{hasPermission:re,owners:null==a?void 0:a.owners,onUpdate:t}),ue,ne&&o.createElement(o.Fragment,null,o.createElement(b.Z,{className:"self-center m-x-sm",type:"vertical"}),o.createElement(h.Z.Text,{className:"self-center text-xs whitespace-nowrap"},o.createElement("span",{className:"text-grey-muted"},l("label.table")+": "),o.createElement(N.Link,{className:"font-medium","data-testid":"table-name",to:{pathname:(0,R.EK)(D.py.TABLE,ne,D.M8.PROFILER),search:Z().stringify({activeTab:G.O.DATA_QUALITY})}},(0,P.AY)(ne)))),o.createElement(b.Z,{className:"self-center m-x-sm",type:"vertical"}),o.createElement(h.Z.Text,{className:"self-center text-xs whitespace-nowrap"},o.createElement("span",{className:"text-grey-muted"},l("label.test-type")+": "),o.createElement(S.Z,{placement:"bottom",title:null==a?void 0:a.testDefinition.description},o.createElement("span",{className:"font-medium","data-testid":"test-definition-name"},(0,_.C_)(null==a?void 0:a.testDefinition)))))},X=a(91631),$=a(76709),H=a(58968),j=a(61105),W=a(66537),Y=a(78802),z=a(96840),ee=a(84731),te=a(45733),ae=a(25986),ne=function(){var e,t=(0,c.$)().t,a=(0,m.k6)(),C=(0,m.TH)(),b=(0,m.UO)().tab,h=void 0===b?ee.u.TEST_CASE_RESULTS:b,g=(0,W.f)().fqn,S=(0,ae.Y)(),T=S.isLoading,Z=S.setIsLoading,N=S.setTestCase,A=S.testCase,I=S.reset,O=(0,n.CR)((0,o.useState)(H.lh),2),F=O[0],_=O[1],L=(0,x.BL)().permissions,q=(0,o.useMemo)((function(){return{hasViewPermission:(0,M.P_)(k.OX.ViewAll,w.A.TEST_CASE,L),editDisplayNamePermission:(0,M.P_)(k.OX.EditDisplayName,w.A.TEST_CASE,L),hasDeletePermission:(0,M.P_)(k.OX.Delete,w.A.TEST_CASE,L)}}),[L]),U=q.hasViewPermission,B=q.editDisplayNamePermission,G=q.hasDeletePermission,J=(0,o.useMemo)((function(){return te.Z.getTab(F.openTaskCount).map((function(e){var t=e.LabelComponent,a=e.labelProps,s=e.key,l=e.Tab;return{key:s,label:o.createElement(t,(0,n.pi)({},a)),children:o.createElement(l,null)}}))}),[F.openTaskCount,te.Z.showSqlQueryTab]),V=(0,o.useMemo)((function(){var e,a,s=(null===(e=C.state)||void 0===e?void 0:e.breadcrumbData)?C.state.breadcrumbData:[{name:t("label.incident-manager"),url:R.Z6.INCIDENT_MANAGER}];return(0,n.ev)((0,n.ev)([],(0,n.CR)(s)),[{name:null!==(a=null==A?void 0:A.name)&&void 0!==a?a:"",url:"",activeTitle:!0}])}),[A]),ne=function(e,t){return(0,n.mG)(void 0,void 0,void 0,(function(){var a,s;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,Y.no)(e,t)];case 1:return a=n.sent(),N(a),[3,3];case 2:return s=n.sent(),(0,K.Eo)(s),[3,3];case 3:return[2]}}))}))},se=(0,o.useCallback)((function(e){_(e)}),[]),le=(0,o.useCallback)((function(){(0,P.Aq)(D.py.TEST_CASE,g,se)}),[g]);return(0,o.useEffect)((function(){return U&&g?((0,n.mG)(void 0,void 0,void 0,(function(){var e,a;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:Z(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,Y.in)(g,{fields:te.Z.getFields()})];case 2:return e=n.sent(),te.Z.setShowSqlQueryTab(!(0,u.isUndefined)(e.inspectionQuery)),N(e),[3,5];case 3:return a=n.sent(),(0,K.Eo)(a,t("server.entity-fetch-error",{entity:t("label.test-case")})),[3,5];case 4:return Z(!1),[7];case 5:return[2]}}))})),le()):Z(!1),function(){I(),te.Z.setShowSqlQueryTab(!1)}}),[g,U]),T?o.createElement(E.Z,null):U?(0,u.isUndefined)(A)?o.createElement(f.Z,null):o.createElement($.Z,{pageTitle:"Incident Manager Detail Page"},o.createElement(p.ZP,null,o.createElement(s.Z,{"data-testid":"incident-manager-details-page-container",gutter:[0,12]},o.createElement(l.Z,{className:"p-x-lg",span:24},o.createElement(y.Z,{className:"m-b-sm",titleLinks:V})),o.createElement(l.Z,{className:"p-x-lg","data-testid":"entity-page-header",span:24},o.createElement(s.Z,{gutter:16},o.createElement(l.Z,{span:23},o.createElement(X.Z,{className:"w-max-full-45",displayName:null==A?void 0:A.displayName,icon:o.createElement(d.ReactComponent,{className:"h-9"}),name:null!==(e=null==A?void 0:A.name)&&void 0!==e?e:"",serviceName:"testCase"})),o.createElement(l.Z,{className:"d-flex justify-end",span:1},o.createElement(v.Z,{isRecursiveDelete:!0,afterDeleteAction:function(){return a.push(R.Z6.INCIDENT_MANAGER)},allowSoftDelete:!1,canDelete:G,displayName:A.displayName,editDisplayNamePermission:B,entityFQN:A.fullyQualifiedName,entityId:A.id,entityName:A.name,entityType:D.py.TEST_CASE,onEditDisplayName:function(e){return(0,n.mG)(void 0,void 0,void 0,(function(){var t,a,s;return(0,n.Jh)(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),A?(t=(0,n.pi)((0,n.pi)({},A),e),(a=(0,r.qu)(A,t)).length&&A.id?[4,ne(A.id,a)]:[3,2]):[3,2];case 1:l.sent(),l.label=2;case 2:return[3,4];case 3:return s=l.sent(),(0,K.Eo)(s),[3,4];case 4:return[2]}}))}))}})))),o.createElement(l.Z,{className:"p-x-lg"},o.createElement(Q,{fetchTaskCount:le,testCaseData:A,onOwnerUpdate:function(e){return(0,n.mG)(void 0,void 0,void 0,(function(){var t,a;return(0,n.Jh)(this,(function(s){switch(s.label){case 0:return A?(t=(0,n.pi)((0,n.pi)({},A),{owners:e}),(a=(0,r.qu)(A,t)).length&&A.id?[4,ne(A.id,a)]:[3,2]):[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}}))}))}})),o.createElement(l.Z,{span:24},o.createElement(i.Z,{destroyInactiveTabPane:!0,activeKey:h,className:"entity-details-page-tabs","data-testid":"tabs",items:J,onChange:function(e){e!==h&&a.push((0,z.xr)(g,e))}}))))):o.createElement(f.Z,{type:j.Wx.PERMISSION})}}}]);