Fixed check for incorrect dynamic bindings (#1775)
* Fixed check for incorrect dynamic bindings
This commit is contained in:
parent
f36adeb6b5
commit
941be8c58d
|
|
@ -17,6 +17,7 @@ public class FieldName {
|
|||
public static String PLUGIN = "plugin";
|
||||
public static String DEFAULT_PAGE_NAME = "Page1";
|
||||
public static String TYPE = "type";
|
||||
public static final String WIDGET_ID = "widgetId";
|
||||
public static String WIDGET_NAME = "widgetName";
|
||||
public static String DYNAMIC_BINDINGS = "dynamicBindings";
|
||||
public static String DYNAMIC_BINDING_PATH_LIST = "dynamicBindingPathList";
|
||||
|
|
|
|||
|
|
@ -455,10 +455,13 @@ public class LayoutActionServiceImpl implements LayoutActionService {
|
|||
}
|
||||
}
|
||||
if (parent == null) {
|
||||
throw new AppsmithException(AppsmithError.INVALID_DYNAMIC_BINDING_REFERENCE, nextKey);
|
||||
log.error("Unable to find dynamically bound key {} for the widget with id {}", nextKey, dsl.get(FieldName.WIDGET_ID));
|
||||
break;
|
||||
}
|
||||
}
|
||||
dynamicBindings.addAll(MustacheHelper.extractMustacheKeysFromFields(parent));
|
||||
if(parent != null) {
|
||||
dynamicBindings.addAll(MustacheHelper.extractMustacheKeysFromFields(parent));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -480,9 +480,13 @@ public class LayoutServiceTest {
|
|||
|
||||
StepVerifier
|
||||
.create(testMono)
|
||||
.expectErrorMatches(throwable -> throwable instanceof AppsmithException &&
|
||||
throwable.getMessage().equals(AppsmithError.INVALID_DYNAMIC_BINDING_REFERENCE.getMessage("dynamicGet_IncorrectKey")))
|
||||
.verify();
|
||||
.assertNext(layout -> {
|
||||
assertThat(layout).isNotNull();
|
||||
assertThat(layout.getId()).isNotNull();
|
||||
assertThat(layout.getDsl().get("key")).isEqualTo("value-updated");
|
||||
assertThat(layout.getLayoutOnLoadActions()).hasSize(0);
|
||||
})
|
||||
.verifyComplete();
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user