Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuzina committed Jun 27, 2023
2 parents 5f3165a + 3502871 commit 5338bda
Show file tree
Hide file tree
Showing 11 changed files with 1,813 additions and 3,127 deletions.
4,735 changes: 1,752 additions & 2,983 deletions package-lock.json

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "portfolio",
"version": "1.02",
"version": "1.03",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand All @@ -11,45 +11,45 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^16.0.3",
"@angular/common": "^16.0.3",
"@angular/compiler": "^16.0.3",
"@angular/core": "^16.0.3",
"@angular/forms": "^16.0.3",
"@angular/platform-browser": "^16.0.3",
"@angular/platform-browser-dynamic": "^16.0.3",
"@angular/router": "^16.0.3",
"@angular/animations": "^16.1.2",
"@angular/common": "^16.1.2",
"@angular/compiler": "^16.1.2",
"@angular/core": "^16.1.2",
"@angular/forms": "^16.1.2",
"@angular/platform-browser": "^16.1.2",
"@angular/platform-browser-dynamic": "^16.1.2",
"@angular/router": "^16.1.2",
"@fortawesome/fontawesome-free": "^6.4.0",
"@ngx-matomo/router": "^4.1.0",
"@ngx-matomo/tracker": "^4.1.0",
"json-to-graphql-query": "^2.2.5",
"npm-check-updates": "^16.10.12",
"moment": "^2.29.4",
"primeicons": "^6.0.1",
"primeng": "^16.0.0-rc.2",
"primeng": "^16.0.2",
"rxjs": "~7.8.1",
"tslib": "^2.5.2",
"zone.js": "~0.13.0"
"tslib": "^2.6.0",
"zone.js": "~0.13.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.0.3",
"@angular-eslint/builder": "16.0.2",
"@angular-eslint/eslint-plugin": "16.0.2",
"@angular-eslint/eslint-plugin-template": "16.0.2",
"@angular-eslint/schematics": "16.0.2",
"@angular-eslint/template-parser": "16.0.2",
"@angular/cli": "~16.0.3",
"@angular/compiler-cli": "^16.0.3",
"@types/jasmine": "~4.3.2",
"@typescript-eslint/eslint-plugin": "5.59.7",
"@typescript-eslint/parser": "5.59.7",
"eslint": "^8.41.0",
"@angular-devkit/build-angular": "^16.1.1",
"@angular-eslint/builder": "16.0.3",
"@angular-eslint/eslint-plugin": "16.0.3",
"@angular-eslint/eslint-plugin-template": "16.0.3",
"@angular-eslint/schematics": "16.0.3",
"@angular-eslint/template-parser": "16.0.3",
"@angular/cli": "~16.1.1",
"@angular/compiler-cli": "^16.1.2",
"@types/jasmine": "~4.3.4",
"@typescript-eslint/eslint-plugin": "5.60.1",
"@typescript-eslint/parser": "5.60.1",
"eslint": "^8.43.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"jasmine-core": "~5.0.0",
"jasmine-core": "~5.0.1",
"karma": "~6.4.2",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-coverage": "~2.2.1",
"karma-jasmine": "~5.1.0",
"typescript": "~5.0.4"
"typescript": "~5.1.3"
}
}
66 changes: 0 additions & 66 deletions src/app/classes/Duration.ts

This file was deleted.

8 changes: 5 additions & 3 deletions src/app/classes/Job.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Duration } from './Duration';
import { Employer } from './Employer';
import { Skill } from './Skill';

Expand All @@ -19,7 +18,8 @@ export class Responsibility implements IResponsibilityOpts {

export interface IJobOpts {
title: string;
timespan: Duration;
started_at: Date;
ended_at?: Date;
employer: Employer;
skills: Skill[];
responsibilities: Responsibility[];
Expand All @@ -28,7 +28,9 @@ export interface IJobOpts {
export class Job implements IJobOpts {
public title!: string;

public timespan!: Duration;
public started_at!: Date;

public ended_at?: Date;

public employer!: Employer;

Expand Down
2 changes: 1 addition & 1 deletion src/app/classes/NavItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class NavigationItem {

public styleClass: ConditionalClassList = new ConditionalClassList();

public style?: string;
public style = {};

public tooltip?: string;

Expand Down
4 changes: 0 additions & 4 deletions src/app/classes/Skill.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { IPicture } from '../interfaces/Picture';
import { Duration } from './Duration';

export interface ISkillOpts {
id: number;
Expand Down Expand Up @@ -43,15 +42,12 @@ export class Skill implements ISkillOpts {

public acquired_at!: Date;

public duration!: Duration;

public highlighted?: boolean;

public classification!: SkillClassification;

constructor(opts: ISkillOpts) {
Object.assign(this, opts);
this.acquired_at = new Date(this.acquired_at);
this.duration = new Duration(this.acquired_at, new Date());
}
}
26 changes: 0 additions & 26 deletions src/app/classes/TimeThreshold.ts

This file was deleted.

17 changes: 17 additions & 0 deletions src/app/modules/shared/pipes/humanized-duration.pipe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Pipe, PipeTransform } from '@angular/core';
import * as moment from 'moment';

@Pipe({ name: 'humanizedDuration' })
export class HumanizedDurationPipe implements PipeTransform {
transform(startDate: Date, endDate?: Date): string {
endDate ||= new Date();
const datesToMoments = {
start: moment(startDate),
end: moment(endDate),
};
const timespan: number = datesToMoments.start.diff(datesToMoments.end);
const duration: moment.Duration = moment.duration(timespan);
const result: string = duration.humanize();
return result;
}
}
3 changes: 3 additions & 0 deletions src/app/modules/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { SelectButtonModule } from 'primeng/selectbutton';
import { AttributionComponent } from './components/attribution/attribution.component';
import { TableModule } from 'primeng/table';
import { MaintenanceMessageComponent } from './components/maintenance-message/maintenance-message.component';
import { HumanizedDurationPipe } from './pipes/humanized-duration.pipe';
@NgModule({
declarations: [
LoadingSpinnerComponent,
Expand All @@ -32,6 +33,7 @@ import { MaintenanceMessageComponent } from './components/maintenance-message/ma
MatomoOptOutComponent,
AttributionComponent,
MaintenanceMessageComponent,
HumanizedDurationPipe,
],
imports: [
CommonModule,
Expand Down Expand Up @@ -62,6 +64,7 @@ import { MaintenanceMessageComponent } from './components/maintenance-message/ma
HeaderComponent,
MaintenanceMessageComponent,
FooterComponent,
HumanizedDurationPipe,
],
})
export class SharedModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<span class="job-title">{{ job.title }}</span>
<span class="job-employer">{{ job.employer.name }}</span>
<span class="job-time-period"
>{{ job.timespan.start | date : "MMM y" }} -
{{ (job.timespan.end | date : "MMM y") || "Present" }}
({{ job.timespan.lastTimeStr }})</span
>{{ job.started_at | date : "MMM y" }} -
{{ (job.ended_at | date : "MMM y") || "Present" }}
({{ job.started_at | humanizedDuration : job.ended_at }})</span
>
<ul *ngIf="job.responsibilities?.length">
<ng-container
Expand Down
17 changes: 4 additions & 13 deletions src/app/services/employer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { GraphQLService } from './graphql.service';
import { EnumType, jsonToGraphQLQuery } from 'json-to-graphql-query';
import { Job } from '../classes/Job';
import { SkillsService } from './skills.service';
import { Skill } from '../classes/Skill';
import { Duration } from '../classes/Duration';

@Injectable({ providedIn: 'root' })
export class EmployerService extends GenericService {
Expand Down Expand Up @@ -48,11 +46,11 @@ export class EmployerService extends GenericService {
},
},
},
})
}),
);

const employers: Employer[] = employerQueryReturn.employers.map(
(employerRecord: any) => new Employer(employerRecord)
(employerRecord: any) => new Employer(employerRecord),
);

return employers;
Expand Down Expand Up @@ -100,21 +98,14 @@ export class EmployerService extends GenericService {
},
},
},
})
}),
);
const jobs: Job[] = jobsQueryReturn.jobs.map((jobRec: any) => {
jobRec.employer = this.getEmployer(jobRec.employer_id_fk);
/* jobRec.skills = jobRec.skills.map((jobSkillMapping: any) =>
this._sks.getSkill(jobSkillMapping.skill_id_fk)
); */
jobRec.timespan = new Duration(jobRec.started_at, jobRec.ended_at);
jobRec.responsibilities = jobRec.responsibilities.map(
(mapping: any) => mapping.Responsibility
(mapping: any) => mapping.Responsibility,
);
//delete jobRec.job_leverages_skills;
delete jobRec.employer_id_fk;
delete jobRec.started_at;
delete jobRec.ended_at;
const job: Job = new Job(jobRec);
job.employer.jobs.push(job);
return job;
Expand Down

0 comments on commit 5338bda

Please sign in to comment.