Skip to content

Commit dea89ac

Browse files
committed
fix: #172 removing old styles
1 parent b0f2d63 commit dea89ac

File tree

7 files changed

+64
-139
lines changed

7 files changed

+64
-139
lines changed

package-lock.json

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

src/app/modules/shared/components/details-fields/details-fields.component.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<div class="ng-autocomplete">
77
<ng-autocomplete
88
class="autocomplete"
9-
109
[data]="listProjects && listProjects"
1110
[searchKeyword]="keyword"
1211
[itemTemplate]="itemTemplate"
@@ -32,7 +31,7 @@
3231

3332
<div class="input-group input-group-sm mb-3">
3433
<div class="input-group-prepend">
35-
<span class="input-group-text span-width" id="inputGroup-sizing-sm">Ticket</span>
34+
<span class="input-group-text span-width" id="inputGroup-sizing-sm">Ticket URI</span>
3635
</div>
3736
<input
3837
formControlName="uri"
@@ -92,11 +91,13 @@
9291
<span class="input-group-text span-width" id="inputGroup-sizing-sm">Technology</span>
9392
</div>
9493
<input
95-
(keypress)="getTechnologies($event.target.value)"
94+
(keyup)="getTechnologies($event.target.value)"
9695
type="text"
9796
class="form-control"
9897
aria-label="Small"
9998
aria-describedby="inputGroup-sizing-sm"
99+
id="technology"
100+
formControlName="technology"
100101
/>
101102
</div>
102103

@@ -111,21 +112,23 @@
111112
{{ item.name }}
112113
</div>
113114
</div>
114-
<div class="tags-content d-flex flex-wrap">
115+
<div class="tags-content d-flex flex-wrap" *ngIf="selectedTechnology.length">
115116
<div *ngFor="let technology of selectedTechnology; let tagIndex = index" class="tag">
116117
<span class="mr-3">{{ technology }}</span>
117118
<i class="fas fa-times text-white" (click)="removeTag(tagIndex)"></i>
118119
</div>
119120
</div>
120-
121+
<div class="form-group" *ngIf="selectedTechnology.length === 0">
122+
<!-- empty-space -->
123+
</div>
121124
<div class="form-group text-left">
122125
<label for="NotesTextarea">Description</label>
123126
<textarea formControlName="description" class="form-control" id="NotesTextarea" rows="3"></textarea>
124127
</div>
125128
<div [ngClass]="{ hidden: formType !== 'entries' }" class="modal-footer">
126-
<button #closeModal type="button" class="btn close-button-style" data-dismiss="modal">
129+
<button #closeModal type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
127130
Close
128131
</button>
129-
<button type="submit" class="btn save-button-style">Save changes</button>
132+
<button type="submit" class="btn btn-sm btn-primary mb-2 ml-2 mt-2">Save changes</button>
130133
</div>
131134
</form>

src/app/modules/shared/components/details-fields/details-fields.component.scss

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@
1919
display: none;
2020
}
2121

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-
3222
.technology-content {
3323
box-shadow: 0 3px 8px 0 rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.08);
3424
margin: 0 0 2rem 6rem;

src/app/modules/shared/components/details-fields/details-fields.component.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
6161
start_hour: '00:00',
6262
end_hour: '00:00',
6363
uri: '',
64+
technology: '',
6465
});
6566
}
6667

6768
ngOnInit(): void {
6869
const technologies$ = this.store.pipe(select(allTechnologies));
6970
technologies$.subscribe((response) => {
7071
this.isLoading = response.isLoading;
71-
this.technology = response.technologyList;
72+
const filteredItems = response.technologyList.items.filter(item => !this.selectedTechnology.includes(item.name));
73+
this.technology = { items: filteredItems };
7274
});
7375

7476
this.store.dispatch(new projectActions.LoadProjects());
@@ -98,6 +100,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
98100
end_date: this.entryToEdit.end_date ? formatDate(this.entryToEdit.end_date, 'yyyy-MM-dd', 'en') : '',
99101
end_hour: this.entryToEdit.end_date ? formatDate(this.entryToEdit.end_date, 'HH:mm', 'en') : '00:00',
100102
uri: this.entryToEdit.uri,
103+
technology: '',
101104
});
102105
} else {
103106
this.selectedTechnology = [];
@@ -110,6 +113,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
110113
end_date: formatDate(new Date(), 'yyyy-MM-dd', 'en'),
111114
end_hour: '00:00',
112115
uri: '',
116+
technology: '',
113117
});
114118
}
115119
}
@@ -122,16 +126,16 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
122126
}
123127

124128
setTechnology(name: string) {
125-
const index = this.selectedTechnology.indexOf(name);
126-
if (index > -1) {
127-
this.removeTag(index);
128-
} else if (this.selectedTechnology.length < 10) {
129-
this.selectedTechnology = [...this.selectedTechnology, name];
130-
}
129+
this.selectedTechnology = [...this.selectedTechnology, name];
130+
this.showlist = false;
131+
this.entryForm.get('technology').reset();
131132
}
132133

133134
removeTag(index) {
134135
this.selectedTechnology.splice(index, 1);
136+
this.selectedTechnology = [...this.selectedTechnology, name];
137+
this.showlist = false;
138+
this.entryForm.get('technology').reset();
135139
}
136140

137141
onSubmit() {

src/app/modules/shared/store/technology.reducers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface TechnologyState {
77
}
88

99
export const initialState = {
10-
technologyList: null,
10+
technologyList: { items: []},
1111
isLoading: false,
1212
};
1313

src/app/modules/time-entries/pages/time-entries.component.html

Lines changed: 38 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,75 +8,49 @@
88
data-target="#editRecordsByDate"
99
class="btn btn-primary"
1010
>
11-
<i class="fa fa-plus-square"></i> New Entry
11+
Add new entry
1212
</button>
1313
</div>
1414
</div>
15-
<div class="card">
16-
<app-month-picker (monthSelected)="getMonth($event)"></app-month-picker>
17-
<div class="row m-0 header-entries">
18-
<div class="col">Project</div>
19-
<div class="col">Duration</div>
20-
<div class="col-2">Actions</div>
21-
</div>
22-
<!--Accordion wrapper-->
23-
<div
24-
*ngIf="dataByMonth.length > 0; else emptyState"
25-
class="accordion accordion-container"
26-
role="tablist"
27-
aria-multiselectable="true"
28-
>
29-
<div class="card" *ngFor="let entry of dataByMonth | groupByDate; let rowIndex = index">
30-
<!-- Card header -->
31-
<div class="date-header" role="tab" id="heading10">
32-
<a data-toggle="collapse" [href]="'#entry' + rowIndex">
33-
<div class="mb-0 text-white">
34-
{{ entry.date }}
35-
</div>
36-
</a>
37-
</div>
15+
<div style="height: 10px;"></div>
16+
<app-month-picker (monthSelected)="getMonth($event)"></app-month-picker>
17+
18+
<div style="height: 10px;"></div>
3819

39-
<!-- Card body -->
40-
<div
41-
*ngFor="let item of entry.details"
42-
[id]="'entry' + rowIndex"
43-
class="collapse show"
44-
role="tabpanel"
45-
aria-labelledby="heading10"
46-
>
47-
<div class="row m-0 entries">
48-
<div class="col">
49-
{{ item.id }}
50-
</div>
51-
<div class="col">
52-
{{ item.time }}
53-
</div>
54-
<div class="col-2">
55-
<button
56-
class="btn btn-sm btn-small"
57-
data-toggle="modal"
58-
data-target="#editRecordsByDate"
59-
(click)="editEntry(item.id)"
60-
>
61-
<i class="fa fa-edit"></i>
62-
</button>
63-
<button
64-
class="btn btn-sm btn-small"
65-
data-toggle="modal"
20+
<table class="table table-sm table-striped">
21+
<thead class="thead-orange">
22+
<tr class="d-flex">
23+
<th class="col-5">Project</th>
24+
<th class="col-5">Duration</th>
25+
<th class="col-2"></th>
26+
</tr>
27+
</thead>
28+
<tbody>
29+
<tr
30+
class="d-flex"
31+
*ngFor="let item of dataByMonth"
32+
>
33+
<td class="col-sm-5">{{ item.project_id }}</td>
34+
<td class="col-sm-5">{{ item.time }}</td>
35+
<td class="col-sm-2 text-center">
36+
<button type="button" class="btn btn-sm btn-secondary"
37+
data-toggle="modal"
38+
data-target="#editRecordsByDate"
39+
(click)="editEntry(item.id)">
40+
<i class="fa fa-pencil fa-xs"></i>
41+
</button>
42+
<button type="button" class="btn btn-sm btn-danger ml-2"
43+
data-toggle="modal"
6644
data-target="#deleteModal"
67-
(click)="openModal(item)"
68-
>
69-
<i class="fa fa-trash"></i>
70-
</button>
71-
</div>
72-
</div>
73-
</div>
74-
</div>
75-
</div>
76-
<ng-template #emptyState>
77-
<app-empty-state></app-empty-state>
78-
</ng-template>
79-
</div>
45+
(click)="openModal(item)">
46+
<i class="fas fa-trash-alt fa-xs"></i>
47+
</button>
48+
</td>
49+
</tr>
50+
</tbody>
51+
</table>
52+
53+
8054
</div>
8155
<div class="modal fade" id="editRecordsByDate" tabindex="-1" role="dialog" aria-hidden="true">
8256
<div class="modal-dialog modal-dialog-centered" role="document">
Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,2 @@
11
@import '../../../../styles/colors.scss';
22

3-
.container-time-entries {
4-
padding: 1rem;
5-
}
6-
7-
.header-entries {
8-
background-color: rgba(0, 0, 0, 0.03);
9-
border-top: 1px solid rgba(0, 0, 0, 0.125);
10-
}
11-
12-
.accordion-container {
13-
max-height: 25rem;
14-
overflow-y: auto;
15-
16-
&::-webkit-scrollbar {
17-
display: none;
18-
}
19-
}
20-
21-
.date-header {
22-
background-image: $background-gradient-items;
23-
border-radius: 0;
24-
border-bottom: 1px solid rgba(0, 0, 0, 0.125);
25-
font-size: small;
26-
padding: 0 0.9rem;
27-
28-
a {
29-
color: #000000;
30-
}
31-
}
32-
33-
.btn-small > i {
34-
font-size: 0.8rem;
35-
opacity: 0.7;
36-
}
37-
38-
.entries {
39-
align-items: center;
40-
border-bottom: 1px solid rgba(0, 0, 0, 0.125);
41-
display: flex;
42-
font-size: small;
43-
44-
&:hover {
45-
background-color: #d5edf0;
46-
cursor: pointer;
47-
}
48-
}

0 commit comments

Comments
 (0)