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

Allow custom adaptation actions to be added to the actions dropdown #99

Merged
merged 4 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions cws-ui/src/main/webapp/js/adaptation-process-actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// overwrite with js code in your adaptation project
Copy link
Contributor

Choose a reason for hiding this comment

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

minor thing, but should really say "override" instead of "overwrite"

function updateAdaptationActionList() {
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would make it explicit here, to further inform users of what is going on, by using:
return; // CWS core behavior is to do nothing here

}
1 change: 1 addition & 0 deletions install/cws-ui/adaptation-process-actions.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- override with adaptation actions -->
6 changes: 6 additions & 0 deletions install/cws-ui/processes.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<script src="/${base}/js/jquery.min.js"></script>
<script src="/${base}/js/bootstrap.min.js"></script>
<script src="/${base}/js/bootstrap-datepicker.min.js"></script>
<!-- Custom js adaptation script; overwrite this file from your adaptation project -->
<script src="/${base}/js/adaptation-process-actions.js"></script>
<link href="/${base}/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/${base}/css/dashboard.css" rel="stylesheet">
Expand Down Expand Up @@ -148,6 +150,7 @@
<li id="action_retry_incident" class="disabled" role="presentation"><a role="menuitem" href="javascript:action_retry_incident_rows();">Retry all selected incident rows (all rows selected must be 'incident')</a></li>
<li id="action_retry_failed_to_start" class="disabled" role="presentation"><a role="menuitem" href="javascript:action_retry_failed_to_start();">Retry all selected failed to start rows (all rows selected must be 'failedToStart')</a></li>
<li id="action_mark_as_resolved" class="disabled" role="presentation"><a role="menuitem" href="javascript:action_mark_as_resolved();">Mark all selected failed rows as resolved (all rows selected must be 'fail')</a></li>
<#include "adaptation-process-actions.ftl">
</ul>
</div>
<div id="hide-subprocs-div">
Expand Down Expand Up @@ -555,6 +558,9 @@
else if (failed) {
$("#action_mark_as_resolved").removeClass("disabled");
}

// Execute adaptation actions if any
updateAdaptationActionList();
}


Expand Down