"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[6292],{16292:(e,t,n)=>{n.r(t),n.d(t,{default:()=>b});var a=n(69060),i=n(66152),o=n(61180),l=n(32296),r=n(78256),s=n(61628),c=n(95705),u=n(66156),d=n(4836),m=n(82496);const b=e=>{let{open:t,bucketName:n,closeModalAndRefresh:b}=e;const p=(0,u.Ab)(),[h,g]=(0,a.useState)(!1),[j,v]=(0,a.useState)(!0),[x,y]=(0,a.useState)(l.AL.Compliance),[f,k]=(0,a.useState)(l.aK.Days),[C,w]=(0,a.useState)(1),[S,_]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{Number.isNaN(C)||(C||1)<1?_(!1):_(!0)}),[C]),(0,a.useEffect)((()=>{j&&o.m.buckets.getBucketRetentionConfig(n).then((e=>{v(!1),y(e.data.mode),w(e.data.validity),k(e.data.unit)})).catch((()=>{v(!1)}))}),[j,n]),(0,m.jsx)(d.c,{title:"Set Retention Configuration",modalOpen:t,onClose:()=>{b()},children:j?(0,m.jsx)(i.c1M,{style:{width:16,height:16}}):(0,m.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),h||(g(!0),o.m.buckets.setBucketRetentionConfig(n,{mode:x||l.AL.Compliance,unit:f||l.aK.Days,validity:C||1}).then((()=>{g(!1),b()})).catch((e=>{g(!1),p((0,c.op)((0,r.K)(e.error)))})))},children:(0,m.jsxs)(i.yE_,{containerPadding:!1,withBorders:!1,children:[(0,m.jsx)(i.ew2,{currentValue:x,id:"retention_mode",name:"retention_mode",label:"Retention Mode",onChange:e=>{y(e.target.value)},selectorOptions:[{value:"compliance",label:"Compliance"},{value:"governance",label:"Governance"}],helpTip:(0,m.jsxs)(a.Fragment,{children:[" ",(0,m.jsx)("a",{href:"https://min.io/docs/minio/macos/administration/object-management/object-retention.html#minio-object-locking-compliance",target:"blank",children:"Compliance"})," ","lock protects Objects from write operations by all users, including the MinIO root user.",(0,m.jsx)("br",{}),(0,m.jsx)("br",{}),(0,m.jsx)("a",{href:"https://min.io/docs/minio/macos/administration/object-management/object-retention.html#minio-object-locking-governance",target:"blank",children:"Governance"})," ","lock protects Objects from write operations by non-privileged users."]}),helpTipPlacement:"right"}),(0,m.jsx)(i.ew2,{currentValue:f,id:"retention_unit",name:"retention_unit",label:"Retention Unit",onChange:e=>{k(e.target.value)},selectorOptions:[{value:"days",label:"Days"},{value:"years",label:"Years"}]}),(0,m.jsx)(i.q22,{type:"number",id:"retention_validity",name:"retention_validity",onChange:e=>{w(e.target.valueAsNumber)},label:"Retention Validity",value:String(C),required:!0,min:"1"}),(0,m.jsxs)(i.yeN,{item:!0,xs:12,sx:s.W2.modalButtonBar,children:[(0,m.jsx)(i.qaq,{id:"cancel",type:"button",variant:"regular",disabled:h,onClick:()=>{b()},label:"Cancel"}),(0,m.jsx)(i.qaq,{id:"set",type:"submit",variant:"callAction",color:"primary",disabled:h||!S,label:"Set"})]}),h&&(0,m.jsx)(i.yeN,{item:!0,xs:12,children:(0,m.jsx)(i.cHM,{})})]})})})}}}]);
//# sourceMappingURL=6292.623b86cd.chunk.js.map