Files
object-browser/portal-ui/build/static/js/2185.4db0ed3d.chunk.js
Daniel Valdivia 66d0182825 Release v0.25.0 (#2696)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-03-08 09:17: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 r=n(29439),a=n(1413),o=n(72791),i=n(57689),l=n(75952),s=n(56028),c=n(61889),u=n(21435),d=n(11135),f=n(23814),h=n(78687),m=n(45248),x=n(81551),p=n(87995),j=n(72455),v=n(80184),b=(0,j.Z)((function(e){return(0,d.Z)((0,a.Z)((0,a.Z)({},f.ID),f.DF))})),w=(0,h.$j)((function(e){return{simplePath:e.objectBrowser.simplePath}}));t.default=w((function(e){var t=e.modalOpen,n=(e.folderName,e.bucketName),a=e.onClose,d=e.simplePath,f=(0,x.TL)(),j=(0,i.s0)(),w=b(),Z=(0,o.useState)(""),P=(0,r.Z)(Z,2),C=P[0],g=P[1],k=(0,o.useState)(!1),F=(0,r.Z)(k,2),N=F[0],y=F[1],E=(0,o.useState)(n),S=(0,r.Z)(E,2),z=S[0],B=S[1],I=(0,h.v9)((function(e){return e.objectBrowser.records}));(0,o.useEffect)((function(){if(d){var e="".concat(n).concat(n.endsWith("/")||d.startsWith("/")?"":"/").concat(d);B(e)}}),[d,n]);var L=function(){var e="/";d&&(e=d.endsWith("/")?d:"".concat(d,"/"));if(-1===I.findIndex((function(t){return t.name===e+C}))){var t=C.split("/").filter((function(e){return""!==e.trim()})).join("/"),r="/browser/".concat(n,"/").concat((0,m.LL)("".concat(e).concat(t,"/")));j(r),a()}else f((0,p.zb)({errorMessage:"Folder cannot have the same name as an existing file",detailedError:""}))};(0,o.useEffect)((function(){var e=!0;0===C.trim().length&&(e=!1),y(e)}),[C]);return(0,v.jsx)(o.Fragment,{children:(0,v.jsx)(s.Z,{modalOpen:t,title:"Choose or create a new path",onClose:a,titleIcon:(0,v.jsx)(l.Z9m,{}),children:(0,v.jsxs)(c.ZP,{container:!0,children:[(0,v.jsxs)(c.ZP,{item:!0,xs:12,className:w.formFieldRow,children:[(0,v.jsx)("strong",{children:"Current Path:"})," ",(0,v.jsx)("br",{}),(0,v.jsx)("div",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",fontSize:14,textAlign:"left"},dir:"rtl",children:z})]}),(0,v.jsx)(c.ZP,{item:!0,xs:12,className:w.formFieldRow,children:(0,v.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&&L()},required:!0})}),(0,v.jsxs)(c.ZP,{item:!0,xs:12,className:w.modalButtonBar,children:[(0,v.jsx)(l.zxk,{id:"clear",type:"button",color:"primary",variant:"regular",onClick:function(){g("")},label:"Clear"}),(0,v.jsx)(l.zxk,{id:"create",type:"submit",variant:"callAction",disabled:!N,onClick:L,label:"Create"})]})]})})})}))}}]);
//# sourceMappingURL=2185.4db0ed3d.chunk.js.map