Skip to content

Commit a48c93d

Browse files
committed
Release v2.0.0 - Feature, Schema Version Choice
- Version bump, update Changelog - Quick fix for getting user's version selection from storage on first load
1 parent 718ed83 commit a48c93d

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ When in doubt, refresh the profile page before using this tool.
6969
## Updates:
7070
Date | Release | Notes
7171
--- | --- | ---
72+
11/12/2020 | 2.0.0 | Support for multiple schema versions ✨ ([#34](https://github.com/joshuatz/linkedin-to-jsonresume/pull/34))
7273
11/8/2020 | 1.5.1 | Fix: Omit partial BDAY export in vCard ([#32](https://github.com/joshuatz/linkedin-to-jsonresume/issues/32))
7374
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.
7475
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.

browser-ext/popup.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<div class="specSelectWrapper">
3030
Select JSONResume version:
3131
<select id="specSelect">
32-
<option value="stable">Stable (v0.0.16)</option>
32+
<option value="stable" selected>Stable (v0.0.16)</option>
3333
<option value="latest">Latest (v0.1.3)</option>
3434
<option value="beta">Beta (v0.1.3 + extra)</option>
3535
</select>

browser-ext/popup.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const STORAGE_KEYS = {
1010
schemaVersion: 'schemaVersion'
1111
};
1212
const SPEC_SELECT = /** @type {HTMLSelectElement} */ (document.getElementById('specSelect'));
13+
/** @type {SchemaVersion[]} */
14+
const SPEC_OPTIONS = ['beta', 'stable', 'latest'];
1315

1416
/**
1517
* Generate injectable code for capturing a value from the contentScript scope and passing back via message
@@ -112,15 +114,21 @@ const setSpecVersion = (version) => {
112114
* @returns {Promise<SchemaVersion>}
113115
*/
114116
const getSpecVersion = () => {
117+
// Fallback value will be what is already selected in dropdown
118+
const fallbackVersion = /** @type {SchemaVersion} */ (SPEC_SELECT.value);
115119
return new Promise((res) => {
116120
try {
117121
chrome.storage.sync.get([STORAGE_KEYS.schemaVersion], (result) => {
118-
res(result[STORAGE_KEYS.schemaVersion]);
122+
const storedSetting = result[STORAGE_KEYS.schemaVersion] || '';
123+
if (SPEC_OPTIONS.includes(storedSetting)) {
124+
res(storedSetting);
125+
} else {
126+
res(fallbackVersion);
127+
}
119128
});
120129
} catch (err) {
121-
// Default to stable
122-
res('stable');
123130
console.error(err);
131+
res(fallbackVersion);
124132
}
125133
});
126134
};

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "linkedin-to-json-resume-exporter",
3-
"version": "1.5.1",
3+
"version": "2.0.0",
44
"description": "Browser tool to grab details from your open LinkedIn profile page and export to JSON Resume Schema",
55
"private": true,
66
"main": "src/main.js",

0 commit comments

Comments
 (0)