Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TT-664 fix bad UX review
  • Loading branch information
ngalvare10 committed May 19, 2022
commit 5a19ec43458da9f2b408477e9bf4a8b7f69c7a6f
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@
<app-loading-bar *ngIf="dataSource.isLoading"></app-loading-bar>
<tbody *ngIf="!dataSource.isLoading">
<tr class="d-flex col-height" *ngFor="let entry of dataSource.data">
<td class="hidden-col">{{ entry.id }}</td>
<td class="col md-col">{{ entry.owner_email }}</td>
<td class="col sm-col">
<td class="hidden-col">{{ entry.id }}</td>
<td class="col md-col">{{ entry.owner_email }}</td>
<td class="col sm-col">
{{ entry.start_date | date: 'MM/dd/yyyy' }}
</td>
<td class="col sm-col">
</td>
<td class="col sm-col">
{{ entry.end_date | substractDate: entry.start_date }}
</td>
<td class="col x-sm-col">{{ dateTimeOffset.parseDateTimeOffset(entry.start_date,entry.timezone_offset) }}</td>
<td class="col x-sm-col">{{ dateTimeOffset.parseDateTimeOffset(entry.end_date , entry.timezone_offset) }}</td>
<td class="col md-col">{{ entry.project_name }}</td>
<td class="hidden-col">{{ entry.project_id }}</td>
<td class="col md-col">{{ entry.customer_name }}</td>
<td class="hidden-col">{{ entry.customer_id }}</td>
<td class="col md-col">{{ entry.activity_name }}</td>
<td class="col lg-col">
</td>
<td class="col x-sm-col">{{ dateTimeOffset.parseDateTimeOffset(entry.start_date,entry.timezone_offset) }}</td>
<td class="col x-sm-col">{{ dateTimeOffset.parseDateTimeOffset(entry.end_date , entry.timezone_offset) }}</td>
<td class="col md-col">{{ entry.project_name }}</td>
<td class="hidden-col">{{ entry.project_id }}</td>
<td class="col md-col">{{ entry.customer_name }}</td>
<td class="hidden-col">{{ entry.customer_id }}</td>
<td class="col md-col">{{ entry.activity_name }}</td>
<td class="col lg-col">
<ng-container *ngIf="entry.uri !== null">
<a [class.is-url]="isURL(entry.uri)" (click)="openURLInNewTab(entry.uri)">
{{ entry.uri }}
</a>
{{ entry.uri }}
</a>
</ng-container>
</td>
<td class="col lg-scroll">{{ entry.description }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,3 @@ table.dataTable thead .sorting_desc {
font-style: italic;
cursor: pointer;
}


Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,11 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
this.rerenderTableSubscription = this.reportDataSource$.subscribe((ds) => {
this.sumDates(ds.data);
});

this.uploadUsers();

this.uploadUsers();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete the whitespace

}

ngAfterViewInit(): void {
this.rerenderDataTable();

this.rerenderDataTable();
}

ngOnDestroy(): void {
Expand All @@ -115,9 +112,7 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
this.dtTrigger.next();
});
} else {

this.dtTrigger.next();

return;
}
}
Expand Down
37 changes: 16 additions & 21 deletions src/app/modules/time-entries/pages/time-entries.component.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<div>
<div>
<button type="button" (click)="newEntry()" data-toggle="modal" data-target="#editRecordsByDate" class="btn btn-primary">
Add new entry
</button>
<button type="button" (click)="onDisplayModeChange()" class="btn btn-primary float-right" *ngIf="isFeatureToggleCalendarActive">
<em class="fas fa-list" *ngIf="displayGridView"></em>
<em class="fas fa-th" *ngIf="!displayGridView"></em>
</button>
Add new entry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review the whitespaces and the indent

</button>
<button type="button" (click)="onDisplayModeChange()" class="btn btn-primary float-right" *ngIf="isFeatureToggleCalendarActive">
<em class="fas fa-list" *ngIf="displayGridView"></em>
<em class="fas fa-th" *ngIf="!displayGridView"></em>
</button>
</div>
<div style="height: 15px"></div>
<app-month-picker [selectedDate]="selectedDate" (dateSelected)="dateSelected($event)"></app-month-picker>
<div style="height: 15px"></div>


<div id="gridView" [hidden]="!displayGridView">
<div *ngIf="timeEntriesDataSource$ | async as dataSource">
<app-loading-bar *ngIf="dataSource.isLoading"></app-loading-bar>
Expand All @@ -21,7 +19,6 @@
</app-calendar>
</div>
</div>

<div id="listView" [hidden]="displayGridView">
<div class="table-responsive">
<table class="table table-sm table-striped mb-0 " datatable [dtTrigger]="dtTrigger" [dtOptions]="dtOptions" *ngIf="(timeEntriesDataSource$ | async) as dataSource">
Expand Down Expand Up @@ -50,8 +47,8 @@
<button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#editRecordsByDate" (click)="editEntry(entry.id)">
<i class="fa fa-edit fa-xs"></i>
</button>
<button class="btn btn-sm btn-danger ml-2" data-toggle="modal" data-target="#deleteModal" (click)="openModal(entry)">
<i class="fa fa-trash fa-xs"></i>
<button class="btn btn-sm btn-danger ml-2" data-toggle="modal" data-target="#deleteModal" (click)="openModal(entry)">
<i class="fa fa-trash fa-xs"></i>
</button>
</td>
</tr>
Expand All @@ -60,28 +57,26 @@
</div>
</div>
</div>

<div class="modal fade" id="editRecordsByDate" tabindex="-1" role="dialog">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content" cdkDrag (cdkDragEnded)="resetDraggablePosition($event)">
<div class="modal-header">
<h5 class="modal-title">{{ entryId ? 'Edit Entry' : 'New Entry' }}</h5>
<div>
<button class="btn shadow-none" data-bs-toggle="tooltip" title="Clean form values" (click)="detailsFields.cleanFieldsForm()">
<em class="fa fa-eraser"> </em>
</button>
<em class="fa fa-eraser"> </em>
</button>
<button class="btn shadow-none" data-bs-toggle="tooltip" title="Drag modal" cdkDragHandle>
<em class="fa fa-grip-vertical"></em>
</button>
<em class="fa fa-grip-vertical"></em>
</button>
</div>
</div>
<div class="modal-body">
<app-details-fields [entryToEdit]="entry" (saveEntry)="saveEntry($event)" (projectSelected)="projectSelected($event)" [canMarkEntryAsWIP]="canMarkEntryAsWIP" #detailsFields>
</app-details-fields>
</div>
<div class="modal-body">
<app-details-fields [entryToEdit]="entry" (saveEntry)="saveEntry($event)" (projectSelected)="projectSelected($event)" [canMarkEntryAsWIP]="canMarkEntryAsWIP" #detailsFields>
</app-details-fields>
</div>
</div>
</div>
</div>

<app-dialog *ngIf="showModal" class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-hidden="true" [body]="message" [title]="'Delete Entry'" (closeModalEvent)="removeEntry()">
</app-dialog>
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,4 @@ export class TimeEntriesComponent implements OnInit, OnDestroy, AfterViewInit {
});
}
}
}
}