Skip to content

Commit

Permalink
Merge pull request #34 from blopa/feature/better-internal-json-schema
Browse files Browse the repository at this point in the history
Feature/better internal json schema
  • Loading branch information
blopa authored May 13, 2021
2 parents 96de6da + dcb7e41 commit 609b827
Show file tree
Hide file tree
Showing 84 changed files with 4,708 additions and 3,369 deletions.
10 changes: 8 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Older versions: [V1](https://github.com/blopa/Resume-Builder/blob/main/README_V1
- Cover Letter Editor

## JSON Resume Schema
This project uses the [jsonresume/resume-schema](https://github.com/jsonresume/resume-schema) v1.0.0, but due a need to extend some of it's features, we also added 4 new fields:
This project uses the [jsonresume/resume-schema](https://github.com/jsonresume/resume-schema) v1.0.0, but due to a need to extend some of it's features, we also added 4 new fields:
- `__translation__` to translate template keys.
- `coverLetter` to add your own Cover Letter template.
- `work[].keywords` to add keywords to your work experience.
Expand Down Expand Up @@ -303,11 +303,17 @@ The following `JSON` is a result of [this Google Spreadsheet](https://docs.googl
![ScreenShot](https://raw.githubusercontent.com/blopa/Resume-Builder/main/screenshots/v4/screenshot_3.png)

## Release Notes
- **v4.0.3:**
- Add toggler for `keywords` and `highlights` on the sidebar.
- Bump Gatsby and plugins to 3.5.
- Big refactor on the global state.
- Data disabled from the spreadsheet can now be enabled via the sidebar.
- Downloaded `JSON` resume will only contain enabled data.
- **v4.0.2:**
- Filter out resume templates that are not ready yet.
- Add download link to download the JSON data.
- Fix resume viewer.
- Add missing fields on "work" and "projects".
- Add missing fields on `work` and `projects`.
- Small layout fixes in the "Default" template.
- Arrays from the spreadsheet are now parsed using `';'` instead of `','`.
- **v4.0.1:**
Expand Down
2,822 changes: 1,101 additions & 1,721 deletions package-lock.json

Large diffs are not rendered by default.

45 changes: 23 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "resume-builder",
"version": "4.0.2",
"version": "4.0.3",
"description": "Resume Builder",
"main": "index.js",
"author": "Pablo Pirata",
Expand All @@ -22,32 +22,32 @@
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-function-bind": "^7.12.13",
"@babel/plugin-proposal-optional-chaining": "^7.13.12",
"@babel/plugin-proposal-optional-chaining": "^7.14.2",
"@babel/plugin-proposal-private-methods": "^7.13.0",
"@babel/plugin-transform-async-to-generator": "^7.13.0",
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.58",
"@material-ui/styles": "^4.11.4",
"classnames": "^2.3.1",
"gatsby": "^3.4.2",
"gatsby": "^3.5.0",
"gatsby-background-image": "^1.5.3",
"gatsby-image": "^3.4.0",
"gatsby-image": "^3.5.0",
"gatsby-plugin-disqus": "^1.2.2",
"gatsby-plugin-feed": "^3.4.0",
"gatsby-plugin-google-analytics": "^3.4.0",
"gatsby-plugin-feed": "^3.5.0",
"gatsby-plugin-google-analytics": "^3.5.0",
"gatsby-plugin-intl": "^0.3.3",
"gatsby-plugin-manifest": "^3.4.0",
"gatsby-plugin-manifest": "^3.5.0",
"gatsby-plugin-material-ui": "^3.0.1",
"gatsby-plugin-nprogress": "^3.4.0",
"gatsby-plugin-offline": "^4.4.0",
"gatsby-plugin-react-helmet": "^4.4.0",
"gatsby-plugin-robots-txt": "^1.5.6",
"gatsby-plugin-sharp": "^3.4.2",
"gatsby-plugin-sitemap": "^4.0.0",
"gatsby-plugin-typography": "^3.4.0",
"gatsby-source-filesystem": "^3.4.0",
"gatsby-transformer-sharp": "^3.4.0",
"gatsby-plugin-nprogress": "^3.5.0",
"gatsby-plugin-offline": "^4.5.0",
"gatsby-plugin-react-helmet": "^4.5.0",
"gatsby-plugin-robots-txt": "^1.6.2",
"gatsby-plugin-sharp": "^3.5.0",
"gatsby-plugin-sitemap": "^4.1.0",
"gatsby-plugin-typography": "^3.5.0",
"gatsby-source-filesystem": "^3.5.0",
"gatsby-transformer-sharp": "^3.5.0",
"lodash": "^4.17.21",
"material-ui-dropzone": "^3.5.0",
"material-ui-flags": "^1.2.4",
Expand All @@ -56,16 +56,17 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-typography": "^0.16.19",
"react-typography": "^0.16.20",
"typeface-roboto": "1.1.13",
"typography": "^0.16.19",
"typography": "^0.16.21",
"typography-theme-wordpress-2016": "^0.16.19",
"use-detect-print": "0.0.2",
"uuid": "^8.3.2",
"xlsx": "^0.16.9"
},
"devDependencies": {
"babel-preset-gatsby": "^1.4.0",
"@babel/eslint-parser": "^7.14.2",
"babel-preset-gatsby": "^1.5.0",
"cross-env": "^7.0.3",
"eslint": "^7.26.0",
"eslint-config-airbnb": "^18.2.1",
Expand All @@ -81,11 +82,11 @@
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-unicorn": "^32.0.0",
"eslint-plugin-unicorn": "^32.0.1",
"eslint-plugin-unused-imports": "^1.1.1",
"gatsby-plugin-eslint": "^3.0.0",
"npm-check-updates": "^11.5.10",
"prettier": "2.2.1"
"npm-check-updates": "^11.5.11",
"prettier": "2.3.0"
},
"repository": {
"type": "git",
Expand Down
17 changes: 15 additions & 2 deletions src/components/MenuItems.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const useStyles = makeStyles((theme) => ({
externalLink: {
textDecoration: 'none',
},
menuItem: {
paddingLeft: '25px',
},
}));

function MenuItems({
Expand All @@ -40,7 +43,12 @@ function MenuItems({
[classes.drawerList]: isDrawer,
})}
>
<ListItemText inset>
<ListItemText
className={classNames({
[classes.menuItem]: !isDrawer,
})}
inset
>
<Link
to="/upload"
onClick={onItemClick}
Expand All @@ -53,7 +61,12 @@ function MenuItems({
</Typography>
</Link>
</ListItemText>
<ListItemText inset>
<ListItemText
className={classNames({
[classes.menuItem]: !isDrawer,
})}
inset
>
<a
className={classes.externalLink}
target="_blank"
Expand Down
63 changes: 30 additions & 33 deletions src/components/ResumeDrawerItems/Items/Awards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,60 +30,53 @@ function Awards({ awards }) {
dispatch(setResumeAwards(newAwards));
}, [dispatch]);

const toggleAwards = () => {
const toggleAwards = useCallback(() => {
const currentState = awards?.enabled;
setResumeAwardsState({
...awards,
enabled: !currentState,
});
};
}, [awards, setResumeAwardsState]);

const toggleAward = useCallback((award) => () => {
const toggleAward = useCallback((award, index) => () => {
const newAwards = { ...awards };
newAwards.value =
newAwards?.value.map((awd) => {
if (JSON.stringify(awd?.value) === JSON.stringify(award?.value)) {
return {
...awd,
enabled: !awd?.enabled,
};
}
return awd;
});
newAwards.value[index] = {
...newAwards.value[index],
enabled: !newAwards.value[index].enabled,
};
setResumeAwardsState(newAwards);
}, [awards, setResumeAwardsState]);

const toggleAwardsDetail = useCallback((award, propName) => () => {
const toggleAwardsDetail = useCallback((award, index, propName) => () => {
const newAwards = { ...awards };
newAwards.value =
newAwards?.value.map((awd) => {
if (JSON.stringify(awd?.value) === JSON.stringify(award?.value)) {
return {
...awd,
value: {
...awd?.value,
[propName]: {
...awd?.value[propName],
enabled: !awd?.value[propName]?.enabled,
},
},
};
}
return awd;
});
newAwards.value[index] = {
...newAwards.value[index],
value: {
...newAwards.value[index].value,
[propName]: {
...newAwards.value[index].value[propName],
enabled: !newAwards.value[index].value[propName].enabled,
},
},
};

if (newAwards.value[index].enabled) {
newAwards.value[index].enabled =
Object.entries(newAwards.value[index].value).some((entry) => entry[1].enabled);
}
setResumeAwardsState(newAwards);
}, [awards, setResumeAwardsState]);

return (
<div className={classes.resumeDrawerItem}>
<ItemInput
label="awards"
label={varNameToString({ awards })}
onChange={toggleAwards}
checked={awards?.enabled}
/>
{awards?.enabled && (
<ul>
{awards?.value.map((award) => {
{awards?.value.map((award, index) => {
const {
title,
date,
Expand All @@ -96,7 +89,7 @@ function Awards({ awards }) {
<ItemsList
label={title?.value}
checked={award?.enabled}
onClick={toggleAward(award)}
onClick={toggleAward(award, index)}
/>
{award?.enabled && (
<ul>
Expand All @@ -106,6 +99,7 @@ function Awards({ awards }) {
checked={title?.enabled}
onClick={toggleAwardsDetail(
award,
index,
varNameToString({ title })
)}
/>
Expand All @@ -116,6 +110,7 @@ function Awards({ awards }) {
checked={date?.enabled}
onClick={toggleAwardsDetail(
award,
index,
varNameToString({ date })
)}
/>
Expand All @@ -126,6 +121,7 @@ function Awards({ awards }) {
checked={awarder?.enabled}
onClick={toggleAwardsDetail(
award,
index,
varNameToString({ awarder })
)}
/>
Expand All @@ -136,6 +132,7 @@ function Awards({ awards }) {
checked={summary?.enabled}
onClick={toggleAwardsDetail(
award,
index,
varNameToString({ summary })
)}
/>
Expand Down
28 changes: 12 additions & 16 deletions src/components/ResumeDrawerItems/Items/Basics.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ function Basics({ basics }) {
dispatch(setResumeBasics(newBasics));
}, [dispatch]);

const toggleBasics = () => {
const toggleBasics = useCallback(() => {
const currentState = basics?.enabled;
setResumeBasicsState({
...basics,
enabled: !currentState,
});
};
}, [basics, setResumeBasicsState]);

const toggleBasicsDetail = useCallback((propName) => () => {
const currentState = basics?.value[propName]?.enabled;
Expand Down Expand Up @@ -72,18 +72,12 @@ function Basics({ basics }) {
});
}, [basics, setResumeBasicsState]);

const toggleBasicsProfilesDetail = useCallback((profile) => () => {
const toggleBasicsProfilesDetail = useCallback((profile, index) => () => {
const newBasics = { ...basics };
newBasics.value.profiles.value =
newBasics?.value.profiles?.value.map((pro) => {
if (JSON.stringify(pro?.value) === JSON.stringify(profile?.value)) {
return {
...pro,
enabled: !pro?.enabled,
};
}
return pro;
});
newBasics.value.profiles.value[index] = {
...newBasics.value.profiles.value[index],
enabled: !newBasics.value.profiles.value[index].enabled,
};
setResumeBasicsState(newBasics);
}, [basics, setResumeBasicsState]);

Expand Down Expand Up @@ -114,7 +108,7 @@ function Basics({ basics }) {
return (
<div className={classes.resumeDrawerItem}>
<ItemInput
label="basics"
label={varNameToString({ basics })}
onChange={toggleBasics}
checked={basicsEnabled}
/>
Expand Down Expand Up @@ -148,6 +142,7 @@ function Basics({ basics }) {
/>
)}
<ItemsList
// TODO varNameToString({ location })
label="location"
checked={locationEnabled}
onClick={toggleBasicsDetail(
Expand Down Expand Up @@ -243,15 +238,16 @@ function Basics({ basics }) {
)}
{profiles?.enabled && (
<ul>
{profiles?.value.map((profile) => {
{profiles?.value.map((profile, index) => {
const { network } = profile?.value || {};
return (
<ItemsList
label={network?.value}
key={uuid()}
checked={profile?.enabled}
onClick={toggleBasicsProfilesDetail(
profile
profile,
index
)}
/>
);
Expand Down
Loading

0 comments on commit 609b827

Please sign in to comment.