Skip to content

Commit

Permalink
Release v2.0.0 - Feature, Schema Version Choice
Browse files Browse the repository at this point in the history
 - Version bump, update Changelog
 - Quick fix for getting user's version selection from storage on first
 load
  • Loading branch information
joshuatz committed Nov 12, 2020
1 parent 718ed83 commit a48c93d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ When in doubt, refresh the profile page before using this tool.
## Updates:
Date | Release | Notes
--- | --- | ---
11/12/2020 | 2.0.0 | Support for multiple schema versions ✨ ([#34](https://github.com/joshuatz/linkedin-to-jsonresume/pull/34))
11/8/2020 | 1.5.1 | Fix: Omit partial BDAY export in vCard ([#32](https://github.com/joshuatz/linkedin-to-jsonresume/issues/32))
10/22/2020 | 1.5.0 | Fix: Incorrect birthday month in exported vCards (off by one)<br>Fix: Better pattern for extracting profile ID from URL, fixes extracting from virtual sub-pages of profile (e.g. `/detail/contact-info`), or with query or hash strings at the end.
7/7/2020 | 1.4.2 | Fix: For work positions, if fetched via `profilePositionGroups`, LI ordering (the way it looks on your profile) was not being preserved.
Expand Down
2 changes: 1 addition & 1 deletion browser-ext/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="specSelectWrapper">
Select JSONResume version:
<select id="specSelect">
<option value="stable">Stable (v0.0.16)</option>
<option value="stable" selected>Stable (v0.0.16)</option>
<option value="latest">Latest (v0.1.3)</option>
<option value="beta">Beta (v0.1.3 + extra)</option>
</select>
Expand Down
14 changes: 11 additions & 3 deletions browser-ext/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const STORAGE_KEYS = {
schemaVersion: 'schemaVersion'
};
const SPEC_SELECT = /** @type {HTMLSelectElement} */ (document.getElementById('specSelect'));
/** @type {SchemaVersion[]} */
const SPEC_OPTIONS = ['beta', 'stable', 'latest'];

/**
* Generate injectable code for capturing a value from the contentScript scope and passing back via message
Expand Down Expand Up @@ -112,15 +114,21 @@ const setSpecVersion = (version) => {
* @returns {Promise<SchemaVersion>}
*/
const getSpecVersion = () => {
// Fallback value will be what is already selected in dropdown
const fallbackVersion = /** @type {SchemaVersion} */ (SPEC_SELECT.value);
return new Promise((res) => {
try {
chrome.storage.sync.get([STORAGE_KEYS.schemaVersion], (result) => {
res(result[STORAGE_KEYS.schemaVersion]);
const storedSetting = result[STORAGE_KEYS.schemaVersion] || '';
if (SPEC_OPTIONS.includes(storedSetting)) {
res(storedSetting);
} else {
res(fallbackVersion);
}
});
} catch (err) {
// Default to stable
res('stable');
console.error(err);
res(fallbackVersion);
}
});
};
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linkedin-to-json-resume-exporter",
"version": "1.5.1",
"version": "2.0.0",
"description": "Browser tool to grab details from your open LinkedIn profile page and export to JSON Resume Schema",
"private": true,
"main": "src/main.js",
Expand Down

0 comments on commit a48c93d

Please sign in to comment.