Skip to content

Commit 3811151

Browse files
committed
fix: TT-178 Make URI clickable when possible
1 parent ec1eae0 commit 3811151

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

src/app/modules/reports/components/time-entries-table/time-entries-table.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</thead>
2626
<app-loading-bar *ngIf="dataSource.isLoading"></app-loading-bar>
2727
<tbody *ngIf="!dataSource.isLoading">
28-
<tr class="d-flex" *ngFor="let entry of dataSource.data">
28+
<tr class="d-flex" *ngFor="let entry of dataSource.data" _nghost-c0 = "" >
2929
<td class="hidden-col">{{ entry.id }}</td>
3030
<td class="col md-col">{{ entry.owner_email }}</td>
3131
<td class="col sm-col">
@@ -41,7 +41,7 @@
4141
<td class="col md-col">{{ entry.customer_name }}</td>
4242
<td class="hidden-col">{{ entry.customer_id }}</td>
4343
<td class="col md-col">{{ entry.activity_name }}</td>
44-
<td class="col lg-col"><a (click)="isLinkExternal(entry.uri)">{{ entry.uri }}</a></td>
44+
<td class="col lg-col" id="uri"><a (click)="isLinkExternal(entry.uri)" [ngStyle]="{'cursor':'pointer','color':entry.uri === ('http' || 'https') ? 'black' : 'blue' }">{{ entry.uri }}</a></td>
4545
<td class="col lg-col">{{ entry.description }}</td>
4646
<td class="col lg-col">{{ entry.technologies }}</td>
4747
</tr>

src/app/modules/reports/components/time-entries-table/time-entries-table.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
overflow-x: scroll;
3232
width: 100%;
3333
display: grid;
34-
}
34+
}

src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { MockStore, provideMockStore } from '@ngrx/store/testing';
33
import { Entry } from 'src/app/modules/shared/models';
44
import { SubstractDatePipe } from 'src/app/modules/shared/pipes/substract-date/substract-date.pipe';
55
import { getReportDataSource } from 'src/app/modules/time-clock/store/entry.selectors';
6-
import { EntryState } from '../../../time-clock/store/entry.reducer';
6+
import { entryReducer, EntryState } from '../../../time-clock/store/entry.reducer';
77
import { TimeEntriesTableComponent } from './time-entries-table.component';
88

99
describe('Reports Page', () => {
@@ -76,6 +76,15 @@ describe('Reports Page', () => {
7676
expect(component.dtTrigger.next).toHaveBeenCalled();
7777
});
7878

79+
fit('when the variable starts with http or https it should be url', () => {
80+
fixture.detectChanges();
81+
const initialUri = ('http' || 'https');
82+
const entryUri = fixture.debugElement.nativeElement.querySelector('[id=uri]');
83+
console.log(entryUri);
84+
85+
expect(entryUri.id).toEqual(initialUri);
86+
});
87+
7988
afterEach(() => {
8089
fixture.destroy();
8190
});

src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,5 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
9797
const isValidUri = uri.startsWith('http' || 'https');
9898
return isValidUri ? window.open(uri, '_blank') : '';
9999
}
100+
100101
}

0 commit comments

Comments
 (0)