From dfa85c226d3bb9461d07c2abbf622035b9522cf1 Mon Sep 17 00:00:00 2001 From: LeticiadelaOsa Date: Wed, 13 Dec 2023 18:06:31 +0100 Subject: [PATCH 1/2] Hard-skills-section --- .../hard-skills-section.ejs | 10 +++++++++ .../hard-skills-section.parts.ts | 22 +++++++++++++++++++ .../html-parts/hard-skills-section/index.ts | 1 + .../hard-skills-english-labels.const.ts | 5 +++++ .../labels/hard-skills-label.model.ts | 3 +++ .../hard-skills-spanish-labels.const.ts | 5 +++++ .../hard-skills-section/labels/index.ts | 15 +++++++++++++ .../cv-monochrome-force/html-parts/index.ts | 1 + .../src/engine/cv-monochrome-force/index.ts | 5 ++++- 9 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/hard-skills-section.ejs create mode 100644 packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/hard-skills-section.parts.ts create mode 100644 packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/index.ts create mode 100644 packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-english-labels.const.ts create mode 100644 packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-label.model.ts create mode 100644 packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-spanish-labels.const.ts create mode 100644 packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/index.ts diff --git a/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/hard-skills-section.ejs b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/hard-skills-section.ejs new file mode 100644 index 00000000..a36ca268 --- /dev/null +++ b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/hard-skills-section.ejs @@ -0,0 +1,10 @@ +<%_ if (hardSkillsCollection && hardSkillsCollection.length !== 0) { -%> +
+

<%- labels.HARD_SKILLS_HEADING %>

+ +
+ <%_ } -%> \ No newline at end of file diff --git a/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/hard-skills-section.parts.ts b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/hard-skills-section.parts.ts new file mode 100644 index 00000000..f32fbfc6 --- /dev/null +++ b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/hard-skills-section.parts.ts @@ -0,0 +1,22 @@ +import ejs from 'ejs'; +import { HardSkillVM, mapFromCvToHardSkillVm } from '@lemoncode/manfred-common/hard-skill-section'; +import { ISO_SPANISH_LANGUAGE } from '@/engine/engine.const'; +import { Settings, Language, ManfredAwesomicCV } from '@/model'; +import { getLabels } from './labels'; +import hardSkillsSection from './hard-skills-section.ejs?raw'; + +export const generateHardSkillsSection = (cv: ManfredAwesomicCV, settings: Settings): string => { + const hardSkillsSectionVm = mapFromCvToHardSkillVm(cv); + return generateHardSkillsSectionInner(hardSkillsSectionVm, settings.language); +}; + +const generateHardSkillsSectionInner = ( + hardSkillsSectionVm: HardSkillVM[], + language: Language = ISO_SPANISH_LANGUAGE +): string => { + const rootObject = { + hardSkillsCollection: hardSkillsSectionVm, + labels: getLabels(language), + }; + return ejs.render(hardSkillsSection, rootObject); +}; diff --git a/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/index.ts b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/index.ts new file mode 100644 index 00000000..167555aa --- /dev/null +++ b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/index.ts @@ -0,0 +1 @@ +export * from './hard-skills-section.parts'; diff --git a/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-english-labels.const.ts b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-english-labels.const.ts new file mode 100644 index 00000000..57fc749e --- /dev/null +++ b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-english-labels.const.ts @@ -0,0 +1,5 @@ +import { HardSkillsLabels } from './hard-skills-label.model'; + +export const englishHardSkillsLabels: HardSkillsLabels = { + HARD_SKILLS_HEADING: 'Hard Skills', +}; diff --git a/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-label.model.ts b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-label.model.ts new file mode 100644 index 00000000..c054c0db --- /dev/null +++ b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-label.model.ts @@ -0,0 +1,3 @@ +export interface HardSkillsLabels { + HARD_SKILLS_HEADING: string; +} diff --git a/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-spanish-labels.const.ts b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-spanish-labels.const.ts new file mode 100644 index 00000000..688d9216 --- /dev/null +++ b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-spanish-labels.const.ts @@ -0,0 +1,5 @@ +import { HardSkillsLabels } from './hard-skills-label.model'; + +export const spanishHardSkillsLabels: HardSkillsLabels = { + HARD_SKILLS_HEADING: 'Competencias', +}; diff --git a/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/index.ts b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/index.ts new file mode 100644 index 00000000..2c8f54f5 --- /dev/null +++ b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-section/labels/index.ts @@ -0,0 +1,15 @@ +import { Language } from '@/model'; +import { HardSkillsLabels } from './hard-skills-label.model'; +import { spanishHardSkillsLabels } from './hard-skills-spanish-labels.const'; +import { englishHardSkillsLabels } from './hard-skills-english-labels.const'; + +export const getLabels = (language: Language): HardSkillsLabels => { + switch (language) { + case 'es': + return spanishHardSkillsLabels; + case 'en': + return englishHardSkillsLabels; + default: + throw new Error(`Language not supported: ${language}`); + } +}; diff --git a/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/index.ts b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/index.ts index a5e50cf4..526bb730 100644 --- a/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/index.ts +++ b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/index.ts @@ -7,3 +7,4 @@ export * from './footer-section'; export * from './main-element-start'; export * from './main-element-end'; export * from './about-me-section'; +export * from './hard-skills-section'; diff --git a/packages/manfred2html/src/engine/cv-monochrome-force/index.ts b/packages/manfred2html/src/engine/cv-monochrome-force/index.ts index d4f09be8..b7e96273 100644 --- a/packages/manfred2html/src/engine/cv-monochrome-force/index.ts +++ b/packages/manfred2html/src/engine/cv-monochrome-force/index.ts @@ -9,6 +9,7 @@ import { generateMainElementStart, generateMainElementEnd, generateAboutMeSection, + generateHardSkillsSection, } from './html-parts'; export const exportManfredJSonToCVMonochromeForceHTML = ( @@ -24,6 +25,7 @@ export const exportManfredJSonToCVMonochromeForceHTML = ( const mainElementStart = generateMainElementStart(); const mainElementEnd = generateMainElementEnd(); const aboutMeSection = generateAboutMeSection(manfredJsonContent, settings); + const hardSkillsSection = generateHardSkillsSection(manfredJsonContent, settings); return ` ${htmlDocumentStart} @@ -31,7 +33,8 @@ export const exportManfredJSonToCVMonochromeForceHTML = ( ${profileSection} ${headerElementEnd} ${mainElementStart} - ${aboutMeSection} + ${aboutMeSection} + ${hardSkillsSection} ${mainElementEnd} ${footerSection} ${htmlDocumentEnd} From a44c6d70774d6e4561734aaf25332e26e0715c84 Mon Sep 17 00:00:00 2001 From: LeticiadelaOsa Date: Thu, 14 Dec 2023 20:00:37 +0100 Subject: [PATCH 2/2] delete clg --- .../relevants-links-section/relevants-links-section.part.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/relevants-links-section/relevants-links-section.part.ts b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/relevants-links-section/relevants-links-section.part.ts index f6b1b991..40f1f94c 100644 --- a/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/relevants-links-section/relevants-links-section.part.ts +++ b/packages/manfred2html/src/engine/cv-monochrome-force/html-parts/relevants-links-section/relevants-links-section.part.ts @@ -19,7 +19,6 @@ const generateRelevantsLinksSectionInner = ( profile: profileSectionVm, labels: getLabels(language), }; - console.log(profileSectionVm.emails); return ejs.render(relevantsLinksSection, rootObject); };