mirror of
https://fast.feibisi.com/https://github.com/lubusIN/visual-blueprint-builder.git
synced 2025-10-03 04:01:24 +08:00
fixed deprecated step from install-plugin and install-theme
This commit is contained in:
parent
2253c4cc3f
commit
08812b6483
4 changed files with 18 additions and 18 deletions
|
@ -16,7 +16,7 @@
|
|||
"type": "string",
|
||||
"default": "installPlugin"
|
||||
},
|
||||
"pluginZipFile": {
|
||||
"pluginData": {
|
||||
"type": "object",
|
||||
"default": {
|
||||
"resource": "url",
|
||||
|
|
|
@ -31,8 +31,8 @@ import { Picker } from '../../../components';
|
|||
* @return {Element} Element to render.
|
||||
*/
|
||||
function Edit({ attributes, setAttributes, isSelected }) {
|
||||
const { pluginZipFile, options } = attributes;
|
||||
const { resource, path, url, slug } = pluginZipFile;
|
||||
const { pluginData, options } = attributes;
|
||||
const { resource, path, url, slug } = pluginData;
|
||||
const { activate } = options;
|
||||
|
||||
const handleResourceChange = (newResource) => {
|
||||
|
@ -42,22 +42,22 @@ function Edit({ attributes, setAttributes, isSelected }) {
|
|||
|
||||
// Conditionally add attributes based on the selected resource
|
||||
if (newResource === 'vfs') {
|
||||
newAttributes.path = pluginZipFile.path || '';
|
||||
newAttributes.path = pluginData.path || '';
|
||||
} else if (newResource === 'url') {
|
||||
newAttributes.url = pluginZipFile.url || '';
|
||||
newAttributes.url = pluginData.url || '';
|
||||
} else if (newResource === 'wordpress.org/plugins') {
|
||||
newAttributes.slug = pluginZipFile.slug || '';
|
||||
newAttributes.slug = pluginData.slug || '';
|
||||
}
|
||||
|
||||
setAttributes({
|
||||
pluginZipFile: newAttributes
|
||||
pluginData: newAttributes
|
||||
});
|
||||
};
|
||||
|
||||
const handleInputChange = (field, value) => {
|
||||
setAttributes({
|
||||
pluginZipFile: {
|
||||
...pluginZipFile,
|
||||
pluginData: {
|
||||
...pluginData,
|
||||
[field]: value
|
||||
}
|
||||
});
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"type": "string",
|
||||
"default": "installTheme"
|
||||
},
|
||||
"themeZipFile": {
|
||||
"themeData": {
|
||||
"type": "object",
|
||||
"default": {
|
||||
"resource": "url",
|
||||
|
|
|
@ -33,8 +33,8 @@ import { Picker } from '../../../components';
|
|||
* @return {Element} Element to render.
|
||||
*/
|
||||
function Edit({ attributes, setAttributes, isSelected }) {
|
||||
const { themeZipFile, options } = attributes;
|
||||
const { resource, path, url, slug } = themeZipFile;
|
||||
const { themeData, options } = attributes;
|
||||
const { resource, path, url, slug } = themeData;
|
||||
const { activate, importStarterContent } = options;
|
||||
|
||||
const handleResourceChange = (newResource) => {
|
||||
|
@ -44,22 +44,22 @@ function Edit({ attributes, setAttributes, isSelected }) {
|
|||
|
||||
// Conditionally add attributes based on the selected resource
|
||||
if (newResource === 'vfs') {
|
||||
newAttributes.path = themeZipFile.path || '';
|
||||
newAttributes.path = themeData.path || '';
|
||||
} else if (newResource === 'url') {
|
||||
newAttributes.url = themeZipFile.url || '';
|
||||
newAttributes.url = themeData.url || '';
|
||||
} else if (newResource === 'wordpress.org/themes') {
|
||||
newAttributes.slug = themeZipFile.slug || '';
|
||||
newAttributes.slug = themeData.slug || '';
|
||||
}
|
||||
|
||||
setAttributes({
|
||||
themeZipFile: newAttributes
|
||||
themeData: newAttributes
|
||||
});
|
||||
};
|
||||
|
||||
const handleInputChange = (field, value) => {
|
||||
setAttributes({
|
||||
themeZipFile: {
|
||||
...themeZipFile,
|
||||
themeData: {
|
||||
...themeData,
|
||||
[field]: value
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue