Skip to content

Commit 761090d

Browse files
authored
Merge pull request #308 from deletidev/feature/#275-CV-monochrome-force-Create-studies-section
Closed #275
2 parents b666249 + 28f44fe commit 761090d

19 files changed

+235
-16
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ManfredAwesomicCV } from '@/model';
1+
import { Competence, ManfredAwesomicCV } from '@/model';
22
import { mapCountries, mapFromMacCvToStudiesSectionVm, mapStudiesTypes } from './studies-section.mapper';
33
import { CountryType, StudiesSectionVm, StudyTypeWithTranslation } from './studies-section.vm';
44

@@ -72,6 +72,7 @@ describe('studies-section.mapper specs', () => {
7272
address: 'address',
7373
},
7474
},
75+
linkedCompetences: [{ name: 'CSS', type: 'technology' }],
7576
},
7677
],
7778
},
@@ -97,6 +98,7 @@ describe('studies-section.mapper specs', () => {
9798
address: 'address',
9899
},
99100
},
101+
linkedCompetences: [{ name: 'CSS', type: 'technology' }],
100102
},
101103
];
102104

@@ -151,6 +153,7 @@ describe('studies-section.mapper specs', () => {
151153
address: 'address2',
152154
},
153155
},
156+
linkedCompetences: [{ name: 'CSS', type: 'technology' }],
154157
},
155158
],
156159
},
@@ -176,6 +179,7 @@ describe('studies-section.mapper specs', () => {
176179
address: 'address',
177180
},
178181
},
182+
linkedCompetences: [],
179183
},
180184
{
181185
studyType: 'Certificación',
@@ -192,6 +196,7 @@ describe('studies-section.mapper specs', () => {
192196
address: 'address2',
193197
},
194198
},
199+
linkedCompetences: [{ name: 'CSS', type: 'technology' }],
195200
},
196201
];
197202

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const mapFromMacCvToStudiesSectionVm = (cv: ManfredAwesomicCV): StudiesSe
2626
const mapStudyType = mapStudiesTypes(studyType, studiesTypes);
2727
const mapCountry = mapCountries(institution.location.country, countryList);
2828
institution = { ...institution, location: { ...institution.location, country: mapCountry } };
29+
const linkedCompetences = study?.linkedCompetences ?? [];
2930

3031
return {
3132
name,
@@ -35,6 +36,7 @@ export const mapFromMacCvToStudiesSectionVm = (cv: ManfredAwesomicCV): StudiesSe
3536
finishDate,
3637
description,
3738
institution,
39+
linkedCompetences,
3840
};
3941
}) ?? [];
4042

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface StudiesSectionVm {
88
finishDate: string;
99
description: string;
1010
institution: Institution;
11+
linkedCompetences?: Competence[];
1112
}
1213

1314
export interface Institution {

packages/manfred2html/src/engine/cv-monochrome-force/html-parts/experience-section/experience-section.ejs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="experience">
77
<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') { -%>
88
<%- "- "+new Date(experience.roles[0].finishDate).toLocaleDateString(undefined, { year:"numeric", month:"short"}) -%>
9-
<%_ } else { -%> - Actualidad<%_}-%></p>
9+
<%_ } else { -%> - <%- labels.CURRENT_DATE %> <%_ } -%>
1010
<h3 class="experience__position"><%- experience.roles[0].name %></h3>
1111
<h4 class="experience__company"><%- experience.name %></h4>
1212
<%_ if(experience.roles[0].challenges && experience.roles[0].challenges.length !== 0) { -%>
@@ -16,8 +16,8 @@
1616
<%_}-%>
1717
</div>
1818
<%_}-%>
19-
<%_ if(experience.url && experience.url !== "undefined") { -%>
20-
<a href="https://www.getmanfred.com" class="experience__url"><%- experience.url %></a>
19+
<%_ if(experience.url) { -%>
20+
<a href=<%= experience.url %> class="experience__url" target="_blank"><%- experience.url %></a>
2121
<%_}-%>
2222
<%_ if(experience.roles[0].competences && experience.roles[0].competences.length !== 0) { -%>
2323
<div>

packages/manfred2html/src/engine/cv-monochrome-force/html-parts/experience-section/labels/experience-english-labels.const.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ import { ExperienceLabels } from './experience-label.model';
33
export const englishExperienceLabels: ExperienceLabels = {
44
EXPERIENCE_CAREER_HEADING: 'Experience / Career',
55
EXPERIENCE_CAREER_TOOLS: 'Technologies and Tools',
6+
CURRENT_DATE: 'Now',
67
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export interface ExperienceLabels {
22
EXPERIENCE_CAREER_HEADING: string;
33
EXPERIENCE_CAREER_TOOLS: string;
4+
CURRENT_DATE: string;
45
}

packages/manfred2html/src/engine/cv-monochrome-force/html-parts/experience-section/labels/experience-spanish-labels.const.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ import { ExperienceLabels } from './experience-label.model';
33
export const spanishExperienceLabels: ExperienceLabels = {
44
EXPERIENCE_CAREER_HEADING: 'Experiencia / Carrera',
55
EXPERIENCE_CAREER_TOOLS: 'Tecnologías y Herramientas',
6+
CURRENT_DATE: 'Actualidad',
67
};

packages/manfred2html/src/engine/cv-monochrome-force/html-parts/html-document-start/html-document-start.ejs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
--space-64: calc(var(--space-base) * 16);
2626
2727
/* colors */
28-
--primary-50: #eaf3f3;
29-
--primary-100: #bcd9db;
30-
--primary-200: #9cc7ca;
31-
--primary-300: #6faeb1;
32-
--primary-400: #539ea2;
33-
--primary-500: <%= color -%>;
34-
--primary-600: #247a7e;
35-
--primary-700: #247a7e;
36-
--primary-800: #164a4c;
37-
--primary-900: #11383a;
28+
--primary-50: <%= colorPalette.fifty-%>;
29+
--primary-100: <%= colorPalette.hundred -%>;
30+
--primary-200: <%= colorPalette.twoHundred -%>;
31+
--primary-300: <%= colorPalette.threeHundred -%>;
32+
--primary-400: <%= colorPalette.fourHundred -%>;
33+
--primary-500: <%= colorPalette.fiveHundred -%>;
34+
--primary-600: <%= colorPalette.sixHundred -%>;
35+
--primary-700: <%= colorPalette.sevenHundred -%>;
36+
--primary-800: <%= colorPalette.eightHundred -%>;
37+
--primary-900: <%= colorPalette.nineHundred -%>;
3838
3939
/* text */
4040
--light-light-50: #fefefe;
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
import { HexColor } from '@/model';
2+
3+
interface ColorPalette {
4+
fifty: string;
5+
hundred: string;
6+
twoHundred: string;
7+
threeHundred: string;
8+
fourHundred: string;
9+
fiveHundred: string;
10+
sixHundred: string;
11+
sevenHundred: string;
12+
eightHundred: string;
13+
nineHundred: string;
14+
}
15+
16+
export const createColorPalette = (color: HexColor): ColorPalette => {
17+
switch (color) {
18+
case HexColor.default:
19+
return {
20+
fifty: '#eaf3f3',
21+
hundred: '#bcd9db',
22+
twoHundred: '#9cc7ca',
23+
threeHundred: '#6faeb1',
24+
fourHundred: '#539ea2',
25+
fiveHundred: '#28868b',
26+
sixHundred: '#247a7e',
27+
sevenHundred: '#1c5f63',
28+
eightHundred: '#164a4c',
29+
nineHundred: '#11383a',
30+
};
31+
case HexColor.red:
32+
return {
33+
fifty: '#ffe8eb',
34+
hundred: '#feb8c2',
35+
twoHundred: '#fe96a4',
36+
threeHundred: '#fe667a',
37+
fourHundred: '#fd4961',
38+
fiveHundred: '#fd1b39',
39+
sixHundred: '#e61934',
40+
sevenHundred: '#b41328',
41+
eightHundred: '#8b0f1f',
42+
nineHundred: '#6a0b18',
43+
};
44+
case HexColor.green:
45+
return {
46+
fifty: '#e9f9ef',
47+
hundred: '#baeccd',
48+
twoHundred: '#98e3b4',
49+
threeHundred: '#6ad692',
50+
fourHundred: '#4dce7d',
51+
fiveHundred: '#20c25d',
52+
sixHundred: '#1db155',
53+
sevenHundred: '#178a42',
54+
eightHundred: '#126b33',
55+
nineHundred: '#0d5127',
56+
};
57+
case HexColor.orange:
58+
return {
59+
fifty: '#fcefeb',
60+
hundred: '#f6cdc0',
61+
twoHundred: '#f1b5a2',
62+
threeHundred: '#eb9477',
63+
fourHundred: '#e77f5d',
64+
fiveHundred: '#e15f34',
65+
sixHundred: '#cd562f',
66+
sevenHundred: '#a04325',
67+
eightHundred: '#7c341d',
68+
nineHundred: '#5f2816',
69+
};
70+
case HexColor.yellow:
71+
return {
72+
fifty: '#fefae8',
73+
hundred: '#fcf0b9',
74+
twoHundred: '#fae997',
75+
threeHundred: '#f8df67',
76+
fourHundred: '#f6d949',
77+
fiveHundred: '#f4cf1c',
78+
sixHundred: '#debc19',
79+
sevenHundred: '#ad9314',
80+
eightHundred: '#86720f',
81+
nineHundred: '#66570c',
82+
};
83+
case HexColor.dark:
84+
return {
85+
fifty: '#e9eaeb',
86+
hundred: '#b9bfc1',
87+
twoHundred: '#989fa3',
88+
threeHundred: '#68747a',
89+
fourHundred: '#4b5960',
90+
fiveHundred: '#1e2f38',
91+
sixHundred: '#1b2b33',
92+
sevenHundred: '#152128',
93+
eightHundred: '#111a1f',
94+
nineHundred: '#0d1418',
95+
};
96+
default:
97+
return {
98+
fifty: '#eaf3f3',
99+
hundred: '#bcd9db',
100+
twoHundred: '#9cc7ca',
101+
threeHundred: '#6faeb1',
102+
fourHundred: '#539ea2',
103+
fiveHundred: '#28868b',
104+
sixHundred: '#247a7e',
105+
sevenHundred: '#1c5f63',
106+
eightHundred: '#164a4c',
107+
nineHundred: '#11383a',
108+
};
109+
}
110+
};

packages/manfred2html/src/engine/cv-monochrome-force/html-parts/html-document-start/html-document-start.part.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import { HexColor } from '@/model';
33
import { ManfredAwesomicCV } from '@lemoncode/manfred-common/model';
44
import htmlDocumentStartTemplate from './html-document-start.ejs?raw';
55
import { mapFromMacCvToProfileSectionVm } from '@lemoncode/manfred-common/profile-section';
6+
import { createColorPalette } from './html-document-start.helper';
67

78
export const generateHtmlDocumentStart = (cv: ManfredAwesomicCV, color: HexColor): string => {
89
const profileSectionVm = mapFromMacCvToProfileSectionVm(cv);
910
const avatarUrl = profileSectionVm.avatarUrl;
11+
const colorPalette = createColorPalette(color);
1012

11-
return ejs.render(htmlDocumentStartTemplate, { color, avatarUrl });
13+
return ejs.render(htmlDocumentStartTemplate, { colorPalette, avatarUrl });
1214
};

0 commit comments

Comments
 (0)