Files
openmaxio-object-browser/web-app/build/static/js/711.e6c691c6.chunk.js
2023-12-29 11:44:01 -06:00

2 lines
2.6 KiB
JavaScript

"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[711],{50711:(e,s,t)=>{t.r(s),t.d(s,{default:()=>p});var n=t(72791),o=t(9505),r=t(23508),i=t(29945),l=t(87995),c=t(44690),a=t(38442),d=t(56087),u=t(78687),b=t(31776),h=t(45248),v=t(80184);const p=e=>{let{closeDeleteModalAndRefresh:s,deleteOpen:t,selectedBucket:p,selectedObjects:j,versioning:g}=e;const x=(0,c.TL)(),f=()=>s(!0),[m,y]=(0,o.Z)(f,(e=>x((0,l.Ih)(e)))),[k,C]=(0,n.useState)(!1),[T,_]=(0,n.useState)(!1),O=(0,u.v9)((e=>e.objectBrowser.retentionConfig)),w=(0,a.F)([p],[d.Ft.S3_BYPASS_GOVERNANCE_RETENTION])&&"governance"===(null===O||void 0===O?void 0:O.mode);if(!j)return null;const N="Enabled"===(null===g||void 0===g?void 0:g.status)||"Suspended"===(null===g||void 0===g?void 0:g.status);return(0,v.jsx)(r.Z,{title:"Delete Objects",confirmText:"Delete",isOpen:t,titleIcon:(0,v.jsx)(i.NvT,{}),isLoading:m,onConfirm:()=>{let e=[];for(let s=0;s<j.length;s++)j[s].endsWith("/")?e.push({path:j[s],versionID:"",recursive:!0}):e.push({path:j[s],versionID:"",recursive:!1});if(e)if(1===j.length){const e=j[0];b.h.buckets.deleteObject(p,{prefix:(0,h.LL)(e),all_versions:k,bypass:T,recursive:e.endsWith("/")}).then(f).catch((e=>{x((0,l.Ih)({errorMessage:"Could not delete object. ".concat(e.statusText,". ").concat(O?"Please check retention mode and if object is WORM protected.":""),detailedError:""}))}))}else y("POST","/api/v1/buckets/".concat(p,"/delete-objects?all_versions=").concat(k).concat(T?"&bypass=true":""),e)},onClose:()=>s(!1),confirmationContent:(0,v.jsxs)(n.Fragment,{children:["Are you sure you want to delete the selected ",j.length," ","objects?"," ",N&&(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)("br",{}),(0,v.jsx)("br",{}),(0,v.jsx)(i.rsf,{label:"Delete All Versions",indicatorLabels:["Yes","No"],checked:k,value:"delete_versions",id:"delete-versions",name:"delete-versions",onChange:e=>{C(!k)},description:""}),w&&k&&(0,v.jsx)(n.Fragment,{children:(0,v.jsx)("div",{style:{marginTop:10},children:(0,v.jsx)(i.rsf,{label:"Bypass Governance Mode",indicatorLabels:["Yes","No"],checked:T,value:"bypass_governance",id:"bypass_governance",name:"bypass_governance",onChange:e=>{_(!T)},description:""})})}),k&&(0,v.jsxs)(n.Fragment,{children:[(0,v.jsxs)("div",{style:{marginTop:10,border:"#c83b51 1px solid",borderRadius:3,padding:5,backgroundColor:"#c83b5120",color:"#c83b51"},children:["This will remove the objects as well as all of their versions, ",(0,v.jsx)("br",{}),"This action is irreversible."]}),(0,v.jsx)("br",{}),"Are you sure you want to continue?"]})]})]})})}}}]);
//# sourceMappingURL=711.e6c691c6.chunk.js.map