Files

1 line
1.7 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[8708,6745],{48708:(t,e,a)=>{a.r(e),a.d(e,{default:()=>p});var n=a(51609),s=a(16745),i=a(86087),l=a(45111),o=a(27723),r=a(56427),c=a(4219);const p=(0,i.memo)((()=>{const{progress:t,active:e,start:a,next:p,total:m,copySites:u}=(0,s.default)(),[g,d]=(0,i.useState)(!1),{addHelpNotice:y,removeHelpNotice:f}=(0,c.default)();return(0,i.useEffect)((()=>{t<100?e&&((async()=>{await u(!1)})(),y("copy-multisite","warning",(0,o.__)("Complianz is currently copying settings of site %1$s to %2$s of %3$s sites.","complianz-gdpr").replace("%1$s",a).replace("%2$s",p).replace("%3$s",m),(0,o.__)("Copying settings...","complianz-gdpr"),!1)):f("copy-multisite")}),[t]),(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"cmplz-export-container"},(0,n.createElement)(r.__experimentalConfirmDialog,{isOpen:g,onConfirm:async()=>{d(!1),await u(!0)},onCancel:()=>{d(!1)}},(0,o.__)("Are you sure? This will overwrite the settings in all your subsites with the Complianz settings of this site.","complianz-gdpr")),(0,n.createElement)("button",{className:"button button-default",onClick:()=>d(!0)},(0,o.__)("Start","complianz-gdpr"),e&&(0,n.createElement)(n.Fragment,null," ",t,"%",(0,n.createElement)(l.default,{name:"loading",color:"grey"})))))}))},16745:(t,e,a)=>{a.r(e),a.d(e,{default:()=>i});var n=a(81621),s=a(9588);const i=(0,n.vt)(((t,e)=>({progress:0,total:0,start:0,next:0,active:!1,copySites:async e=>{let a={restart:e};t({active:!0});const{start:n,next:i,total:l}=await s.doAction("copy_multisite",a).then((t=>t));let o=Math.round(i/l*100);t({progress:o,start:n,next:i,total:l}),o>=100&&t({active:!1})}})))}}]);