Possible fix to Issue #2315 (affects templates/abilities.html)#2321
Merged
Conversation
The REST API expects an ability object in which the cleanup field is an array (list) of strings. Currently, the "Create Ability" UI saves the cleanup command as a string, causing an Unprocessable Entity response status code (422) when executing the PUT request in API v2. This commit includes a slight change to the cleanup field in the Create Ability modal which converts a line-break separated list of cleanup commands to the correct type. The net effect of the change is to enable users to create and edit abilities which include cleanup commands through the UI and API v2.
Ensure correct typing in `transformCleanup` under the Alpine.js framework.
Redone cleanup commands to enable easy and intuitive addition and removal of cleanup commands.
Propagate change to ability modal to `profiles.html`.
Changes to create ability modal incorporating Adam's UI fixes and backend change to the cleanup field.
Incorporate the changes to the create ability modal to the `profiles.html` template.
mkultraWasHere
previously approved these changes
Oct 29, 2021
Contributor
mkultraWasHere
left a comment
There was a problem hiding this comment.
@CDJellen LGTM.
Lets have @argaudreau have final review of HTML.
argaudreau
previously approved these changes
Nov 1, 2021
Contributor
argaudreau
left a comment
There was a problem hiding this comment.
Works as intended and HTML is super clean! I hope alpine and bulma were easy to pick up.
d718e37
|
Kudos, SonarCloud Quality Gate passed! |
mkultraWasHere
approved these changes
Nov 2, 2021
argaudreau
approved these changes
Nov 2, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Possible fix to Issue #2315 (unable to create new ability)
Affects:
templates/abilities.htmlChange: ensure the executor.cleanup object conforms to the type expected by API v2.
Description
The REST API expects an ability object in which the cleanup field is an array (list) of strings. Currently, the "Create Ability" UI saves the cleanup command as a string, causing an Unprocessable Entity response status code (422) when executing the
PUTrequest in API v2.This commit includes a slight change to the cleanup field in the Create Ability modal which converts a line-break separated list of cleanup commands to the correct type. The net effect of the change is to enable users to create and edit abilities which include cleanup commands through the UI and API v2.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
My test abilityin accordance with the User Certificate in thetrainingplugin which:discoverytactic,sandcat.go-darwinas an executor,whoamicommand,ifconfig -aas a cleanup command;rm;GETrequest, verifying the changes to both abilities.Checklist: