UX: Improve validation error message when saving theme objects setting (#26455)

Why this change?

Before this change, the validation error message shown to the user when
saving a theme objects setting is very cryptic. This commit changes the
validation error messages to be displayed on top of the editor instead.

Note that I don't think this way of displaying is the ideal state we
want to get to but given the time we have this will do for now.
This commit is contained in:
Alan Guo Xiang Tan
2024-04-02 11:55:51 +08:00
committed by GitHub
parent e58110a9a0
commit 91f0c71720
7 changed files with 243 additions and 174 deletions

View File

@ -20,15 +20,19 @@ module PageObjects
expect(input_field_label(field_name)).to have_text(label)
end
def click_link(name)
def click_link(name, child: false)
find(
".schema-theme-setting-editor__navigation .schema-theme-setting-editor__tree-node.--child",
".schema-theme-setting-editor__navigation .schema-theme-setting-editor__tree-node#{child ? ".--child" : ".--parent"}",
text: name,
).click
self
end
def click_child_link(name)
click_link(name, child: true)
end
def fill_in_field(field_name, value)
input_field(field_name).fill_in(with: value)
self