Skip to content

Commit aa0567c

Browse files
committed
update source branch and html output in js
2 parents 117048f + c46efa4 commit aa0567c

29 files changed

+242
-11
lines changed

export-samples/html/cv-monochrome-force.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,9 +1060,9 @@ <h2 class="title">Educación</h2>
10601060
// Mueve los elementos al contenedor
10611061
myLinks && main.appendChild(myLinks);
10621062
aboutMe && main.appendChild(aboutMe);
1063-
languages && main.appendChild(languages);
10641063
hardSkills && main.appendChild(hardSkills);
10651064
softSkills && main.appendChild(softSkills);
1065+
languages && main.appendChild(languages);
10661066
experience && main.appendChild(experience);
10671067
education && main.appendChild(education);
10681068
}

packages/manfred-common/src/doc-parts/experience-section/experience-section.helpers.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,19 +252,19 @@ describe('experience-section.helpers specs', () => {
252252
competences: [
253253
{
254254
name: 'name',
255-
type: 'type',
255+
type: 'technology',
256256
},
257257
{
258258
name: 'name',
259-
type: 'type',
259+
type: 'technology',
260260
},
261261
{
262262
name: 'name',
263-
type: 'type',
263+
type: 'technology',
264264
},
265265
{
266266
name: 'name',
267-
type: 'name',
267+
type: 'technology',
268268
},
269269
],
270270
organization: {
@@ -365,19 +365,19 @@ describe('experience-section.helpers specs', () => {
365365
competences: [
366366
{
367367
name: 'name',
368-
type: 'type',
368+
type: 'technology',
369369
},
370370
{
371371
name: 'name',
372-
type: 'type',
372+
type: 'technology',
373373
},
374374
{
375375
name: 'name',
376-
type: 'type',
376+
type: 'technology',
377377
},
378378
{
379379
name: 'name',
380-
type: 'name',
380+
type: 'technology',
381381
},
382382
],
383383
organization: {

packages/manfred-common/src/doc-parts/experience-section/experience-section.mapper.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ describe('mapFromMacCvToExperienceSectionVm', () => {
5454
organization: {
5555
name: 'name',
5656
description: 'description',
57+
URL: 'https://lemoncode.net',
5758
},
5859
type: 'freelance',
5960
roles: [
@@ -89,6 +90,7 @@ describe('mapFromMacCvToExperienceSectionVm', () => {
8990
{
9091
name: 'name',
9192
description: 'description',
93+
url: 'https://lemoncode.net',
9294
type: 'Autónomo',
9395
roles: [
9496
{

packages/manfred-common/src/doc-parts/experience-section/experience-section.mapper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const mapFromMacCvToExperienceSectionVm = (cv: ManfredAwesomicCV): Experi
1414
export const mapJobToExperience = (job: JobManfredAwesomicCV): ExperienceVm => ({
1515
name: job.organization?.name ?? '',
1616
description: job.organization?.description ?? '',
17+
url: job.organization?.URL ?? '',
1718
type: mapOrganizationType(job.type, types),
1819
roles: job.roles?.map(role => role),
1920
});

packages/manfred-common/src/doc-parts/experience-section/experience-section.vm.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { OrganizationType, PublicEntityDetails, Role } from '@/model';
1+
import { Competence, OrganizationType, PublicEntityDetails, Role } from '@/model';
22

33
export interface ExperienceVm {
44
name: string;
55
description?: string;
6+
url?: string;
67
type?: string;
78
roles: Role[];
89
}
@@ -18,4 +19,5 @@ export interface JobManfredAwesomicCV {
1819
organization: PublicEntityDetails;
1920
type?: OrganizationType | undefined;
2021
roles: [Role, ...Role[]];
22+
competences?: Competence[];
2123
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<%_ if(experienceCollection && experienceCollection.length !== 0){ -%>
2+
<section class="section experiencies">
3+
<h2 class="title"><%- labels.EXPERIENCE_CAREER_HEADING %></h2>
4+
<div class="experiencies__container">
5+
<%_ for(const experience of experienceCollection){ -%>
6+
<div class="experience">
7+
<p class="experience__date"><%- new Date(experience.roles[0].startDate).toLocaleDateString(undefined, { year:"numeric", month:"short"})%> <%_ if(experience.roles[0].finishDate && experience.roles[0].finishDate.toLowerCase() !=='actualidad') { -%>
8+
<%- "- "+new Date(experience.roles[0].finishDate).toLocaleDateString(undefined, { year:"numeric", month:"short"}) -%>
9+
<%_ } else { -%> - Actualidad<%_}-%></p>
10+
<h3 class="experience__position"><%- experience.roles[0].name %></h3>
11+
<h4 class="experience__company"><%- experience.name %></h4>
12+
<%_ if(experience.roles[0].challenges && experience.roles[0].challenges.length !== 0) { -%>
13+
<div class="experience__text">
14+
<%_ for(const challenge of experience.roles[0].challenges){ -%>
15+
<p><%- challenge.description %></p>
16+
<%_}-%>
17+
</div>
18+
<%_}-%>
19+
<%_ if(experience.url && experience.url !== "undefined") { -%>
20+
<a href="https://www.getmanfred.com" class="experience__url"><%- experience.url %></a>
21+
<%_}-%>
22+
<%_ if(experience.roles[0].competences && experience.roles[0].competences.length !== 0) { -%>
23+
<div>
24+
<h5 class="experience__tools"><%- labels.EXPERIENCE_CAREER_TOOLS %></h5>
25+
<ul class="experience__tools-list">
26+
<%_ for(const competences of experience.roles[0].competences ){ -%>
27+
<li class="chip"><%- competences.name %></li>
28+
<%_ } -%>
29+
</ul>
30+
</div>
31+
<%_ } -%>
32+
</div>
33+
<%_ } -%>
34+
</div>
35+
</section>
36+
<%_ }-%>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import ejs from 'ejs';
2+
import { ExperienceVm, mapFromMacCvToExperienceSectionVm } from '@lemoncode/manfred-common/experience-section';
3+
import { Settings, Language, ManfredAwesomicCV } from '@/model';
4+
import { ISO_SPANISH_LANGUAGE } from '@/engine/engine.const';
5+
import experienceTemplate from './experience-section.ejs?raw';
6+
import { getLabels } from './labels';
7+
8+
export const generateExperiencesSection = (cv: ManfredAwesomicCV, settings: Settings): string => {
9+
const experienceSectionVm = mapFromMacCvToExperienceSectionVm(cv);
10+
11+
return generateExperienceSectionInner(experienceSectionVm, settings.language);
12+
};
13+
14+
const generateExperienceSectionInner = (
15+
experienceSectionVm: ExperienceVm[],
16+
language: Language = ISO_SPANISH_LANGUAGE
17+
): string => {
18+
const rootObject = {
19+
experienceCollection: experienceSectionVm,
20+
labels: getLabels(language),
21+
};
22+
23+
return ejs.render(experienceTemplate, rootObject);
24+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './experience-section.part';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { ExperienceLabels } from './experience-label.model';
2+
3+
export const englishExperienceLabels: ExperienceLabels = {
4+
EXPERIENCE_CAREER_HEADING: 'Experience / Career',
5+
EXPERIENCE_CAREER_TOOLS: 'Technologies and Tools',
6+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface ExperienceLabels {
2+
EXPERIENCE_CAREER_HEADING: string;
3+
EXPERIENCE_CAREER_TOOLS: string;
4+
}

0 commit comments

Comments
 (0)