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

Tabs refactor #257

Merged
merged 22 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
636eae4
moved help page to a dialog
clemiller Dec 14, 2020
700086e
update nav version to 4.2
clemiller Dec 14, 2020
05a2523
removed help tab template
clemiller Dec 14, 2020
c0b1545
moved SVG export interface to a dialog window
clemiller Dec 14, 2020
68c3ac7
added comments to tabs component for readability
clemiller Dec 15, 2020
c3ae524
removed dynamic tabs directive
clemiller Dec 15, 2020
684003b
Merge branch 'develop' into bugs/tabs-refactor
clemiller Dec 29, 2020
497edb0
fix for dialog imports
clemiller Jan 4, 2021
7f90097
fix for accessing a private service from html
clemiller Jan 4, 2021
6c76a5e
removed TabComponent; added Tab class to TabsComponent
clemiller Jan 4, 2021
094dc27
updated version in package and package-lock
clemiller Jan 4, 2021
484cfd4
removed dead code
clemiller Jan 6, 2021
c5dbc17
close button for help and exporter dialogs
clemiller Jan 6, 2021
8fe4bd0
updated SVG exporter style
clemiller Jan 11, 2021
05f1722
updated tab title
clemiller Jan 12, 2021
96edfde
fixed bug causing help dialog to close when clicking a relative link
clemiller Jan 13, 2021
030b8a2
added class to section hyperlinks
clemiller Jan 14, 2021
465429d
updated changelog for 254
clemiller Jan 14, 2021
a281b92
bug fix for #258
clemiller Jan 28, 2021
6055b4e
add unsubscribes, refactor how active tab is tracked for efficiency
isaisabel Feb 1, 2021
5eb19d7
xmerging in tabs refactor
isaisabel Feb 1, 2021
4941ddd
Merge pull request #263 from mitre-attack/bugs/tabs-refactor-subscrip…
clemiller Feb 1, 2021
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: 2 additions & 2 deletions layers/LAYERFORMATv4_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This document describes **Version 4.1** of the MITRE ATT&CK Navigator Layer file
| Name | Type | Required? | Default Value (if not present) | Description |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| attack | String | No | Current version of ATT&CK: "8" | ATT&CK version of this layer |
| navigator | String | Yes | | Must be "4.1" |
| navigator | String | Yes | | Must be "4.2" |
| layer | String | Yes | | Must be "4.1" |

## Technique Object properties
Expand Down Expand Up @@ -90,7 +90,7 @@ The following example illustrates the layer file format:
"name": "example layer",
"versions": {
"attack": "8",
"navigator": "4.1",
"navigator": "4.2",
"layer": "4.1"
},
"domain": "enterprise-attack",
Expand Down
2 changes: 1 addition & 1 deletion nav-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nav-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "git",
"url": "https://github.com/mitre-attack/attack-navigator.git"
},
"version": "4.1.0",
"version": "4.2.0",
"license": "Apache-2.0",
"scripts": {
"ng": "ng",
Expand Down
6 changes: 1 addition & 5 deletions nav-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import { HttpClientModule } from '@angular/common/http';
import { AppComponent } from './app.component';
import { DataTableComponent } from './datatable/data-table.component';
import { TabsComponent } from './tabs/tabs.component';
import { DynamicTabsDirective } from './tabs/dynamic-tabs.directive';
import { TabComponent } from './tab/tab.component';
import { HelpComponent } from './help/help.component';
import { ExporterComponent } from './exporter/exporter.component';
import { TechniqueCellComponent } from './matrix/technique-cell/technique-cell.component';
Expand All @@ -41,8 +39,6 @@ import { VersionUpgradeComponent } from './version-upgrade/version-upgrade.compo
AppComponent,
DataTableComponent,
TabsComponent,
TabComponent,
DynamicTabsDirective,
HelpComponent,
ExporterComponent,
TechniqueCellComponent,
Expand Down Expand Up @@ -83,6 +79,6 @@ import { VersionUpgradeComponent } from './version-upgrade/version-upgrade.compo
],
providers: [],
bootstrap: [AppComponent],
entryComponents: [ TabComponent, VersionUpgradeComponent ]
entryComponents: [ VersionUpgradeComponent, HelpComponent, ExporterComponent ]
})
export class AppModule { }
2 changes: 1 addition & 1 deletion nav-app/src/app/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export class DataService {
if (domain) {
this.getDomainData(domain, refresh).subscribe((data: Object[]) => {
this.parseBundle(domain, data);
resolve();
resolve(null);
});
} else if (!domain) { // domain not defined in config
reject("'" + domainID + "' is not a valid domain.")
Expand Down
5 changes: 1 addition & 4 deletions nav-app/src/app/datatable/data-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,6 @@ export class DataTableComponent implements AfterViewInit {
* open an export layer render tab for the current layer
*/
exportRender(): void {
let viewModelCopy = new ViewModel(this.viewModel.name, "vm" + this.viewModelsService.getNonce(), this.viewModel.domainID, this.dataService);
viewModelCopy.deSerialize(this.viewModel.serialize());
// let exportData = new ExportData(viewModelCopy, JSON.parse(JSON.stringify(this.tactics)), this.dataService.tacticNames(this.filteredTechniques), JSON.parse(JSON.stringify(this.filteredTechniques)));
this.tabs.newExporterTab(this.viewModel);
this.tabs.openSVGDialog(this.viewModel);
clemiller marked this conversation as resolved.
Show resolved Hide resolved
}
}
4 changes: 4 additions & 0 deletions nav-app/src/app/exporter/exporter.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,7 @@
<div class="svgcontainer" [id]="'svgInsert' + viewModel.uid">
loading...
</div>

<div class="close-button">
<button mat-button mat-dialog-close>close</button>
</div>
16 changes: 15 additions & 1 deletion nav-app/src/app/exporter/exporter.component.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
@import "../../colors.scss";

.svgcontainer {
overflow-x: auto
overflow-x: auto;
text-align: center;
min-height: 60vh;
max-height: 60vh;
min-width: 75vw;
max-width: 75vw;
padding:25px;
}

.close-button {
margin-top: 25px;
margin-bottom: 25px;
text-align: center;
}

.dropdown-container {
Expand Down
23 changes: 14 additions & 9 deletions nav-app/src/app/exporter/exporter.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, Input, AfterContentInit } from '@angular/core';
import { Component, OnInit, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ViewModel, TechniqueVM } from "../viewmodels.service";
import { ConfigService } from "../config.service";
import { Technique, DataService, Tactic, Matrix } from '../data.service';
Expand All @@ -12,20 +13,22 @@ import { ColorPickerModule } from 'ngx-color-picker';
templateUrl: './exporter.component.html',
styleUrls: ['./exporter.component.scss']
})
export class ExporterComponent implements AfterContentInit {

export class ExporterComponent implements OnInit {
public currentDropdown: string = null;

@Input() viewModel: ViewModel;

viewModel: ViewModel;
public config: any = {}

public isIE() {
return is.ie();
}

private svgDivName = "svgInsert_tmp"
unitEnum = 0; //counter for unit change ui element
constructor(public configService: ConfigService, private dataService: DataService) {
constructor(private dialogRef: MatDialogRef<ExporterComponent>,
private configService: ConfigService,
private dataService: DataService,
@Inject(MAT_DIALOG_DATA) public data) {
this.config = {
"width": 11,
"height": 8.5,
Expand All @@ -52,10 +55,12 @@ export class ExporterComponent implements AfterContentInit {
"showAbout": true,
"showDomain": true,
}
}
}

ngAfterContentInit() {
ngOnInit() {
this.viewModel = this.data.vm;
this.svgDivName = "svgInsert" + this.viewModel.uid;

let self = this;
//determine if the layer has any scores
for (let matrix of this.dataService.getDomain(this.viewModel.domainID).matrices) {
Expand Down
2 changes: 1 addition & 1 deletion nav-app/src/app/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
//
'use strict';

export const nav_version: string="4.1"
export const nav_version: string="4.2"
clemiller marked this conversation as resolved.
Show resolved Hide resolved
export const layer_version: string="4.1"
Loading