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

Handle Undefined Ability in Adversary Profile #2574

Merged
merged 10 commits into from May 27, 2022
Merged

Conversation

ZacharyLPalmer
Copy link
Contributor

Description

Previously an "undefined ability" (An ability ID in the atomic ordering the .yml file that does not map to a known ability) would cause the UI to lock up and require a page reload. This PR resolves that lock up and adds a series of UI indicators to inform the user of the problem. Specifically a Icon and error message appears at the bottom of the Ability table. Also the undefined abilities are highlighted in red and call out the unknown Ability ID from the .yml file. This change also involved changing the look of the "unmet requirements" call out from a red outline to a orange outline to better fit the icons in use.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I added multiple "bogus" Ability IDs in the .yml file (data/adversaries/ade13716-230a-48ea-a9b6-2446c83fe716.yml) and verified that they locked up the page before. After my fix I verified that they no longer lock up the page or cause any unexpected behavior to occur.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code

Screenshots of new callouts:

Undefined Ability and Unmet Requirements:
Screen Shot 2022-05-10 at 8 37 45 AM

Undefined Ability:
Screen Shot 2022-05-10 at 8 37 34 AM

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Wohoo! Your first PR -- thanks for contributing!

@sonarcloud
Copy link

sonarcloud bot commented May 10, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@ZacharyLPalmer ZacharyLPalmer removed the request for review from iguannalin May 16, 2022 13:08
Copy link
Contributor

@argaudreau argaudreau left a comment

Choose a reason for hiding this comment

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

Clean code and clean interface -- great work! The feature itself works well, just a couple of minor comments. There are also a couple of console errors that pop up when I load the "Advanced Thief" adversary:
Screen Shot 2022-05-16 at 9 57 04 AM
Screen Shot 2022-05-16 at 9 56 57 AM

Those functions likely just need a catch for if a property is undefined since they don'
t affect how the page works.

static/css/lib/custom-bulma.css Outdated Show resolved Hide resolved
templates/adversaries.html Outdated Show resolved Hide resolved
argaudreau
argaudreau previously approved these changes May 19, 2022
Copy link
Contributor

@argaudreau argaudreau left a comment

Choose a reason for hiding this comment

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

Works great and the code is super clean, well done!

@argaudreau argaudreau self-requested a review May 25, 2022 13:31
@sonarcloud
Copy link

sonarcloud bot commented May 27, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@argaudreau argaudreau enabled auto-merge (squash) May 27, 2022 17:09
@argaudreau argaudreau merged commit a966833 into master May 27, 2022
@argaudreau argaudreau deleted the handle-missing-ability branch May 27, 2022 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants