fix: Copy evaluation version for cloned application from the source application to fix dynamic binding evaluation to support escaped characters without double escapes (#10702)

This commit is contained in:
Abhijeet 2022-01-28 13:37:59 +05:30 committed by GitHub
parent 45d3704dda
commit 07082f6bde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -687,6 +687,7 @@ public class ApplicationPageServiceCEImpl implements ApplicationPageServiceCE {
Application newApplication = new Application(sourceApplication);
newApplication.setName(newName);
newApplication.setLastEditedAt(Instant.now());
newApplication.setEvaluationVersion(sourceApplication.getEvaluationVersion());
Mono<User> userMono = sessionUserService.getCurrentUser().cache();
// First set the correct policies for the new cloned application
return setApplicationPolicies(userMono, sourceApplication.getOrganizationId(), newApplication)

View File

@ -990,6 +990,9 @@ public class ApplicationServiceTest {
assertThat(clonedApplication.getOrganizationId().equals(orgId));
assertThat(clonedApplication.getModifiedBy()).isEqualTo("api_user");
assertThat(clonedApplication.getUpdatedAt()).isNotNull();
assertThat(clonedApplication.getEvaluationVersion()).isNotNull();
assertThat(clonedApplication.getEvaluationVersion()).isEqualTo(gitConnectedApp.getEvaluationVersion());
List<ApplicationPage> pages = clonedApplication.getPages();
Set<String> clonedPageIdsFromApplication = pages.stream().map(page -> page.getId()).collect(Collectors.toSet());
Set<String> clonedPageIdsFromDb = clonedPageList.stream().map(page -> page.getId()).collect(Collectors.toSet());