diff --git a/packages/manfred-common/src/doc-parts/profile-section/profile-section.vm.ts b/packages/manfred-common/src/doc-parts/profile-section/profile-section.vm.ts index 4bae9fbf..2b8bf49c 100644 --- a/packages/manfred-common/src/doc-parts/profile-section/profile-section.vm.ts +++ b/packages/manfred-common/src/doc-parts/profile-section/profile-section.vm.ts @@ -6,9 +6,9 @@ export interface ProfileSectionVm { fullname: string; emails: string[]; relevantLinks: RelevantLinkVm[]; - avatar: string; - regionLocation: string; - countryLocation: string; + avatar?: string; + regionLocation?: string; + countryLocation?: string; } export interface RelevantLinkVm { diff --git a/packages/manfred-common/src/doc-parts/studies-section/studies-section.helpers.spec.ts b/packages/manfred-common/src/doc-parts/studies-section/studies-section.helpers.spec.ts index f8d14a22..d11796cf 100644 --- a/packages/manfred-common/src/doc-parts/studies-section/studies-section.helpers.spec.ts +++ b/packages/manfred-common/src/doc-parts/studies-section/studies-section.helpers.spec.ts @@ -15,6 +15,7 @@ describe('studies-section.helpers specs', () => { description: 'description2', institution: { name: 'name2', + description: 'description2', location: { country: 'Italia', region: 'region2', @@ -31,6 +32,7 @@ describe('studies-section.helpers specs', () => { description: 'description2', institution: { name: 'name2', + description: 'description2', location: { country: 'Italia', region: 'region2', @@ -47,6 +49,7 @@ describe('studies-section.helpers specs', () => { description: 'description', institution: { name: 'name', + description: 'description', location: { country: 'España', region: 'region', @@ -69,6 +72,7 @@ describe('studies-section.helpers specs', () => { description: 'description', institution: { name: 'name', + description: 'description', location: { country: 'España', region: 'region', @@ -85,6 +89,7 @@ describe('studies-section.helpers specs', () => { description: 'description2', institution: { name: 'name2', + description: 'description2', location: { country: 'Italia', region: 'region2', @@ -101,6 +106,7 @@ describe('studies-section.helpers specs', () => { description: 'description2', institution: { name: 'name2', + description: 'description2', location: { country: 'Italia', region: 'region2', @@ -123,6 +129,7 @@ describe('studies-section.helpers specs', () => { description: 'description', institution: { name: 'name', + description: 'description', location: { country: 'España', region: 'region', @@ -139,6 +146,7 @@ describe('studies-section.helpers specs', () => { description: 'description2', institution: { name: 'name2', + description: 'description2', location: { country: 'Italia', region: 'region2', @@ -161,6 +169,7 @@ describe('studies-section.helpers specs', () => { description: 'description', institution: { name: 'name', + description: 'description', location: { country: 'España', region: 'region', @@ -177,6 +186,7 @@ describe('studies-section.helpers specs', () => { description: 'description2', institution: { name: 'name2', + description: 'description2', location: { country: 'Italia', region: 'region2', @@ -201,6 +211,7 @@ describe('studies-section.helpers specs', () => { description: 'description2', institution: { name: 'name2', + description: 'description2', location: { country: 'Italia', region: 'region2', @@ -223,6 +234,7 @@ describe('studies-section.helpers specs', () => { description: 'description2', institution: { name: 'name2', + description: 'description2', location: { country: 'Italia', region: 'region2', diff --git a/packages/manfred-common/src/doc-parts/studies-section/studies-section.mapper.spec.ts b/packages/manfred-common/src/doc-parts/studies-section/studies-section.mapper.spec.ts index 29756c5b..a53095c9 100644 --- a/packages/manfred-common/src/doc-parts/studies-section/studies-section.mapper.spec.ts +++ b/packages/manfred-common/src/doc-parts/studies-section/studies-section.mapper.spec.ts @@ -72,6 +72,7 @@ describe('studies-section.mapper specs', () => { address: 'address', }, }, + linkedCompetences: [{ name: 'Competence 1' }, { name: 'Competence 2' }], }, ], }, @@ -91,12 +92,14 @@ describe('studies-section.mapper specs', () => { description: 'description', institution: { name: 'name', + description: 'description', location: { country: 'España', region: 'region', address: 'address', }, }, + linkedCompetences: ['Competence 1', 'Competence 2'], }, ]; @@ -134,6 +137,7 @@ describe('studies-section.mapper specs', () => { address: 'address', }, }, + linkedCompetences: [{ name: 'Competence 1' }, { name: 'Competence 2' }], }, { studyType: 'certification', @@ -151,6 +155,7 @@ describe('studies-section.mapper specs', () => { address: 'address2', }, }, + linkedCompetences: [{ name: 'Competence 3' }, { name: 'Competence 4' }], }, ], }, @@ -170,12 +175,14 @@ describe('studies-section.mapper specs', () => { description: 'description', institution: { name: 'name', + description: 'description', location: { country: 'España', region: 'region', address: 'address', }, }, + linkedCompetences: ['Competence 1', 'Competence 2'], }, { studyType: 'Certificación', @@ -186,12 +193,14 @@ describe('studies-section.mapper specs', () => { description: 'description2', institution: { name: 'name2', + description: 'description2', location: { country: 'Italia', region: 'region2', address: 'address2', }, }, + linkedCompetences: ['Competence 3', 'Competence 4'], }, ]; diff --git a/packages/manfred-common/src/doc-parts/studies-section/studies-section.mapper.ts b/packages/manfred-common/src/doc-parts/studies-section/studies-section.mapper.ts index f74a60c3..96847f68 100644 --- a/packages/manfred-common/src/doc-parts/studies-section/studies-section.mapper.ts +++ b/packages/manfred-common/src/doc-parts/studies-section/studies-section.mapper.ts @@ -1,4 +1,4 @@ -import { ManfredAwesomicCV } from '@/model'; +import { Competence, ManfredAwesomicCV } from '@/model'; import { CountryType, Institution, StudiesSectionVm, StudyTypeWithTranslation } from './studies-section.vm'; import { studiesTypes, countryList } from './studies-section.constants'; import { sortedStudiesByStartDate } from './studies-section.helpers'; @@ -16,17 +16,18 @@ export const mapFromMacCvToStudiesSectionVm = (cv: ManfredAwesomicCV): StudiesSe const description = study?.description ?? ''; let institution: Institution = { name: study?.institution?.name ?? '', + description: study?.institution?.description ?? '', location: { country: study?.institution?.location?.country ?? '', region: study?.institution?.location?.region ?? '', address: study?.institution?.location?.address ?? '', }, }; - const mapStudyType = mapStudiesTypes(studyType, studiesTypes); const mapCountry = mapCountries(institution.location.country, countryList); institution = { ...institution, location: { ...institution.location, country: mapCountry } }; - + const linkedCompetences: Competence[] = study?.linkedCompetences ?? []; + const mapLinkedCompetence = linkedCompetences.map(competence => competence.name); return { name, studyType: mapStudyType, @@ -35,6 +36,7 @@ export const mapFromMacCvToStudiesSectionVm = (cv: ManfredAwesomicCV): StudiesSe finishDate, description, institution, + linkedCompetences: mapLinkedCompetence, }; }) ?? []; diff --git a/packages/manfred-common/src/doc-parts/studies-section/studies-section.vm.ts b/packages/manfred-common/src/doc-parts/studies-section/studies-section.vm.ts index ec088ff1..d3a88746 100644 --- a/packages/manfred-common/src/doc-parts/studies-section/studies-section.vm.ts +++ b/packages/manfred-common/src/doc-parts/studies-section/studies-section.vm.ts @@ -8,11 +8,13 @@ export interface StudiesSectionVm { finishDate: string; description: string; institution: Institution; + linkedCompetences: string[]; } export interface Institution { name: string; location: Location; + description: string; } export interface Location { diff --git a/packages/manfred-common/src/model/manfred-schema.model.ts b/packages/manfred-common/src/model/manfred-schema.model.ts index 94178717..96e38b3d 100644 --- a/packages/manfred-common/src/model/manfred-schema.model.ts +++ b/packages/manfred-common/src/model/manfred-schema.model.ts @@ -398,6 +398,6 @@ export interface Role { */ export interface Competence { name: string; - type: 'tool' | 'technology' | 'practice' | 'hardware' | 'domain'; + type?: 'tool' | 'technology' | 'practice' | 'hardware' | 'domain'; description?: string; } diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/experience-section.ejs b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/experience-section.ejs index bc0d2b7a..360dffc7 100644 --- a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/experience-section.ejs +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/experience-section.ejs @@ -4,7 +4,7 @@ -

Experiencia

+

<%- labels.EXPERIENCE_CAREER_HEADING %>

<%_ for(const experience of experienceCollection) { -%>
diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/experience-section.part.ts b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/experience-section.part.ts index cad6e8b1..6e8a91f8 100644 --- a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/experience-section.part.ts +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/experience-section.part.ts @@ -1,16 +1,22 @@ import { ExperienceVm, mapFromMacCvToExperienceSectionVm } from '@lemoncode/manfred-common/experience-section'; -import { ManfredAwesomicCV } from '@/model'; +import { ManfredAwesomicCV, Settings, Language } from '@/model'; +import { ISO_SPANISH_LANGUAGE } from '@/engine/engine.const'; +import { getLabels } from './labels'; import ejs from 'ejs'; import experienceTemplate from './experience-section.ejs?raw'; -export const generateExperienceSection = (cv: ManfredAwesomicCV): string => { +export const generateExperienceSection = (cv: ManfredAwesomicCV, settings: Settings): string => { const experienceSectionVm = mapFromMacCvToExperienceSectionVm(cv); - return generateExperienceSectionInner(experienceSectionVm); + return generateExperienceSectionInner(experienceSectionVm, settings.language); }; -const generateExperienceSectionInner = (experienceSectionVm: ExperienceVm[]): string => { +const generateExperienceSectionInner = ( + experienceSectionVm: ExperienceVm[], + language: Language = ISO_SPANISH_LANGUAGE +): string => { const rootObject = { experienceCollection: experienceSectionVm, + labels: getLabels(language), }; return ejs.render(experienceTemplate, rootObject); }; diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/experience-english-labels.const.ts b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/experience-english-labels.const.ts new file mode 100644 index 00000000..32bfca4b --- /dev/null +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/experience-english-labels.const.ts @@ -0,0 +1,5 @@ +import { ExperienceLabels } from './experience-label.model'; + +export const englishExperienceLabels: ExperienceLabels = { + EXPERIENCE_CAREER_HEADING: 'Experience / Career', +}; diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/experience-label.model.ts b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/experience-label.model.ts new file mode 100644 index 00000000..6f3c04e3 --- /dev/null +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/experience-label.model.ts @@ -0,0 +1,3 @@ +export interface ExperienceLabels { + EXPERIENCE_CAREER_HEADING: string; +} diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/experience-spanish-labels.const.ts b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/experience-spanish-labels.const.ts new file mode 100644 index 00000000..40dee25d --- /dev/null +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/experience-spanish-labels.const.ts @@ -0,0 +1,5 @@ +import { ExperienceLabels } from './experience-label.model'; + +export const spanishExperienceLabels: ExperienceLabels = { + EXPERIENCE_CAREER_HEADING: 'Experiencia / Carrera', +}; diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/index.ts b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/index.ts new file mode 100644 index 00000000..bf9c695e --- /dev/null +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/index.ts @@ -0,0 +1,15 @@ +import { Language } from '@/model'; +import { ExperienceLabels } from './experience-label.model'; +import { spanishExperienceLabels } from './experience-spanish-labels.const'; +import { englishExperienceLabels } from './experience-english-labels.const'; + +export const getLabels = (language: Language): ExperienceLabels => { + switch (language) { + case 'es': + return spanishExperienceLabels; + case 'en': + return englishExperienceLabels; + default: + throw new Error(`Language not supported: ${language}`); + } +}; diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/hard-skills-section/hard-skills-section.ejs b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/hard-skills-section/hard-skills-section.ejs index d04afbab..82129716 100644 --- a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/hard-skills-section/hard-skills-section.ejs +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/hard-skills-section/hard-skills-section.ejs @@ -4,7 +4,7 @@ -

Competencias

+

<%- labels.HARD_SKILLS_HEADING %>