Files
object-browser/portal-ui/build/static/js/2185.a1da3e17.chunk.js
Daniel Valdivia 8a9fbb461c Release v0.21.2 (#2435)
Signed-off-by: Daniel Valdivia
<18384552+dvaldivia@users.noreply.github.com>
2022-11-07 21:03:03 -08:00

2 lines
2.4 KiB
JavaScript

"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[2185],{62185:function(e,t,n){n.r(t);var a=n(29439),r=n(1413),i=n(72791),l=n(16871),s=n(75952),o=n(56028),c=n(61889),u=n(21435),d=n(11135),f=n(25787),h=n(23814),m=n(60364),x=n(45248),p=n(38588),j=n(25469),v=n(87995),b=n(80184),Z=(0,m.$j)((function(e){return{simplePath:e.objectBrowser.simplePath}}));t.default=Z((0,f.Z)((function(e){return(0,d.Z)((0,r.Z)((0,r.Z)({},h.ID),h.DF))}))((function(e){var t=e.modalOpen,n=(e.folderName,e.bucketName),r=e.onClose,d=e.classes,f=e.existingFiles,h=e.simplePath,m=(0,j.TL)(),Z=(0,l.s0)(),w=(0,i.useState)(""),P=(0,a.Z)(w,2),C=P[0],g=P[1],k=(0,i.useState)(!1),F=(0,a.Z)(k,2),N=F[0],y=F[1],E=(0,i.useState)(n),S=(0,a.Z)(E,2),z=S[0],B=S[1];(0,i.useEffect)((function(){if(h){var e="".concat(n).concat(n.endsWith("/")||h.startsWith("/")?"":"/").concat(h);B(e)}}),[h,n]);var I=function(){var e="/";h&&(e=h.endsWith("/")?h:"".concat(h,"/"));if(-1===f.findIndex((function(t){return t.name===e+C}))){var t=C.split("/").filter((function(e){return""!==e.trim()})).join("/"),a="/buckets/".concat(n,"/browse/").concat((0,x.LL)("".concat(e).concat(t,"/")));Z(a),r()}else m((0,v.zb)({errorMessage:"Folder cannot have the same name as an existing file",detailedError:""}))};(0,i.useEffect)((function(){var e=!0;0===C.trim().length&&(e=!1),y(e)}),[C]);return(0,b.jsx)(i.Fragment,{children:(0,b.jsx)(o.Z,{modalOpen:t,title:"Choose or create a new path",onClose:r,titleIcon:(0,b.jsx)(p.Z9m,{}),children:(0,b.jsxs)(c.ZP,{container:!0,children:[(0,b.jsxs)(c.ZP,{item:!0,xs:12,className:d.formFieldRow,children:[(0,b.jsx)("strong",{children:"Current Path:"})," ",(0,b.jsx)("br",{}),(0,b.jsx)("div",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",fontSize:14,textAlign:"left"},dir:"rtl",children:z})]}),(0,b.jsx)(c.ZP,{item:!0,xs:12,className:d.formFieldRow,children:(0,b.jsx)(u.Z,{value:C,label:"New Folder Path",id:"folderPath",name:"folderPath",placeholder:"Enter the new Folder Path",onChange:function(e){g(e.target.value)},onKeyPress:function(e){"Enter"===e.code&&""!==C&&I()},required:!0})}),(0,b.jsxs)(c.ZP,{item:!0,xs:12,className:d.modalButtonBar,children:[(0,b.jsx)(s.zx,{id:"clear",type:"button",color:"primary",variant:"regular",onClick:function(){g("")},label:"Clear"}),(0,b.jsx)(s.zx,{id:"create",type:"submit",variant:"callAction",disabled:!N,onClick:I,label:"Create"})]})]})})})})))}}]);
//# sourceMappingURL=2185.a1da3e17.chunk.js.map