Skip to content

Commit 912fc06

Browse files
Reihtwwilc0519jisazacMarco AguirreMarco Aguirre
authored
Tta 83 solving conflicts (#912)
* Tta 50 error when editing an entry (#907) * fix: TTA-50 Error when editing an entry * fix: TTA-50 Error when editing an entry * Tta 94 refactor endpoints to make it work on tt stage and tt prod (#903) * Innecesary env files deleted * New changes to env files * Add 1 git-crypt collaborator New collaborators: F295BDD1 Marco Aguirre <[email protected]> * Add 1 git-crypt collaborator New collaborators: 1CC2872D Rodolfo Diaz <[email protected]> * Add 2 git-crypt collaborators New collaborators: 1CC2872D Rodolfo Diaz <[email protected]> F295BDD1 Marco Aguirre <[email protected]> * New keys and env variables added * env files added & modified * Make run now uses .dev.env * Pipeline modified * is the .env needed? * using encrypted .stage.env * load secrets * adding env variables * scopes cannot be empty * use env * using env var * using env file * adding mask * using docker buildkit * only on tags * using buildkit directly * using dash source * docker buildkit * missing folders added * nginx fix * fixing secrets * problem with double qoutes * fixing quotes in .stage.env * fixing secrets * loading to env * quotes fixed * replacing \r * fixing trailing \n * one line expose * fixing endpoint url * removing unnecessary jobs * update creds * adding with space at the end of the file * primer commit * cambios en users list components * Se ajusta la variable isDevelopmentOrProd * revision tests * reportsUrl como variable global Co-authored-by: Marco Aguirre <[email protected]> Co-authored-by: Marco Aguirre <[email protected]> Co-authored-by: Rodolfo IOET <[email protected]> Co-authored-by: jisazac <[email protected]> Co-authored-by: Juan Isaza <[email protected]> * Set copy of package.json and npm install before copying all other project files (#906) * Set copy of package.json and npm install before copying all other project files * Fix error on COPY on Dockerfiles Co-authored-by: Gustavo Lozada <[email protected]> * feat: TTA-113 Set a new logo for TT - version 2 (#909) Co-authored-by: Jimmy Jaramillo <[email protected]> * chore(release): 1.74.0 [skip ci]nn Co-authored-by: wilc0519 <[email protected]> Co-authored-by: Juan Esteban Isaza Cadavid <[email protected]> Co-authored-by: Marco Aguirre <[email protected]> Co-authored-by: Marco Aguirre <[email protected]> Co-authored-by: Rodolfo IOET <[email protected]> Co-authored-by: jisazac <[email protected]> Co-authored-by: Juan Isaza <[email protected]> Co-authored-by: GuLozada99 <[email protected]> Co-authored-by: Gustavo Lozada <[email protected]> Co-authored-by: Jimmy Jaramillo <[email protected]> Co-authored-by: Jimmy Jaramillo <[email protected]> Co-authored-by: semantic-release-bot <[email protected]>
1 parent b461870 commit 912fc06

File tree

18 files changed

+36
-39
lines changed

18 files changed

+36
-39
lines changed

Docker/Dockerfile.dev

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ ENV HOME /home/${USERNAME}
55
RUN useradd -ms /bin/bash ${USERNAME}
66

77
WORKDIR ${HOME}/time-tracker-ui
8+
COPY package.json package-lock.json ./
9+
RUN npm cache clean --force && npm install
810
COPY . .
911
RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui \
1012
&& chmod -R 777 ${HOME}/time-tracker-ui
1113

1214
USER ${USERNAME}
13-
RUN npm cache clean --force && npm install
1415
EXPOSE 4200
1516
CMD ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck

Docker/Dockerfile.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ RUN mkdir -p /opt/selenium \
3434
RUN useradd -ms /bin/bash ${USERNAME}
3535

3636
WORKDIR ${HOME}/time-tracker-ui
37+
COPY package.json package-lock.json ./
38+
RUN npm cache clean --force && npm install
3739
COPY . .
3840
RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui
3941
RUN chmod -R 777 ${HOME}/time-tracker-ui
4042

4143
USER ${USERNAME}
4244
EXPOSE 4200
4345
EXPOSE 9876
44-
RUN npm cache clean --force && npm install
4546
CMD npm run ci-test

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "time-tracker",
3-
"version": "1.73.2",
3+
"version": "1.74.0",
44
"scripts": {
55
"preinstall": "npx npm-force-resolutions",
66
"ng": "ng",

src/app/modules/customer-management/components/projects/components/services/project.service.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('ProjectService', () => {
104104
it('update project using PUT from url locally', () => {
105105
const project: Project = { id: '1', name: 'new name', description: 'description', project_type_id: '123', status: 'active'};
106106
service.url = 'projects';
107-
service.isDevelopment = true;
107+
service.isDevelopmentOrProd = true;
108108
service.updateProject(project).subscribe((response) => {
109109
expect(response.name).toBe('new name');
110110
});
@@ -115,7 +115,7 @@ describe('ProjectService', () => {
115115

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

127127
it('update status project using PUT from baseUrl locally', () => {
128128
const url = `${service.url}/1`;
129-
service.isDevelopment = true;
129+
service.isDevelopmentOrProd = true;
130130
service.deleteProject(projectsList[0].id).subscribe((projectsInResponse) => {
131131
expect(projectsInResponse.filter((project) => project.id !== projectsList[0].id).length).toEqual(2);
132132
});

src/app/modules/customer-management/components/projects/components/services/project.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Project } from '../../../../../shared/models';
1111
export class ProjectService {
1212
projects: Project[] = [];
1313
url = `${environment.timeTrackerApiUrl}/projects`;
14-
isDevelopment = environment.production === EnvironmentType.TT_DEV;
14+
isDevelopmentOrProd = environment.production === EnvironmentType.TT_DEV || environment.production === EnvironmentType.TT_PROD;
1515

1616
constructor(private http: HttpClient) {}
1717

@@ -34,7 +34,7 @@ export class ProjectService {
3434

3535
updateProject(projectData): Observable<any> {
3636
const { id } = projectData;
37-
if (this.isDevelopment) {
37+
if (this.isDevelopmentOrProd) {
3838
if (projectData.status === 'active') {
3939
projectData.status = 1;
4040
}
@@ -43,7 +43,7 @@ export class ProjectService {
4343
}
4444

4545
deleteProject(projectId: string): Observable<any> {
46-
return this.isDevelopment
46+
return this.isDevelopmentOrProd
4747
? this.http.put(`${this.url}/${projectId}`, { status: 0 })
4848
: this.http.delete(`${this.url}/${projectId}`);
4949
}

src/app/modules/shared/components/details-fields/details-fields.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
(search)="onClearedComponent($event)"
2222
(change)="onSelectedProject($event)"
2323
ngDefaultControl="project_name">
24-
24+
2525
<ng-template ng-option-tmp let-item="item">
2626
<div class="flex flex-wrap flex-row justify-between">
2727
<div class="p-2 text-xs">

src/app/modules/shared/components/details-fields/details-fields.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { TechnologyState } from '../../store/technology.reducers';
2222
import { EntryActionTypes } from './../../../time-clock/store/entry.actions';
2323
import { SaveEntryEvent } from './save-entry-event';
2424
import { ProjectSelectedEvent } from './project-selected-event';
25-
import { get } from 'lodash';
25+
import { get, isEmpty } from 'lodash';
2626
import { DATE_FORMAT, DATE_FORMAT_YEAR } from 'src/environments/environment';
2727
import { TechnologiesComponent } from '../technologies/technologies.component';
2828
import { MatDatepicker } from '@angular/material/datepicker';
@@ -179,7 +179,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
179179
this.goingToWorkOnThis = this.entryToEdit?.running ? true : false;
180180
this.shouldRestartEntry = false;
181181
this.getRecentProjects();
182-
if (this.entryToEdit) {
182+
if (this.entryToEdit && !isEmpty(this.entryToEdit)) {
183183
this.isTechnologiesDisabled = false;
184184
this.selectedTechnologies = this.entryToEdit.technologies;
185185
const projectFound = this.listProjects.find((project) => project.id === this.entryToEdit.project_id);

src/app/modules/shared/components/sidebar/sidebar.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div id="sidebar-wrapper" class="table-row border-r border-grayTW-lighter shadow-sm bg-whiteTW dark:bg-grayTW-dark dark:border-grayTW">
33
<div class="table-cell">
44
<div class="relative flex items-center border-b border-grayTW-lighter dark:border-grayTW sidebar-heading">
5-
<img src="assets/img/time-tracker-logo.png" alt="ioet-logo" width="200" height="auto"/>
5+
<img [src]="urlLogo" alt="ioet-logo" width="200" height="auto"/>
66
</div>
77
<app-user></app-user>
88
<div class="list-group list-group-flush bg-whiteTW dark:bg-grayTW-darker">

src/app/modules/shared/components/sidebar/sidebar.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export class SidebarComponent implements OnInit, OnDestroy {
1919
navStart;
2020
sidebarItems$: Subscription;
2121
isProduction = environment.production === EnvironmentType.TT_PROD_LEGACY;
22+
urlLogo = this.isProduction ? 'assets/img/time-tracker-logo.png' : 'assets/img/time-tracker-logo-v2.png';
2223

2324
constructor(
2425
private router: Router,

0 commit comments

Comments
 (0)