Skip to content

Commit 6416f1a

Browse files
authored
Merge pull request #188 from ioet/150/Update-current-time-entry
fix: #150 Get active entry and update entry
2 parents 16cf3a3 + 3290e05 commit 6416f1a

21 files changed

+751
-25
lines changed

.github/workflows/CI-mutation-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.stack_exchange_access_token }}
3131
run: sudo sh scripts/populate-keys.sh
3232

33-
- name: Run the test
33+
- name: Running tests
3434
run: npm run ci-test --if-present
3535

3636
- name: Installing stryker-cli

.github/workflows/CI-time-tracker-ui.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.stack_exchange_access_token }}
4949
run: sudo sh scripts/populate-keys.sh
5050

51-
- name: Run the test
51+
- name: Running tests
5252
run: npm run ci-test --if-present
5353

5454
- name: Generate coverage report

package-lock.json

Lines changed: 4 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { ActivityListComponent } from './modules/activities-management/component
2929
import { CreateActivityComponent } from './modules/activities-management/components/create-activity/create-activity.component';
3030
import { FilterProjectPipe } from './modules/shared/pipes/filter-project/filter-project.pipe';
3131
import { SearchComponent } from './modules/shared/components/search/search.component';
32+
import { EntryFieldsComponent } from './modules/time-clock/components/entry-fields/entry-fields.component';
3233
import { HomeComponent } from './modules/home/home.component';
3334
import { LoginComponent } from './modules/login/login.component';
3435
import { ActivityEffects } from './modules/activities-management/store/activity-management.effects';
@@ -86,6 +87,7 @@ import { InjectTokenInterceptor } from './modules/shared/interceptors/inject.tok
8687
ProjectListComponent,
8788
ProjectTypeListComponent,
8889
CreateProjectTypeComponent,
90+
EntryFieldsComponent,
8991
],
9092
imports: [
9193
CommonModule,

src/app/modules/shared/models/entry.model.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ export interface Entry {
66
activity: string;
77
technologies: string[];
88
comments?: string;
9-
ticket?: string;
9+
uri?: string;
1010
}
1111

1212
export interface NewEntry {
1313
project_id: string;
14-
start_date: string;
14+
start_date?: string;
15+
description?: string;
16+
technologies?: string[];
17+
uri?: string;
1518
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<form [formGroup]="entryForm" (ngSubmit)="onSubmit()">
2+
<div class="input-group input-group-sm mb-3">
3+
<div class="input-group-prepend">
4+
<span class="input-group-text span-width" id="inputGroup-sizing-sm">Activity</span>
5+
</div>
6+
<select id="activitiesSelect" (blur)="onSubmit()" class="form-control">
7+
<option *ngFor="let activity of activities">{{ activity.name }}</option>
8+
</select>
9+
</div>
10+
<div class="input-group input-group-sm mb-3">
11+
<div class="input-group-prepend">
12+
<span class="input-group-text span-width" id="inputGroup-sizing-sm">Ticket URI</span>
13+
</div>
14+
<input (blur)="onSubmit()" type="text" id="uri" formControlName="uri" class="form-control" aria-label="Small" aria-describedby="inputGroup-sizing-sm" />
15+
</div>
16+
17+
<div class="input-group input-group-sm">
18+
<div class="input-group-prepend">
19+
<span class="input-group-text span-width" id="inputGroup-sizing-sm">Technology</span>
20+
</div>
21+
<input
22+
(keypress)="getTechnologies($event.target.value)"
23+
type="text"
24+
class="form-control"
25+
aria-label="Small"
26+
aria-describedby="inputGroup-sizing-sm"
27+
/>
28+
</div>
29+
30+
<div *ngIf="isLoading">LOADING...</div>
31+
<div #list *ngIf="technology && showlist" class="d-flex flex-column technology-content">
32+
<div
33+
*ngFor="let item of technology.items"
34+
(click)="setTechnology(item.name)"
35+
class="technology-list"
36+
[ngClass]="{ active: selectedTechnology && selectedTechnology.includes(item.name) }"
37+
>
38+
{{ item.name }}
39+
</div>
40+
</div>
41+
<div class="tags-content d-flex flex-wrap">
42+
<div *ngFor="let technology of selectedTechnology; let tagIndex = index" class="tag">
43+
<span class="mr-3">{{ technology }}</span>
44+
<i class="fas fa-times text-white" (click)="removeTag(tagIndex)"></i>
45+
</div>
46+
</div>
47+
48+
<div class="form-group text-left">
49+
<label for="NotesTextarea">Description</label>
50+
<textarea
51+
(blur)="onSubmit()"
52+
formControlName="description"
53+
class="form-control"
54+
id="NotesTextarea"
55+
rows="3"
56+
></textarea>
57+
</div>
58+
</form>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
@import '../../../../../styles/colors.scss';
2+
3+
@mixin tagTechnology() {
4+
background-color: $modal-button-secondary;
5+
color: #ffffff;
6+
7+
&:hover {
8+
opacity: 0.8;
9+
}
10+
}
11+
12+
.span-width {
13+
width: 6rem;
14+
background-image: $background-pantone;
15+
color: white;
16+
}
17+
18+
.hidden {
19+
display: none;
20+
}
21+
22+
.save-button-style {
23+
background-color: $modal-button-primary;
24+
color: white;
25+
}
26+
27+
.close-button-style {
28+
background-color: $modal-button-secondary;
29+
color: white;
30+
}
31+
32+
.technology-content {
33+
box-shadow: 0 3px 8px 0 rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.08);
34+
margin: 0 0 2rem 6rem;
35+
max-height: 7.5rem;
36+
overflow-y: auto;
37+
38+
.technology-list {
39+
cursor: pointer;
40+
font-size: 0.8rem;
41+
margin-bottom: 0.1rem;
42+
padding: 0.2rem 0.5rem;
43+
44+
&:hover {
45+
opacity: 0.7;
46+
}
47+
}
48+
49+
.active {
50+
background-color: #efefef;
51+
}
52+
}
53+
54+
.tags-content {
55+
margin: 2rem 0;
56+
57+
div {
58+
@include tagTechnology();
59+
60+
border-radius: 0.2rem;
61+
box-shadow: 2px 2px 5px 0px rgba(0, 0, 0, 0.75);
62+
font-size: 0.8rem;
63+
padding: 0.1rem 1rem 0.2rem 1.5rem;
64+
position: relative;
65+
margin: 0 0.5rem 0.5rem 0;
66+
67+
i {
68+
cursor: pointer;
69+
}
70+
}
71+
}
72+
73+
.ng-autocomplete {
74+
width: 100%;
75+
}
76+
77+
.autocomplete::ng-deep .autocomplete-container {
78+
border: 1px solid #ced4da;
79+
border-radius: 0 0.25rem 0.25rem 0;
80+
box-shadow: none;
81+
height: 2rem;
82+
83+
.input-container {
84+
height: 100%;
85+
86+
input {
87+
border-radius: 0.25rem;
88+
height: 100%;
89+
}
90+
}
91+
}

0 commit comments

Comments
 (0)