From abd4de1cd910a19b42e0ff31eb0d525aca0aefae Mon Sep 17 00:00:00 2001 From: Nayan Date: Thu, 30 Dec 2021 12:32:54 +0600 Subject: [PATCH] fix: Application is not publishable when imported without theme (#10009) When we import an application from a JSON file where themes are not present, publishing the application fails. This PR fixes this issue. --- .../ce/CustomApplicationRepositoryCE.java | 3 +- .../ce/CustomApplicationRepositoryCEImpl.java | 13 +- .../services/ce/ThemeServiceCEImpl.java | 46 +- .../ImportExportApplicationServiceCEImpl.java | 24 +- .../server/services/ThemeServiceTest.java | 23 + .../ImportExportApplicationServiceTests.java | 22 + .../valid-application-without-theme.json | 632 ++++++++++++++++++ 7 files changed, 724 insertions(+), 39 deletions(-) create mode 100644 app/server/appsmith-server/src/test/resources/test_assets/ImportExportServiceTest/valid-application-without-theme.json diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CustomApplicationRepositoryCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CustomApplicationRepositoryCE.java index ec0eed4e68..d611483a68 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CustomApplicationRepositoryCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CustomApplicationRepositoryCE.java @@ -2,7 +2,6 @@ package com.appsmith.server.repositories.ce; import com.appsmith.server.acl.AclPermission; import com.appsmith.server.domains.Application; -import com.appsmith.server.domains.ApplicationMode; import com.appsmith.server.domains.ApplicationPage; import com.appsmith.server.domains.GitAuth; import com.appsmith.server.repositories.AppsmithRepository; @@ -39,7 +38,7 @@ public interface CustomApplicationRepositoryCE extends AppsmithRepository> getAllApplicationId(String organizationId); - Mono setAppTheme(String applicationId, String themeId, ApplicationMode applicationMode, AclPermission aclPermission); + Mono setAppTheme(String applicationId, String editModeThemeId, String publishedModeThemeId, AclPermission aclPermission); Mono countByOrganizationId(String organizationId); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CustomApplicationRepositoryCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CustomApplicationRepositoryCEImpl.java index 9b3fc3df83..31aa7209fc 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CustomApplicationRepositoryCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CustomApplicationRepositoryCEImpl.java @@ -3,7 +3,6 @@ package com.appsmith.server.repositories.ce; import com.appsmith.external.models.BaseDomain; import com.appsmith.server.acl.AclPermission; import com.appsmith.server.domains.Application; -import com.appsmith.server.domains.ApplicationMode; import com.appsmith.server.domains.ApplicationPage; import com.appsmith.server.domains.GitAuth; import com.appsmith.server.domains.QApplication; @@ -18,6 +17,7 @@ import org.springframework.data.mongodb.core.convert.MongoConverter; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Update; +import org.springframework.util.StringUtils; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -177,12 +177,13 @@ public class CustomApplicationRepositoryCEImpl extends BaseAppsmithRepositoryImp } @Override - public Mono setAppTheme(String applicationId, String themeId, ApplicationMode applicationMode, AclPermission aclPermission) { + public Mono setAppTheme(String applicationId, String editModeThemeId, String publishedModeThemeId, AclPermission aclPermission) { Update updateObj = new Update(); - if(applicationMode == ApplicationMode.EDIT) { - updateObj = updateObj.set(fieldName(QApplication.application.editModeThemeId), themeId); - } else if(applicationMode == ApplicationMode.PUBLISHED) { - updateObj = updateObj.set(fieldName(QApplication.application.publishedModeThemeId), themeId); + if(StringUtils.hasLength(editModeThemeId)) { + updateObj = updateObj.set(fieldName(QApplication.application.editModeThemeId), editModeThemeId); + } + if(StringUtils.hasLength(publishedModeThemeId)) { + updateObj = updateObj.set(fieldName(QApplication.application.publishedModeThemeId), publishedModeThemeId); } return this.updateById(applicationId, updateObj, aclPermission); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ThemeServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ThemeServiceCEImpl.java index 20467849f2..58d488c6cf 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ThemeServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ThemeServiceCEImpl.java @@ -91,7 +91,7 @@ public class ThemeServiceCEImpl extends BaseService changeCurrentTheme(String newThemeId, String applicationId) { // set provided theme to application and return that theme object Mono setAppThemeMono = applicationRepository.setAppTheme( - applicationId, newThemeId, ApplicationMode.EDIT, MANAGE_APPLICATIONS + applicationId, newThemeId,null, MANAGE_APPLICATIONS ).then(repository.findById(newThemeId)); // in case a customized theme was set to application, we need to delete that @@ -138,19 +138,25 @@ public class ThemeServiceCEImpl extends BaseService publishTheme(String editModeThemeId, String publishedThemeId, String applicationId) { - return applicationRepository.findById(applicationId, MANAGE_APPLICATIONS).then( - // makes sure user has permission to manage this application - repository.findById(editModeThemeId).flatMap(editModeTheme -> { - if (editModeTheme.isSystemTheme()) { // system theme is set as edit mode theme - // just set the system theme id as published theme id to application object - return applicationRepository.setAppTheme( - applicationId, editModeThemeId, ApplicationMode.PUBLISHED, MANAGE_APPLICATIONS - ).thenReturn(editModeTheme); - } else { // a customized theme is set as edit mode theme, copy that theme for published mode - return saveThemeForApplication(publishedThemeId, editModeTheme, applicationId, ApplicationMode.PUBLISHED); - } - }) - ); + Mono editModeThemeMono; + if(!StringUtils.hasLength(editModeThemeId)) { // theme id is empty, use the default theme + editModeThemeMono = repository.getSystemThemeByName(Theme.LEGACY_THEME_NAME); + } else { // theme id is not empty, fetch it by id + editModeThemeMono = repository.findById(editModeThemeId); + } + + Mono publishThemeMono = editModeThemeMono.flatMap(editModeTheme -> { + if (editModeTheme.isSystemTheme()) { // system theme is set as edit mode theme + // just set the system theme id as edit and published mode theme id to application object + return applicationRepository.setAppTheme( + applicationId, editModeTheme.getId(), editModeTheme.getId(), MANAGE_APPLICATIONS + ).thenReturn(editModeTheme); + } else { // a customized theme is set as edit mode theme, copy that theme for published mode + return saveThemeForApplication(publishedThemeId, editModeTheme, applicationId, ApplicationMode.PUBLISHED); + } + }); + // fetch application to make sure user has permission to manage this application + return applicationRepository.findById(applicationId, MANAGE_APPLICATIONS).then(publishThemeMono); } /** @@ -182,9 +188,15 @@ public class ThemeServiceCEImpl extends BaseService { Theme theme = savedThemeTuple.getT1(); if (savedThemeTuple.getT2()) { // new published theme created, update the application - return applicationRepository.setAppTheme( - applicationId, theme.getId(), applicationMode, MANAGE_APPLICATIONS - ).thenReturn(theme); + if(applicationMode == ApplicationMode.EDIT) { + return applicationRepository.setAppTheme( + applicationId, theme.getId(), null, MANAGE_APPLICATIONS + ).thenReturn(theme); + } else { + return applicationRepository.setAppTheme( + applicationId, null, theme.getId(), MANAGE_APPLICATIONS + ).thenReturn(theme); + } } else { return Mono.just(theme); // old theme overwritten, no need to update application } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ImportExportApplicationServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ImportExportApplicationServiceCEImpl.java index 01abfdd52c..6a36b385ca 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ImportExportApplicationServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ImportExportApplicationServiceCEImpl.java @@ -1368,27 +1368,23 @@ public class ImportExportApplicationServiceCEImpl implements ImportExportApplica } private Mono importThemes(Application application, ApplicationJson importedApplicationJson) { - if(importedApplicationJson.getEditModeTheme() != null && importedApplicationJson.getPublishedTheme() != null) { - Mono importedEditModeTheme = getOrSaveTheme(importedApplicationJson.getEditModeTheme()); - Mono importedPublishedModeTheme = getOrSaveTheme(importedApplicationJson.getPublishedTheme()); + Mono importedEditModeTheme = getOrSaveTheme(importedApplicationJson.getEditModeTheme()); + Mono importedPublishedModeTheme = getOrSaveTheme(importedApplicationJson.getPublishedTheme()); - return Mono.zip(importedEditModeTheme, importedPublishedModeTheme).map(importedThemesTuple -> { - application.setEditModeThemeId(importedThemesTuple.getT1().getId()); - application.setPublishedModeThemeId(importedThemesTuple.getT2().getId()); - return application; - }); - } else { - return Mono.just(application); - } + return Mono.zip(importedEditModeTheme, importedPublishedModeTheme).map(importedThemesTuple -> { + application.setEditModeThemeId(importedThemesTuple.getT1().getId()); + application.setPublishedModeThemeId(importedThemesTuple.getT2().getId()); + return application; + }); } private Mono getOrSaveTheme(Theme theme) { - if (theme.isSystemTheme()) { + if(theme == null) { // this application was exported without theme, assign the legacy theme to it + return themeRepository.getSystemThemeByName(Theme.LEGACY_THEME_NAME); // return the default theme + } else if (theme.isSystemTheme()) { return themeRepository.getSystemThemeByName(theme.getName()); } else { return themeRepository.save(theme); } } - - } diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ThemeServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ThemeServiceTest.java index fffe7396c6..29424b4d0d 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ThemeServiceTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ThemeServiceTest.java @@ -357,4 +357,27 @@ public class ThemeServiceTest { assertThat(publishedModeTheme.getName()).isEqualToIgnoringCase("classic"); }).verifyComplete(); } + + @WithUserDetails("api_user") + @Test + public void publishTheme_WhenNoThemeIsSet_SystemDefaultThemeIsSetToPublishedMode() { + Mono classicThemeMono = themeRepository.getSystemThemeByName(Theme.LEGACY_THEME_NAME); + + Mono> appAndThemeTuple = applicationRepository.save( + createApplication("api_user", Set.of(MANAGE_APPLICATIONS)) + ) + .flatMap(savedApplication -> + themeService.publishTheme(savedApplication.getEditModeThemeId(), + savedApplication.getPublishedModeThemeId(), savedApplication.getId() + ).then(applicationRepository.findById(savedApplication.getId())) + ) + .zipWith(classicThemeMono); + + StepVerifier.create(appAndThemeTuple) + .assertNext(objects -> { + Application application = objects.getT1(); + Theme classicSystemTheme = objects.getT2(); + assertThat(application.getPublishedModeThemeId()).isEqualTo(classicSystemTheme.getId()); + }).verifyComplete(); + } } \ No newline at end of file diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/ImportExportApplicationServiceTests.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/ImportExportApplicationServiceTests.java index f891fd710e..320b746dbd 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/ImportExportApplicationServiceTests.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/ImportExportApplicationServiceTests.java @@ -832,6 +832,28 @@ public class ImportExportApplicationServiceTests { .verifyComplete(); } + @Test + @WithUserDetails(value = "api_user") + public void importApplication_WithoutThemes_LegacyThemesAssigned() { + FilePart filePart = createFilePart("test_assets/ImportExportServiceTest/valid-application-without-theme.json"); + + Organization newOrganization = new Organization(); + newOrganization.setName("Template Organization"); + + final Mono resultMono = organizationService.create(newOrganization) + .flatMap(organization -> importExportApplicationService + .extractFileAndSaveApplication(organization.getId(), filePart) + ); + + StepVerifier + .create(resultMono) + .assertNext(application -> { + assertThat(application.getEditModeThemeId()).isNotEmpty(); + assertThat(application.getPublishedModeThemeId()).isNotEmpty(); + }) + .verifyComplete(); + } + @Test @WithUserDetails(value = "api_user") public void importApplication_withoutPageIdInActionCollection_succeeds() { diff --git a/app/server/appsmith-server/src/test/resources/test_assets/ImportExportServiceTest/valid-application-without-theme.json b/app/server/appsmith-server/src/test/resources/test_assets/ImportExportServiceTest/valid-application-without-theme.json new file mode 100644 index 0000000000..c8261caf1b --- /dev/null +++ b/app/server/appsmith-server/src/test/resources/test_assets/ImportExportServiceTest/valid-application-without-theme.json @@ -0,0 +1,632 @@ +{ + "exportedApplication": { + "userPermissions": [ + "canComment:applications", + "manage:applications", + "read:applications", + "publish:applications", + "makePublic:applications" + ], + "name": "valid_application", + "isPublic": false, + "appIsExample": false, + "color": "#EA6179", + "icon": "medical", + "new": true + }, + "datasourceList": [ + { + "userPermissions": [ + "execute:datasources", + "manage:datasources", + "read:datasources" + ], + "name": "db-auth", + "pluginId": "mongo-plugin", + "gitSyncId": "datasource1_git", + "datasourceConfiguration": { + "connection": { + "mode": "READ_WRITE", + "type": "REPLICA_SET", + "ssl": { + "authType": "DEFAULT" + } + }, + "endpoints": [ + { + "host": "db-auth-uri.net" + } + ], + "sshProxyEnabled": false, + "properties": [ + { + "key": "Use Mongo Connection String URI", + "value": "No" + } + ] + }, + "invalids": [], + "isValid": true, + "new": true + }, + { + "userPermissions": [ + "execute:datasources", + "manage:datasources", + "read:datasources" + ], + "name": "api_ds_wo_auth", + "pluginId": "restapi-plugin", + "gitSyncId": "datasource2_git", + "datasourceConfiguration": { + "sshProxyEnabled": false, + "properties": [ + { + "key": "isSendSessionEnabled", + "value": "N" + }, + { + "key": "sessionSignatureKey", + "value": "" + } + ], + "url": "https://api-ds-wo-auth-uri.com", + "headers": [] + }, + "invalids": [], + "isValid": true, + "new": true + } + ], + "pageList": [ + { + "userPermissions": [ + "read:pages", + "manage:pages" + ], + "gitSyncId": "page1_git", + "applicationId": "valid_application", + "unpublishedPage": { + "name": "Page1", + "layouts": [ + { + "id": "60aca056136c4b7178f67906", + "userPermissions": [], + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 1280, + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 800, + "containerStyle": "none", + "snapRows": 33, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 4, + "minHeight": 840, + "parentColumnSpace": 1, + "dynamicTriggerPathList": [], + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "widgetName": "Table1", + "columnOrder": [ + "_id", + "username", + "active" + ], + "dynamicPropertyPathList": [], + "topRow": 4, + "bottomRow": 15, + "parentRowSpace": 40, + "type": "TABLE_WIDGET", + "parentColumnSpace": 77.5, + "dynamicTriggerPathList": [], + "dynamicBindingPathList": [ + { + "key": "tableData" + }, + { + "key": "primaryColumns._id.computedValue" + }, + { + "key": "primaryColumns.username.computedValue" + }, + { + "key": "primaryColumns.active.computedValue" + } + ], + "leftColumn": 0, + "primaryColumns": { + "appsmith_mongo_escape_id": { + "isDerived": false, + "computedValue": "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow._id ))}}", + "textSize": "PARAGRAPH", + "index": 4, + "isVisible": true, + "label": "_id", + "columnType": "text", + "horizontalAlignment": "LEFT", + "width": 150, + "enableFilter": true, + "enableSort": true, + "id": "_id", + "verticalAlignment": "CENTER" + }, + "active": { + "isDerived": false, + "computedValue": "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.active ))}}", + "textSize": "PARAGRAPH", + "index": 8, + "isVisible": true, + "label": "active", + "columnType": "text", + "horizontalAlignment": "LEFT", + "width": 150, + "enableFilter": true, + "enableSort": true, + "id": "active", + "verticalAlignment": "CENTER" + }, + "username": { + "isDerived": false, + "computedValue": "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.username ))}}", + "textSize": "PARAGRAPH", + "index": 7, + "isVisible": true, + "label": "username", + "columnType": "text", + "horizontalAlignment": "LEFT", + "width": 150, + "enableFilter": true, + "enableSort": true, + "id": "username", + "verticalAlignment": "CENTER" + } + }, + "derivedColumns": {}, + "rightColumn": 8, + "textSize": "PARAGRAPH", + "widgetId": "aisibaxwhb", + "tableData": "{{get_users.data}}", + "isVisible": true, + "label": "Data", + "searchKey": "", + "version": 1, + "parentId": "0", + "isLoading": false, + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnSizeMap": { + "task": 245, + "step": 62, + "status": 75 + } + }, + { + "widgetName": "Form1", + "backgroundColor": "white", + "rightColumn": 16, + "widgetId": "ut3l54pzqw", + "topRow": 4, + "bottomRow": 11, + "parentRowSpace": 40, + "isVisible": true, + "type": "FORM_WIDGET", + "parentId": "0", + "isLoading": false, + "parentColumnSpace": 77.5, + "leftColumn": 9, + "children": [ + { + "widgetName": "Canvas1", + "rightColumn": 542.5, + "detachFromLayout": true, + "widgetId": "mcsltg1l0j", + "containerStyle": "none", + "topRow": 0, + "bottomRow": 320, + "parentRowSpace": 1, + "isVisible": true, + "canExtend": false, + "type": "CANVAS_WIDGET", + "version": 1, + "parentId": "ut3l54pzqw", + "minHeight": 520, + "isLoading": false, + "parentColumnSpace": 1, + "leftColumn": 0, + "children": [ + { + "widgetName": "Text1", + "rightColumn": 6, + "textAlign": "LEFT", + "widgetId": "7b4x786lxp", + "topRow": 0, + "bottomRow": 1, + "isVisible": true, + "fontStyle": "BOLD", + "type": "TEXT_WIDGET", + "textColor": "#231F20", + "version": 1, + "parentId": "mcsltg1l0j", + "isLoading": false, + "leftColumn": 0, + "fontSize": "HEADING1", + "text": "Form" + }, + { + "widgetName": "Text2", + "rightColumn": 16, + "textAlign": "LEFT", + "widgetId": "d0axuxiosp", + "topRow": 3, + "bottomRow": 6, + "parentRowSpace": 40, + "isVisible": true, + "fontStyle": "BOLD", + "type": "TEXT_WIDGET", + "textColor": "#231F20", + "version": 1, + "parentId": "mcsltg1l0j", + "isLoading": false, + "parentColumnSpace": 31.40625, + "dynamicTriggerPathList": [], + "leftColumn": 0, + "dynamicBindingPathList": [ + { + "key": "text" + } + ], + "fontSize": "PARAGRAPH2", + "text": "{{api_wo_auth.data.body}}" + }, + { + "widgetName": "Text3", + "rightColumn": 4, + "textAlign": "LEFT", + "widgetId": "lmfer0622c", + "topRow": 2, + "bottomRow": 3, + "parentRowSpace": 40, + "isVisible": true, + "fontStyle": "BOLD", + "type": "TEXT_WIDGET", + "textColor": "#231F20", + "version": 1, + "parentId": "mcsltg1l0j", + "isLoading": false, + "parentColumnSpace": 31.40625, + "dynamicTriggerPathList": [], + "leftColumn": 0, + "dynamicBindingPathList": [ + { + "key": "text" + } + ], + "fontSize": "PARAGRAPH", + "text": "{{api_wo_auth.data.id}}" + } + ] + } + ] + } + ] + }, + "layoutOnLoadActions": [ + [ + { + "id": "60aca24c136c4b7178f6790d", + "name": "api_wo_auth", + "pluginType": "API", + "jsonPathKeys": [], + "timeoutInMillisecond": 10000 + }, + { + "id": "60aca092136c4b7178f6790a", + "name": "get_users", + "pluginType": "DB", + "jsonPathKeys": [], + "timeoutInMillisecond": 10000 + } + ] + ], + "new": false + } + ], + "userPermissions": [] + }, + "publishedPage": { + "name": "Page1", + "layouts": [ + { + "id": "60aca056136c4b7178f67906", + "userPermissions": [], + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 1224, + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 1254, + "containerStyle": "none", + "snapRows": 33, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 4, + "minHeight": 1292, + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [] + }, + "new": false + } + ], + "userPermissions": [] + }, + "new": true + }, + { + "userPermissions": [ + "read:pages", + "manage:pages" + ], + "gitSyncId": "page2_git", + "applicationId": "valid_application", + "unpublishedPage": { + "name": "Page2", + "layouts": [ + { + "id": "60aca056136c4b7178f67999", + "userPermissions": [], + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 1280, + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 800, + "containerStyle": "none", + "snapRows": 33, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 4, + "minHeight": 840, + "parentColumnSpace": 1, + "dynamicTriggerPathList": [], + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [] + }, + "layoutOnLoadActions": [ + [] + ], + "new": false + } + ], + "userPermissions": [] + }, + "new": true + } + ], + "actionList": [ + { + "id": "60aca092136c4b7178f6790a", + "userPermissions": [], + "applicationId": "valid_application", + "pluginType": "DB", + "pluginId": "mongo-plugin", + "gitSyncId": "action1_git", + "unpublishedAction": { + "name": "get_users", + "datasource": { + "id": "db-auth", + "userPermissions": [], + "isValid": true, + "new": false + }, + "pageId": "Page1", + "actionConfiguration": { + "timeoutInMillisecond": 10000, + "paginationType": "NONE", + "encodeParamsToggle": true, + "body": "{\n \"find\": \"users\",\n \"sort\": {\n \"id\": 1\n },\n \"limit\": 10\n}", + "pluginSpecifiedTemplates": [ + { + "value": false + } + ] + }, + "executeOnLoad": true, + "dynamicBindingPathList": [], + "isValid": true, + "invalids": [], + "jsonPathKeys": [], + "confirmBeforeExecute": false, + "userPermissions": [] + }, + "publishedAction": { + "datasource": { + "userPermissions": [], + "isValid": true, + "new": true + }, + "confirmBeforeExecute": false, + "userPermissions": [] + }, + "new": false + }, + { + "id": "60aca24c136c4b7178f6790d", + "userPermissions": [], + "applicationId": "valid_application", + "pluginType": "API", + "pluginId": "restapi-plugin", + "gitSyncId": "action2_git", + "unpublishedAction": { + "name": "api_wo_auth", + "datasource": { + "id": "api_ds_wo_auth", + "userPermissions": [], + "isValid": true, + "new": false + }, + "pageId": "Page1", + "actionConfiguration": { + "timeoutInMillisecond": 10000, + "paginationType": "NONE", + "path": "/params", + "headers": [ + { + "key": "", + "value": "" + }, + { + "key": "", + "value": "" + } + ], + "encodeParamsToggle": true, + "queryParameters": [], + "body": "", + "httpMethod": "GET", + "pluginSpecifiedTemplates": [ + { + "value": false + } + ] + }, + "executeOnLoad": true, + "dynamicBindingPathList": [], + "isValid": true, + "invalids": [], + "jsonPathKeys": [], + "confirmBeforeExecute": false, + "userPermissions": [] + }, + "publishedAction": { + "datasource": { + "userPermissions": [], + "isValid": true, + "new": true + }, + "confirmBeforeExecute": false, + "userPermissions": [] + }, + "new": false + }, + { + "id": "61518b8548b30155375f5275", + "userPermissions": [ + "read:actions", + "execute:actions", + "manage:actions" + ], + "pluginType": "JS", + "pluginId": "js-plugin", + "unpublishedAction": { + "name": "run", + "fullyQualifiedName": "JSObject1.run", + "datasource": { + "userPermissions": [], + "name": "UNUSED_DATASOURCE", + "pluginId": "js-plugin", + "isValid": true, + "new": true + }, + "pageId": "Page1", + "collectionId": "61518b8548b30155375f5276", + "actionConfiguration": { + "timeoutInMillisecond": 10000, + "paginationType": "NONE", + "encodeParamsToggle": true, + "body": "() => {\n\t\t//write code here\n\t\treturn \"Hi\"\n\t}", + "jsArguments": [], + "isAsync": false + }, + "executeOnLoad": false, + "isValid": true, + "invalids": [], + "jsonPathKeys": [ + "() => {\n\t\t//write code here\n\t\treturn \"Hi\"\n\t}" + ], + "confirmBeforeExecute": false, + "userPermissions": [], + "validName": "JSObject1.run" + }, + "publishedAction": { + "datasource": { + "userPermissions": [], + "isValid": true, + "new": true + }, + "confirmBeforeExecute": false, + "userPermissions": [] + }, + "gitSyncId": "614b5f42a25cb80bca4ccf35_2021-09-27T09:14:45.330186Z", + "new": false + } + ], + "actionCollectionList": [ + { + "id": "61518b8548b30155375f5276", + "userPermissions": [ + "read:actions", + "execute:actions", + "manage:actions" + ], + "unpublishedCollection": { + "name": "JSObject1", + "pageId": "Page1", + "pluginId": "js-plugin", + "pluginType": "JS", + "actions": [], + "archivedActions": [], + "body": "export default {\n\tresults: [],\n\trun: () => {\n\t\t//write code here\n\t\treturn \"Hi\"\n\t}\n}", + "variables": [ + { + "name": "results", + "value": [] + } + ] + }, + "new": false + } + ], + "decryptedFields": { + "db-auth": { + "password": "CreativePassword", + "authType": "com.appsmith.external.models.DBAuth", + "dbAuth": { + "authenticationType": "dbAuth", + "authType": "SCRAM_SHA_1", + "username": "CreativeUser", + "databaseName": "db-name" + } + } + }, + "publishedDefaultPageName": "Page1", + "unpublishedDefaultPageName": "Page1", + "publishedLayoutmongoEscapedWidgets": { + "60aca056136c4b7178f67906": [ + "Table1" + ] + }, + "unpublishedLayoutmongoEscapedWidgets": { + "60aca056136c4b7178f67906": [ + "Table1" + ] + } +} \ No newline at end of file