Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend sitemap syntax for switch to support press & release buttons #4183

Merged
merged 3 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
* @author Kai Kreuzer - Initial contribution
* @author Laurent Garnier - New fields position and icon
* @author Laurent Garnier - Replace field position by fields row and column
* @author Laurent Garnier - New field releaseCommand
*/
public class MappingDTO {

public Integer row;
public Integer column;
public String command;
public String releaseCommand;
public String label;
public String icon;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
* @author Laurent Garnier - Added icon field for mappings used for switch element
* @author Laurent Garnier - Support added for multiple AND conditions in labelcolor/valuecolor/visibility
* @author Laurent Garnier - New widget icon parameter based on conditional rules
* @author Laurent Garnier - Added releaseCmd field for mappings used for switch element
*/
@Component(service = { RESTResource.class, EventSubscriber.class })
@JaxrsResource
Expand Down Expand Up @@ -565,6 +566,7 @@ private PageDTO createPageBean(String sitemapName, @Nullable String title, @Null
for (Mapping mapping : switchWidget.getMappings()) {
MappingDTO mappingBean = new MappingDTO();
mappingBean.command = mapping.getCmd();
mappingBean.releaseCommand = mapping.getReleaseCmd();
mappingBean.label = mapping.getLabel();
mappingBean.icon = mapping.getIcon();
bean.mappings.add(mappingBean);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Button:
row=INT ':' column=INT ':' cmd=Command '=' label=(ID | STRING) ('=' icon=Icon)?;

Mapping:
cmd=Command '=' label=(ID | STRING) ('=' icon=Icon)?;
cmd=Command (':' releaseCmd=Command)? '=' label=(ID | STRING) ('=' icon=Icon)?;

VisibilityRule:
conditions+=Condition ('AND' conditions+=Condition)*;
Expand Down