Skip to content
Snippets Groups Projects
Commit 77e3f5dc authored by Lukáš Majdan's avatar Lukáš Majdan
Browse files

Merge branch 'forbidden-commands-integration' into 'master'

Forbidden commands integration

See merge request muni-kypo-crp/frontend-angular/components/kypo-command-visualizations!17
parents fc08fc8c 9e41a168
No related branches found
No related tags found
No related merge requests found
15.1.6 Fix commands not displaying.
15.1.5 Update boolean directive of command.
15.1.4 Fix behavior subject for forbidden commands.
15.1.3 Change background color for forbidden commands.
......
......@@ -29,14 +29,7 @@
{{command.trainingTime}}
</mgl-timeline-entry-side>
<mgl-timeline-entry-header>
<ng-container *ngIf="checkCommandColor(command) | async as isCommandForbidden">
<div *ngIf="isCommandForbidden" [style.color]="'red'">
[x] {{command.cmd}} {{command.options}}
</div>
<div *ngIf="!isCommandForbidden">
{{command.cmd}} {{command.options}}
</div>
</ng-container>
<div>{{command.cmd}} {{command.options}}</div>
</mgl-timeline-entry-header>
<mgl-timeline-entry-content [expandAnimationTiming]="'200ms ease'"
......
......@@ -4,7 +4,7 @@ import { TimelineCommandService } from './service/timeline-command.service';
import { Command } from './model/command';
import { TrainingRun } from './model/training-run';
import { BehaviorSubject, Observable, of } from 'rxjs';
import { map, take } from 'rxjs/operators';
import { take } from 'rxjs/operators';
import { OffsetPaginationEvent } from '@sentinel/common/pagination';
import { DetectedForbiddenCommand } from './model/detected-forbidden-command';
......@@ -59,19 +59,6 @@ export class TimelineComponent implements OnInit {
}
}
checkCommandColor(command: Command): Observable<boolean> {
if (!this.isForbidden) {
of(false);
}
return this.forbiddenCommands$.pipe(
map((forbiddenCommands) => {
return forbiddenCommands.some((forbiddenCommand) => {
return command.cmd === forbiddenCommand.command;
});
})
);
}
onTraineeSelect(event): void {
this.timelineCommandService.setSelectedTrainee(event.value);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment