Skip to content

Commit

Permalink
Update DisplayTab.java
Browse files Browse the repository at this point in the history
verify if vip:dot values are one of the inputs
  • Loading branch information
sandepat authored Jul 1, 2024
1 parent f7619a2 commit f78e43e
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,25 @@ private static void verifyBoutiquesTool(BoutiquesApplication boutiquesTool)
* **/
private static void checkvipdot(BoutiquesApplication application) {
Set<String> commandLineFlags = application.getCommandLineFlag();

Set<String> vipDotInputIds = application.getVipDotInputIds();
Set<String> commonValues = new HashSet<>(application.getVipDotInputIds());

commonValues.retainAll(commandLineFlags);

if (!commonValues.isEmpty()) {
String warningMessage = "<b>" + String.join(", ", commonValues) + "</b> appears as command-line flag input(s), it should not be included in Dot iteration. Importing it may cause functionality issues, although the application will still be imported.";
Layout.getInstance().setWarningMessage(warningMessage);
}

// Extract the IDs from inputs
Set<String> inputIds = application.getInputs().stream().map(BoutiquesInput::getId).collect(Collectors.toSet());
// Check if all vipDotInputIds are in inputs
if (!inputIds.containsAll(vipDotInputIds)) {
Set<String> incorrectInputs = new HashSet<>(vipDotInputIds);
incorrectInputs.removeAll(inputIds);
String warningMessage = "<b>" + String.join(", ", incorrectInputs) + "</b> appears in vipDotInputIds but not in inputs. Please ensure all ids are correct.";
Layout.getInstance().setWarningMessage(warningMessage);
}
}

/**
Expand Down

0 comments on commit f78e43e

Please sign in to comment.