Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
32,761 changes: 32,610 additions & 151 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "time-tracker",
"version": "1.52.5",
"version": "1.52.6",
"scripts": {
"preinstall": "npx npm-force-resolutions",
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build": "ng build --prod",
"test": "ng test",
"test-headless": "ng test --browsers ChromeHeadless",
"ci-test": "ng test --no-watch --no-progress --browsers ChromeHeadless",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,32 @@
<tr class="d-flex">
<th class="col-4 text-center">Activity ID</th>
<th class="col-4 text-center">Activity</th>
<th class="col-2 text-center hidden">Options</th>
<th class="col-4 text-center">Status</th>
<th class="col-2 text-center" *ngIf="showOptionInDevelopment">Options</th>
<th scope="col" class="col-2 text-center" *ngIf="showOptionInDevelopment">Status</th>
</tr>
</thead>
<app-loading-bar *ngIf="isLoading$ | async"></app-loading-bar>
<tbody *ngIf="(isLoading$ | async) === false">
<tr class="d-flex" *ngFor="let activity of activities">
<td class="col-4 text-break">{{ activity.id }}</td>
<td class="col-4">{{ activity.name }}</td>
<td class="col-2 text-center hidden">
<td class="col-2 text-center" *ngIf="showOptionInDevelopment">
<button type="button" class="btn btn-sm btn-primary" (click)="updateActivity(activity.id)">
<i class="fa fa-pencil fa-xs"></i>
</button>
</td>
<td class="col-4 text-center">
<div class="flex justify-center">
<div *ngIf="showOptionInDevelopment; then devBlock; else prodBlock"></div>
<ng-template #devBlock>
<td class="col-2 text-center">
<app-dropdown [info]="activity" (updateInfo)="changeOperation($event)"></app-dropdown>
</td>
</ng-template>
<ng-template #prodBlock>
<td class="col-4 text-center">
<em class="fa mr-2 mt-1" [ngClass]="[activity.btnIcon, activity.iconColor]"></em>
<p> {{ activity.btnName }}</p>
</div>
</td>
<span>{{ activity.btnName }}</span>
</td>
</ng-template>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { select, Store } from '@ngrx/store';
import { Observable } from 'rxjs';
import { delay, map } from 'rxjs/operators';
Expand All @@ -16,6 +16,7 @@ import { ActivityState } from './../../store/activity-management.reducers';
export class ActivityListComponent implements OnInit {
@Output() changeValueShowActivityForm = new EventEmitter<boolean>();
showActivityForm: boolean;
@Input() showOptionInDevelopment: boolean;

constructor(private store: Store<ActivityState>) {
this.isLoading$ = store.pipe(delay(0), select(getIsLoading));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<div class="col-12 col-md-9 px-0">
<div class="hidden">
<div class="col-12 px-0">
<div *ngIf="showOptionInDevelopment">
<app-create-activity
[showActivityForm]="showActivityForm" (changeValueShowActivityForm)="showActivityForm = $event"></app-create-activity>
[showActivityForm]="showActivityForm"
(changeValueShowActivityForm)="showActivityForm = $event"
>
</app-create-activity>
</div>
<app-activity-list
(changeValueShowActivityForm)="showActivityForm = $event"></app-activity-list>
[showOptionInDevelopment]="showOptionInDevelopment"
(changeValueShowActivityForm)="showActivityForm = $event"
>
</app-activity-list>
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { waitForAsync, TestBed, ComponentFixture } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { ActivitiesManagementComponent } from './activities-management.component';

describe('ActivitiesManagementComponent', () => {
Expand All @@ -21,4 +22,13 @@ describe('ActivitiesManagementComponent', () => {
it('should create the component', () => {
expect(component).toBeTruthy();
});

it('should check if is in development environment', () => {
expect(component.showOptionInDevelopment).toBe(true);
});

it('should check if add new entry button is render', () => {
const addItemDebugElement = fixture.debugElement.query(By.css('div.col-12.px-0')).childNodes.length;
expect(addItemDebugElement).toBe(3);
});
});
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import { Component, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { environment } from 'src/environments/environment';

@Component({
selector: 'app-activities-management',
templateUrl: './activities-management.component.html',
styleUrls: ['./activities-management.component.scss'],
})
export class ActivitiesManagementComponent {
export class ActivitiesManagementComponent implements OnInit {
@Input() showActivityForm: boolean;
showOptionInDevelopment = true;

ngOnInit() {
this.showOption();
}

showOption(): void {
if (environment.production){
this.showOptionInDevelopment = false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,17 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
this.store.dispatch(new projectActions.LoadProjects());
const recentProjects$ = this.store.pipe(select(getRecentProjects));
recentProjects$.subscribe((projects) => {
if (projects) {
this.listRecentProjects = [];
this.listRecentProjects = [];
if (projects?.length > 0) {
projects.forEach((project) => {
const projectWithSearchField = { ...project };
projectWithSearchField.search_field = `${project.customer.name} - ${project.name}`;
this.listRecentProjects.push(projectWithSearchField);
});
this.listProjectsShowed = this.listRecentProjects;
}else{
this.listRecentProjects = this.listProjects;
}
this.listProjectsShowed = this.listRecentProjects;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class TechnologiesComponent implements OnInit, OnDestroy {
readonly ALLOW_SELECT_MULTIPLE = true;
readonly ALLOW_SEARCH = true;
readonly MIN_SEARCH_TERM_LENGTH = 2;
readonly TYPE_TO_SEARCH_TEXT = 'Please enter 2 or more characters';
readonly TYPE_TO_SEARCH_TEXT = 'Please enter 2 or more characters to search for technologies ';
readonly WAITING_TIME_AFTER_KEY_UP = 400;

isLoading = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ export class ProjectListHoverComponent implements OnInit, OnDestroy {
this.store.dispatch(new actions.LoadProjects());
const recentProjects$ = this.store.pipe(select(getRecentProjects));
this.recentProjectsSubscription = recentProjects$.subscribe((projects) => {
if (projects) {
if (projects?.length > 0) {
this.listRecentProjects = projects;
this.listProjectsShowed = this.listRecentProjects;
}else{
this.listRecentProjects = this.listProjects;
}
this.listProjectsShowed = this.listRecentProjects;
});

this.updateEntrySubscription = this.actionsSubject$
Expand Down
25 changes: 24 additions & 1 deletion src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
import * as keys from './keys';

export const environment = {
production: true
production: true,
timeTrackerApiUrl: 'https://timetracker-api.azurewebsites.net',
stackexchangeApiUrl: 'https://api.stackexchange.com',
};

export const AUTHORITY = keys.AUTHORITY;
export const CLIENT_ID = keys.CLIENT_ID;
export const SCOPES = keys.SCOPES;
export const ITEMS_PER_PAGE = 5;
export const STACK_EXCHANGE_ID = keys.STACK_EXCHANGE_ID;
export const STACK_EXCHANGE_ACCESS_TOKEN = keys.STACK_EXCHANGE_ACCESS_TOKEN;
export const AZURE_APP_CONFIGURATION_CONNECTION_STRING = keys.AZURE_APP_CONFIGURATION_CONNECTION_STRING;
export const DATE_FORMAT = 'yyyy-MM-dd';
export const DATE_FORMAT_YEAR = 'YYYY-MM-DD';
export const GROUPS = {
ADMIN: 'time-tracker-admin',
TESTER: 'time-tracker-tester',
};

export const ROLES = {
admin: {
name: 'admin',
value: 'time-tracker-admin',
},
tester: {
name: 'test',
value: 'time-tracker-tester',
},
};
2 changes: 1 addition & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as keys from './keys';

export const environment = {
production: false,
timeTrackerApiUrl: 'https://timetracker-api.azurewebsites.net',
timeTrackerApiUrl: 'http://localhost:7071/api',
stackexchangeApiUrl: 'https://api.stackexchange.com',
};

Expand Down