Merge branch 'release' of https://github.com/appsmithorg/appsmith into release
This commit is contained in:
commit
fffe8e6230
|
|
@ -12,5 +12,6 @@ import java.util.Set;
|
|||
public class ActionViewDTO {
|
||||
String id;
|
||||
String name;
|
||||
String pageId;
|
||||
Set<String> jsonPathKeys;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -537,8 +537,13 @@ public class ActionServiceImpl extends BaseService<ActionRepository, Action, Str
|
|||
ActionViewDTO actionViewDTO = new ActionViewDTO();
|
||||
actionViewDTO.setId(action.getId());
|
||||
actionViewDTO.setName(action.getName());
|
||||
actionViewDTO.setJsonPathKeys(new HashSet<>());
|
||||
actionViewDTO.getJsonPathKeys().addAll(action.getJsonPathKeys());
|
||||
actionViewDTO.setPageId(action.getPageId());
|
||||
if (action.getJsonPathKeys() != null && !action.getJsonPathKeys().isEmpty()) {
|
||||
Set<String> jsonPathKeys;
|
||||
jsonPathKeys = new HashSet<>();
|
||||
jsonPathKeys.addAll(action.getJsonPathKeys());
|
||||
actionViewDTO.setJsonPathKeys(jsonPathKeys);
|
||||
}
|
||||
return actionViewDTO;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,10 +44,8 @@ import reactor.test.StepVerifier;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.appsmith.server.acl.AclPermission.MANAGE_ACTIONS;
|
||||
import static com.appsmith.server.acl.AclPermission.READ_ACTIONS;
|
||||
|
|
@ -472,17 +470,33 @@ public class ActionServiceTest {
|
|||
action.setActionConfiguration(actionConfiguration);
|
||||
action.setDatasource(datasource);
|
||||
|
||||
Action action1 = new Action();
|
||||
action1.setName("actionInViewModeWithoutMustacheKey");
|
||||
action1.setPageId(testPage.getId());
|
||||
ActionConfiguration actionConfiguration1 = new ActionConfiguration();
|
||||
actionConfiguration1.setHttpMethod(HttpMethod.GET);
|
||||
action1.setActionConfiguration(actionConfiguration1);
|
||||
action1.setDatasource(datasource);
|
||||
|
||||
Mono<List<ActionViewDTO>> actionsListMono = actionService.create(action)
|
||||
.then(actionService.create(action1))
|
||||
.then(actionService.getActionsForViewMode(testApp.getId()).collectList());
|
||||
|
||||
StepVerifier
|
||||
.create(actionsListMono)
|
||||
.assertNext(actionsList -> {
|
||||
assertThat(actionsList.size()).isGreaterThan(0);
|
||||
ActionViewDTO actionViewDTO = actionsList.stream().filter(action1 -> action1.getName().equals(action.getName())).findFirst().get();
|
||||
ActionViewDTO actionViewDTO = actionsList.stream().filter(dto -> dto.getName().equals(action.getName())).findFirst().get();
|
||||
|
||||
assertThat(actionViewDTO).isNotNull();
|
||||
assertThat(actionViewDTO.getJsonPathKeys()).containsAll(Set.of(key));
|
||||
assertThat(actionViewDTO.getPageId()).isEqualTo(testPage.getId());
|
||||
|
||||
ActionViewDTO actionViewDTO1 = actionsList.stream().filter(dto -> dto.getName().equals(action1.getName())).findFirst().get();
|
||||
|
||||
assertThat(actionViewDTO1).isNotNull();
|
||||
assertThat(actionViewDTO1.getJsonPathKeys()).isNullOrEmpty();
|
||||
assertThat(actionViewDTO1.getPageId()).isEqualTo(testPage.getId());
|
||||
})
|
||||
.verifyComplete();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user