Commit 985776fe authored by Romain DELEAU's avatar Romain DELEAU

fix: prerequires panel no longer close automatically + clear task now clear...

fix: prerequires panel no longer close automatically + clear task now clear the prerequires too + clear role now clean the prerequired ressources in tasks
parent d24990b5
...@@ -62,8 +62,18 @@ export class RoleComponent implements OnInit { ...@@ -62,8 +62,18 @@ export class RoleComponent implements OnInit {
this.role.educationnalObjectives = [new RoleEducationnalObjective()]; this.role.educationnalObjectives = [new RoleEducationnalObjective()];
this.role.rewards = []; this.role.rewards = [];
this.role.stuff = ''; this.role.stuff = '';
this.role.ressources = [];
this.role.supplementaryRoles = []; this.role.supplementaryRoles = [];
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
this.role.ressources.forEach(ressource => {
if (task?.prerequireRessources.some(element => element.ressource == ressource)) {
let index: number = task.prerequireRessources.findIndex(element => element.ressource == ressource);
task.prerequireRessources.splice(index, 1);
}
});
});
});
this.role.ressources = [];
} }
}); });
} }
......
<div class="piece" [ngStyle]="{'width': pieceWidth}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displayPrequires='hide'; displaySymbolChoice='hide'" <div class="piece" [ngStyle]="{'width': pieceWidth}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'"
[style.background]="task.supplementaryRole ? [style.background]="task.supplementaryRole ?
'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)' 'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)'
: 'var(--piece-background-color)'" : 'var(--piece-background-color)'"
......
...@@ -64,6 +64,17 @@ export class AnnexeTaskComponent implements OnInit { ...@@ -64,6 +64,17 @@ export class AnnexeTaskComponent implements OnInit {
this.task.durationUnit = 'UT'; this.task.durationUnit = 'UT';
this.task.identifier = ''; this.task.identifier = '';
this.task.objective = ''; this.task.objective = '';
this.task.prerequireRessources = [];
this.task.prerequireTasks = [];
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
task?.prerequireTasks.forEach((prerequire, index) => {
if (prerequire.identifier == this.task.identifier) {
task.prerequireTasks.splice(index, 1);
}
});
});
});
} }
}); });
} }
......
<div class="piece" [ngStyle]="{'width': pieceWidth}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displayPrequires='hide'; displaySymbolChoice='hide'" <div class="piece" [ngStyle]="{'width': pieceWidth}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'"
[style.background]="task.supplementaryRole ? [style.background]="task.supplementaryRole ?
'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)' 'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)'
: 'var(--piece-background-color)'" : 'var(--piece-background-color)'"
......
...@@ -66,6 +66,17 @@ export class FinalTaskComponent implements OnInit { ...@@ -66,6 +66,17 @@ export class FinalTaskComponent implements OnInit {
this.task.objective = ''; this.task.objective = '';
this.task.symbol.color = ''; this.task.symbol.color = '';
this.task.symbol.symbol = ''; this.task.symbol.symbol = '';
this.task.prerequireRessources = [];
this.task.prerequireTasks = [];
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
task?.prerequireTasks.forEach((prerequire, index) => {
if (prerequire.identifier == this.task.identifier) {
task.prerequireTasks.splice(index, 1);
}
});
});
});
} }
}); });
} }
......
<div class="piece" [ngStyle]="{'width': pieceWidth}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displayPrequires='hide'; displaySymbolChoice='hide'" <div class="piece" [ngStyle]="{'width': pieceWidth}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'"
[style.background]="task.supplementaryRole ? [style.background]="task.supplementaryRole ?
'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)' 'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)'
: 'var(--piece-background-color)'" : 'var(--piece-background-color)'"
......
...@@ -66,6 +66,17 @@ export class OptionnalTaskComponent implements OnInit { ...@@ -66,6 +66,17 @@ export class OptionnalTaskComponent implements OnInit {
this.task.objective = ''; this.task.objective = '';
this.task.symbol.color = ''; this.task.symbol.color = '';
this.task.symbol.symbol = ''; this.task.symbol.symbol = '';
this.task.prerequireRessources = [];
this.task.prerequireTasks = [];
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
task?.prerequireTasks.forEach((prerequire, index) => {
if (prerequire.identifier == this.task.identifier) {
task.prerequireTasks.splice(index, 1);
}
});
});
});
} }
}); });
} }
......
<div class="piece" [ngStyle]="{'width': pieceWidth}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displayPrequires='hide'; displaySymbolChoice='hide'" <div class="piece" [ngStyle]="{'width': pieceWidth}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'"
[style.background]="task.supplementaryRole ? [style.background]="task.supplementaryRole ?
'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)' 'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)'
: 'var(--piece-background-color)'"> : 'var(--piece-background-color)'">
......
...@@ -66,6 +66,17 @@ export class RandomEventComponent implements OnInit { ...@@ -66,6 +66,17 @@ export class RandomEventComponent implements OnInit {
this.task.objective = ''; this.task.objective = '';
this.task.symbol.color = ''; this.task.symbol.color = '';
this.task.symbol.symbol = ''; this.task.symbol.symbol = '';
this.task.prerequireRessources = [];
this.task.prerequireTasks = [];
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
task?.prerequireTasks.forEach((prerequire, index) => {
if (prerequire.identifier == this.task.identifier) {
task.prerequireTasks.splice(index, 1);
}
});
});
});
} }
}); });
} }
......
...@@ -66,6 +66,17 @@ export class TaskComponent implements OnInit { ...@@ -66,6 +66,17 @@ export class TaskComponent implements OnInit {
this.task.objective = ''; this.task.objective = '';
this.task.symbol.color = ''; this.task.symbol.color = '';
this.task.symbol.symbol = ''; this.task.symbol.symbol = '';
this.task.prerequireRessources = [];
this.task.prerequireTasks = [];
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
task?.prerequireTasks.forEach((prerequire, index) => {
if (prerequire.identifier == this.task.identifier) {
task.prerequireTasks.splice(index, 1);
}
});
});
});
} }
}); });
} }
......
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