Commit fb73c7b0 authored by Romain DELEAU's avatar Romain DELEAU

Traces on Steps/Tasks/enable-disabled tooltips

parent baf24c4c
This diff is collapsed.
......@@ -260,18 +260,28 @@ export class AppComponent {
}
}
addMissionStep(mission: Mission, index: number): void {
addMissionStep(mission: Mission, index: number, missionIndex: number): void {
mission.addChronologieStep(index);
mission.equalizeLengths();
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',missionIndex,undefined,'all','Step_m_['+index+']','#ACC9FC'));
}
addRoleStep(mission: Mission, role: Role, index: number): void {
addRoleStep(mission: Mission, role: Role, index: number, missionIndex: number, roleIndex: number): void {
role.addChronologieStep(index);
mission.equalizeLengths();
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',missionIndex,roleIndex,'all','Step_r_['+index+']','#ACC9FC'));
}
addTask(mission: Mission, role: Role, i: number, j: number, type: string) {
addTask(mission: Mission, role: Role, missionIndex: number, roleIndex: number, i: number, j: number, type: string) {
role.addTask(i, j, type);
switch(type) {
case 'normal': this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',missionIndex,roleIndex,'all','Task_['+i+';'+j+']', '#B9DFE3')); break;
case 'annexe': this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',missionIndex,roleIndex,'all','Task_['+i+';'+j+']', '#BCCECC')); break;
case 'optionnal': this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',missionIndex,roleIndex,'all','Task_['+i+';'+j+']', '#E8E3B3')); break;
case 'final': this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',missionIndex,roleIndex,'all','Task_['+i+';'+j+']', '#B28386')); break;
case 'event': this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',missionIndex,roleIndex,'all','Task_['+i+';'+j+']', '#BFDAA3')); break;
case 'reppeat': this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',missionIndex,roleIndex,'all','Task_['+i+';'+j+']', '#ABBCC6')); break;
}
mission.equalizeLengths();
}
......@@ -311,4 +321,12 @@ export class AppComponent {
return "";
}
}
tooltipsTrace(event: any) {
if(event.target.checked) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'enable_tooltips',undefined, undefined,'tooltips','Scenario'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'disable_tooltips',undefined, undefined,'tooltips','Scenario'));
}
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ matTooltipPosition="below" [matTooltipDisabled]="!tooltipService.activatedToolti
<div class="piece-attach piece-attach-left"></div>
<div class="piece-menu" [class]="displayMenu">
<mat-icon fontIcon="arrow_back_ios" (click)="moveStep('left')" *ngIf="index > 0"
<mat-icon fontIcon="arrow_back_ios" (click)="moveStep('left'); editTrace($event,'Step_moveLeft')" *ngIf="index > 0"
matTooltip="Décaler la tuile vers la gauche. Dans le cas où une tuile est déjà présente, leurs places sont inversées."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
<mat-icon fontIcon="backspace" (click)="onClickErase()"
......@@ -15,7 +15,7 @@ matTooltipPosition="below" [matTooltipDisabled]="!tooltipService.activatedToolti
<mat-icon fontIcon="delete" (click)="onClickDelete()"
matTooltip="Supprimer la tuile."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
<mat-icon fontIcon="arrow_forward_ios" (click)="moveStep('right')"
<mat-icon fontIcon="arrow_forward_ios" (click)="moveStep('right'); editTrace($event,'Step_moveRight')"
matTooltip="Décaler la tuile vers la droite. Dans le cas où une tuile est déjà présente, leurs places sont inversées."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
......@@ -23,11 +23,11 @@ matTooltipPosition="below" [matTooltipDisabled]="!tooltipService.activatedToolti
<div class="piece-form">
<div class="piece-form-title">Étape {{getStepNumber()}}</div>
<mat-icon class="piece-form-comment" fontIcon="comment" *ngIf="step.comments.length > 0"></mat-icon>
<textarea [(ngModel)]="step.description" [style.background-image]="index == FirstStepIndex() ? urlIcon : ''"></textarea>
<textarea [(ngModel)]="step.description" [style.background-image]="index == FirstStepIndex() ? urlIcon : ''" (change)="editTrace($event,'Step_content')"></textarea>
<div class="piece-form-duration">
<label for="duration">Durée</label>
<input name="duration" type="number" [(ngModel)]="step.duration" (input)="durationChange()" min="1" (change)="step.duration < 1 ? step.duration = 1 : ''"/>
<select name="duration" [(ngModel)]="step.durationUnit" (change)="durationChange()">
<input name="duration" type="number" [(ngModel)]="step.duration" (input)="durationChange()" min="1" (change)="step.duration < 1 ? step.duration = 1 : ''; editTrace($event, 'Step_duration')"/>
<select name="duration" [(ngModel)]="step.durationUnit" (change)="durationChange(); editTrace($event, 'Step_duration_unit')">
<option value="UT">UT</option>
<option value="min">min</option>
<option value="tours">tours</option>
......
......@@ -7,6 +7,8 @@ import { PieceDetailsService } from 'src/app/services/piece-details/piece-detail
import { SuppressDialogComponent } from 'src/app/components/dialogs/suppress-dialog/suppress-dialog.component';
import { CleanDialogComponent } from 'src/app/components/dialogs/clean-dialog/clean-dialog.component';
import { TooltipService } from 'src/app/services/tooltip/tooltip.service';
import { Trace } from 'src/app/class/trace/trace';
import { Scenario } from 'src/app/class/scenario/scenario';
@Component({
selector: 'app-step',
......@@ -15,10 +17,13 @@ import { TooltipService } from 'src/app/services/tooltip/tooltip.service';
})
export class StepComponent implements OnInit {
@Input() step: Step = new Step;
@Input() scenario: Scenario = new Scenario();
@Input() step: Step = new Step();
@Input() parent!: Mission | Role;
@Input() index!: number;
@Input() mission!: Mission;
@Input() roleIndex!: number;
@Input() missionIndex: number = 0;
displayMenu: string = 'hide';
pieceWidth: number = 400;
......@@ -90,6 +95,17 @@ export class StepComponent implements OnInit {
this.step.description = '';
this.step.durationUnit = 'UT';
this.step.duration = 1;
if (this.parent instanceof Mission) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,undefined,'all','Step_m_['+this.index+']','#ACC9FC'));
} else if (this.parent instanceof Role) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,'all','Step_r_['+this.index+']','#ACC9FC'));
}
} else {
if (this.parent instanceof Mission) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_erase',this.missionIndex,undefined,'all','Step_m_['+this.index+']','#ACC9FC'));
} else if (this.parent instanceof Role) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_erase',this.missionIndex,this.roleIndex,'all','Step_r_['+this.index+']','#ACC9FC'));
}
}
});
}
......@@ -104,6 +120,17 @@ export class StepComponent implements OnInit {
this.parent.removeChronologieStep(this.index);
}
this.mission.equalizeLengths();
if (this.parent instanceof Mission) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,undefined,'all','Step_m_['+this.index+']','#ACC9FC'));
} else if (this.parent instanceof Role) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,'all','Step_r_['+this.index+']','#ACC9FC'));
}
} else {
if (this.parent instanceof Mission) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_erase',this.missionIndex,undefined,'all','Step_m_['+this.index+']','#ACC9FC'));
} else if (this.parent instanceof Role) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_erase',this.missionIndex,this.roleIndex,'all','Step_r_['+this.index+']','#ACC9FC'));
}
}
});
}
......@@ -122,4 +149,30 @@ export class StepComponent implements OnInit {
}
return 0;
}
editTrace(event: any, source: string): void {
if (event.target.value != '') {
if (this.parent instanceof Mission) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'write',this.missionIndex,undefined,source,'Step_m_['+this.index+']','#ACC9FC'));
} else if (this.parent instanceof Role) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'write',this.missionIndex,this.roleIndex,source,'Step_r_['+this.index+']','#ACC9FC'));
}
} else {
if (this.parent instanceof Mission) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,undefined,source,'Step_m_['+this.index+']','#ACC9FC'));
} else if (this.parent instanceof Role) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,source,'Step_r_['+this.index+']','#ACC9FC'));
}
}
}
editMoveTrace(event: any, source: string): void {
if (event.target.value != '') {
if (this.parent instanceof Mission) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,undefined,source,'Step_m_['+this.index+']','#ACC9FC'));
} else if (this.parent instanceof Role) {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Step_r_['+this.index+']','#ACC9FC'));
}
}
}
}
\ No newline at end of file
......@@ -27,24 +27,24 @@
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
<div class="piece-menu-directioncross">
<div class="piece-menu-directioncross-left">
<mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left')"
<mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left'); editMoveTrace($event,'Task_moveLeft')"
matTooltip="Décaler la tuile vers la gauche. Dans le cas où une tuile est déjà présente, leurs places sont inversées."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
<div class="piece-menu-directioncross-updownarrows">
<div class="piece-menu-updownarrows-up">
<mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top')"
<mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top'); editMoveTrace($event,'Task_moveTop')"
matTooltip="Décaler la tuile vers le haut (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
<div class="piece-menu-directioncross-updownarrows-down">
<mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom')"
<mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom'); editMoveTrace($event,'Task_moveBottom')"
matTooltip="Décaler la tuile vers le bas (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
</div>
<div class="piece-menu-directioncross-right">
<mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right')"
<mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right'); editMoveTrace($event,'Task_moveRight')"
matTooltip="Décaler la tuile vers la droite. Dans le cas où une tuile est déjà présente, leurs places sont inversées."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
......@@ -121,7 +121,7 @@
<mat-icon class="piece-form-top-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon>
<mat-icon class="piece-form-top-repeat" fontIcon="refresh" *ngIf="task.repeat.iteration > 0 || task.repeat.while != ''"></mat-icon>
</div>
<textarea class="piece-form-content" [(ngModel)]="task.objective" [style.background-image]="(i == findFirstIndexOfTaskType('annexe')[0] && j == findFirstIndexOfTaskType('annexe')[1]) ? urlIcon : ''"
<textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('annexe')[0] && j == findFirstIndexOfTaskType('annexe')[1]) ? urlIcon : ''"
placeholder="Vérifier ses connaissances sur les formulaires PHP"
matTooltip="Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea>
......@@ -129,8 +129,8 @@
<div class="piece-form-bottom-duration"
matTooltip="Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="1" (change)="task.duration < 1 ? task.duration = 1 : ''"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange()">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="1" (change)="task.duration < 1 ? task.duration = 1 : ''; editTrace($event,'Task_duration')"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')">
<option value="UT">UT</option>
<option value="min">min</option>
<option value="tours">tours</option>
......
......@@ -13,6 +13,7 @@ import { SuppressDialogComponent } from 'src/app/components/dialogs/suppress-dia
import { CleanDialogComponent } from 'src/app/components/dialogs/clean-dialog/clean-dialog.component';
import { MatSnackBar } from '@angular/material/snack-bar';
import { IdentifierSnackbarComponent } from 'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component';
import { Trace } from 'src/app/class/trace/trace';
@Component({
selector: 'app-annexe-task',
......@@ -30,7 +31,9 @@ export class AnnexeTaskComponent implements OnInit {
@Input() task: Task = new Task('normal');
@Input() scenario: Scenario = new Scenario();
@Input() mission!: Mission;
@Input() missionIndex: number = 0;
@Input() role!: Role;
@Input() roleIndex: number = 0;
@Input() i!: number;
@Input() j!: number;
......@@ -102,6 +105,9 @@ export class AnnexeTaskComponent implements OnInit {
});
});
});
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,'all','Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_erase',this.missionIndex,this.roleIndex,'all','Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
}
});
}
......@@ -126,19 +132,25 @@ export class AnnexeTaskComponent implements OnInit {
});
this.role.removeTask(this.i, this.j);
this.mission.equalizeLengths();
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'all','Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_delete',this.missionIndex,this.roleIndex,'all','Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
}
});
}
onClickChange(type: string): void {
this.task.changeType(type);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'transform_into_['+type+']',this.missionIndex,this.roleIndex,'all','Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
}
changeDisplayPrerequires(): void {
if(this.displayPrequires == 'show') {
this.displayPrequires = 'hide';
this.scenario.traces.push(new Trace(this.scenario.traces.length,'hide',this.missionIndex,this.roleIndex,'prerequires','Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
} else {
this.displayPrequires = 'show';
this.scenario.traces.push(new Trace(this.scenario.traces.length,'show',this.missionIndex,this.roleIndex,'prerequires','Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
}
}
......@@ -242,6 +254,7 @@ export class AnnexeTaskComponent implements OnInit {
this._snackBar.openFromComponent(IdentifierSnackbarComponent, { duration: 5000 });
this.task.identifier = '';
}
this.editTrace(event, 'Task_identifier');
}
checkboxChangedTask(event: any, task:(Task|null)): void {
......@@ -263,11 +276,13 @@ export class AnnexeTaskComponent implements OnInit {
onCheckTask(task: Task): void {
this.task.prerequireTasks.push(new PrerequireTask(task.identifier));
this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',this.missionIndex,this.roleIndex,'prerequire_task','Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
}
onUncheckTask(task: Task): void {
let i: number = this.task.prerequireTasks.findIndex(element => element.identifier == task.identifier);
this.task.prerequireTasks.splice(i,1);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'prerequire_task','Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
}
checkboxChangedRessource(event: any, ressource: Ressource): void {
......@@ -284,11 +299,13 @@ export class AnnexeTaskComponent implements OnInit {
onCheckRessource(ressource: Ressource): void {
this.task.prerequireRessources.push(new PrerequireRessource(ressource));
this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',this.missionIndex,this.roleIndex,'prerequire_ressource','Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
}
onUncheckRessource(ressource: Ressource): void {
let i: number = this.task.prerequireRessources.findIndex(element => ressource == element.ressource);
this.task.prerequireRessources.splice(i, 1);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'prerequire_ressource','Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
}
getAssociatePrerequireRessource(ressource: Ressource): PrerequireRessource {
......@@ -307,4 +324,16 @@ export class AnnexeTaskComponent implements OnInit {
});
return res;
}
editTrace(event: any, source: string): void {
if (event.target.value != '') {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'write',this.missionIndex,this.roleIndex,source,'Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,source,'Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
}
}
editMoveTrace(event: any, source: string): void {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
}
}
......@@ -26,24 +26,24 @@
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
<div class="piece-menu-directioncross">
<div class="piece-menu-directioncross-left">
<mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left')"
<mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left'); editMoveTrace($event,'Task_moveLeft')"
matTooltip="Décaler la tuile vers la gauche."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
<div class="piece-menu-directioncross-updownarrows">
<div class="piece-menu-updownarrows-up">
<mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top')"
<mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top'); editMoveTrace($event,'Task_moveTop')"
matTooltip="Décaler la tuile vers le haut (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
<div class="piece-menu-directioncross-updownarrows-down">
<mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom')"
<mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom'); editMoveTrace($event,'Task_moveBottom')"
matTooltip="Décaler la tuile vers le bas (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
</div>
<div class="piece-menu-directioncross-right">
<mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right')"
<mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right'); editMoveTrace($event,'Task_moveRight')"
matTooltip="Décaler la tuile vers la droite."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
......@@ -154,7 +154,7 @@
<mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon>
</button>
</div>
<textarea class="piece-form-content" [(ngModel)]="task.objective" [style.background-image]="(i == findFirstIndexOfTaskType('final')[0] && j == findFirstIndexOfTaskType('final')[1]) ? urlIcon : ''"
<textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('final')[0] && j == findFirstIndexOfTaskType('final')[1]) ? urlIcon : ''"
placeholder="Mettre le site web en ligne"
matTooltip="Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea>
......@@ -162,8 +162,8 @@
<div class="piece-form-bottom-duration"
matTooltip="Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="1" (change)="task.duration < 1 ? task.duration = 1 : ''"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange()">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="1" (change)="task.duration < 1 ? task.duration = 1 : ''; editTrace($event,'Task_duration')"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')">
<option value="UT">UT</option>
<option value="min">min</option>
<option value="tours">tours</option>
......
......@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
import { CleanDialogComponent } from 'src/app/components/dialogs/clean-dialog/clean-dialog.component';
import { MatSnackBar } from '@angular/material/snack-bar';
import { IdentifierSnackbarComponent } from 'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component';
import { Trace } from 'src/app/class/trace/trace';
@Component({
selector: 'app-final-task',
......@@ -30,7 +31,9 @@ export class FinalTaskComponent implements OnInit {
@Input() task: Task = new Task('normal');
@Input() scenario: Scenario = new Scenario();
@Input() mission!: Mission;
@Input() missionIndex: number = 0;
@Input() role!: Role;
@Input() roleIndex: number = 0;
@Input() i!: number;
@Input() j!: number;
......@@ -104,6 +107,9 @@ export class FinalTaskComponent implements OnInit {
});
});
});
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,'all','Final_task_['+this.i+';'+this.j+']', '#B28386'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_erase',this.missionIndex,this.roleIndex,'all','Final_task_['+this.i+';'+this.j+']', '#B28386'));
}
});
}
......@@ -120,6 +126,7 @@ export class FinalTaskComponent implements OnInit {
}
this.task.changeType(type);
this.mission.equalizeLengths();
this.scenario.traces.push(new Trace(this.scenario.traces.length,'transform_into_['+type+']',this.missionIndex,this.roleIndex,'all','Final_task_['+this.i+';'+this.j+']', '#B28386'));
}
onClickDelete(): void {
......@@ -137,6 +144,9 @@ export class FinalTaskComponent implements OnInit {
});
this.role.removeTask(this.i, this.j);
this.mission.equalizeLengths();
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'all','Final_task_['+this.i+';'+this.j+']', '#B28386'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_delete',this.missionIndex,this.roleIndex,'all','Final_task_['+this.i+';'+this.j+']', '#B28386'));
}
});
}
......@@ -153,13 +163,20 @@ export class FinalTaskComponent implements OnInit {
this.task.symbol.symbol = symbol;
this.task.symbol.color = symbolColor;
this.displaySymbolChoice = 'hide';
if (symbol != '' && symbolColor != '') {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'select_common',this.missionIndex,this.roleIndex,'symbol','Final_task_['+this.i+';'+this.j+']', '#B28386'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete_common',this.missionIndex,this.roleIndex,'symbol','Final_task_['+this.i+';'+this.j+']', '#B28386'));
}
}
changeDisplayPrerequires(): void {
if(this.displayPrequires == 'show') {
this.displayPrequires = 'hide';
this.scenario.traces.push(new Trace(this.scenario.traces.length,'hide',this.missionIndex,this.roleIndex,'prerequires','Final_task_['+this.i+';'+this.j+']', '#B28386'));
} else {
this.displayPrequires = 'show';
this.scenario.traces.push(new Trace(this.scenario.traces.length,'show',this.missionIndex,this.roleIndex,'prerequires','Final_task_['+this.i+';'+this.j+']', '#B28386'));
}
}
......@@ -244,6 +261,7 @@ export class FinalTaskComponent implements OnInit {
this._snackBar.openFromComponent(IdentifierSnackbarComponent, { duration: 5000 });
this.task.identifier = '';
}
this.editTrace(event,'Task_identifier');
}
checkboxChangedTask(event: any, task:(Task|null)): void {
......@@ -265,11 +283,13 @@ export class FinalTaskComponent implements OnInit {
onCheckTask(task: Task): void {
this.task.prerequireTasks.push(new PrerequireTask(task.identifier));
this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',this.missionIndex,this.roleIndex,'prerequire_task','Final_task_['+this.i+';'+this.j+']', '#B28386'));
}
onUncheckTask(task: Task): void {
let i: number = this.task.prerequireTasks.findIndex(element => element.identifier == task.identifier);
this.task.prerequireTasks.splice(i,1);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'prerequire_task','Final_task_['+this.i+';'+this.j+']', '#B28386'));
}
checkboxChangedRessource(event: any, ressource: Ressource): void {
......@@ -286,11 +306,13 @@ export class FinalTaskComponent implements OnInit {
onCheckRessource(ressource: Ressource): void {
this.task.prerequireRessources.push(new PrerequireRessource(ressource));
this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',this.missionIndex,this.roleIndex,'prerequire_ressource','Final_task_['+this.i+';'+this.j+']', '#B28386'));
}
onUncheckRessource(ressource: Ressource): void {
let i: number = this.task.prerequireRessources.findIndex(element => ressource == element.ressource);
this.task.prerequireRessources.splice(i, 1);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'prerequire_ressource','Final_task_['+this.i+';'+this.j+']', '#B28386'));
}
getAssociatePrerequireRessource(ressource: Ressource): PrerequireRessource {
......@@ -309,4 +331,16 @@ export class FinalTaskComponent implements OnInit {
});
return res;
}
editTrace(event: any, source: string): void {
if (event.target.value != '') {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'write',this.missionIndex,this.roleIndex,source,'Final_task_['+this.i+';'+this.j+']', '#B28386'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,source,'Final_task_['+this.i+';'+this.j+']', '#B28386'));
}
}
editMoveTrace(event: any, source: string): void {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Final_task_['+this.i+';'+this.j+']', '#B28386'));
}
}
......@@ -27,24 +27,24 @@
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
<div class="piece-menu-directioncross">
<div class="piece-menu-directioncross-left">
<mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left')"
<mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left'); editMoveTrace($event,'Task_moveLeft')"
matTooltip="Décaler la tuile vers la gauche. Dans le cas où une tuile est déjà présente, leurs places sont inversées."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
<div class="piece-menu-directioncross-updownarrows">
<div class="piece-menu-updownarrows-up">
<mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top')"
<mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top'); editMoveTrace($event,'Task_moveTop')"
matTooltip="Décaler la tuile vers le haut (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
<div class="piece-menu-directioncross-updownarrows-down">
<mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom')"
<mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom'); editMoveTrace($event,'Task_moveBottom')"
matTooltip="Décaler la tuile vers le bas (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
</div>
<div class="piece-menu-directioncross-right">
<mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right')"
<mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right'); editMoveTrace($event,'Task_moveRight')"
matTooltip="Décaler la tuile vers la droite. Dans le cas où une tuile est déjà présente, leurs places sont inversées."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
......@@ -155,7 +155,7 @@
<mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon>
</button>
</div>
<textarea class="piece-form-content" [(ngModel)]="task.objective" [style.background-image]="(i == findFirstIndexOfTaskType('optionnal')[0] && j == findFirstIndexOfTaskType('optionnal')[1]) ? urlIcon : ''"
<textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('optionnal')[0] && j == findFirstIndexOfTaskType('optionnal')[1]) ? urlIcon : ''"
placeholder="Partir d'un template / Partir de zéro"
matTooltip="Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea>
......@@ -163,8 +163,8 @@
<div class="piece-form-bottom-duration"
matTooltip="Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="1" (change)="task.duration < 1 ? task.duration = 1 : ''"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange()">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="1" (change)="task.duration < 1 ? task.duration = 1 : ''; editTrace($event,'Task_duration')"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')">
<option value="UT">UT</option>
<option value="min">min</option>
<option value="tours">tours</option>
......
......@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
import { CleanDialogComponent } from 'src/app/components/dialogs/clean-dialog/clean-dialog.component';
import { MatSnackBar } from '@angular/material/snack-bar';
import { IdentifierSnackbarComponent } from 'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component';
import { Trace } from 'src/app/class/trace/trace';
@Component({
selector: 'app-optionnal-task',
......@@ -30,7 +31,9 @@ export class OptionnalTaskComponent implements OnInit {
@Input() task: Task = new Task('normal');
@Input() scenario: Scenario = new Scenario();
@Input() mission!: Mission;
@Input() missionIndex: number = 0;
@Input() role!: Role;
@Input() roleIndex: number = 0;
@Input() i!: number;
@Input() j!: number;
......@@ -104,6 +107,9 @@ export class OptionnalTaskComponent implements OnInit {
});
});
});
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,'all','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_erase',this.missionIndex,this.roleIndex,'all','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
}
});
}
......@@ -119,6 +125,7 @@ export class OptionnalTaskComponent implements OnInit {
this.task.symbol.symbol = '';
}
this.task.changeType(type);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'transform_into_['+type+']',this.missionIndex,this.roleIndex,'all','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
}
onClickDelete(): void {
......@@ -136,6 +143,9 @@ export class OptionnalTaskComponent implements OnInit {
});
this.role.removeTask(this.i, this.j);
this.mission.equalizeLengths();
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'all','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_delete',this.missionIndex,this.roleIndex,'all','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
}
});
}
......@@ -152,13 +162,20 @@ export class OptionnalTaskComponent implements OnInit {
this.task.symbol.symbol = symbol;
this.task.symbol.color = symbolColor;
this.displaySymbolChoice = 'hide';
if (symbol != '' && symbolColor != '') {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'select_common',this.missionIndex,this.roleIndex,'symbol','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete_common',this.missionIndex,this.roleIndex,'symbol','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
}
}
changeDisplayPrerequires(): void {
if(this.displayPrequires == 'show') {
this.displayPrequires = 'hide';
this.scenario.traces.push(new Trace(this.scenario.traces.length,'hide',this.missionIndex,this.roleIndex,'prerequires','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
} else {
this.displayPrequires = 'show';
this.scenario.traces.push(new Trace(this.scenario.traces.length,'show',this.missionIndex,this.roleIndex,'prerequires','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
}
}
......@@ -261,6 +278,7 @@ export class OptionnalTaskComponent implements OnInit {
this._snackBar.openFromComponent(IdentifierSnackbarComponent, { duration: 5000 });
this.task.identifier = '';
}
this.editTrace(event, 'Task_identifier');
}
checkboxChangedTask(event: any, task:(Task|null)): void {
......@@ -282,11 +300,13 @@ export class OptionnalTaskComponent implements OnInit {
onCheckTask(task: Task): void {
this.task.prerequireTasks.push(new PrerequireTask(task.identifier));
this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',this.missionIndex,this.roleIndex,'prerequire_task','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
}
onUncheckTask(task: Task): void {
let i: number = this.task.prerequireTasks.findIndex(element => element.identifier == task.identifier);
this.task.prerequireTasks.splice(i,1);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'prerequire_task','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
}
checkboxChangedRessource(event: any, ressource: Ressource): void {
......@@ -303,11 +323,13 @@ export class OptionnalTaskComponent implements OnInit {
onCheckRessource(ressource: Ressource): void {
this.task.prerequireRessources.push(new PrerequireRessource(ressource));
this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',this.missionIndex,this.roleIndex,'prerequire_ressource','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
}
onUncheckRessource(ressource: Ressource): void {
let i: number = this.task.prerequireRessources.findIndex(element => ressource == element.ressource);
this.task.prerequireRessources.splice(i, 1);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'prerequire_ressource','Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
}
getAssociatePrerequireRessource(ressource: Ressource): PrerequireRessource {
......@@ -326,4 +348,16 @@ export class OptionnalTaskComponent implements OnInit {
});
return res;
}
editTrace(event: any, source: string): void {
if (event.target.value != '') {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'write',this.missionIndex,this.roleIndex,source,'Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,source,'Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
}
}
editMoveTrace(event: any, source: string): void {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
}
}
......@@ -15,24 +15,24 @@
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
<div class="piece-menu-directioncross">
<div class="piece-menu-directioncross-left">
<mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left')"
<mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left'); editMoveTrace($event,'Task_moveLeft')"
matTooltip="Décaler la tuile vers la gauche. Dans le cas où une tuile est déjà présente, leurs places sont inversées."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
<div class="piece-menu-directioncross-updownarrows">
<div class="piece-menu-updownarrows-up">
<mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top')"
<mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top'); editMoveTrace($event,'Task_moveTop')"
matTooltip="Décaler la tuile vers le haut (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
<div class="piece-menu-directioncross-updownarrows-down">
<mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom')"
<mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom'); editMoveTrace($event,'Task_moveBottom')"
matTooltip="Décaler la tuile vers le bas (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
</div>
<div class="piece-menu-directioncross-right">
<mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right')"
<mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right'); editMoveTrace($event,'Task_moveRight')"
matTooltip="Décaler la tuile vers la droite. Dans le cas où une tuile est déjà présente, leurs places sont inversées."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
......@@ -143,7 +143,7 @@
<mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon>
</button>
</div>
<textarea class="piece-form-content" [(ngModel)]="task.objective" [style.background-image]="(i == findFirstIndexOfTaskType('event')[0] && j == findFirstIndexOfTaskType('event')[1]) ? urlIcon : ''"
<textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('event')[0] && j == findFirstIndexOfTaskType('event')[1]) ? urlIcon : ''"
placeholder="Le client modifie sa demande"
matTooltip="Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea>
......@@ -151,8 +151,8 @@
<div class="piece-form-bottom-duration"
matTooltip="Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="1" (change)="task.duration < 1 ? task.duration = 1 : ''"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange()">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="1" (change)="task.duration < 1 ? task.duration = 1 : ''; editTrace($event,'Task_duration')"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')">
<option value="UT">UT</option>
<option value="min">min</option>
<option value="tours">tours</option>
......
......@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
import { CleanDialogComponent } from 'src/app/components/dialogs/clean-dialog/clean-dialog.component';
import { MatSnackBar } from '@angular/material/snack-bar';
import { IdentifierSnackbarComponent } from 'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component';
import { Trace } from 'src/app/class/trace/trace';
@Component({
selector: 'app-random-event',
......@@ -30,7 +31,9 @@ export class RandomEventComponent implements OnInit {
@Input() task: Task = new Task('normal');
@Input() scenario: Scenario = new Scenario();
@Input() mission!: Mission;
@Input() missionIndex: number = 0;
@Input() role!: Role;
@Input() roleIndex: number = 0;
@Input() i!: number;
@Input() j!: number;
......@@ -104,6 +107,9 @@ export class RandomEventComponent implements OnInit {
});
});
});
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,'all','Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_erase',this.missionIndex,this.roleIndex,'all','Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
}
});
}
......@@ -128,6 +134,9 @@ export class RandomEventComponent implements OnInit {
});
this.role.removeTask(this.i, this.j);
this.mission.equalizeLengths();
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'all','Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_delete',this.missionIndex,this.roleIndex,'all','Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
}
});
}
......@@ -144,13 +153,20 @@ export class RandomEventComponent implements OnInit {
this.task.symbol.symbol = symbol;
this.task.symbol.color = symbolColor;
this.displaySymbolChoice = 'hide';
if (symbol != '' && symbolColor != '') {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'select_common',this.missionIndex,this.roleIndex,'symbol','Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete_common',this.missionIndex,this.roleIndex,'symbol','Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
}
}
changeDisplayPrerequires(): void {
if(this.displayPrequires == 'show') {
this.displayPrequires = 'hide';
this.scenario.traces.push(new Trace(this.scenario.traces.length,'hide',this.missionIndex,this.roleIndex,'prerequires','Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
} else {
this.displayPrequires = 'show';
this.scenario.traces.push(new Trace(this.scenario.traces.length,'show',this.missionIndex,this.roleIndex,'prerequires','Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
}
}
......@@ -239,6 +255,7 @@ export class RandomEventComponent implements OnInit {
this._snackBar.openFromComponent(IdentifierSnackbarComponent, { duration: 5000 });
this.task.identifier = '';
}
this.editTrace(event, 'Task_identifier');
}
checkboxChangedTask(event: any, task:(Task|null)): void {
......@@ -260,11 +277,13 @@ export class RandomEventComponent implements OnInit {
onCheckTask(task: Task): void {
this.task.prerequireTasks.push(new PrerequireTask(task.identifier));
this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',this.missionIndex,this.roleIndex,'prerequire_task','Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
}
onUncheckTask(task: Task): void {
let i: number = this.task.prerequireTasks.findIndex(element => element.identifier == task.identifier);
this.task.prerequireTasks.splice(i,1);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'prerequire_task','Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
}
checkboxChangedRessource(event: any, ressource: Ressource): void {
......@@ -281,11 +300,13 @@ export class RandomEventComponent implements OnInit {
onCheckRessource(ressource: Ressource): void {
this.task.prerequireRessources.push(new PrerequireRessource(ressource));
this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',this.missionIndex,this.roleIndex,'prerequire_ressource','Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
}
onUncheckRessource(ressource: Ressource): void {
let i: number = this.task.prerequireRessources.findIndex(element => ressource == element.ressource);
this.task.prerequireRessources.splice(i, 1);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'prerequire_ressource','Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
}
getAssociatePrerequireRessource(ressource: Ressource): PrerequireRessource {
......@@ -304,4 +325,16 @@ export class RandomEventComponent implements OnInit {
});
return res;
}
editTrace(event: any, source: string): void {
if (event.target.value != '') {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'write',this.missionIndex,this.roleIndex,source,'Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,source,'Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
}
}
editMoveTrace(event: any, source: string): void {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Event_task_['+this.i+';'+this.j+']', '#BFDAA3'));
}
}
......@@ -11,24 +11,24 @@
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
<div class="piece-menu-directioncross">
<div class="piece-menu-directioncross-left">
<mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left')"
<mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left'); editMoveTrace($event,'Task_moveLeft')"
matTooltip="Décaler la tuile vers la gauche."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
<div class="piece-menu-directioncross-updownarrows">
<div class="piece-menu-updownarrows-up">
<mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top')"
<mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top'); editMoveTrace($event,'Task_moveTop')"
matTooltip="Décaler la tuile vers le haut (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
<div class="piece-menu-directioncross-updownarrows-down">
<mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom')"
<mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom'); editMoveTrace($event,'Task_moveBottom')"
matTooltip="Décaler la tuile vers le bas (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
</div>
<div class="piece-menu-directioncross-right">
<mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right')"
<mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right'); editMoveTrace($event,'Task_moveRight')"
matTooltip="Décaler la tuile vers la droite."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
......@@ -37,7 +37,7 @@
<div class="piece-form">
<label>Recommencer<br>le tour jusqu'à ce que :</label>
<textarea [(ngModel)]="task.objective" [(ngModel)]="task.objective" [style.background-image]="(i == findFirstIndexOfTaskType('repeat')[0] && j == findFirstIndexOfTaskType('repeat')[1]) ? urlIcon : ''"
<textarea [(ngModel)]="task.objective" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('repeat')[0] && j == findFirstIndexOfTaskType('repeat')[1]) ? urlIcon : ''"
placeholder="Faire valider au commanditaire"
matTooltip="Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea>
......
......@@ -7,6 +7,8 @@ import { TooltipService } from 'src/app/services/tooltip/tooltip.service';
import { SuppressDialogComponent } from 'src/app/components/dialogs/suppress-dialog/suppress-dialog.component';
import { MatDialog } from '@angular/material/dialog';
import { CleanDialogComponent } from 'src/app/components/dialogs/clean-dialog/clean-dialog.component';
import { Scenario } from 'src/app/class/scenario/scenario';
import { Trace } from 'src/app/class/trace/trace';
@Component({
selector: 'app-repeat-task',
......@@ -17,9 +19,12 @@ export class RepeatTaskComponent implements OnInit {
displayMenu: string = 'hide';
@Input() scenario: Scenario = new Scenario();
@Input() task: Task = new Task('normal');
@Input() mission!: Mission;
@Input() missionIndex: number = 0;
@Input() role!: Role;
@Input() roleIndex: number = 0;
@Input() i!: number;
@Input() j!: number;
......@@ -36,6 +41,9 @@ export class RepeatTaskComponent implements OnInit {
dialogRef.afterClosed().subscribe(result => {
if (result == true) {
this.task.objective = '';
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,'all','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_erase',this.missionIndex,this.roleIndex,'all','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
});
}
......@@ -60,6 +68,9 @@ export class RepeatTaskComponent implements OnInit {
});
this.role.removeTask(this.i, this.j);
this.mission.equalizeLengths();
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'all','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_delete',this.missionIndex,this.roleIndex,'all','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
});
}
......@@ -120,4 +131,16 @@ export class RepeatTaskComponent implements OnInit {
}
return [0, 0];
}
editTrace(event: any, source: string): void {
if (event.target.value != '') {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'write',this.missionIndex,this.roleIndex,source,'Task_['+this.i+';'+this.j+']', '#B9DFE3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,source,'Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
}
editMoveTrace(event: any, source: string): void {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
}
......@@ -25,24 +25,24 @@
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
<div class="piece-menu-directioncross">
<div class="piece-menu-directioncross-left">
<mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left')"
<mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left'); editMoveTrace($event,'Task_moveLeft')"
matTooltip="Décaler la tuile vers la gauche. Dans le cas où une tuile est déjà présente, leurs places sont inversées."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
<div class="piece-menu-directioncross-updownarrows">
<div class="piece-menu-updownarrows-up">
<mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top')"
<mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top'); editMoveTrace($event,'Task_moveTop')"
matTooltip="Décaler la tuile vers le haut (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
<div class="piece-menu-directioncross-updownarrows-down">
<mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom')"
<mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom'); editMoveTrace($event,'Task_moveBottom')"
matTooltip="Décaler la tuile vers le bas (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
</div>
<div class="piece-menu-directioncross-right">
<mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right')"
<mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right'); editMoveTrace($event,'Task_moveRight')"
matTooltip="Décaler la tuile vers la droite. Dans le cas où une tuile est déjà présente, leurs places sont inversées."
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
</div>
......@@ -153,7 +153,7 @@
<mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon>
</button>
</div>
<textarea class="piece-form-content" [(ngModel)]="task.objective" [style.background-image]="(i == findFirstIndexOfTaskType('normal')[0] && j == findFirstIndexOfTaskType('normal')[1]) ? urlIcon : ''"
<textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('normal')[0] && j == findFirstIndexOfTaskType('normal')[1]) ? urlIcon : ''"
placeholder="Positionner dans l'ordre les balises HTML principales"
matTooltip="Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea>
......@@ -161,8 +161,8 @@
<div class="piece-form-bottom-duration"
matTooltip="Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="1" (change)="task.duration < 1 ? task.duration = 1 : ''"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange()">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="1" (change)="task.duration < 1 ? task.duration = 1 : ''; editTrace($event,'Task_duration')"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')">
<option value="UT">UT</option>
<option value="min">min</option>
<option value="tours">tours</option>
......
......@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
import { CleanDialogComponent } from 'src/app/components/dialogs/clean-dialog/clean-dialog.component';
import { MatSnackBar } from '@angular/material/snack-bar';
import { IdentifierSnackbarComponent } from 'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component';
import { Trace } from 'src/app/class/trace/trace';
@Component({
selector: 'app-task',
......@@ -30,7 +31,9 @@ export class TaskComponent implements OnInit {
@Input() task: Task = new Task('normal');
@Input() scenario: Scenario = new Scenario();
@Input() mission: Mission = new Mission();
@Input() missionIndex: number = 0;
@Input() role!: Role;
@Input() roleIndex: number = 0;
@Input() i!: number;
@Input() j!: number;
......@@ -104,6 +107,9 @@ export class TaskComponent implements OnInit {
});
});
});
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,'all','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_erase',this.missionIndex,this.roleIndex,'all','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
});
}
......@@ -119,6 +125,7 @@ export class TaskComponent implements OnInit {
this.task.symbol.symbol = '';
}
this.task.changeType(type);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'transform_into_['+type+']',this.missionIndex,this.roleIndex,'all','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
onClickDelete(): void {
......@@ -136,6 +143,9 @@ export class TaskComponent implements OnInit {
});
this.role.removeTask(this.i, this.j);
this.mission.equalizeLengths();
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'all','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'cancel_delete',this.missionIndex,this.roleIndex,'all','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
});
}
......@@ -152,13 +162,20 @@ export class TaskComponent implements OnInit {
this.task.symbol.symbol = symbol;
this.task.symbol.color = symbolColor;
this.displaySymbolChoice = 'hide';
if (symbol != '' && symbolColor != '') {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'select_common',this.missionIndex,this.roleIndex,'symbol','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete_common',this.missionIndex,this.roleIndex,'symbol','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
}
changeDisplayPrerequires(): void {
if(this.displayPrequires == 'show') {
this.displayPrequires = 'hide';
this.scenario.traces.push(new Trace(this.scenario.traces.length,'hide',this.missionIndex,this.roleIndex,'prerequires','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
} else {
this.displayPrequires = 'show';
this.scenario.traces.push(new Trace(this.scenario.traces.length,'show',this.missionIndex,this.roleIndex,'prerequires','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
}
......@@ -272,6 +289,7 @@ export class TaskComponent implements OnInit {
this._snackBar.openFromComponent(IdentifierSnackbarComponent, { duration: 5000 });
this.task.identifier = '';
}
this.editTrace(event, 'Task_identifier');
}
checkboxChangedTask(event: any, task:(Task|null)): void {
......@@ -293,11 +311,13 @@ export class TaskComponent implements OnInit {
onCheckTask(task: Task): void {
this.task.prerequireTasks.push(new PrerequireTask(task.identifier));
this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',this.missionIndex,this.roleIndex,'prerequire_task','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
onUncheckTask(task: Task): void {
let i: number = this.task.prerequireTasks.findIndex(element => element.identifier == task.identifier);
this.task.prerequireTasks.splice(i,1);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'prerequire_task','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
checkboxChangedRessource(event: any, ressource: Ressource): void {
......@@ -314,11 +334,13 @@ export class TaskComponent implements OnInit {
onCheckRessource(ressource: Ressource): void {
this.task.prerequireRessources.push(new PrerequireRessource(ressource));
this.scenario.traces.push(new Trace(this.scenario.traces.length,'new',this.missionIndex,this.roleIndex,'prerequire_ressource','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
onUncheckRessource(ressource: Ressource): void {
let i: number = this.task.prerequireRessources.findIndex(element => ressource == element.ressource);
this.task.prerequireRessources.splice(i, 1);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',this.missionIndex,this.roleIndex,'prerequire_ressource','Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
getAssociatePrerequireRessource(ressource: Ressource): PrerequireRessource {
......@@ -337,4 +359,16 @@ export class TaskComponent implements OnInit {
});
return res;
}
editTrace(event: any, source: string): void {
if (event.target.value != '') {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'write',this.missionIndex,this.roleIndex,source,'Task_['+this.i+';'+this.j+']', '#B9DFE3'));
} else {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'erase',this.missionIndex,this.roleIndex,source,'Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
}
editMoveTrace(event: any, source: string): void {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Task_['+this.i+';'+this.j+']', '#B9DFE3'));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment