Skip to content

Ticket3396 show global macros#1829

Open
Chsudeepta wants to merge 11 commits intomasterfrom
Ticket3396_ShowGlobalMacros
Open

Ticket3396 show global macros#1829
Chsudeepta wants to merge 11 commits intomasterfrom
Ticket3396_ShowGlobalMacros

Conversation

@Chsudeepta
Copy link
Contributor

Description of work

GUI changes to show macro setting from globals.txt

Ticket

This address the issue described here

Acceptance criteria

  1. The GUI should show the globals.txt macro settings in a separate tab in the edit/view configuration dialog.
  2. The data should be shown in a sortable table.
  3. The code should acceptable coding standards.

Code Review

Final Steps

Comment on lines 67 to 72
macros = (globalmacros == null) ? new ArrayList<>()
: globalmacros.stream().sorted().filter(Objects::nonNull)
.flatMap(macro -> macro.getMacros().entrySet().stream().sorted(Map.Entry.comparingByKey()).map(
entry -> new GlobalMacroViewModel(macro.getName(), entry.getKey(), entry.getValue())))
.collect(Collectors.toList());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
macros = (globalmacros == null) ? new ArrayList<>()
: globalmacros.stream().sorted().filter(Objects::nonNull)
.flatMap(macro -> macro.getMacros().entrySet().stream().sorted(Map.Entry.comparingByKey()).map(
entry -> new GlobalMacroViewModel(macro.getName(), entry.getKey(), entry.getValue())))
.collect(Collectors.toList());
}
if (globalmacros == null) {
macros = new ArrayList<>();
return;
}
macros = globalmacros.stream()
.sorted()
.filter(Objects::nonNull)
.flatMap(macro ->macro.getMacros()
.entrySet()
.stream()
.sorted(Map.Entry.comparingByKey())
.map(entry -> new GlobalMacroViewModel(
macro.getName(),
entry.getKey(),
entry.getValue()
))
)
.collect(Collectors.toList());
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reformatted the code

* @param configuresBlockGWAndArchiver True this configuration includes the block gateway and archive files;
* False these are generated by the block server
*/
public Configuration(String name, String description, String defaultSynoptic, Collection<Ioc> iocs,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try deleting this constructor.

* @param macroValue The Macro Value.
*/
public GlobalMacroViewModel(String iocName, String macroName, String macroValue) {
this.iocName = !IOC_SEPARATOR.equals(iocName) ? iocName : ALL_IOCS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of IOC_SEPARATOR we could use something like <All IOCs> to make it much easier to understand?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IOC_SEPARATOR is __ as it is used in the globals.txt. The logic additionally expects that if a macro value is true for all IOCs, then the block server will group them under the name __, ie without any IOC name

@Chsudeepta Chsudeepta self-assigned this Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants