-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add stix ids to object view pages (#584)
* add stix ids to object pages * update to position of stix id * minor changes * css updates
- Loading branch information
Showing
10 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
10 changes: 5 additions & 5 deletions
10
app/src/app/components/stix/attackid-property/attackid-view/attackid-view.component.spec.ts
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# stixid-property | ||
`stixid-property.component` is used for displaying ATT&CK STIX IDs of an object. |
10 changes: 10 additions & 0 deletions
10
app/src/app/components/stix/stixid-property/stixid-property.component.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="stix-header text-deemphasis"> | ||
<div> | ||
{{config.object["stixID"]}} | ||
<button mat-icon-button class="mini-icon-button" [cdkCopyToClipboard]="stixIdLink" | ||
(click)="snackbar.open('STIX ID copied to clipboard', null, {duration: 1000})" | ||
matTooltip="copy STIX ID" aria-label="copy stixID"> | ||
<mat-icon>content_copy</mat-icon> | ||
</button> | ||
</div> | ||
</div> |
6 changes: 6 additions & 0 deletions
6
app/src/app/components/stix/stixid-property/stixid-property.component.scss
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.stix-header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: 14px; | ||
} |
25 changes: 25 additions & 0 deletions
25
app/src/app/components/stix/stixid-property/stixid-property.component.spec.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { StixIDPropertyComponent } from './stixid-property.component'; | ||
|
||
describe('StixidPropertyComponent', () => { | ||
let component: StixIDPropertyComponent; | ||
let fixture: ComponentFixture<StixIDPropertyComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ StixIDPropertyComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(StixIDPropertyComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
27 changes: 27 additions & 0 deletions
27
app/src/app/components/stix/stixid-property/stixid-property.component.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { MatSnackBar } from '@angular/material/snack-bar'; | ||
import { StixObject } from 'src/app/classes/stix/stix-object'; | ||
|
||
@Component({ | ||
selector: 'app-stixid-property', | ||
templateUrl: './stixid-property.component.html', | ||
styleUrls: ['./stixid-property.component.scss'] | ||
}) | ||
export class StixIDPropertyComponent { | ||
@Input() public config: StixIDPropertyConfig; | ||
public get stixIdLink(): string { return `${this.config.object["stixID"]}`; } | ||
|
||
constructor(public snackbar: MatSnackBar) { | ||
// intentionally left blank | ||
} | ||
} | ||
export interface StixIDPropertyConfig { | ||
/* What is the current mode? | ||
* view: viewing the list property | ||
*/ | ||
mode: "view" | ||
/* The object to show the field of | ||
* Note: if mode is diff, pass an array of two objects to diff | ||
*/ | ||
object: StixObject | [StixObject, StixObject]; | ||
} |
This file contains 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
This file contains 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