Skip to content
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
cd6a676
Innecesary env files deleted
Jul 6, 2022
9dd2d22
New changes to env files
Jul 6, 2022
5cd8097
Merge from master
Jul 6, 2022
cee7a67
Add 1 git-crypt collaborator
Jul 6, 2022
37395a4
Add 1 git-crypt collaborator
Jul 6, 2022
64715d8
Add 2 git-crypt collaborators
Jul 6, 2022
04b36bf
New keys and env variables added
Jul 6, 2022
46713de
env files added & modified
Jul 7, 2022
3cbea5e
Merge from master
Jul 8, 2022
dd2e28c
Make run now uses .dev.env
Jul 8, 2022
5fbd76a
Pipeline modified
Jul 8, 2022
417fb0f
is the .env needed?
rodolfoIOET Jul 8, 2022
f98d359
using encrypted .stage.env
rodolfoIOET Jul 8, 2022
d829238
load secrets
rodolfoIOET Jul 8, 2022
f304803
adding env variables
rodolfoIOET Jul 8, 2022
d798597
scopes cannot be empty
rodolfoIOET Jul 8, 2022
71b814c
use env
rodolfoIOET Jul 8, 2022
e0557f3
using env var
rodolfoIOET Jul 8, 2022
09204b3
using env file
rodolfoIOET Jul 8, 2022
eaa95fe
adding mask
rodolfoIOET Jul 8, 2022
38b3cd8
using docker buildkit
rodolfoIOET Jul 11, 2022
c9a8046
only on tags
rodolfoIOET Jul 11, 2022
ac78df4
using buildkit directly
rodolfoIOET Jul 11, 2022
9f8f2f3
using dash source
rodolfoIOET Jul 11, 2022
4f78988
docker buildkit
rodolfoIOET Jul 11, 2022
c6ab1b4
missing folders added
rodolfoIOET Jul 11, 2022
82f58a6
nginx fix
rodolfoIOET Jul 11, 2022
0b5f089
fixing secrets
rodolfoIOET Jul 11, 2022
59dbb51
problem with double qoutes
rodolfoIOET Jul 11, 2022
6506028
fixing quotes in .stage.env
rodolfoIOET Jul 11, 2022
a3e3082
fixing secrets
rodolfoIOET Jul 11, 2022
ab39a18
loading to env
rodolfoIOET Jul 11, 2022
58f2706
quotes fixed
rodolfoIOET Jul 11, 2022
ac3c03d
replacing \r
rodolfoIOET Jul 12, 2022
103f4b4
fixing trailing \n
rodolfoIOET Jul 12, 2022
0a56877
one line expose
rodolfoIOET Jul 12, 2022
8ba2a27
fixing endpoint url
rodolfoIOET Jul 12, 2022
b7693a3
removing unnecessary jobs
rodolfoIOET Jul 12, 2022
1b62b4b
update creds
rodolfoIOET Jul 12, 2022
6b3a57c
adding with space at the end of the file
rodolfoIOET Jul 13, 2022
c21ca6c
primer commit
Jul 15, 2022
f11eeee
merge from branch 87
rodolfoIOET Jul 15, 2022
3336236
solving conflics
rodolfoIOET Jul 18, 2022
8d9e744
cambios en users list components
Jul 21, 2022
16ccb5a
Se ajusta la variable isDevelopmentOrProd
Jul 21, 2022
c4d30e9
revision tests
Jul 21, 2022
6553cc9
reportsUrl como variable global
Jul 27, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('ProjectService', () => {
it('update project using PUT from url locally', () => {
const project: Project = { id: '1', name: 'new name', description: 'description', project_type_id: '123', status: 'active'};
service.url = 'projects';
service.isDevelopment = true;
service.isDevelopmentOrProd = true;
service.updateProject(project).subscribe((response) => {
expect(response.name).toBe('new name');
});
Expand All @@ -115,7 +115,7 @@ describe('ProjectService', () => {

it('delete project using DELETE from baseUrl', () => {
const url = `${service.url}/1`;
service.isDevelopment = false;
service.isDevelopmentOrProd = false;
service.deleteProject(projectsList[0].id).subscribe((projectsInResponse) => {
expect(projectsInResponse.filter((project) => project.id !== projectsList[0].id).length).toEqual(2);
});
Expand All @@ -126,7 +126,7 @@ describe('ProjectService', () => {

it('update status project using PUT from baseUrl locally', () => {
const url = `${service.url}/1`;
service.isDevelopment = true;
service.isDevelopmentOrProd = true;
service.deleteProject(projectsList[0].id).subscribe((projectsInResponse) => {
expect(projectsInResponse.filter((project) => project.id !== projectsList[0].id).length).toEqual(2);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Project } from '../../../../../shared/models';
export class ProjectService {
projects: Project[] = [];
url = `${environment.timeTrackerApiUrl}/projects`;
isDevelopment = environment.production === EnvironmentType.TT_DEV;
isDevelopmentOrProd = environment.production === EnvironmentType.TT_DEV || environment.production === EnvironmentType.TT_PROD;

constructor(private http: HttpClient) {}

Expand All @@ -34,7 +34,7 @@ export class ProjectService {

updateProject(projectData): Observable<any> {
const { id } = projectData;
if (this.isDevelopment) {
if (this.isDevelopmentOrProd) {
if (projectData.status === 'active') {
projectData.status = 1;
}
Expand All @@ -43,7 +43,7 @@ export class ProjectService {
}

deleteProject(projectId: string): Observable<any> {
return this.isDevelopment
return this.isDevelopmentOrProd
? this.http.put(`${this.url}/${projectId}`, { status: 0 })
: this.http.delete(`${this.url}/${projectId}`);
}
Expand Down
10 changes: 5 additions & 5 deletions src/app/modules/time-clock/services/entry.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ describe('EntryService', () => {
});

it('stops an entry using POST', () => {
service.urlInProduction = true;
service.urlInProductionLegacy = true;
service.stopEntryRunning('id').subscribe();

const updateEntryRequest = httpMock.expectOne(`${service.baseUrl}/id/stop`);
expect(updateEntryRequest.request.method).toBe('POST');
});

it('stops an entry using PUT', () => {
service.urlInProduction = false;
service.urlInProductionLegacy = false;
service.stopEntryRunning('id').subscribe();

const updateEntryRequest = httpMock.expectOne(`${service.baseUrl}/stop`);
Expand All @@ -105,7 +105,7 @@ describe('EntryService', () => {
const pipe: DatePipe = new DatePipe('en');
const timeRange: TimeEntriesTimeRange = {start_date: yesterday, end_date: today};
const userId = '123';
const reportsUrl = service.urlInProduction ? service.baseUrl : service.baseUrl + '/report';
const reportsUrl = service.urlInProductionLegacy ? service.baseUrl : service.baseUrl + '/report';
service.loadEntriesByTimeRange(timeRange, userId).subscribe();

const loadEntryRequest = httpMock.expectOne(req => req.method === 'GET' && req.url === reportsUrl);
Expand All @@ -120,7 +120,7 @@ describe('EntryService', () => {
const today = moment(new Date());
const timeRange: TimeEntriesTimeRange = { start_date: yesterday, end_date: today };
const userId = '123';
const reportsUrl = service.urlInProduction ? service.baseUrl : service.baseUrl + '/report';
const reportsUrl = service.urlInProductionLegacy ? service.baseUrl : service.baseUrl + '/report';
service.loadEntriesByTimeRange(timeRange, userId).subscribe();

const loadEntryRequest = httpMock.expectOne(req => req.method === 'GET' && req.url === reportsUrl);
Expand All @@ -132,7 +132,7 @@ describe('EntryService', () => {
const today = moment(new Date());
const timeRange: TimeEntriesTimeRange = { start_date: yesterday, end_date: today };
const userId = '123';
const reportsUrl = service.urlInProduction ? service.baseUrl : service.baseUrl + '/report';
const reportsUrl = service.urlInProductionLegacy ? service.baseUrl : service.baseUrl + '/report';

service.loadEntriesByTimeRange(timeRange, userId).subscribe();

Expand Down
6 changes: 3 additions & 3 deletions src/app/modules/time-clock/services/entry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class EntryService {

static TIME_ENTRIES_DATE_TIME_FORMAT = 'yyyy-MM-ddTHH:mm:ssZZZZZ';
baseUrl = `${environment.timeTrackerApiUrl}/time-entries`;
urlInProduction = environment.production === EnvironmentType.TT_PROD || environment.production === EnvironmentType.TT_PROD_LEGACY;
urlInProductionLegacy = environment.production === EnvironmentType.TT_PROD_LEGACY;

loadActiveEntry(): Observable<any> {
return this.http.get(`${this.baseUrl}/running`);
Expand All @@ -46,7 +46,7 @@ export class EntryService {
}

stopEntryRunning(idEntry: string): Observable<any> {
return (this.urlInProduction ? this.http.post(`${this.baseUrl}/${idEntry}/stop`, null) : this.http.put(`${this.baseUrl}/stop`, null) );
return (this.urlInProductionLegacy ? this.http.post(`${this.baseUrl}/${idEntry}/stop`, null) : this.http.put(`${this.baseUrl}/stop`, null) );
}

restartEntry(idEntry: string): Observable<Entry> {
Expand All @@ -69,7 +69,7 @@ export class EntryService {

loadEntriesByTimeRange(range: TimeEntriesTimeRange, userId: string): Observable<any> {
const MAX_NUMBER_OF_ENTRIES_FOR_REPORTS = 9999;
const loadEntriesByTimeRangeURL = this.urlInProduction ? this.baseUrl : this.baseUrl + '/report';
const loadEntriesByTimeRangeURL = this.urlInProductionLegacy ? this.baseUrl : this.baseUrl + '/report';
return this.http.get(loadEntriesByTimeRangeURL,
{
params: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<td class="col-3 text-center">
<ui-switch
size="small"
(change)="!isDevelopment?switchGroup('time-tracker-admin', user):null; updateRole(ROLES.admin, user, $event);"
(change)="!isDevelopmentOrProd?switchGroup('time-tracker-admin', user):null; updateRole(ROLES.admin, user, $event);"
[checked]="user.groups.includes('time-tracker-admin')"></ui-switch>
admin
<span *ngIf="!isDevelopment">
<span *ngIf="!isDevelopmentOrProd">
<ui-switch
size="small"
(change)="switchGroup('time-tracker-tester', user)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class UsersListComponent implements OnInit, OnDestroy, AfterViewInit {
columnDefs: [{ orderable: false, targets: [2]}]
};
switchGroupsSubscription: Subscription;
isDevelopment = true;
isDevelopmentOrProd = true;

public get ROLES() {
return ROLES;
Expand All @@ -38,7 +38,7 @@ export class UsersListComponent implements OnInit, OnDestroy, AfterViewInit {
}

ngOnInit(): void {
this.isDevelopment = environment.production === EnvironmentType.TT_DEV;
this.isDevelopmentOrProd = environment.production === EnvironmentType.TT_DEV || environment.production === EnvironmentType.TT_PROD;
this.store.dispatch(new LoadUsers());
this.loadUsersSubscription = this.actionsSubject$
.pipe(filter((action: any) => action.type === UserActionTypes.LOAD_USERS_SUCCESS))
Expand Down
8 changes: 4 additions & 4 deletions src/app/modules/users/services/users.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('UsersService', () => {
it('grant role to a User', () => {
const userId = 'userId';
const roleId = 'admin';
service.isProduction = true;
service.isProductionLegacy = true;

service.grantRole(userId, roleId).subscribe();

Expand All @@ -46,7 +46,7 @@ describe('UsersService', () => {
it('grant role to a User locally', () => {
const userId = 'userId';
const roleId = 'admin';
service.isProduction = false;
service.isProductionLegacy = false;

service.grantRole(userId, roleId).subscribe();

Expand All @@ -57,7 +57,7 @@ describe('UsersService', () => {
it('revoke role to a User', () => {
const userId = 'userId';
const roleId = 'admin';
service.isProduction = true;
service.isProductionLegacy = true;

service.revokeRole(userId, roleId).subscribe();

Expand All @@ -68,7 +68,7 @@ describe('UsersService', () => {
it('revoke role to a User locally', () => {
const userId = 'userId';
const roleId = 'admin';
service.isProduction = false;
service.isProductionLegacy = false;

service.revokeRole(userId, roleId).subscribe();

Expand Down
6 changes: 3 additions & 3 deletions src/app/modules/users/services/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { EnvironmentType } from './../../../../environments/enum';
providedIn: 'root',
})
export class UsersService {
isProduction = environment.production === EnvironmentType.TT_PROD || environment.production === EnvironmentType.TT_PROD_LEGACY;
isProductionLegacy = environment.production === EnvironmentType.TT_PROD_LEGACY;
constructor(private http: HttpClient) {}

baseUrl = `${environment.timeTrackerApiUrl}/users`;
Expand All @@ -19,13 +19,13 @@ export class UsersService {
}

grantRole(userId: string, roleId: string): Observable<any> {
const url = this.isProduction ? `${this.baseUrl}/${userId}/roles/${roleId}/grant`
const url = this.isProductionLegacy ? `${this.baseUrl}/${userId}/roles/${roleId}/grant`
: `${this.baseUrl}/${userId}/${roleId}/grant`;
return this.http.post(url, null);
}

revokeRole(userId: string, roleId: string): Observable<any> {
const url = this.isProduction ? `${this.baseUrl}/${userId}/roles/${roleId}/revoke`
const url = this.isProductionLegacy ? `${this.baseUrl}/${userId}/roles/${roleId}/revoke`
: `${this.baseUrl}/${userId}/${roleId}/revoke`;
return this.http.post(url, null);
}
Expand Down