From 5b0a02efe46f6e3ab4ed35bad947da9dd987bf53 Mon Sep 17 00:00:00 2001 From: Pablo Benmaman Date: Thu, 13 May 2021 20:24:37 +0200 Subject: [PATCH] fix profiles urls --- README.MD | 8 ++++++++ package-lock.json | 2 +- package.json | 2 +- resume.json | 2 +- src/utils/spreadsheet-parser.js | 8 ++++++-- src/utils/spreadsheet-to-json-resume.js | 2 +- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.MD b/README.MD index 38925cb..547f6b7 100644 --- a/README.MD +++ b/README.MD @@ -89,6 +89,8 @@ First of all you need to create a Google Spreadsheet following the same rules as - **coverLetter:** Your cover letter template - **__translation__:** Add your custom translations +###**Please make sure to [publish your Spreadsheet to the web](https://support.google.com/a/users/answer/9308870)**, otherwise it won't work. + ## Libraries - I'm using [gatsby.js](https://github.com/gatsbyjs/gatsby), [react.js](https://github.com/facebook/react), [js-xlsx](https://github.com/sheetjs/js-xlsx), [Material UI](https://material-ui.com/) and [mustache.js](https://github.com/janl/mustache.js/). - Gatsby template from [gatsby-material-ui-blog-starter](https://github.com/blopa/gatsby-material-ui-blog-starter) @@ -303,6 +305,12 @@ 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.5:** + - Fix `profiles` not being parsed correctly from the Spreadsheet + - Fix parsing Google Spreadsheet (but you need to publish it to the web to work) +- **v4.0.4:** + - *Error 404: Release not found* + - Sorry I had to make this joke... - **v4.0.3:** - Add toggler for `keywords` and `highlights` on the sidebar. - Bump Gatsby and plugins to 3.5. diff --git a/package-lock.json b/package-lock.json index 9b8b81b..bccabf6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "resume-builder", - "version": "4.0.3", + "version": "4.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5a78da6..02c55d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "resume-builder", - "version": "4.0.3", + "version": "4.0.5", "description": "Resume Builder", "main": "index.js", "author": "Pablo Pirata", diff --git a/resume.json b/resume.json index 5d4d6ce..b61fbad 100644 --- a/resume.json +++ b/resume.json @@ -20,7 +20,7 @@ { "network": "Twitter", "username": "neutralthoughts", - "url": "" + "url": "https://twitter.com/neutralthoughts" }, { "network": "SoundCloud", diff --git a/src/utils/spreadsheet-parser.js b/src/utils/spreadsheet-parser.js index a019b3e..dc125bc 100644 --- a/src/utils/spreadsheet-parser.js +++ b/src/utils/spreadsheet-parser.js @@ -31,7 +31,11 @@ export const downloadSpreadsheetFile = xhr.overrideMimeType('text/plain; charset=x-user-defined'); xhr.onload = (event) => { if (event.currentTarget.status === 200) { - return readSpreadsheetData(xhr.responseText, callback); + if (xhr.responseText.startsWith('PK')) { + return readSpreadsheetData(xhr.responseText, callback); + } + + return errorCallback(downloadUrl); } return errorCallback(downloadUrl); @@ -58,7 +62,7 @@ export const parseSpreadsheetUrl = } const spreadsheetId = spreadsheetIdResult[1]; - downloadSpreadsheetFile(spreadsheetId, sheetId, callback, errorCallback); + downloadSpreadsheetFile(spreadsheetId, sheetId, callback, errorCallback, false); }; export const readSpreadsheet = (file, callback) => { diff --git a/src/utils/spreadsheet-to-json-resume.js b/src/utils/spreadsheet-to-json-resume.js index d40dcc3..de4a9ac 100644 --- a/src/utils/spreadsheet-to-json-resume.js +++ b/src/utils/spreadsheet-to-json-resume.js @@ -347,7 +347,7 @@ export default function spreadsheetToJsonResume(jsonSpreadsheet) { .some((entry) => entry[1].enabled), value: { ...jsonResume.basics.value, - profile: { + profiles: { enabled: profileEnabled, value: profilesArray, },