Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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,740 changes: 32,596 additions & 144 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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 @@ -2,27 +2,26 @@
<table class="table table-sm table-bordered table-striped">
<thead class="thead-blue">
<tr class="d-flex">
<th class="col-4 text-center">Activity ID</th>
<th class="col-2 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="{{showOptionInDevelopment ? 'col-2' : 'col-6'}} 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-2 text-break">{{ activity.id }}</td>
<td class="col-4">{{ activity.name }}</td>
<td class="col-2 text-center hidden">
<td class="{{showOptionInDevelopment ? 'col-2' : 'col-6'}} text-center">{{ activity.status }}</td>
<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">
<em class="fa mr-2 mt-1" [ngClass]="[activity.btnIcon, activity.iconColor]"></em>
<p> {{ activity.btnName }}</p>
</div>
<td class="col-2 text-center" *ngIf="showOptionInDevelopment">
<app-dropdown [info]="activity" (updateInfo)="changeOperation($event)"> </app-dropdown>
</td>
</tr>
</tbody>
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 @@ -96,7 +96,8 @@ export class ActivityEffects {
ofType(actions.ActivityManagementActionTypes.UNARCHIVE_ACTIVITY),
map((action: actions.UnarchiveActivity) => ({
id: action.payload,
status: 'active'
status: 'active',
deleted: false
})
),
mergeMap((activity: ActivityStatus) =>
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