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

Metadata underline #577

Merged
merged 3 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
## Improvements
- Added ability to render SVG export in dark mode. See issue [#564](https://github.com/mitre-attack/attack-navigator/pull/564).
- Updated Angular from 11.0.3 to 14.3.0.
- Added the ability to be able to select whether or not to display the metadata underline either by changing the config file or by using the customized navigator. See issue [#400](https://github.com/mitre-attack/attack-navigator/issues/400)

## Miscellaneous

Expand Down
5 changes: 4 additions & 1 deletion nav-app/src/app/matrix/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,12 @@ export abstract class Cell {
public getTechniqueUnderlineColor() {
if (this.tactic) {
let tvm = this.viewModel.getTechniqueVM(this.technique, this.tactic);
if (tvm.comment.length > 0 || tvm.metadata.length > 0 || this.hasNotes()) {
if (tvm.comment.length > 0 || this.hasNotes()) {
if (this.configService.getFeature('comment_underline')) return this.configService.comment_color;
}
if (tvm.metadata.length > 0) {
if (this.configService.getFeature('metadata_underline')) return this.configService.metadata_color;
}
if (tvm.links.length > 0) {
if (this.configService.getFeature('link_underline')) return this.configService.link_color;
}
Expand Down
2 changes: 2 additions & 0 deletions nav-app/src/app/services/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ContextMenuItem } from '../classes/context-menu-item';
export class ConfigService {
public comment_color = "yellow";
public link_color = "blue";
public metadata_color = "purple";
public banner: string;
private features = new Map<string, boolean>();
private featureGroups = new Map<string, string[]>();
Expand All @@ -34,6 +35,7 @@ export class ConfigService {
dataService.subtechniquesEnabled = self.getFeature("subtechniques");
self.featureStructure = config["features"];
self.comment_color = config["comment_color"];
self.metadata_color = config["metadata_color"];
self.link_color = config["link_color"];
self.banner = config["banner"];
for (let obj of config["custom_context_menu_items"]) {
Expand Down
2 changes: 2 additions & 0 deletions nav-app/src/assets/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@

"comment_color": "yellow",
"link_color": "blue",
"metadata_color": "purple",

"banner": "",

Expand Down Expand Up @@ -238,6 +239,7 @@
{"name": "scoring", "enabled": true, "description": "Disable to remove the ability to score techniques."},
{"name": "comments", "enabled": true, "description": "Disable to remove the ability to add comments to techniques."},
{"name": "comment_underline", "enabled": true, "description": "Disable to remove the comment underline effect on techniques."},
{"name": "metadata_underline", "enabled": true, "description": "Disable to remove the metadata underline effect on techniques."},
{"name": "links", "enabled": true, "description": "Disable to remove the ability to assign hyperlinks to techniques."},
{"name": "link_underline", "enabled": true, "description": "Disable to remove the hyperlink underline effect on techniques."},
{"name": "metadata", "enabled": true, "description": "Disable to remove the ability to add metadata to techniques."},
Expand Down