-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdetails-fields.component.html
More file actions
157 lines (147 loc) · 5.49 KB
/
details-fields.component.html
File metadata and controls
157 lines (147 loc) · 5.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<form [formGroup]="entryForm" (ngSubmit)="onSubmit()">
<label *ngIf="canMarkEntryAsWIP">
<input
id="isEntryRunning"
type="checkbox"
(change)="onGoingToWorkOnThisChange($event)"
[checked]="goingToWorkOnThis"
/>
I am working on this
</label>
<div class="form-group row">
<label class="col-12 col-sm-2 col-form-label">Project:</label>
<div class="col-12 col-sm-10 autocomplete">
<ng-select
bindLabel="search_field"
formControlName="project_name"
placeholder="Enter the project name"
notFoundText="No projects found"
[items]="listProjectsShowed"
(search)="onClearedComponent($event)"
(change)="onSelectedProject($event)"
ngDefaultControl="project_name">
<ng-template ng-option-tmp let-item="item">
<div class="flex flex-wrap flex-row justify-between">
<div class="p-2 text-xs">
<span>{{item.customer.name}}</span> -
<strong><span>{{item.name}}</span></strong>
</div>
</div>
</ng-template>
</ng-select>
<!-- <app-loading-bar *ngIf="(isLoading$ | async)"></app-loading-bar> -->
</div>
</div>
<div (click)="onclickFormAction(!(project_id.value && project_name.value))">
<fieldset [disabled]="!(project_id.value && project_name.value)">
<div class="form-group row">
<label class="col-12 col-sm-2 col-form-label">Activity:</label>
<div class="col-12 col-sm-10">
<select
[class.is-invalid]="activity_id.invalid && activity_id.touched"
required
id="activity_id"
class="custom-select"
formControlName="activity_id"
>
<option value="" selected="selected"></option>
<option *ngFor="let activity of activities$ | async" value="{{ activity.id }}">{{ activity.name }}</option>
</select>
</div>
<div
class="invalid-feedback"
*ngIf="(activity_id.dirty || activity_id.touched) && activity_id.invalid && activity_id.errors.required"
></div>
</div>
<div class="form-group row">
<label class="col-12 col-sm-2 col-form-label">Ticket:</label>
<div class="col-12 col-sm-10">
<input
formControlName="uri"
id="uri"
type="text"
placeholder="Enter your ticket number"
class="url-ticket-input form-control"
aria-label="Small"
aria-describedby="inputGroup-sizing-sm"
/>
</div>
</div>
<div class="form-group row" >
<label class="col-12 col-sm-2">Date:</label>
<div class="col-12 col-sm-4" tabindex="0">
<input
matInput
formControlName="start_date"
id="start_date"
class="form-control"
aria-label="Small"
aria-describedby="inputGroup-sizing-sm"
[class.is-invalid]="start_date.invalid && start_date.touched"
required
(ngModelChange)="onStartDateChange($event)"
[max]="getCurrentDate()"
onkeydown="return false"
[tabIndex]="1"
(click)="openOrCloseDatePicker(datepickerStartDate)"
(dateInput)="start_date.setValue($event.value.format('YYYY-MM-DD'))"
[matDatepicker]="datepickerStartDate"
/>
<mat-datepicker #datepickerStartDate></mat-datepicker>
</div>
<label class="col-12 col-sm-2">Time in:</label>
<div class="col-12 col-sm-4">
<ngx-timepicker-field
[format]="24"
formControlName="start_hour"
id="start_hour"
class="timepicker-input"
[defaultTime]="'00:00'"
[class.timepicker-input--disabled]="!(project_id.value && project_name.value)"
></ngx-timepicker-field>
</div>
</div>
<div class="form-group row" *ngIf="!goingToWorkOnThis || !canMarkEntryAsWIP">
<label class="col-12 col-sm-2">Total Hours:</label>
<div class="col-12 col-sm-4">
<span class="border-tag" [class.border-tag--disabled]="!(project_id.value && project_name.value)">
{{ this.getTimeDifference() }}
</span>
</div>
<label class="col-12 col-sm-2">Time out:</label>
<div class="col-12 col-sm-4">
<ngx-timepicker-field
[format]="24"
formControlName="end_hour"
id="end_hour"
class="timepicker-input"
[defaultTime]="'00:00'"
[class.timepicker-input--disabled]="!(project_id.value && project_name.value)"
></ngx-timepicker-field>
</div>
</div>
<app-technologies
(technologyUpdated)="onTechnologiesUpdated($event)"
[selectedTechnologies]="selectedTechnologies"
[isDisabled]="isTechnologiesDisabled"
#technologies
>
</app-technologies>
<div class="form-group text-left">
<label for="NotesTextarea">Description:</label>
<textarea
maxlength="1500"
formControlName="description"
placeholder="Write a brief description of your activity"
class="form-control"
id="NotesTextarea"
rows="3"
></textarea>
</div>
</fieldset>
</div>
<div class="modal-footer">
<button type="submit" id=submitButton class="btn btn-primary">Save</button>
<button #closeModal type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</form>