assets.1383.d6c7d905492d8496b4a5.js Maven / Gradle / Ivy
"use strict";(self.webpackChunkopen_metadata=self.webpackChunkopen_metadata||[]).push([[1383],{3765:function(e,t,n){var a=n(8081),i=n.n(a),r=n(23645),s=n.n(r)()(i());s.push([e.id,'/*\n * Copyright 2023 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* navbar+tab_height+padding = 64+46+12 */\n.service-doc-panel {\n background: #fff;\n padding-bottom: 8px;\n}\n.service-doc-panel .toastui-editor-contents h1:first-child {\n padding-top: 8px !important;\n}\n.service-doc-panel .toastui-editor-contents > * {\n padding: 5px 35px !important;\n}\n',""]),t.Z=s},81383:function(e,t,n){n.r(t),n.d(t,{default:function(){return k}});var a,i=n(70655),r=n(49409),s=n(71230),o=n(15746),l=n(71577),c=n(23031),u=n(96486),d=n(67294),p=n(15137),m=n(62761),f=n(96162),h=n(16139),v=n(85071);!function(e){e.Entity="entity",e.Field="field"}(a||(a={}));var y=n(17309),b=n(226),g=n(30996),E=n(23575),w=n(96840),T=n(46321),S=n(79686),C=n(86879),Z=n(26387),k=function(){var e=(0,p.UO)().entityTypeFQN,t=(0,p.k6)(),n=(0,i.CR)((0,d.useState)(),2),k=n[0],L=n[1],I=(0,i.CR)((0,d.useState)([]),2),N=I[0],A=I[1],R=(0,i.CR)((0,d.useState)(""),2),O=R[0],U=R[1],J=(0,i.CR)((0,d.useState)(!1),2),x=J[0],q=J[1],F=(0,d.useMemo)((function(){return[{name:(0,c.t)("label.setting-plural"),url:(0,w.si)()},{name:(0,c.t)("label.custom-attribute-plural"),url:(0,w.si)(f.CZ.CUSTOM_ATTRIBUTES,(0,E.cE)(e))},{name:(0,c.t)("label.add-entity",{entity:(0,c.t)("label.custom-property")}),url:""}]}),[e]),G=(0,d.useMemo)((function(){var e=N.filter((function(e){return m.UT.includes(e.name)}));return(0,u.map)(e,(function(e){var t;return{key:e.name,label:(0,u.startCase)(null!==(t=e.displayName)&&void 0!==t?t:e.name),value:e.id}}))}),[N]),P=(0,d.useCallback)((function(){return t.goBack()}),[t]),W=(0,d.useCallback)((function(e){var t=e.target.classList.contains("ProseMirror");U(t?"root/description":e.target.id)}),[]);(0,d.useEffect)((function(){var t;t=e,(0,i.mG)(void 0,void 0,void 0,(function(){var e,n;return(0,i.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,(0,b.ov)(t)];case 1:return e=a.sent(),L(e),[3,3];case 2:return n=a.sent(),(0,T.Eo)(n),[3,3];case 3:return[2]}}))}))}),[e]),(0,d.useEffect)((function(){(0,i.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,b.Qe)(a.Field)];case 1:return e=n.sent(),A(e.data),[3,3];case 2:return t=n.sent(),(0,T.Eo)(t),[3,3];case 3:return[2]}}))}))}),[]);var Q=[{name:"name",required:!0,label:(0,c.t)("label.name"),id:"root/name",type:y.U.TEXT,props:{"data-testid":"name",autoComplete:"off"},placeholder:(0,c.t)("label.name"),rules:[{pattern:h.YZ,message:(0,c.t)("message.custom-property-name-validation")}]},{name:"propertyType",required:!0,label:(0,c.t)("label.type"),id:"root/propertyType",type:y.U.SELECT,props:{"data-testid":"propertyType",options:G,placeholder:""+(0,c.t)("label.select-field",{field:(0,c.t)("label.type")})}},{name:"description",required:!0,label:(0,c.t)("label.description"),id:"root/description",type:y.U.DESCRIPTION,props:{"data-testid":"description",initialValue:""}}],B=d.createElement("div",{className:"max-width-md w-9/10 service-form-container"},d.createElement(Z.Z,{titleLinks:F}),d.createElement(r.Z,{className:"m-t-md","data-testid":"custom-property-form",layout:"vertical",onFinish:function(e){return(0,i.mG)(void 0,void 0,void 0,(function(){var n,a;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:if((0,u.isUndefined)(k))return[2];r.label=1;case 1:return r.trys.push([1,3,4,5]),q(!0),[4,(0,b.q8)(null!==(a=null==k?void 0:k.id)&&void 0!==a?a:"",(0,i.pi)((0,i.pi)({},e),{propertyType:{id:e.propertyType,type:"type"}}))];case 2:return r.sent(),t.goBack(),[3,5];case 3:return n=r.sent(),(0,T.Eo)(n),[3,5];case 4:return q(!1),[7];case 5:return[2]}}))}))},onFocus:W},(0,g.GL)(Q),d.createElement(s.Z,{justify:"end"},d.createElement(o.Z,null,d.createElement(l.Z,{"data-testid":"back-button",type:"link",onClick:P},(0,c.t)("label.back"))),d.createElement(o.Z,null,d.createElement(l.Z,{"data-testid":"create-button",htmlType:"submit",loading:x,type:"primary"},(0,c.t)("label.create")))))),D=d.createElement(C.Z,{activeField:O,serviceName:v.uR,serviceType:v.rn});return d.createElement(S.Z,{firstPanel:{children:B,minWidth:700,flex:.7},pageTitle:(0,c.t)("label.add-entity",{entity:(0,c.t)("label.custom-property")}),secondPanel:{children:D,className:"service-doc-panel",minWidth:60,overlay:{displayThreshold:200,header:(0,c.t)("label.setup-guide"),rotation:"counter-clockwise"}}})}},86879:function(e,t,n){n.d(t,{Z:function(){return I}});var a=n(70655),i=n(71230),r=n(15746),s=n(96486),o=n(67294),l=n(68432),c=n(16139),u=n(39117),d=n(73975),p=n(69523),m=n(24135),f=n(93379),h=n.n(f),v=n(7795),y=n.n(v),b=n(90569),g=n.n(b),E=n(3565),w=n.n(E),T=n(19216),S=n.n(T),C=n(44589),Z=n.n(C),k=n(3765),L={};L.styleTagTransform=Z(),L.setAttributes=w(),L.insert=g().bind(null,"head"),L.domAPI=y(),L.insertStyleElement=S(),h()(k.Z,L),k.Z&&k.Z.locals&&k.Z.locals;var I=function(e){var t=e.serviceType,n=e.serviceName,f=e.activeField,h=e.isWorkflow,v=e.workflowType,y=(0,l.$)().i18n,b=(0,a.CR)((0,o.useState)(!1),2),g=b[0],E=b[1],w=(0,a.CR)((0,o.useState)(""),2),T=w[0],S=w[1],C=(0,o.useCallback)((function(e){var t;if(e){var n=e.split("/");if(c.JJ.test(e))return n[1];var a=null!==(t=(0,s.last)(n))&&void 0!==t?t:"";return c.X$.test(a)?(0,s.first)(a.split("_")):a}}),[]);return(0,o.useEffect)((function(){(0,a.mG)(void 0,void 0,void 0,(function(){var e,i,r,s,o,l,c;return(0,a.Jh)(this,(function(p){switch(p.label){case 0:E(!0),p.label=1;case 1:return p.trys.push([1,3,4,5]),e="",i=y.language===d.Qv.English,r=y.language+"/"+t+"/"+n+".md",s=d.Qv.English+"/"+t+"/"+n+".md",h&&v&&(r=y.language+"/"+t+"/workflows/"+v+".md",s=d.Qv.English+"/"+t+"/workflows/"+v+".md"),[4,Promise.allSettled([(0,u.bA)(r),i?Promise.reject(""):(0,u.bA)(s)])];case 2:return o=a.CR.apply(void 0,[p.sent(),2]),l=o[0],c=o[1],"fulfilled"===l.status&&(e=l.value),i||"fulfilled"!==c.status||(e=c.value),S(e),[3,5];case 3:return p.sent(),S(""),[3,5];case 4:return E(!1),[7];case 5:return[2]}}))}))}),[n,t]),(0,o.useEffect)((function(){var e=C(f);if(e){var t=document.querySelector('[data-id="'+e+'"]');t&&(t.scrollIntoView({block:"center",behavior:"smooth",inline:"center"}),t.setAttribute("data-highlighted","true"))}}),[f,C]),g?o.createElement(p.Z,null):o.createElement(i.Z,{"data-testid":"service-requirements"},o.createElement(r.Z,{span:24},o.createElement(m.Z,{enableSeeMoreVariant:!1,markdown:T})))}},226:function(e,t,n){n.d(t,{Qe:function(){return r},TJ:function(){return l},ov:function(){return s},q8:function(){return o}});var a=n(70655),i=n(2598),r=function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){var t;return(0,a.Jh)(this,(function(n){switch(n.label){case 0:return t={category:e,limit:"12"},[4,i.Z.get("/metadata/types",{params:t})];case 1:return[2,n.sent().data]}}))}))},s=function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){var t,n;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:return t="/metadata/types/name/"+e,n={fields:"customProperties"},[4,i.Z.get(t,{params:n})];case 1:return[2,a.sent().data]}}))}))},o=function(e,t){return(0,a.mG)(void 0,void 0,void 0,(function(){var n;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:return n="/metadata/types/"+e,[4,i.Z.put(n,t)];case 1:return[2,a.sent().data]}}))}))},l=function(e,t){return(0,a.mG)(void 0,void 0,void 0,(function(){var n,r;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:return n={headers:{"Content-type":"application/json-patch+json"}},r="/metadata/types/"+e,[4,i.Z.patch(r,t,n)];case 1:return[2,a.sent().data]}}))}))}}}]);
© 2015 - 2025 Weber Informatics LLC | Privacy Policy