chore: modified server schema version (#28358)
## Description > fixes xml parser Fixes: https://github.com/appsmithorg/appsmith/issues/28364
This commit is contained in:
parent
492eece3c9
commit
a3f184b986
|
|
@ -1,6 +1,5 @@
|
||||||
package com.appsmith.server.jslibs.imports;
|
package com.appsmith.server.jslibs.imports;
|
||||||
|
|
||||||
import com.appsmith.server.constants.ApplicationConstants;
|
|
||||||
import com.appsmith.server.domains.Application;
|
import com.appsmith.server.domains.Application;
|
||||||
import com.appsmith.server.domains.CustomJSLib;
|
import com.appsmith.server.domains.CustomJSLib;
|
||||||
import com.appsmith.server.domains.Workspace;
|
import com.appsmith.server.domains.Workspace;
|
||||||
|
|
@ -37,8 +36,6 @@ public class CustomJSLibImportableServiceCEImpl implements ImportableServiceCE<C
|
||||||
customJSLibs = new ArrayList<>();
|
customJSLibs = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
ensureXmlParserPresenceInCustomJsLibList(customJSLibs);
|
|
||||||
|
|
||||||
return Flux.fromIterable(customJSLibs)
|
return Flux.fromIterable(customJSLibs)
|
||||||
.flatMap(customJSLib -> {
|
.flatMap(customJSLib -> {
|
||||||
customJSLib.setId(null);
|
customJSLib.setId(null);
|
||||||
|
|
@ -56,30 +53,4 @@ public class CustomJSLibImportableServiceCEImpl implements ImportableServiceCE<C
|
||||||
return Mono.error(e);
|
return Mono.error(e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This method takes customJSLibList from application JSON, checks if an entry for XML parser exists,
|
|
||||||
* otherwise adds the entry.
|
|
||||||
* This has been done to add the xmlParser entry in imported application as appsmith is stopping native support
|
|
||||||
* for xml parser.
|
|
||||||
* Read More: https://github.com/appsmithorg/appsmith/pull/28012
|
|
||||||
*
|
|
||||||
* @param customJSLibList
|
|
||||||
*/
|
|
||||||
private void ensureXmlParserPresenceInCustomJsLibList(List<CustomJSLib> customJSLibList) {
|
|
||||||
boolean isXmlParserLibFound = false;
|
|
||||||
for (CustomJSLib customJSLib : customJSLibList) {
|
|
||||||
if (!customJSLib.getUidString().equals(ApplicationConstants.XML_PARSER_LIBRARY_UID)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
isXmlParserLibFound = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isXmlParserLibFound) {
|
|
||||||
CustomJSLib xmlParserJsLib = ApplicationConstants.getDefaultParserCustomJsLibCompatibilityDTO();
|
|
||||||
customJSLibList.add(xmlParserJsLib);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,9 @@ public class JsonSchemaMigration {
|
||||||
case 5:
|
case 5:
|
||||||
MigrationHelperMethods.migrateGoogleSheetsActionsToUqi(applicationJson);
|
MigrationHelperMethods.migrateGoogleSheetsActionsToUqi(applicationJson);
|
||||||
applicationJson.setServerSchemaVersion(6);
|
applicationJson.setServerSchemaVersion(6);
|
||||||
|
case 6:
|
||||||
|
MigrationHelperMethods.ensureXmlParserPresenceInCustomJsLibList(applicationJson);
|
||||||
|
applicationJson.setServerSchemaVersion(7);
|
||||||
default:
|
default:
|
||||||
// Unable to detect the serverSchema
|
// Unable to detect the serverSchema
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,6 @@ import lombok.Getter;
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
public class JsonSchemaVersions {
|
public class JsonSchemaVersions {
|
||||||
public static final Integer serverVersion = 6;
|
public static final Integer serverVersion = 7;
|
||||||
public static final Integer clientVersion = 1;
|
public static final Integer clientVersion = 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,11 @@ package com.appsmith.server.migrations;
|
||||||
import com.appsmith.external.models.ActionDTO;
|
import com.appsmith.external.models.ActionDTO;
|
||||||
import com.appsmith.external.models.BaseDomain;
|
import com.appsmith.external.models.BaseDomain;
|
||||||
import com.appsmith.external.models.InvisibleActionFields;
|
import com.appsmith.external.models.InvisibleActionFields;
|
||||||
|
import com.appsmith.server.constants.ApplicationConstants;
|
||||||
import com.appsmith.server.constants.FieldName;
|
import com.appsmith.server.constants.FieldName;
|
||||||
import com.appsmith.server.constants.ResourceModes;
|
import com.appsmith.server.constants.ResourceModes;
|
||||||
import com.appsmith.server.domains.ApplicationPage;
|
import com.appsmith.server.domains.ApplicationPage;
|
||||||
|
import com.appsmith.server.domains.CustomJSLib;
|
||||||
import com.appsmith.server.domains.NewAction;
|
import com.appsmith.server.domains.NewAction;
|
||||||
import com.appsmith.server.domains.Plugin;
|
import com.appsmith.server.domains.Plugin;
|
||||||
import com.appsmith.server.domains.QUser;
|
import com.appsmith.server.domains.QUser;
|
||||||
|
|
@ -256,4 +258,37 @@ public class MigrationHelperMethods {
|
||||||
where(FieldName.DELETED_AT).exists(false),
|
where(FieldName.DELETED_AT).exists(false),
|
||||||
where(FieldName.DELETED_AT).is(null)));
|
where(FieldName.DELETED_AT).is(null)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method takes customJSLibList from application JSON, checks if an entry for XML parser exists,
|
||||||
|
* otherwise adds the entry.
|
||||||
|
* This has been done to add the xmlParser entry in imported application as appsmith is stopping native support
|
||||||
|
* for xml parser.
|
||||||
|
* Read More: https://github.com/appsmithorg/appsmith/pull/28012
|
||||||
|
*
|
||||||
|
* @param applicationJson
|
||||||
|
*/
|
||||||
|
public static void ensureXmlParserPresenceInCustomJsLibList(ApplicationJson applicationJson) {
|
||||||
|
|
||||||
|
if (CollectionUtils.isNullOrEmpty(applicationJson.getCustomJSLibList())) {
|
||||||
|
applicationJson.setCustomJSLibList(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<CustomJSLib> customJSLibList = applicationJson.getCustomJSLibList();
|
||||||
|
boolean isXmlParserLibFound = false;
|
||||||
|
|
||||||
|
for (CustomJSLib customJSLib : customJSLibList) {
|
||||||
|
if (!customJSLib.getUidString().equals(ApplicationConstants.XML_PARSER_LIBRARY_UID)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
isXmlParserLibFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isXmlParserLibFound) {
|
||||||
|
CustomJSLib xmlParserJsLib = ApplicationConstants.getDefaultParserCustomJsLibCompatibilityDTO();
|
||||||
|
customJSLibList.add(xmlParserJsLib);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user