task.component.html 28.5 KB
Newer Older
Romain DELEAU's avatar
Romain DELEAU committed
1
<div class="piece" [ngStyle]="{'width': pieceWidth+'px'}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'" (click)="onClickPiece()"
2 3
    [style.background]="task.supplementaryRole ?
    'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)'
4
    : 'var(--piece-background-color)'"
5
    [class]="pieceDetailsService.piece == task ? 'isActive' : 'border'">
Romain DELEAU's avatar
Romain DELEAU committed
6
    <div class="piece-attach piece-attach-left"></div>
7
    <div class="piece-attach piece-attach-right" [style.background]="task.supplementaryRole ? task.supplementaryRole.color : 'var(--piece-background-color)'"></div>
Romain DELEAU's avatar
Romain DELEAU committed
8

Romain DELEAU's avatar
Romain DELEAU committed
9
    <div class="piece-menu" [class]="displayMenu">
Romain DELEAU's avatar
Romain DELEAU committed
10
        <div>
11
            <mat-icon fontIcon="change_circle" [matMenuTriggerFor]="menuChange"
12
            [matTooltip]="translate.instant('task_transform_tooltip')"
13
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
Romain DELEAU's avatar
Romain DELEAU committed
14
            <mat-menu #menuChange="matMenu">
15 16 17
                <button class="piece-menu-changeMenuButton" [style.background-color]="'#bccecc'" mat-menu-item (click)="onClickChange('annexe')">{{'task_transform_annexeTask' | translate}}</button>
                <button class="piece-menu-changeMenuButton" [style.background-color]="'#e8e3b3'" mat-menu-item (click)="onClickChange('optionnal')">{{'task_transform_optionnalTask' | translate}}</button>
                <button class="piece-menu-changeMenuButton" [style.background-color]="'#b28386'" mat-menu-item (click)="onClickChange('final')" *ngIf="canChangeInFinalTask()">{{'task_transform_finalTask' | translate}}</button>
Romain DELEAU's avatar
Romain DELEAU committed
18 19
            </mat-menu>
        </div>
20
        <mat-icon fontIcon="backspace" (click)="onClickErase()"
21
        [matTooltip]="translate.instant('clearPiece_tooltip')"
22 23
        matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
        <mat-icon fontIcon="delete" (click)="onClickDelete()"
24
        [matTooltip]="translate.instant('deletePiece_tooltip')"
25
        matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
26 27
        <div class="piece-menu-directioncross">
            <div class="piece-menu-directioncross-left">
28
                <mat-icon style="transform: rotate(0turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('left'); editMoveTrace($event,'Task_moveLeft')"
29
                [matTooltip]="translate.instant('moveLeft_tooltip')"
30 31 32 33
                matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>                
            </div>
            <div class="piece-menu-directioncross-updownarrows">
                <div class="piece-menu-updownarrows-up">
34
                    <mat-icon style="transform: rotate(0.25turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('top'); editMoveTrace($event,'Task_moveTop')"
35
                    [matTooltip]="translate.instant('moveTop_tooltip')"
36 37 38
                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>                
                </div>
                <div class="piece-menu-directioncross-updownarrows-down">
39
                    <mat-icon style="transform: rotate(0.75turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('bottom'); editMoveTrace($event,'Task_moveBottom')"
40
                    [matTooltip]="translate.instant('moveBottom_tooltip')"
41 42 43 44
                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
                </div>
            </div>
            <div class="piece-menu-directioncross-right">
45
                <mat-icon style="transform: rotate(0.5turn) scale(0.6);" fontIcon="arrow_back_ios" (click)="moveTask('right'); editMoveTrace($event,'Task_moveRight')"
46
                [matTooltip]="translate.instant('moveRight_tooltip')"
47 48 49
                matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
            </div>
        </div>
Romain DELEAU's avatar
Romain DELEAU committed
50 51
    </div>

Romain DELEAU's avatar
Romain DELEAU committed
52
    <div class="piece-symbolchoice" [class]="displaySymbolChoice">
53
        <div class="piece-symbolchoice-header">
54
            <label>{{'task_common_label' | translate}}</label>
55 56
            <div><mat-icon fontIcon="delete" (click)="setSymbol('','')"></mat-icon></div>
        </div>
Romain DELEAU's avatar
Romain DELEAU committed
57
        <div class="piece-symbolchoice-symbols">
58 59 60 61 62 63 64 65 66
            <mat-icon [style.color]="'#d79297'" fontIcon="favorite" (click)="canUseSymbol('favorite','#d79297') == 'enable' ? setSymbol('favorite','#d79297') : ''" [ngClass]="canUseSymbol('favorite','#d79297')"></mat-icon>
            <mat-icon [style.color]="'#9ad5ec'" fontIcon="diamond" (click)="canUseSymbol('diamond','#9ad5ec') == 'enable' ? setSymbol('diamond','#9ad5ec') : ''" [ngClass]="canUseSymbol('diamond','#9ad5ec')"></mat-icon>
            <mat-icon [style.color]="'#e9ec54'" fontIcon="star" (click)="canUseSymbol('star','#e9ec54') == 'enable' ? setSymbol('star','#e9ec54') : ''" [ngClass]="canUseSymbol('star','#e9ec54')"></mat-icon>
            <mat-icon [style.color]="'#f5cee3'" fontIcon="hexagon" (click)="canUseSymbol('hexagon','#f5cee3') == 'enable' ? setSymbol('hexagon','#f5cee3') : ''" [ngClass]="canUseSymbol('hexagon','#f5cee3')"></mat-icon>
            <mat-icon [style.color]="'#d3d2d2'" fontIcon="add" (click)="canUseSymbol('add','#d3d2d2') == 'enable' ? setSymbol('add','#d3d2d2') : ''" [ngClass]="canUseSymbol('add','#d3d2d2')"></mat-icon>
            <mat-icon [style.color]="'#9ad5ec'" fontIcon="circle" (click)="canUseSymbol('circle','#9ad5ec') == 'enable' ? setSymbol('circle','#9ad5ec') : ''" [ngClass]="canUseSymbol('circle','#9ad5ec')"></mat-icon>
            <mat-icon [style.color]="'#b6cc87'" fontIcon="eco" (click)="canUseSymbol('eco','#b6cc87') == 'enable' ? setSymbol('eco','#b6cc87') : ''" [ngClass]="canUseSymbol('eco','#b6cc87')"></mat-icon>
            <mat-icon [style.color]="'#d0bbdb'" fontIcon="play_arrow" (click)="canUseSymbol('play_arrow','#d0bbdb') == 'enable' ? setSymbol('play_arrow','#d0bbdb') : ''" [ngClass]="canUseSymbol('play_arrow','#d0bbdb')"></mat-icon>
            <mat-icon [style.color]="'#8b7e64'" fontIcon="remove" (click)="canUseSymbol('remove','#8b7e64') == 'enable' ? setSymbol('remove','#8b7e64') : ''" [ngClass]="canUseSymbol('remove','#8b7e64')"></mat-icon>
Romain DELEAU's avatar
Romain DELEAU committed
67 68
        </div>
        <div class="piece-symbolchoice-symbols">
69 70 71 72 73 74 75 76 77
            <mat-icon [style.color]="'#d79297'" fontIcon="square" (click)="canUseSymbol('square','#d79297') == 'enable' ? setSymbol('square','#d79297') : ''" [ngClass]="canUseSymbol('square','#d79297')"></mat-icon>
            <mat-icon [style.color]="'#9ad5ec'" fontIcon="square" (click)="canUseSymbol('square','#9ad5ec') == 'enable' ? setSymbol('square','#9ad5ec') : ''" [ngClass]="canUseSymbol('square','#9ad5ec')"></mat-icon>
            <mat-icon [style.color]="'#e9ec54'" fontIcon="square" (click)="canUseSymbol('square','#e9ec54') == 'enable' ? setSymbol('square','#e9ec54') : ''" [ngClass]="canUseSymbol('square','#e9ec54')"></mat-icon>
            <mat-icon [style.color]="'#f5cee3'" fontIcon="square" (click)="canUseSymbol('square','#f5cee3') == 'enable' ? setSymbol('square','#f5cee3') : ''" [ngClass]="canUseSymbol('square','#f5cee3')"></mat-icon>
            <mat-icon [style.color]="'#d3d2d2'" fontIcon="square" (click)="canUseSymbol('square','#d3d2d2') == 'enable' ? setSymbol('square','#d3d2d2') : ''" [ngClass]="canUseSymbol('square','#d3d2d2')"></mat-icon>
            <mat-icon [style.color]="'#9ad5ec'" fontIcon="square" (click)="canUseSymbol('square','#9ad5ec') == 'enable' ? setSymbol('square','#9ad5ec') : ''" [ngClass]="canUseSymbol('square','#9ad5ec')"></mat-icon>
            <mat-icon [style.color]="'#b6cc87'" fontIcon="square" (click)="canUseSymbol('square','#b6cc87') == 'enable' ? setSymbol('square','#b6cc87') : ''" [ngClass]="canUseSymbol('square','#b6cc87')"></mat-icon>
            <mat-icon [style.color]="'#d0bbdb'" fontIcon="square" (click)="canUseSymbol('square','#d0bbdb') == 'enable' ? setSymbol('square','#d0bbdb') : ''" [ngClass]="canUseSymbol('square','#d0bbdb')"></mat-icon>
            <mat-icon [style.color]="'#8b7e64'" fontIcon="square" (click)="canUseSymbol('square','#8b7e64') == 'enable' ? setSymbol('square','#8b7e64') : ''" [ngClass]="canUseSymbol('square','#8b7e64')"></mat-icon>
Romain DELEAU's avatar
Romain DELEAU committed
78
        </div>
Romain DELEAU's avatar
Romain DELEAU committed
79
    </div>
Romain DELEAU's avatar
Romain DELEAU committed
80

81
    <div class="piece-prerequires" [class]="pieceDetailsService.piece == task ? displayPrequires : 'hide'">
Romain DELEAU's avatar
Romain DELEAU committed
82
        <div class="piece-prerequires-prerequires">
83
            <label class="piece-prerequires-title">{{'task_prerequire_antecedents_title' | translate}}</label>
Romain DELEAU's avatar
Romain DELEAU committed
84
            <div class="piece-prerequires-form">
85 86 87
                <ng-container *ngIf="hasPossibleAntecedents()">
                    <ng-container *ngFor="let inlineTask of role.tasks">
                        <ng-container *ngFor="let element of inlineTask; let index = index">
88
                            <div class="piece-prerequires-prerequires-element" *ngIf="element?.identifier && (task.identifier != element?.identifier) && element?.type != 'annexe'">
89 90 91 92
                                <input name="antecedent" type="checkbox" [checked]="isCheckedTask(element)" (change)="checkboxChangedTask($event, element)"/>
                                <label for="antecedent">{{element?.identifier}}</label>
                            </div>
                        </ng-container>
Romain DELEAU's avatar
Romain DELEAU committed
93 94
                    </ng-container>
                </ng-container>
95
                <div style="text-align: center;" *ngIf="!hasPossibleAntecedents()">{{'task_prerequire_antecedents_err2' | translate}}</div>
Romain DELEAU's avatar
Romain DELEAU committed
96 97 98
            </div>
        </div>
        <div class="piece-prerequires-ressources">
99
            <label class="piece-prerequires-title">{{'task_prerequire_ressource_title' | translate}}</label>
Romain DELEAU's avatar
Romain DELEAU committed
100
            <div class="piece-prerequires-form">
Romain DELEAU's avatar
Romain DELEAU committed
101 102 103 104
                <ng-container *ngFor="let ressource of scenario.ressources">
                    <div class="piece-prerequires-ressources-element" *ngIf="ressource.name">
                        <div class="piece-prerequires-ressources-element-checkbox">
                            <input name="ressource" type="checkbox" (change)="checkboxChangedRessource($event, ressource)" [checked]="isCheckedRessource(ressource)"/>
Romain DELEAU's avatar
Romain DELEAU committed
105
                            <label for="ressource" [title]="ressource.name">{{ressource.name}}</label>   
Romain DELEAU's avatar
Romain DELEAU committed
106 107 108 109 110 111 112 113 114 115 116
                        </div>
                        <div class="piece-prerequires-ressources-element-quantity" *ngIf="isCheckedRessource(ressource)">
                            <select name="ressource" [(ngModel)]="getAssociatePrerequireRessource(ressource).operator">
                                <option><</option>
                                <option><=</option>
                                <option>=</option>
                                <option>>=</option>
                                <option>></option>
                            </select>
                            <input type="text" value="1" [(ngModel)]="getAssociatePrerequireRessource(ressource).quantity"/> 
                        </div>
Romain DELEAU's avatar
Romain DELEAU committed
117
                    </div>
Romain DELEAU's avatar
Romain DELEAU committed
118 119 120 121 122
                </ng-container>
                <ng-container *ngFor="let ressource of role.ressources">
                    <div class="piece-prerequires-ressources-element" *ngIf="ressource.name">
                        <div class="piece-prerequires-ressources-element-checkbox">
                            <input name="ressource" type="checkbox" (change)="checkboxChangedRessource($event, ressource)" [checked]="isCheckedRessource(ressource)"/>
Romain DELEAU's avatar
Romain DELEAU committed
123
                            <label for="ressource" [title]="ressource.name">{{ressource.name}}</label>   
Romain DELEAU's avatar
Romain DELEAU committed
124 125 126 127 128 129 130 131 132 133 134
                        </div>
                        <div class="piece-prerequires-ressources-element-quantity" *ngIf="isCheckedRessource(ressource)">
                            <select name="ressource" [(ngModel)]="getAssociatePrerequireRessource(ressource).operator">
                                <option><</option>
                                <option><=</option>
                                <option>=</option>
                                <option>>=</option>
                                <option>></option>
                            </select>
                            <input type="text" value="1" [(ngModel)]="getAssociatePrerequireRessource(ressource).quantity"/> 
                        </div>
Romain DELEAU's avatar
Romain DELEAU committed
135
                    </div>
Romain DELEAU's avatar
Romain DELEAU committed
136
                </ng-container>
Romain DELEAU's avatar
Romain DELEAU committed
137 138
            </div>
        </div>
Romain DELEAU's avatar
Romain DELEAU committed
139 140
    </div>

Romain DELEAU's avatar
Romain DELEAU committed
141 142
    <div class="piece-form">
        <div class="piece-form-top">
143
            <input class="piece-form-top-identifier" name="identifier" type="text" [(ngModel)]="task.identifier" (change)="changeIdentifier($event)" placeholder="A" min="1" maxlength="5"
144
            [matTooltip]="translate.instant('task_identifier_tooltip')"
145
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"/>
146
            <div class="piece-form-top-title">{{'normalTask_title' | translate}}</div>
Romain DELEAU's avatar
Romain DELEAU committed
147
            <mat-icon class="piece-form-top-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon>
148
            <mat-icon class="piece-form-top-repeat" fontIcon="refresh" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '') && !unityService.unity_isActive"></mat-icon>
149
            <span class="piece-form-top-repeat-off" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '') && !unityService.unity_isActive && task.repeat.limitMissionRepeat == 1"></span>
150
            <button mat-button class="piece-form-top-symbol" (click)="changeDisplaySymbolChoice()"
151
            [matTooltip]="translate.instant('task_common_tooltip')"
152
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
Romain DELEAU's avatar
Romain DELEAU committed
153
                <mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon>
154
            </button>    
Romain DELEAU's avatar
Romain DELEAU committed
155
        </div>
Romain DELEAU's avatar
Romain DELEAU committed
156
        <textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action'); validTutorialPhase6();" [style.background-image]="(i == findFirstIndexOfTaskType('normal')[0] && j == findFirstIndexOfTaskType('normal')[1]) ? urlIcon : ''"
157
            *ngIf="!unityService.unity_isActive"
158 159
            [placeholder]="translate.instant('normalTask_action_placeholder')"
            [matTooltip]="translate.instant('task_action_tooltip')"
160
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea>
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
        
        <div class="piece-form-content piece-form-content-unity" *ngIf="unityService.unity_isActive">
            <div class="piece-form-content-unity-type">
                <label for="type">{{'task_unity_type_label' | translate}}</label>
                <select name="type" [(ngModel)]="task.typeUnity" (change)="task.resetUnityContent()">
                    <option value="getObject">{{'task_unity_type_getObject' | translate}}</option>
                    <option value="character">{{'task_unity_type_character' | translate}}</option>
                    <option value="combineObjects">{{'task_unity_type_combineObjects' | translate}}</option>
                    <option value="talkWithRole">{{'task_unity_type_talkWithRole' | translate}}</option>
                    <option value="exchangeObjects">{{'task_unity_type_exchangeObjects' | translate}}</option>
                    <option value="depositObject">{{'task_unity_type_depositObject' | translate}}</option>
                    <option value="askToSeeRole">{{'task_unity_type_askToSeeRole' | translate}}</option>
                    <option value="interactObject">{{'task_unity_type_interactObject' | translate}}</option>
                    <option value="other">{{'task_unity_type_other' | translate}}</option>
                </select>
            </div>
            <div class="piece-form-content-unity-typeContent">
                
                <div class="piece-form-content-unity-typeContent-getObject" *ngIf="task.typeUnity == 'getObject'">
                    <input type="number" [(ngModel)]="task.objectQuantity"/>
                    <select [(ngModel)]="task.object">
                        <option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
                        <ng-container *ngFor="let ressource of scenario.ressources">
                            <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                        </ng-container>
                        <ng-container *ngFor="let role2 of mission.roles">
                            <ng-container *ngIf="role2 != role">
                                <ng-container *ngFor="let ressource of role2.ressources">
                                    <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                </ng-container>
                            </ng-container>
                        </ng-container>
                    </select>                    
                </div>

                <div class="piece-form-content-unity-typeContent-character" *ngIf="task.typeUnity == 'character'">
                    <select [(ngModel)]="task.character">
                        <option [ngValue]="null" selected disabled>{{'task_unity_characterName_label' | translate}}</option>
                        <option *ngFor="let character of scenario.characters" [ngValue]="character">{{character.name}}</option>
                    </select>
                </div>

                <div class="piece-form-content-unity-typeContent-combineObjects" *ngIf="task.typeUnity == 'combineObjects'">
                    <div class="piece-form-content-unity-typeContent-combineObjects-element" *ngFor="let element of task.combineObjects, let elementIndex = index">
                        <button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeCombineObject(elementIndex)" *ngIf="task.combineObjects.length > 2"><mat-icon fontIcon="remove"></mat-icon></button>
                        <div class="piece-form-content-unity-typeContent-combineObjects-element-object">
                            <input type="number" [(ngModel)]="element[1]"/>
                            <select [(ngModel)]="element[0]">
                                <option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
                                <ng-container *ngFor="let ressource of role.ressources">
                                    <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                </ng-container>
                            </select>                        
                        </div>
                    </div>
                    <button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addCombineObject()"><mat-icon fontIcon="add"></mat-icon></button>
                </div>

                <div class="piece-form-content-unity-typeContent-talkWithRole" *ngIf="task.typeUnity == 'talkWithRole'">
                    <select [(ngModel)]="task.role">
                        <option [ngValue]="''" selected disabled>{{'task_unity_roleName_label' | translate}}</option>
                        <ng-container *ngFor="let selectableRole of mission.roles">
                            <option *ngIf="selectableRole != role && selectableRole.intitule != ''">{{selectableRole.intitule}}</option>
                        </ng-container>
                    </select>
                </div>

                <div class="piece-form-content-unity-typeContent-exchangeObjects" *ngIf="task.typeUnity == 'exchangeObjects'">
                    <div class="piece-form-content-unity-typeContent-exchangeObjects-give">
                        <label>{{'task_unity_exchangeObjects_give_label' | translate}}</label>
                        <div class="piece-form-content-unity-typeContent-exchangeObjects-element" *ngFor="let element of task.giveObjects, let elementIndex = index">
                            <button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeExchangeGiveObject(elementIndex)" *ngIf="task.giveObjects.length > 1"><mat-icon fontIcon="remove"></mat-icon></button>
                            <div class="piece-form-content-unity-typeContent-exchangeObjects-element-object">
                                <input type="number" [(ngModel)]="element[1]"/>
                                <select [(ngModel)]="element[0]">
                                    <option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
                                    <ng-container *ngFor="let ressource of role.ressources">
                                        <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                    </ng-container>
                                </select>                        
                            </div>
                        </div>
                        <button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addExchangeGiveObject()"><mat-icon fontIcon="add"></mat-icon></button>
                    </div>

                    <div class="piece-form-content-unity-typeContent-exchangeObjects-receive">
                        <select [(ngModel)]="task.character">
                            <option [ngValue]="null" selected disabled>{{'task_unity_characterName_label' | translate}}</option>
                            <option *ngFor="let character of scenario.characters" [ngValue]="character">{{character.name}}</option>
                        </select>
                        <label>{{'task_unity_exchangeObjects_receive_label' | translate}}</label>
                        <div class="piece-form-content-unity-typeContent-exchangeObjects-element" *ngFor="let element of task.receiveObjects, let elementIndex = index">
                            <button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeExchangeReceiveObject(elementIndex)" *ngIf="task.receiveObjects.length > 1"><mat-icon fontIcon="remove"></mat-icon></button>
                            <div class="piece-form-content-unity-typeContent-exchangeObjects-element-object">
                                <input type="number" [(ngModel)]="element[1]"/>
                                <select [(ngModel)]="element[0]">
                                    <option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
                                    <ng-container *ngFor="let ressource of scenario.ressources">
                                        <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                    </ng-container>
                                </select>                        
                            </div>
                        </div>
                        <button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addExchangeReceiveObject()"><mat-icon fontIcon="add"></mat-icon></button>
                    </div>
                </div>

                <div class="piece-form-content-unity-typeContent-depositObject" *ngIf="task.typeUnity == 'depositObject'">
                    <input type="number" [(ngModel)]="task.objectQuantity"/>
                    <select [(ngModel)]="task.object">
                        <option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
                        <ng-container *ngFor="let ressource of role.ressources">
                            <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                        </ng-container>
                    </select>  
                </div>

                <div class="piece-form-content-unity-typeContent-askToSeeRole" *ngIf="task.typeUnity == 'askToSeeRole'">
                    <select [(ngModel)]="task.role">
                        <option [ngValue]="''" selected disabled>{{'task_unity_roleName_label' | translate}}</option>
                        <ng-container *ngFor="let selectableRole of mission.roles">
                            <option *ngIf="selectableRole != role && selectableRole.intitule != ''">{{selectableRole.intitule}}</option>
                        </ng-container>
                    </select>
                </div>

                <div class="piece-form-content-unity-typeContent-interactObject" *ngIf="task.typeUnity == 'interactObject'">
                    <div class="piece-form-content-unity-typeContent-interactObject-select">
                        <select [(ngModel)]="task.object">
                            <option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
                            <ng-container *ngFor="let ressource of scenario.ressources">
                                <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                            </ng-container>
                            <ng-container *ngFor="let role2 of mission.roles">
                                <ng-container *ngFor="let ressource of role2.ressources">
                                    <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                </ng-container>
                            </ng-container>
                        </select>                         
                    </div>
                       
                    <div class="piece-form-content-unity-typeContent-interactObject-name">
                        <input name="interactionName" type="text" [(ngModel)]="task.interactionName" [placeholder]="translate.instant('task_unity_interactName_placeholder')"/>
                    </div>
                </div>

                <div class="piece-form-content-unity-typeContent-other" *ngIf="task.typeUnity == 'other'">
                    <textarea [(ngModel)]="task.other"></textarea>
                </div>

            </div>
            <div class="piece-form-content-unity-infos">
                <div class="piece-form-content-unity-infos-name">
                    <label for="name">{{'task_unity_name_label' | translate}}</label>
                    <input name="name" type="text" [(ngModel)]="task.name"/>
                </div>
                <div class="piece-form-content-unity-infos-desc">
                    <label for="description">{{'task_unity_desc_label' | translate}}</label>
                    <textarea name="description" [(ngModel)]="task.objective"></textarea>
                </div>  
            </div>
     
        </div>

Romain DELEAU's avatar
Romain DELEAU committed
325
        <div class="piece-form-bottom">
326
            <div class="piece-form-bottom-duration"
327
            [matTooltip]="translate.instant('task_duration_tooltip')"
328
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
329
                <input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="0" (change)="task.duration < 0 ? task.duration = 0 : ''; editTrace($event,'Task_duration')"/>
330
                <select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')">
331 332 333
                    <option value="UT">{{'task_duration_ut' | translate}}</option>
                    <option value="min">{{'task_duration_min' | translate}}</option>
                    <option value="tours">{{'task_duration_turn' | translate}}</option> 
Romain DELEAU's avatar
Romain DELEAU committed
334 335
                </select>
            </div>
336
            <mat-icon class="piece-form-bottom-character" fontIcon="person" *ngIf="task.characters.length > 0 && !unityService.unity_isActive"
Romain DELEAU's avatar
Romain DELEAU committed
337 338
                [style.color]="task.characters.length == 1 ? task.characters[0].color : 'black'"
                [style.background]="task.characters.length > 1 ? 'linear-gradient('+ task.characters[0].color +','+ task.characters[task.characters.length-1].color +')' : 'white'"></mat-icon>
339
            <mat-icon class="piece-form-bottom-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != '' && !unityService.unity_isActive"></mat-icon>
Romain DELEAU's avatar
Romain DELEAU committed
340
            <button mat-button class="piece-form-bottom-prerequires" (click)="changeDisplayPrerequires()"
341
            [matTooltip]="translate.instant('task_prerequire_tooltip')"
Romain DELEAU's avatar
Romain DELEAU committed
342
            matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
343
                {{'task_prerequire_label' | translate}}
Romain DELEAU's avatar
Romain DELEAU committed
344
            </button>
Romain DELEAU's avatar
Romain DELEAU committed
345 346 347
        </div>
    </div>
</div>