PluginProbe
Extendify / 0.9.3
Extendify v0.9.3
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / src / Library / middleware / hasRequiredPlugins / InstallingModal.js

InstallingModal.js in Extendify 0.9.3, at src/Library/middleware/hasRequiredPlugins/InstallingModal.js

58 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { Modal, Button } from '@wordpress/components'
2 import { useState, render } from '@wordpress/element'
3 import { __ } from '@wordpress/i18n'
4 import { Plugins } from '@library/api/Plugins'
5 import { useWantedTemplateStore } from '@library/state/Importing'
6 import ReloadRequiredModal from '../ReloadRequiredModal'
7 import ErrorInstalling from './ErrorInstalling'
8
9 export default function InstallingModal({ requiredPlugins }) {
10 const [errorMessage, setErrorMessage] = useState('')
11 const wantedTemplate = useWantedTemplateStore(
12 (store) => store.wantedTemplate,
13 )
14
15 // Hardcoded temporarily to not force EP install
16 // const required = wantedTemplate?.fields?.required_plugins
17 const required =
18 requiredPlugins ??
19 wantedTemplate?.fields?.required_plugins.filter(
20 (p) => p !== 'editorplus',
21 )
22
23 Plugins.installAndActivate(required)
24 .then(() => {
25 useWantedTemplateStore.setState({
26 importOnLoad: true,
27 })
28 render(
29 <ReloadRequiredModal />,
30 document.getElementById('extendify-root'),
31 )
32 })
33 .catch(({ message }) => {
34 setErrorMessage(message)
35 })
36
37 if (errorMessage) {
38 return <ErrorInstalling msg={errorMessage} />
39 }
40
41 return (
42 <Modal
43 title={__('Installing plugins', 'extendify')}
44 isDismissible={false}>
45 <Button
46 style={{
47 width: '100%',
48 }}
49 disabled
50 isPrimary
51 isBusy
52 onClick={() => {}}>
53 {__('Installing...', 'extendify')}
54 </Button>
55 </Modal>
56 )
57 }
58