|
1 | 1 | <form [formGroup]="entryForm" (ngSubmit)="onSubmit()"> |
2 | | - <label *ngIf='canMarkEntryAsWIP'><input id='isEntryRunning' type="checkbox" (change)="onGoingToWorkOnThisChange($event)" [checked]="goingToWorkOnThis"> I am working on |
3 | | - this</label> |
| 2 | + <label *ngIf="canMarkEntryAsWIP"> |
| 3 | + <input |
| 4 | + id="isEntryRunning" |
| 5 | + type="checkbox" |
| 6 | + (change)="onGoingToWorkOnThisChange($event)" |
| 7 | + [checked]="goingToWorkOnThis" |
| 8 | + /> |
| 9 | + I am working on this |
| 10 | + </label> |
4 | 11 |
|
5 | 12 | <div class="form-group row"> |
6 | 13 | <label class="col-12 col-sm-2 col-form-label">Project:</label> |
7 | 14 | <div class="col-12 col-sm-10 autocomplete"> |
8 | 15 | <ng-autocomplete |
9 | | - (selected)='onSelectedProject($event)' |
10 | | - (inputCleared)='onClearedComponent($event)' |
| 16 | + (selected)="onSelectedProject($event)" |
| 17 | + (inputCleared)="onClearedComponent($event)" |
11 | 18 | formControlName="project_name" |
12 | 19 | [data]="listProjects" |
13 | 20 | [searchKeyword]="keyword" |
14 | 21 | historyIdentifier="projectsSelected" |
15 | 22 | notFoundText="No projects found" |
16 | 23 | placeHolder="Enter the project name" |
17 | 24 | [itemTemplate]="itemTemplate" |
18 | | - [notFoundTemplate]="notFoundTemplate"> |
| 25 | + [notFoundTemplate]="notFoundTemplate" |
| 26 | + [class.valid]="project_name.invalid" |
| 27 | + > |
19 | 28 | </ng-autocomplete> |
20 | 29 |
|
21 | 30 | <ng-template #itemTemplate let-item> |
|
33 | 42 | <!-- <app-loading-bar *ngIf="(isLoading$ | async)"></app-loading-bar> --> |
34 | 43 | </div> |
35 | 44 | </div> |
| 45 | + <div (click)="onclickFormAction(!(project_id.value && project_name.value))"> |
| 46 | + <fieldset [disabled]="!(project_id.value && project_name.value)"> |
| 47 | + <div class="form-group row"> |
| 48 | + <label class="col-12 col-sm-2 col-form-label">Activity:</label> |
| 49 | + <div class="col-12 col-sm-10"> |
| 50 | + <select |
| 51 | + [class.is-invalid]="activity_id.invalid && activity_id.touched" |
| 52 | + required |
| 53 | + id="activity_id" |
| 54 | + class="custom-select" |
| 55 | + formControlName="activity_id" |
| 56 | + > |
| 57 | + <option value="" selected="selected"></option> |
| 58 | + <option *ngFor="let activity of activities" value="{{ activity.id }}">{{ activity.name }}</option> |
| 59 | + </select> |
| 60 | + </div> |
| 61 | + <div |
| 62 | + class="invalid-feedback" |
| 63 | + *ngIf="(activity_id.dirty || activity_id.touched) && activity_id.invalid && activity_id.errors.required" |
| 64 | + ></div> |
| 65 | + </div> |
| 66 | + |
| 67 | + <div class="form-group row"> |
| 68 | + <label class="col-12 col-sm-2 col-form-label">Ticket:</label> |
| 69 | + <div class="col-12 col-sm-10"> |
| 70 | + <input |
| 71 | + formControlName="uri" |
| 72 | + id="uri" |
| 73 | + type="text" |
| 74 | + class="form-control" |
| 75 | + aria-label="Small" |
| 76 | + aria-describedby="inputGroup-sizing-sm" |
| 77 | + /> |
| 78 | + </div> |
| 79 | + </div> |
| 80 | + |
| 81 | + <div class="form-group row"> |
| 82 | + <label class="col-12 col-sm-2">Date in:</label> |
| 83 | + <div class="col-12 col-sm-4"> |
| 84 | + <input |
| 85 | + formControlName="start_date" |
| 86 | + id="start_date" |
| 87 | + type="date" |
| 88 | + class="form-control" |
| 89 | + aria-label="Small" |
| 90 | + aria-describedby="inputGroup-sizing-sm" |
| 91 | + [class.is-invalid]="start_date.invalid && start_date.touched" |
| 92 | + required |
| 93 | + /> |
| 94 | + </div> |
36 | 95 |
|
| 96 | + <label class="col-12 col-sm-2">Time in:</label> |
| 97 | + <div class="col-12 col-sm-4"> |
| 98 | + <ngx-timepicker-field |
| 99 | + [format]="24" |
| 100 | + formControlName="start_hour" |
| 101 | + id="start_hour" |
| 102 | + [disabled]="!(project_name.value && project_id.value)" |
| 103 | + class="timepicker-input" |
| 104 | + ></ngx-timepicker-field> |
| 105 | + </div> |
| 106 | + </div> |
| 107 | + |
| 108 | + <div class="form-group row" *ngIf="!goingToWorkOnThis"> |
| 109 | + <label class="col-12 col-sm-2">Date out:</label> |
| 110 | + <div class="col-12 col-sm-4"> |
| 111 | + <input |
| 112 | + formControlName="end_date" |
| 113 | + id="end_date" |
| 114 | + type="date" |
| 115 | + class="form-control" |
| 116 | + aria-label="Small" |
| 117 | + aria-describedby="inputGroup-sizing-sm" |
| 118 | + [class.is-invalid]="end_date.invalid && end_date.touched" |
| 119 | + required |
| 120 | + /> |
| 121 | + </div> |
37 | 122 |
|
38 | | - <div class="form-group row"> |
39 | | - <label class="col-12 col-sm-2 col-form-label">Activity:</label> |
40 | | - <div class="col-12 col-sm-10"> |
41 | | - <select |
42 | | - [class.is-invalid]="activity_id.invalid" |
43 | | - required |
44 | | - id="activity_id" |
45 | | - class="custom-select" |
46 | | - formControlName="activity_id" |
47 | | - > |
48 | | - <option value="" selected="selected"></option> |
49 | | - <option *ngFor="let activity of activities" value="{{ activity.id }}">{{ activity.name }}</option> |
50 | | - </select> |
51 | | - </div> |
52 | | - <div |
53 | | - class="invalid-feedback" |
54 | | - *ngIf="(activity_id.dirty || activity_id.touched) && activity_id.invalid && activity_id.errors.required" |
55 | | - ></div> |
56 | | - </div> |
57 | | - |
58 | | - |
59 | | - <div class="form-group row"> |
60 | | - <label class="col-12 col-sm-2 col-form-label">Ticket:</label> |
61 | | - <div class="col-12 col-sm-10"> |
62 | | - <input |
63 | | - formControlName="uri" |
64 | | - id="uri" |
65 | | - type="text" |
66 | | - class="form-control" |
67 | | - aria-label="Small" |
68 | | - aria-describedby="inputGroup-sizing-sm" |
69 | | - /> |
70 | | - </div> |
71 | | - </div> |
72 | | - |
73 | | - |
74 | | - <div class="form-group row"> |
75 | | - <label class="col-12 col-sm-2">Date in:</label> |
76 | | - <div class="col-12 col-sm-4"> |
77 | | - <input |
78 | | - formControlName="start_date" |
79 | | - id="start_date" |
80 | | - type="date" |
81 | | - class="form-control" |
82 | | - aria-label="Small" |
83 | | - aria-describedby="inputGroup-sizing-sm" |
84 | | - [class.is-invalid]="start_date.invalid && start_date.touched" |
85 | | - required |
86 | | - /> |
87 | | - </div> |
88 | | - |
89 | | - <label class="col-12 col-sm-2">Time in:</label> |
90 | | - <div class="col-12 col-sm-4"> |
91 | | - <ngx-timepicker-field |
92 | | - [format]="24" |
93 | | - formControlName="start_hour" |
94 | | - id="start_hour" |
95 | | - ></ngx-timepicker-field> |
96 | | - </div> |
97 | | - </div> |
| 123 | + <label class="col-12 col-sm-2">Time out:</label> |
| 124 | + <div class="col-12 col-sm-4"> |
| 125 | + <ngx-timepicker-field |
| 126 | + [format]="24" |
| 127 | + formControlName="end_hour" |
| 128 | + id="end_hour" |
| 129 | + [disabled]="!(project_name.value && project_id.value)" |
| 130 | + class="timepicker-input" |
| 131 | + ></ngx-timepicker-field> |
| 132 | + </div> |
| 133 | + </div> |
98 | 134 |
|
| 135 | + <app-technologies |
| 136 | + (technologyAdded)="onTechnologiesUpdated($event)" |
| 137 | + (technologyRemoved)="onTechnologiesUpdated($event)" |
| 138 | + [selectedTechnologies]="selectedTechnologies" |
| 139 | + > |
| 140 | + </app-technologies> |
99 | 141 |
|
100 | | - <div class="form-group row" *ngIf="!goingToWorkOnThis"> |
101 | | - <label class="col-12 col-sm-2">Date out:</label> |
102 | | - <div class="col-12 col-sm-4"> |
103 | | - <input |
104 | | - formControlName="end_date" |
105 | | - id="end_date" |
106 | | - type="date" |
| 142 | + <div class="form-group text-left"> |
| 143 | + <label for="NotesTextarea">Description:</label> |
| 144 | + <textarea |
| 145 | + maxlength="1500" |
| 146 | + formControlName="description" |
107 | 147 | class="form-control" |
108 | | - aria-label="Small" |
109 | | - aria-describedby="inputGroup-sizing-sm" |
110 | | - [class.is-invalid]="end_date.invalid && end_date.touched" |
111 | | - required |
112 | | - /> |
113 | | - </div> |
114 | | - |
115 | | - <label class="col-12 col-sm-2">Time out:</label> |
116 | | - <div class="col-12 col-sm-4"> |
117 | | - <ngx-timepicker-field |
118 | | - [format]="24" |
119 | | - formControlName="end_hour" |
120 | | - id="end_hour" |
121 | | - ></ngx-timepicker-field> |
122 | | - </div> |
123 | | - </div> |
124 | | - |
125 | | - |
126 | | - <app-technologies |
127 | | - (technologyAdded)="onTechnologiesUpdated($event)" |
128 | | - (technologyRemoved)="onTechnologiesUpdated($event)" |
129 | | - [selectedTechnologies]="selectedTechnologies" |
130 | | - > |
131 | | - </app-technologies> |
132 | | - |
133 | | - |
134 | | - <div class="form-group text-left"> |
135 | | - <label for="NotesTextarea">Description:</label> |
136 | | - <textarea maxlength="1500" formControlName="description" class="form-control" id="NotesTextarea" |
137 | | - rows="3"></textarea> |
| 148 | + id="NotesTextarea" |
| 149 | + rows="3" |
| 150 | + > |
| 151 | + </textarea> |
| 152 | + </div> |
| 153 | + </fieldset> |
138 | 154 | </div> |
139 | 155 | <div class="modal-footer"> |
140 | 156 | <button type="submit" class="btn btn-primary">Save</button> |
|
0 commit comments