Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RLG Maker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Romain DELEAU
RLG Maker
Commits
fb73c7b0
Commit
fb73c7b0
authored
Sep 28, 2023
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Traces on Steps/Tasks/enable-disabled tooltips
parent
baf24c4c
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
335 additions
and
77 deletions
+335
-77
app.component.html
src/app/app.component.html
+27
-27
app.component.ts
src/app/app.component.ts
+21
-3
step.component.html
src/app/pieces/step/step.component.html
+5
-5
step.component.ts
src/app/pieces/step/step.component.ts
+55
-2
annexe-task.component.html
src/app/pieces/tasks/annexe-task/annexe-task.component.html
+7
-7
annexe-task.component.ts
src/app/pieces/tasks/annexe-task/annexe-task.component.ts
+29
-0
final-task.component.html
src/app/pieces/tasks/final-task/final-task.component.html
+7
-7
final-task.component.ts
src/app/pieces/tasks/final-task/final-task.component.ts
+34
-0
optionnal-task.component.html
...pieces/tasks/optionnal-task/optionnal-task.component.html
+7
-7
optionnal-task.component.ts
...p/pieces/tasks/optionnal-task/optionnal-task.component.ts
+34
-0
random-event.component.html
...app/pieces/tasks/random-event/random-event.component.html
+7
-7
random-event.component.ts
src/app/pieces/tasks/random-event/random-event.component.ts
+33
-0
repeat-task.component.html
src/app/pieces/tasks/repeat-task/repeat-task.component.html
+5
-5
repeat-task.component.ts
src/app/pieces/tasks/repeat-task/repeat-task.component.ts
+23
-0
task.component.html
src/app/pieces/tasks/task/task.component.html
+7
-7
task.component.ts
src/app/pieces/tasks/task/task.component.ts
+34
-0
No files found.
src/app/app.component.html
View file @
fb73c7b0
This diff is collapsed.
Click to expand it.
src/app/app.component.ts
View file @
fb73c7b0
...
@@ -260,18 +260,28 @@ export class AppComponent {
...
@@ -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
.
addChronologieStep
(
index
);
mission
.
equalizeLengths
();
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
);
role
.
addChronologieStep
(
index
);
mission
.
equalizeLengths
();
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
);
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
();
mission
.
equalizeLengths
();
}
}
...
@@ -311,4 +321,12 @@ export class AppComponent {
...
@@ -311,4 +321,12 @@ export class AppComponent {
return
""
;
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
src/app/pieces/step/step.component.html
View file @
fb73c7b0
...
@@ -6,7 +6,7 @@ matTooltipPosition="below" [matTooltipDisabled]="!tooltipService.activatedToolti
...
@@ -6,7 +6,7 @@ matTooltipPosition="below" [matTooltipDisabled]="!tooltipService.activatedToolti
<div
class=
"piece-attach piece-attach-left"
></div>
<div
class=
"piece-attach piece-attach-left"
></div>
<div
class=
"piece-menu"
[
class
]="
displayMenu
"
>
<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."
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>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
<mat-icon
fontIcon=
"backspace"
(
click
)="
onClickErase
()"
<mat-icon
fontIcon=
"backspace"
(
click
)="
onClickErase
()"
...
@@ -15,7 +15,7 @@ matTooltipPosition="below" [matTooltipDisabled]="!tooltipService.activatedToolti
...
@@ -15,7 +15,7 @@ matTooltipPosition="below" [matTooltipDisabled]="!tooltipService.activatedToolti
<mat-icon
fontIcon=
"delete"
(
click
)="
onClickDelete
()"
<mat-icon
fontIcon=
"delete"
(
click
)="
onClickDelete
()"
matTooltip=
"Supprimer la tuile."
matTooltip=
"Supprimer la tuile."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
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."
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>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
...
@@ -23,11 +23,11 @@ matTooltipPosition="below" [matTooltipDisabled]="!tooltipService.activatedToolti
...
@@ -23,11 +23,11 @@ matTooltipPosition="below" [matTooltipDisabled]="!tooltipService.activatedToolti
<div
class=
"piece-form"
>
<div
class=
"piece-form"
>
<div
class=
"piece-form-title"
>
Étape {{getStepNumber()}}
</div>
<div
class=
"piece-form-title"
>
Étape {{getStepNumber()}}
</div>
<mat-icon
class=
"piece-form-comment"
fontIcon=
"comment"
*
ngIf=
"step.comments.length > 0"
></mat-icon>
<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"
>
<div
class=
"piece-form-duration"
>
<label
for=
"duration"
>
Durée
</label>
<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
:
''"
/>
<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
()"
>
<select
name=
"duration"
[(
ngModel
)]="
step
.
durationUnit
"
(
change
)="
durationChange
()
;
editTrace
($
event
,
'
Step_duration_unit
')
"
>
<option
value=
"UT"
>
UT
</option>
<option
value=
"UT"
>
UT
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"tours"
>
tours
</option>
<option
value=
"tours"
>
tours
</option>
...
...
src/app/pieces/step/step.component.ts
View file @
fb73c7b0
...
@@ -7,6 +7,8 @@ import { PieceDetailsService } from 'src/app/services/piece-details/piece-detail
...
@@ -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
{
SuppressDialogComponent
}
from
'src/app/components/dialogs/suppress-dialog/suppress-dialog.component'
;
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
TooltipService
}
from
'src/app/services/tooltip/tooltip.service'
;
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
({
@
Component
({
selector
:
'app-step'
,
selector
:
'app-step'
,
...
@@ -15,10 +17,13 @@ import { TooltipService } from 'src/app/services/tooltip/tooltip.service';
...
@@ -15,10 +17,13 @@ import { TooltipService } from 'src/app/services/tooltip/tooltip.service';
})
})
export
class
StepComponent
implements
OnInit
{
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
()
parent
!
:
Mission
|
Role
;
@
Input
()
index
!
:
number
;
@
Input
()
index
!
:
number
;
@
Input
()
mission
!
:
Mission
;
@
Input
()
mission
!
:
Mission
;
@
Input
()
roleIndex
!
:
number
;
@
Input
()
missionIndex
:
number
=
0
;
displayMenu
:
string
=
'hide'
;
displayMenu
:
string
=
'hide'
;
pieceWidth
:
number
=
400
;
pieceWidth
:
number
=
400
;
...
@@ -89,7 +94,18 @@ export class StepComponent implements OnInit {
...
@@ -89,7 +94,18 @@ export class StepComponent implements OnInit {
if
(
result
==
true
)
{
if
(
result
==
true
)
{
this
.
step
.
description
=
''
;
this
.
step
.
description
=
''
;
this
.
step
.
durationUnit
=
'UT'
;
this
.
step
.
durationUnit
=
'UT'
;
this
.
step
.
duration
=
1
;
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 {
...
@@ -104,6 +120,17 @@ export class StepComponent implements OnInit {
this
.
parent
.
removeChronologieStep
(
this
.
index
);
this
.
parent
.
removeChronologieStep
(
this
.
index
);
}
}
this
.
mission
.
equalizeLengths
();
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 {
...
@@ -122,4 +149,30 @@ export class StepComponent implements OnInit {
}
}
return
0
;
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
src/app/pieces/tasks/annexe-task/annexe-task.component.html
View file @
fb73c7b0
...
@@ -27,24 +27,24 @@
...
@@ -27,24 +27,24 @@
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
<div
class=
"piece-menu-directioncross"
>
<div
class=
"piece-menu-directioncross"
>
<div
class=
"piece-menu-directioncross-left"
>
<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."
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>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
<div
class=
"piece-menu-directioncross-updownarrows"
>
<div
class=
"piece-menu-directioncross-updownarrows"
>
<div
class=
"piece-menu-updownarrows-up"
>
<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)."
matTooltip=
"Décaler la tuile vers le haut (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
<div
class=
"piece-menu-directioncross-updownarrows-down"
>
<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)."
matTooltip=
"Décaler la tuile vers le bas (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
</div>
</div>
<div
class=
"piece-menu-directioncross-right"
>
<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."
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>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
...
@@ -121,7 +121,7 @@
...
@@ -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-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>
<mat-icon
class=
"piece-form-top-repeat"
fontIcon=
"refresh"
*
ngIf=
"task.repeat.iteration > 0 || task.repeat.while != ''"
></mat-icon>
</div>
</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"
placeholder=
"Vérifier ses connaissances sur les formulaires PHP"
matTooltip=
"Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltip=
"Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
...
@@ -129,8 +129,8 @@
...
@@ -129,8 +129,8 @@
<div
class=
"piece-form-bottom-duration"
<div
class=
"piece-form-bottom-duration"
matTooltip=
"Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltip=
"Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
<input
name=
"value"
type=
"number"
[(
ngModel
)]="
task
.
duration
"
(
input
)="
durationChange
()"
min=
"1"
(
change
)="
task
.
duration
<
1
?
task
.
duration =
1
:
''"
/>
<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
()"
>
<select
name=
"unite"
[(
ngModel
)]="
task
.
durationUnit
"
(
change
)="
durationChange
()
;
editTrace
($
event
,'
Task_duration_unit
')
"
>
<option
value=
"UT"
>
UT
</option>
<option
value=
"UT"
>
UT
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"tours"
>
tours
</option>
<option
value=
"tours"
>
tours
</option>
...
...
src/app/pieces/tasks/annexe-task/annexe-task.component.ts
View file @
fb73c7b0
...
@@ -13,6 +13,7 @@ import { SuppressDialogComponent } from 'src/app/components/dialogs/suppress-dia
...
@@ -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
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
MatSnackBar
}
from
'@angular/material/snack-bar'
;
import
{
MatSnackBar
}
from
'@angular/material/snack-bar'
;
import
{
IdentifierSnackbarComponent
}
from
'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component'
;
import
{
IdentifierSnackbarComponent
}
from
'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component'
;
import
{
Trace
}
from
'src/app/class/trace/trace'
;
@
Component
({
@
Component
({
selector
:
'app-annexe-task'
,
selector
:
'app-annexe-task'
,
...
@@ -30,7 +31,9 @@ export class AnnexeTaskComponent implements OnInit {
...
@@ -30,7 +31,9 @@ export class AnnexeTaskComponent implements OnInit {
@
Input
()
task
:
Task
=
new
Task
(
'normal'
);
@
Input
()
task
:
Task
=
new
Task
(
'normal'
);
@
Input
()
scenario
:
Scenario
=
new
Scenario
();
@
Input
()
scenario
:
Scenario
=
new
Scenario
();
@
Input
()
mission
!
:
Mission
;
@
Input
()
mission
!
:
Mission
;
@
Input
()
missionIndex
:
number
=
0
;
@
Input
()
role
!
:
Role
;
@
Input
()
role
!
:
Role
;
@
Input
()
roleIndex
:
number
=
0
;
@
Input
()
i
!
:
number
;
@
Input
()
i
!
:
number
;
@
Input
()
j
!
:
number
;
@
Input
()
j
!
:
number
;
...
@@ -102,6 +105,9 @@ export class AnnexeTaskComponent implements OnInit {
...
@@ -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 {
...
@@ -126,19 +132,25 @@ export class AnnexeTaskComponent implements OnInit {
});
});
this
.
role
.
removeTask
(
this
.
i
,
this
.
j
);
this
.
role
.
removeTask
(
this
.
i
,
this
.
j
);
this
.
mission
.
equalizeLengths
();
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
{
onClickChange
(
type
:
string
):
void
{
this
.
task
.
changeType
(
type
);
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
{
changeDisplayPrerequires
():
void
{
if
(
this
.
displayPrequires
==
'show'
)
{
if
(
this
.
displayPrequires
==
'show'
)
{
this
.
displayPrequires
=
'hide'
;
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
{
}
else
{
this
.
displayPrequires
=
'show'
;
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 {
...
@@ -242,6 +254,7 @@ export class AnnexeTaskComponent implements OnInit {
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
task
.
identifier
=
''
;
this
.
task
.
identifier
=
''
;
}
}
this
.
editTrace
(
event
,
'Task_identifier'
);
}
}
checkboxChangedTask
(
event
:
any
,
task
:(
Task
|
null
)):
void
{
checkboxChangedTask
(
event
:
any
,
task
:(
Task
|
null
)):
void
{
...
@@ -263,11 +276,13 @@ export class AnnexeTaskComponent implements OnInit {
...
@@ -263,11 +276,13 @@ export class AnnexeTaskComponent implements OnInit {
onCheckTask
(
task
:
Task
):
void
{
onCheckTask
(
task
:
Task
):
void
{
this
.
task
.
prerequireTasks
.
push
(
new
PrerequireTask
(
task
.
identifier
));
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
{
onUncheckTask
(
task
:
Task
):
void
{
let
i
:
number
=
this
.
task
.
prerequireTasks
.
findIndex
(
element
=>
element
.
identifier
==
task
.
identifier
);
let
i
:
number
=
this
.
task
.
prerequireTasks
.
findIndex
(
element
=>
element
.
identifier
==
task
.
identifier
);
this
.
task
.
prerequireTasks
.
splice
(
i
,
1
);
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
{
checkboxChangedRessource
(
event
:
any
,
ressource
:
Ressource
):
void
{
...
@@ -284,11 +299,13 @@ export class AnnexeTaskComponent implements OnInit {
...
@@ -284,11 +299,13 @@ export class AnnexeTaskComponent implements OnInit {
onCheckRessource
(
ressource
:
Ressource
):
void
{
onCheckRessource
(
ressource
:
Ressource
):
void
{
this
.
task
.
prerequireRessources
.
push
(
new
PrerequireRessource
(
ressource
));
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
{
onUncheckRessource
(
ressource
:
Ressource
):
void
{
let
i
:
number
=
this
.
task
.
prerequireRessources
.
findIndex
(
element
=>
ressource
==
element
.
ressource
);
let
i
:
number
=
this
.
task
.
prerequireRessources
.
findIndex
(
element
=>
ressource
==
element
.
ressource
);
this
.
task
.
prerequireRessources
.
splice
(
i
,
1
);
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
{
getAssociatePrerequireRessource
(
ressource
:
Ressource
):
PrerequireRessource
{
...
@@ -307,4 +324,16 @@ export class AnnexeTaskComponent implements OnInit {
...
@@ -307,4 +324,16 @@ export class AnnexeTaskComponent implements OnInit {
});
});
return
res
;
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'
));
}
}
}
src/app/pieces/tasks/final-task/final-task.component.html
View file @
fb73c7b0
...
@@ -26,24 +26,24 @@
...
@@ -26,24 +26,24 @@
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
<div
class=
"piece-menu-directioncross"
>
<div
class=
"piece-menu-directioncross"
>
<div
class=
"piece-menu-directioncross-left"
>
<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."
matTooltip=
"Décaler la tuile vers la gauche."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
<div
class=
"piece-menu-directioncross-updownarrows"
>
<div
class=
"piece-menu-directioncross-updownarrows"
>
<div
class=
"piece-menu-updownarrows-up"
>
<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)."
matTooltip=
"Décaler la tuile vers le haut (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
<div
class=
"piece-menu-directioncross-updownarrows-down"
>
<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)."
matTooltip=
"Décaler la tuile vers le bas (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
</div>
</div>
<div
class=
"piece-menu-directioncross-right"
>
<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."
matTooltip=
"Décaler la tuile vers la droite."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
...
@@ -154,7 +154,7 @@
...
@@ -154,7 +154,7 @@
<mat-icon
*
ngIf=
"task.symbol.symbol"
[
style
.
color
]="
task
.
symbol
.
color
"
[
fontIcon
]="
task
.
symbol
.
symbol
"
></mat-icon>
<mat-icon
*
ngIf=
"task.symbol.symbol"
[
style
.
color
]="
task
.
symbol
.
color
"
[
fontIcon
]="
task
.
symbol
.
symbol
"
></mat-icon>
</button>
</button>
</div>
</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"
placeholder=
"Mettre le site web en ligne"
matTooltip=
"Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltip=
"Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
...
@@ -162,8 +162,8 @@
...
@@ -162,8 +162,8 @@
<div
class=
"piece-form-bottom-duration"
<div
class=
"piece-form-bottom-duration"
matTooltip=
"Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltip=
"Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
<input
name=
"value"
type=
"number"
[(
ngModel
)]="
task
.
duration
"
(
input
)="
durationChange
()"
min=
"1"
(
change
)="
task
.
duration
<
1
?
task
.
duration =
1
:
''"
/>
<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
()"
>
<select
name=
"unite"
[(
ngModel
)]="
task
.
durationUnit
"
(
change
)="
durationChange
()
;
editTrace
($
event
,'
Task_duration_unit
')
"
>
<option
value=
"UT"
>
UT
</option>
<option
value=
"UT"
>
UT
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"tours"
>
tours
</option>
<option
value=
"tours"
>
tours
</option>
...
...
src/app/pieces/tasks/final-task/final-task.component.ts
View file @
fb73c7b0
...
@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
...
@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
MatSnackBar
}
from
'@angular/material/snack-bar'
;
import
{
MatSnackBar
}
from
'@angular/material/snack-bar'
;
import
{
IdentifierSnackbarComponent
}
from
'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component'
;
import
{
IdentifierSnackbarComponent
}
from
'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component'
;
import
{
Trace
}
from
'src/app/class/trace/trace'
;
@
Component
({
@
Component
({
selector
:
'app-final-task'
,
selector
:
'app-final-task'
,
...
@@ -30,7 +31,9 @@ export class FinalTaskComponent implements OnInit {
...
@@ -30,7 +31,9 @@ export class FinalTaskComponent implements OnInit {
@
Input
()
task
:
Task
=
new
Task
(
'normal'
);
@
Input
()
task
:
Task
=
new
Task
(
'normal'
);
@
Input
()
scenario
:
Scenario
=
new
Scenario
();
@
Input
()
scenario
:
Scenario
=
new
Scenario
();
@
Input
()
mission
!
:
Mission
;
@
Input
()
mission
!
:
Mission
;
@
Input
()
missionIndex
:
number
=
0
;
@
Input
()
role
!
:
Role
;
@
Input
()
role
!
:
Role
;
@
Input
()
roleIndex
:
number
=
0
;
@
Input
()
i
!
:
number
;
@
Input
()
i
!
:
number
;
@
Input
()
j
!
:
number
;
@
Input
()
j
!
:
number
;
...
@@ -104,6 +107,9 @@ export class FinalTaskComponent implements OnInit {
...
@@ -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 {
...
@@ -120,6 +126,7 @@ export class FinalTaskComponent implements OnInit {
}
}
this
.
task
.
changeType
(
type
);
this
.
task
.
changeType
(
type
);
this
.
mission
.
equalizeLengths
();
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
{
onClickDelete
():
void
{
...
@@ -137,6 +144,9 @@ export class FinalTaskComponent implements OnInit {
...
@@ -137,6 +144,9 @@ export class FinalTaskComponent implements OnInit {
});
});
this
.
role
.
removeTask
(
this
.
i
,
this
.
j
);
this
.
role
.
removeTask
(
this
.
i
,
this
.
j
);
this
.
mission
.
equalizeLengths
();
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 {
...
@@ -153,13 +163,20 @@ export class FinalTaskComponent implements OnInit {
this
.
task
.
symbol
.
symbol
=
symbol
;
this
.
task
.
symbol
.
symbol
=
symbol
;
this
.
task
.
symbol
.
color
=
symbolColor
;
this
.
task
.
symbol
.
color
=
symbolColor
;
this
.
displaySymbolChoice
=
'hide'
;
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
{
changeDisplayPrerequires
():
void
{
if
(
this
.
displayPrequires
==
'show'
)
{
if
(
this
.
displayPrequires
==
'show'
)
{
this
.
displayPrequires
=
'hide'
;
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
{
}
else
{
this
.
displayPrequires
=
'show'
;
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 {
...
@@ -244,6 +261,7 @@ export class FinalTaskComponent implements OnInit {
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
task
.
identifier
=
''
;
this
.
task
.
identifier
=
''
;
}
}
this
.
editTrace
(
event
,
'Task_identifier'
);
}
}
checkboxChangedTask
(
event
:
any
,
task
:(
Task
|
null
)):
void
{
checkboxChangedTask
(
event
:
any
,
task
:(
Task
|
null
)):
void
{
...
@@ -265,11 +283,13 @@ export class FinalTaskComponent implements OnInit {
...
@@ -265,11 +283,13 @@ export class FinalTaskComponent implements OnInit {
onCheckTask
(
task
:
Task
):
void
{
onCheckTask
(
task
:
Task
):
void
{
this
.
task
.
prerequireTasks
.
push
(
new
PrerequireTask
(
task
.
identifier
));
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
{
onUncheckTask
(
task
:
Task
):
void
{
let
i
:
number
=
this
.
task
.
prerequireTasks
.
findIndex
(
element
=>
element
.
identifier
==
task
.
identifier
);
let
i
:
number
=
this
.
task
.
prerequireTasks
.
findIndex
(
element
=>
element
.
identifier
==
task
.
identifier
);
this
.
task
.
prerequireTasks
.
splice
(
i
,
1
);
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
{
checkboxChangedRessource
(
event
:
any
,
ressource
:
Ressource
):
void
{
...
@@ -286,11 +306,13 @@ export class FinalTaskComponent implements OnInit {
...
@@ -286,11 +306,13 @@ export class FinalTaskComponent implements OnInit {
onCheckRessource
(
ressource
:
Ressource
):
void
{
onCheckRessource
(
ressource
:
Ressource
):
void
{
this
.
task
.
prerequireRessources
.
push
(
new
PrerequireRessource
(
ressource
));
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
{
onUncheckRessource
(
ressource
:
Ressource
):
void
{
let
i
:
number
=
this
.
task
.
prerequireRessources
.
findIndex
(
element
=>
ressource
==
element
.
ressource
);
let
i
:
number
=
this
.
task
.
prerequireRessources
.
findIndex
(
element
=>
ressource
==
element
.
ressource
);
this
.
task
.
prerequireRessources
.
splice
(
i
,
1
);
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
{
getAssociatePrerequireRessource
(
ressource
:
Ressource
):
PrerequireRessource
{
...
@@ -309,4 +331,16 @@ export class FinalTaskComponent implements OnInit {
...
@@ -309,4 +331,16 @@ export class FinalTaskComponent implements OnInit {
});
});
return
res
;
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'
));
}
}
}
src/app/pieces/tasks/optionnal-task/optionnal-task.component.html
View file @
fb73c7b0
...
@@ -27,24 +27,24 @@
...
@@ -27,24 +27,24 @@
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
<div
class=
"piece-menu-directioncross"
>
<div
class=
"piece-menu-directioncross"
>
<div
class=
"piece-menu-directioncross-left"
>
<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."
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>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
<div
class=
"piece-menu-directioncross-updownarrows"
>
<div
class=
"piece-menu-directioncross-updownarrows"
>
<div
class=
"piece-menu-updownarrows-up"
>
<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)."
matTooltip=
"Décaler la tuile vers le haut (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
<div
class=
"piece-menu-directioncross-updownarrows-down"
>
<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)."
matTooltip=
"Décaler la tuile vers le bas (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
</div>
</div>
<div
class=
"piece-menu-directioncross-right"
>
<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."
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>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
...
@@ -155,7 +155,7 @@
...
@@ -155,7 +155,7 @@
<mat-icon
*
ngIf=
"task.symbol.symbol"
[
style
.
color
]="
task
.
symbol
.
color
"
[
fontIcon
]="
task
.
symbol
.
symbol
"
></mat-icon>
<mat-icon
*
ngIf=
"task.symbol.symbol"
[
style
.
color
]="
task
.
symbol
.
color
"
[
fontIcon
]="
task
.
symbol
.
symbol
"
></mat-icon>
</button>
</button>
</div>
</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"
placeholder=
"Partir d'un template / Partir de zéro"
matTooltip=
"Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltip=
"Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
...
@@ -163,8 +163,8 @@
...
@@ -163,8 +163,8 @@
<div
class=
"piece-form-bottom-duration"
<div
class=
"piece-form-bottom-duration"
matTooltip=
"Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltip=
"Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
<input
name=
"value"
type=
"number"
[(
ngModel
)]="
task
.
duration
"
(
input
)="
durationChange
()"
min=
"1"
(
change
)="
task
.
duration
<
1
?
task
.
duration =
1
:
''"
/>
<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
()"
>
<select
name=
"unite"
[(
ngModel
)]="
task
.
durationUnit
"
(
change
)="
durationChange
()
;
editTrace
($
event
,'
Task_duration_unit
')
"
>
<option
value=
"UT"
>
UT
</option>
<option
value=
"UT"
>
UT
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"tours"
>
tours
</option>
<option
value=
"tours"
>
tours
</option>
...
...
src/app/pieces/tasks/optionnal-task/optionnal-task.component.ts
View file @
fb73c7b0
...
@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
...
@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
MatSnackBar
}
from
'@angular/material/snack-bar'
;
import
{
MatSnackBar
}
from
'@angular/material/snack-bar'
;
import
{
IdentifierSnackbarComponent
}
from
'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component'
;
import
{
IdentifierSnackbarComponent
}
from
'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component'
;
import
{
Trace
}
from
'src/app/class/trace/trace'
;
@
Component
({
@
Component
({
selector
:
'app-optionnal-task'
,
selector
:
'app-optionnal-task'
,
...
@@ -30,7 +31,9 @@ export class OptionnalTaskComponent implements OnInit {
...
@@ -30,7 +31,9 @@ export class OptionnalTaskComponent implements OnInit {
@
Input
()
task
:
Task
=
new
Task
(
'normal'
);
@
Input
()
task
:
Task
=
new
Task
(
'normal'
);
@
Input
()
scenario
:
Scenario
=
new
Scenario
();
@
Input
()
scenario
:
Scenario
=
new
Scenario
();
@
Input
()
mission
!
:
Mission
;
@
Input
()
mission
!
:
Mission
;
@
Input
()
missionIndex
:
number
=
0
;
@
Input
()
role
!
:
Role
;
@
Input
()
role
!
:
Role
;
@
Input
()
roleIndex
:
number
=
0
;
@
Input
()
i
!
:
number
;
@
Input
()
i
!
:
number
;
@
Input
()
j
!
:
number
;
@
Input
()
j
!
:
number
;
...
@@ -104,6 +107,9 @@ export class OptionnalTaskComponent implements OnInit {
...
@@ -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 {
...
@@ -119,6 +125,7 @@ export class OptionnalTaskComponent implements OnInit {
this
.
task
.
symbol
.
symbol
=
''
;
this
.
task
.
symbol
.
symbol
=
''
;
}
}
this
.
task
.
changeType
(
type
);
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
{
onClickDelete
():
void
{
...
@@ -136,6 +143,9 @@ export class OptionnalTaskComponent implements OnInit {
...
@@ -136,6 +143,9 @@ export class OptionnalTaskComponent implements OnInit {
});
});
this
.
role
.
removeTask
(
this
.
i
,
this
.
j
);
this
.
role
.
removeTask
(
this
.
i
,
this
.
j
);
this
.
mission
.
equalizeLengths
();
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 {
...
@@ -152,13 +162,20 @@ export class OptionnalTaskComponent implements OnInit {
this
.
task
.
symbol
.
symbol
=
symbol
;
this
.
task
.
symbol
.
symbol
=
symbol
;
this
.
task
.
symbol
.
color
=
symbolColor
;
this
.
task
.
symbol
.
color
=
symbolColor
;
this
.
displaySymbolChoice
=
'hide'
;
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
{
changeDisplayPrerequires
():
void
{
if
(
this
.
displayPrequires
==
'show'
)
{
if
(
this
.
displayPrequires
==
'show'
)
{
this
.
displayPrequires
=
'hide'
;
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
{
}
else
{
this
.
displayPrequires
=
'show'
;
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 {
...
@@ -261,6 +278,7 @@ export class OptionnalTaskComponent implements OnInit {
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
task
.
identifier
=
''
;
this
.
task
.
identifier
=
''
;
}
}
this
.
editTrace
(
event
,
'Task_identifier'
);
}
}
checkboxChangedTask
(
event
:
any
,
task
:(
Task
|
null
)):
void
{
checkboxChangedTask
(
event
:
any
,
task
:(
Task
|
null
)):
void
{
...
@@ -282,11 +300,13 @@ export class OptionnalTaskComponent implements OnInit {
...
@@ -282,11 +300,13 @@ export class OptionnalTaskComponent implements OnInit {
onCheckTask
(
task
:
Task
):
void
{
onCheckTask
(
task
:
Task
):
void
{
this
.
task
.
prerequireTasks
.
push
(
new
PrerequireTask
(
task
.
identifier
));
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
{
onUncheckTask
(
task
:
Task
):
void
{
let
i
:
number
=
this
.
task
.
prerequireTasks
.
findIndex
(
element
=>
element
.
identifier
==
task
.
identifier
);
let
i
:
number
=
this
.
task
.
prerequireTasks
.
findIndex
(
element
=>
element
.
identifier
==
task
.
identifier
);
this
.
task
.
prerequireTasks
.
splice
(
i
,
1
);
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
{
checkboxChangedRessource
(
event
:
any
,
ressource
:
Ressource
):
void
{
...
@@ -303,11 +323,13 @@ export class OptionnalTaskComponent implements OnInit {
...
@@ -303,11 +323,13 @@ export class OptionnalTaskComponent implements OnInit {
onCheckRessource
(
ressource
:
Ressource
):
void
{
onCheckRessource
(
ressource
:
Ressource
):
void
{
this
.
task
.
prerequireRessources
.
push
(
new
PrerequireRessource
(
ressource
));
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
{
onUncheckRessource
(
ressource
:
Ressource
):
void
{
let
i
:
number
=
this
.
task
.
prerequireRessources
.
findIndex
(
element
=>
ressource
==
element
.
ressource
);
let
i
:
number
=
this
.
task
.
prerequireRessources
.
findIndex
(
element
=>
ressource
==
element
.
ressource
);
this
.
task
.
prerequireRessources
.
splice
(
i
,
1
);
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
{
getAssociatePrerequireRessource
(
ressource
:
Ressource
):
PrerequireRessource
{
...
@@ -326,4 +348,16 @@ export class OptionnalTaskComponent implements OnInit {
...
@@ -326,4 +348,16 @@ export class OptionnalTaskComponent implements OnInit {
});
});
return
res
;
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'
));
}
}
}
src/app/pieces/tasks/random-event/random-event.component.html
View file @
fb73c7b0
...
@@ -15,24 +15,24 @@
...
@@ -15,24 +15,24 @@
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
<div
class=
"piece-menu-directioncross"
>
<div
class=
"piece-menu-directioncross"
>
<div
class=
"piece-menu-directioncross-left"
>
<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."
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>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
<div
class=
"piece-menu-directioncross-updownarrows"
>
<div
class=
"piece-menu-directioncross-updownarrows"
>
<div
class=
"piece-menu-updownarrows-up"
>
<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)."
matTooltip=
"Décaler la tuile vers le haut (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
<div
class=
"piece-menu-directioncross-updownarrows-down"
>
<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)."
matTooltip=
"Décaler la tuile vers le bas (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
</div>
</div>
<div
class=
"piece-menu-directioncross-right"
>
<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."
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>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
...
@@ -143,7 +143,7 @@
...
@@ -143,7 +143,7 @@
<mat-icon
*
ngIf=
"task.symbol.symbol"
[
style
.
color
]="
task
.
symbol
.
color
"
[
fontIcon
]="
task
.
symbol
.
symbol
"
></mat-icon>
<mat-icon
*
ngIf=
"task.symbol.symbol"
[
style
.
color
]="
task
.
symbol
.
color
"
[
fontIcon
]="
task
.
symbol
.
symbol
"
></mat-icon>
</button>
</button>
</div>
</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"
placeholder=
"Le client modifie sa demande"
matTooltip=
"Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltip=
"Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
...
@@ -151,8 +151,8 @@
...
@@ -151,8 +151,8 @@
<div
class=
"piece-form-bottom-duration"
<div
class=
"piece-form-bottom-duration"
matTooltip=
"Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltip=
"Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
<input
name=
"value"
type=
"number"
[(
ngModel
)]="
task
.
duration
"
(
input
)="
durationChange
()"
min=
"1"
(
change
)="
task
.
duration
<
1
?
task
.
duration =
1
:
''"
/>
<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
()"
>
<select
name=
"unite"
[(
ngModel
)]="
task
.
durationUnit
"
(
change
)="
durationChange
()
;
editTrace
($
event
,'
Task_duration_unit
')
"
>
<option
value=
"UT"
>
UT
</option>
<option
value=
"UT"
>
UT
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"tours"
>
tours
</option>
<option
value=
"tours"
>
tours
</option>
...
...
src/app/pieces/tasks/random-event/random-event.component.ts
View file @
fb73c7b0
...
@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
...
@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
MatSnackBar
}
from
'@angular/material/snack-bar'
;
import
{
MatSnackBar
}
from
'@angular/material/snack-bar'
;
import
{
IdentifierSnackbarComponent
}
from
'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component'
;
import
{
IdentifierSnackbarComponent
}
from
'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component'
;
import
{
Trace
}
from
'src/app/class/trace/trace'
;
@
Component
({
@
Component
({
selector
:
'app-random-event'
,
selector
:
'app-random-event'
,
...
@@ -30,7 +31,9 @@ export class RandomEventComponent implements OnInit {
...
@@ -30,7 +31,9 @@ export class RandomEventComponent implements OnInit {
@
Input
()
task
:
Task
=
new
Task
(
'normal'
);
@
Input
()
task
:
Task
=
new
Task
(
'normal'
);
@
Input
()
scenario
:
Scenario
=
new
Scenario
();
@
Input
()
scenario
:
Scenario
=
new
Scenario
();
@
Input
()
mission
!
:
Mission
;
@
Input
()
mission
!
:
Mission
;
@
Input
()
missionIndex
:
number
=
0
;
@
Input
()
role
!
:
Role
;
@
Input
()
role
!
:
Role
;
@
Input
()
roleIndex
:
number
=
0
;
@
Input
()
i
!
:
number
;
@
Input
()
i
!
:
number
;
@
Input
()
j
!
:
number
;
@
Input
()
j
!
:
number
;
...
@@ -104,6 +107,9 @@ export class RandomEventComponent implements OnInit {
...
@@ -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 {
...
@@ -128,6 +134,9 @@ export class RandomEventComponent implements OnInit {
});
});
this
.
role
.
removeTask
(
this
.
i
,
this
.
j
);
this
.
role
.
removeTask
(
this
.
i
,
this
.
j
);
this
.
mission
.
equalizeLengths
();
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 {
...
@@ -144,13 +153,20 @@ export class RandomEventComponent implements OnInit {
this
.
task
.
symbol
.
symbol
=
symbol
;
this
.
task
.
symbol
.
symbol
=
symbol
;
this
.
task
.
symbol
.
color
=
symbolColor
;
this
.
task
.
symbol
.
color
=
symbolColor
;
this
.
displaySymbolChoice
=
'hide'
;
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
{
changeDisplayPrerequires
():
void
{
if
(
this
.
displayPrequires
==
'show'
)
{
if
(
this
.
displayPrequires
==
'show'
)
{
this
.
displayPrequires
=
'hide'
;
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
{
}
else
{
this
.
displayPrequires
=
'show'
;
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 {
...
@@ -239,6 +255,7 @@ export class RandomEventComponent implements OnInit {
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
task
.
identifier
=
''
;
this
.
task
.
identifier
=
''
;
}
}
this
.
editTrace
(
event
,
'Task_identifier'
);
}
}
checkboxChangedTask
(
event
:
any
,
task
:(
Task
|
null
)):
void
{
checkboxChangedTask
(
event
:
any
,
task
:(
Task
|
null
)):
void
{
...
@@ -260,11 +277,13 @@ export class RandomEventComponent implements OnInit {
...
@@ -260,11 +277,13 @@ export class RandomEventComponent implements OnInit {
onCheckTask
(
task
:
Task
):
void
{
onCheckTask
(
task
:
Task
):
void
{
this
.
task
.
prerequireTasks
.
push
(
new
PrerequireTask
(
task
.
identifier
));
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
{
onUncheckTask
(
task
:
Task
):
void
{
let
i
:
number
=
this
.
task
.
prerequireTasks
.
findIndex
(
element
=>
element
.
identifier
==
task
.
identifier
);
let
i
:
number
=
this
.
task
.
prerequireTasks
.
findIndex
(
element
=>
element
.
identifier
==
task
.
identifier
);
this
.
task
.
prerequireTasks
.
splice
(
i
,
1
);
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
{
checkboxChangedRessource
(
event
:
any
,
ressource
:
Ressource
):
void
{
...
@@ -281,11 +300,13 @@ export class RandomEventComponent implements OnInit {
...
@@ -281,11 +300,13 @@ export class RandomEventComponent implements OnInit {
onCheckRessource
(
ressource
:
Ressource
):
void
{
onCheckRessource
(
ressource
:
Ressource
):
void
{
this
.
task
.
prerequireRessources
.
push
(
new
PrerequireRessource
(
ressource
));
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
{
onUncheckRessource
(
ressource
:
Ressource
):
void
{
let
i
:
number
=
this
.
task
.
prerequireRessources
.
findIndex
(
element
=>
ressource
==
element
.
ressource
);
let
i
:
number
=
this
.
task
.
prerequireRessources
.
findIndex
(
element
=>
ressource
==
element
.
ressource
);
this
.
task
.
prerequireRessources
.
splice
(
i
,
1
);
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
{
getAssociatePrerequireRessource
(
ressource
:
Ressource
):
PrerequireRessource
{
...
@@ -304,4 +325,16 @@ export class RandomEventComponent implements OnInit {
...
@@ -304,4 +325,16 @@ export class RandomEventComponent implements OnInit {
});
});
return
res
;
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'
));
}
}
}
src/app/pieces/tasks/repeat-task/repeat-task.component.html
View file @
fb73c7b0
...
@@ -11,24 +11,24 @@
...
@@ -11,24 +11,24 @@
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
<div
class=
"piece-menu-directioncross"
>
<div
class=
"piece-menu-directioncross"
>
<div
class=
"piece-menu-directioncross-left"
>
<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."
matTooltip=
"Décaler la tuile vers la gauche."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
<div
class=
"piece-menu-directioncross-updownarrows"
>
<div
class=
"piece-menu-directioncross-updownarrows"
>
<div
class=
"piece-menu-updownarrows-up"
>
<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)."
matTooltip=
"Décaler la tuile vers le haut (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
<div
class=
"piece-menu-directioncross-updownarrows-down"
>
<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)."
matTooltip=
"Décaler la tuile vers le bas (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
</div>
</div>
<div
class=
"piece-menu-directioncross-right"
>
<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."
matTooltip=
"Décaler la tuile vers la droite."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<div
class=
"piece-form"
>
<div
class=
"piece-form"
>
<label>
Recommencer
<br>
le tour jusqu'à ce que :
</label>
<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"
placeholder=
"Faire valider au commanditaire"
matTooltip=
"Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltip=
"Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
...
...
src/app/pieces/tasks/repeat-task/repeat-task.component.ts
View file @
fb73c7b0
...
@@ -7,6 +7,8 @@ import { TooltipService } from 'src/app/services/tooltip/tooltip.service';
...
@@ -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
{
SuppressDialogComponent
}
from
'src/app/components/dialogs/suppress-dialog/suppress-dialog.component'
;
import
{
MatDialog
}
from
'@angular/material/dialog'
;
import
{
MatDialog
}
from
'@angular/material/dialog'
;
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
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
({
@
Component
({
selector
:
'app-repeat-task'
,
selector
:
'app-repeat-task'
,
...
@@ -17,9 +19,12 @@ export class RepeatTaskComponent implements OnInit {
...
@@ -17,9 +19,12 @@ export class RepeatTaskComponent implements OnInit {
displayMenu
:
string
=
'hide'
;
displayMenu
:
string
=
'hide'
;
@
Input
()
scenario
:
Scenario
=
new
Scenario
();
@
Input
()
task
:
Task
=
new
Task
(
'normal'
);
@
Input
()
task
:
Task
=
new
Task
(
'normal'
);
@
Input
()
mission
!
:
Mission
;
@
Input
()
mission
!
:
Mission
;
@
Input
()
missionIndex
:
number
=
0
;
@
Input
()
role
!
:
Role
;
@
Input
()
role
!
:
Role
;
@
Input
()
roleIndex
:
number
=
0
;
@
Input
()
i
!
:
number
;
@
Input
()
i
!
:
number
;
@
Input
()
j
!
:
number
;
@
Input
()
j
!
:
number
;
...
@@ -36,6 +41,9 @@ export class RepeatTaskComponent implements OnInit {
...
@@ -36,6 +41,9 @@ export class RepeatTaskComponent implements OnInit {
dialogRef
.
afterClosed
().
subscribe
(
result
=>
{
dialogRef
.
afterClosed
().
subscribe
(
result
=>
{
if
(
result
==
true
)
{
if
(
result
==
true
)
{
this
.
task
.
objective
=
''
;
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 {
...
@@ -60,6 +68,9 @@ export class RepeatTaskComponent implements OnInit {
});
});
this
.
role
.
removeTask
(
this
.
i
,
this
.
j
);
this
.
role
.
removeTask
(
this
.
i
,
this
.
j
);
this
.
mission
.
equalizeLengths
();
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 {
...
@@ -120,4 +131,16 @@ export class RepeatTaskComponent implements OnInit {
}
}
return
[
0
,
0
];
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'
));
}
}
}
src/app/pieces/tasks/task/task.component.html
View file @
fb73c7b0
...
@@ -25,24 +25,24 @@
...
@@ -25,24 +25,24 @@
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
<div
class=
"piece-menu-directioncross"
>
<div
class=
"piece-menu-directioncross"
>
<div
class=
"piece-menu-directioncross-left"
>
<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."
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>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
<div
class=
"piece-menu-directioncross-updownarrows"
>
<div
class=
"piece-menu-directioncross-updownarrows"
>
<div
class=
"piece-menu-updownarrows-up"
>
<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)."
matTooltip=
"Décaler la tuile vers le haut (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
<div
class=
"piece-menu-directioncross-updownarrows-down"
>
<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)."
matTooltip=
"Décaler la tuile vers le bas (ceci placera la tuile à la fin de la ligne)."
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
</div>
</div>
<div
class=
"piece-menu-directioncross-right"
>
<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."
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>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></mat-icon>
</div>
</div>
...
@@ -153,7 +153,7 @@
...
@@ -153,7 +153,7 @@
<mat-icon
*
ngIf=
"task.symbol.symbol"
[
style
.
color
]="
task
.
symbol
.
color
"
[
fontIcon
]="
task
.
symbol
.
symbol
"
></mat-icon>
<mat-icon
*
ngIf=
"task.symbol.symbol"
[
style
.
color
]="
task
.
symbol
.
color
"
[
fontIcon
]="
task
.
symbol
.
symbol
"
></mat-icon>
</button>
</button>
</div>
</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"
placeholder=
"Positionner dans l'ordre les balises HTML principales"
matTooltip=
"Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltip=
"Action à effectuer (interagir avec un objet, parler avec quelqu'un, …)"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
...
@@ -161,8 +161,8 @@
...
@@ -161,8 +161,8 @@
<div
class=
"piece-form-bottom-duration"
<div
class=
"piece-form-bottom-duration"
matTooltip=
"Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltip=
"Durée de la tâche (en unité de temps, minutes ou tours)"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
<input
name=
"value"
type=
"number"
[(
ngModel
)]="
task
.
duration
"
(
input
)="
durationChange
()"
min=
"1"
(
change
)="
task
.
duration
<
1
?
task
.
duration =
1
:
''"
/>
<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
()"
>
<select
name=
"unite"
[(
ngModel
)]="
task
.
durationUnit
"
(
change
)="
durationChange
()
;
editTrace
($
event
,'
Task_duration_unit
')
"
>
<option
value=
"UT"
>
UT
</option>
<option
value=
"UT"
>
UT
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"tours"
>
tours
</option>
<option
value=
"tours"
>
tours
</option>
...
...
src/app/pieces/tasks/task/task.component.ts
View file @
fb73c7b0
...
@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
...
@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
MatSnackBar
}
from
'@angular/material/snack-bar'
;
import
{
MatSnackBar
}
from
'@angular/material/snack-bar'
;
import
{
IdentifierSnackbarComponent
}
from
'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component'
;
import
{
IdentifierSnackbarComponent
}
from
'src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component'
;
import
{
Trace
}
from
'src/app/class/trace/trace'
;
@
Component
({
@
Component
({
selector
:
'app-task'
,
selector
:
'app-task'
,
...
@@ -30,7 +31,9 @@ export class TaskComponent implements OnInit {
...
@@ -30,7 +31,9 @@ export class TaskComponent implements OnInit {
@
Input
()
task
:
Task
=
new
Task
(
'normal'
);
@
Input
()
task
:
Task
=
new
Task
(
'normal'
);
@
Input
()
scenario
:
Scenario
=
new
Scenario
();
@
Input
()
scenario
:
Scenario
=
new
Scenario
();
@
Input
()
mission
:
Mission
=
new
Mission
();
@
Input
()
mission
:
Mission
=
new
Mission
();
@
Input
()
missionIndex
:
number
=
0
;
@
Input
()
role
!
:
Role
;
@
Input
()
role
!
:
Role
;
@
Input
()
roleIndex
:
number
=
0
;
@
Input
()
i
!
:
number
;
@
Input
()
i
!
:
number
;
@
Input
()
j
!
:
number
;
@
Input
()
j
!
:
number
;
...
@@ -104,6 +107,9 @@ export class TaskComponent implements OnInit {
...
@@ -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 {
...
@@ -119,6 +125,7 @@ export class TaskComponent implements OnInit {
this
.
task
.
symbol
.
symbol
=
''
;
this
.
task
.
symbol
.
symbol
=
''
;
}
}
this
.
task
.
changeType
(
type
);
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
{
onClickDelete
():
void
{
...
@@ -136,6 +143,9 @@ export class TaskComponent implements OnInit {
...
@@ -136,6 +143,9 @@ export class TaskComponent implements OnInit {
});
});
this
.
role
.
removeTask
(
this
.
i
,
this
.
j
);
this
.
role
.
removeTask
(
this
.
i
,
this
.
j
);
this
.
mission
.
equalizeLengths
();
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 {
...
@@ -152,13 +162,20 @@ export class TaskComponent implements OnInit {
this
.
task
.
symbol
.
symbol
=
symbol
;
this
.
task
.
symbol
.
symbol
=
symbol
;
this
.
task
.
symbol
.
color
=
symbolColor
;
this
.
task
.
symbol
.
color
=
symbolColor
;
this
.
displaySymbolChoice
=
'hide'
;
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
{
changeDisplayPrerequires
():
void
{
if
(
this
.
displayPrequires
==
'show'
)
{
if
(
this
.
displayPrequires
==
'show'
)
{
this
.
displayPrequires
=
'hide'
;
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
{
}
else
{
this
.
displayPrequires
=
'show'
;
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 {
...
@@ -272,6 +289,7 @@ export class TaskComponent implements OnInit {
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
task
.
identifier
=
''
;
this
.
task
.
identifier
=
''
;
}
}
this
.
editTrace
(
event
,
'Task_identifier'
);
}
}
checkboxChangedTask
(
event
:
any
,
task
:(
Task
|
null
)):
void
{
checkboxChangedTask
(
event
:
any
,
task
:(
Task
|
null
)):
void
{
...
@@ -293,11 +311,13 @@ export class TaskComponent implements OnInit {
...
@@ -293,11 +311,13 @@ export class TaskComponent implements OnInit {
onCheckTask
(
task
:
Task
):
void
{
onCheckTask
(
task
:
Task
):
void
{
this
.
task
.
prerequireTasks
.
push
(
new
PrerequireTask
(
task
.
identifier
));
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
{
onUncheckTask
(
task
:
Task
):
void
{
let
i
:
number
=
this
.
task
.
prerequireTasks
.
findIndex
(
element
=>
element
.
identifier
==
task
.
identifier
);
let
i
:
number
=
this
.
task
.
prerequireTasks
.
findIndex
(
element
=>
element
.
identifier
==
task
.
identifier
);
this
.
task
.
prerequireTasks
.
splice
(
i
,
1
);
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
{
checkboxChangedRessource
(
event
:
any
,
ressource
:
Ressource
):
void
{
...
@@ -314,11 +334,13 @@ export class TaskComponent implements OnInit {
...
@@ -314,11 +334,13 @@ export class TaskComponent implements OnInit {
onCheckRessource
(
ressource
:
Ressource
):
void
{
onCheckRessource
(
ressource
:
Ressource
):
void
{
this
.
task
.
prerequireRessources
.
push
(
new
PrerequireRessource
(
ressource
));
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
{
onUncheckRessource
(
ressource
:
Ressource
):
void
{
let
i
:
number
=
this
.
task
.
prerequireRessources
.
findIndex
(
element
=>
ressource
==
element
.
ressource
);
let
i
:
number
=
this
.
task
.
prerequireRessources
.
findIndex
(
element
=>
ressource
==
element
.
ressource
);
this
.
task
.
prerequireRessources
.
splice
(
i
,
1
);
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
{
getAssociatePrerequireRessource
(
ressource
:
Ressource
):
PrerequireRessource
{
...
@@ -337,4 +359,16 @@ export class TaskComponent implements OnInit {
...
@@ -337,4 +359,16 @@ export class TaskComponent implements OnInit {
});
});
return
res
;
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment