Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Cleanup: Enforce Linting Rules & Update UNSAFE_ React Lifecycle Events #559

Merged
merged 33 commits into from Jun 4, 2020
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
75b0091
add linting for no-param-reassign and fix resulting linting errors
IAmThePan Apr 29, 2020
8d37082
add linting for prefer-object-spread and fix resulting linting errors
IAmThePan Apr 29, 2020
3049bd1
add linting for no-restricted-syntax and fix 1/2 of resulting errors
IAmThePan May 1, 2020
fe03ad7
add linting for no-prototype-builtins and fix resulting linting errors
IAmThePan May 4, 2020
f11bc18
add linting for class-methods-use-this and fix most resulting errors.…
IAmThePan May 5, 2020
5f3471e
finish linting for class-methods-use-this
IAmThePan May 6, 2020
d4d84dc
add linting for no-mixed-operators and fix resulting linting errors
IAmThePan May 6, 2020
17f90ed
add linting for import/prefer-default-export and fix resulting lintin…
IAmThePan May 8, 2020
a77cd1b
add linting for react/no-access-state-in-setstate and fix resulting l…
IAmThePan May 8, 2020
c31dbaf
add linting for react/jsx-props-no-spreading and fix resulting lintin…
IAmThePan May 11, 2020
3d50aff
finish linting errors for no-restricted-syntax. 1 remains: couldn't r…
IAmThePan May 12, 2020
227d012
Merge branch 'develop' into feature/update-linter
IAmThePan May 12, 2020
0988a29
Fix linting errors resulting from the merge with develop
IAmThePan May 12, 2020
b55be21
Refactor UNSAFE_componentWillMount into either constructor or compone…
IAmThePan May 14, 2020
241747c
Refactor UNSAFE_componentWillReceiveProps to componentDidUpdate or ge…
IAmThePan May 18, 2020
eb413fb
re-enable lint exception for no-prototype-builtins and revert calls b…
IAmThePan May 20, 2020
ac0ec93
add single line exception for no-restricted-syntax linting rule
IAmThePan May 20, 2020
fd954eb
add linting for react/destructuring-assignment and fix errors. ToDo: …
IAmThePan May 21, 2020
e815546
Fix minor bugs
IAmThePan May 22, 2020
ae8ffcc
Fix General Settings last updated text
IAmThePan May 22, 2020
4c56460
rework linting rule no-param-reassign to have more exceptions and par…
IAmThePan May 23, 2020
c5ef663
Remove file and line linting exceptions.
IAmThePan May 26, 2020
3ca2402
re-add linting rule react/sort-comp and fix resulting errors
IAmThePan May 26, 2020
4533fd7
remove added linting exception consistent-return and fix resulting er…
IAmThePan May 26, 2020
590aa60
remove added linting expression no-use-before-define and fix resultin…
IAmThePan May 26, 2020
ecb62e8
Fix linting error
IAmThePan May 26, 2020
f634c1d
fix minor bugs
IAmThePan May 26, 2020
ea51432
Code cleanup: fix PromoModal imports
IAmThePan May 26, 2020
75a88cb
Merge with develop. Fix resulting linting errors
IAmThePan May 26, 2020
68493d2
remove unnecessary hasOwnProperty calls after refactored for...in loops
IAmThePan May 28, 2020
6297062
Fix missing strings bug
IAmThePan May 28, 2020
9b4d16c
Fix last remaining string bug
IAmThePan May 28, 2020
2cb47a1
Merge branch 'develop' into feature/cleanup
IAmThePan Jun 4, 2020
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Fix General Settings last updated text

  • Loading branch information
IAmThePan committed May 22, 2020
commit ae8ffcc7ae5411f9555747f169b8e881db918ec7
@@ -184,6 +184,7 @@ export function updateDatabase() {
dispatch({
type: UPDATE_DATABASE,
resultText,
...result.confData,
This conversation was marked as resolved by wlycdgr

This comment has been minimized.

@wlycdgr

wlycdgr Jun 4, 2020
Member

Was this just a bug where bugs_last_checked and bugs_last_updated were not being included in the action object when they always should have been?

This comment has been minimized.

@IAmThePan

IAmThePan Jun 11, 2020
Author Contributor

Yes, I noticed a bug where after clicking to update the Ghostery tracker library the "Update Now" link text would change to "Still up-to-date" but the timestamp would remain the same until you reopened the panel. Only when you reopened the panel would the timestamp change to when you last clicked the update link. I fixed it so the timestamp changes when you click to get the update.

I also had to modify src/background.js#checkLibraryVersion to send the relevant confData in the resolve object.
There may have been a few files changed in relation to this bug fix. Search for bugs_last_checked and bugs_last_updated to find them.

This comment has been minimized.

@wlycdgr

wlycdgr Jun 11, 2020
Member

I did see a bunch of the other changes, yeah. Cool, thanks for fixing & explaining!

});
});
};
@@ -79,9 +79,9 @@ class GeneralSettings extends React.Component {
* @param {Object} settingsData
*/
static getDbLastUpdated(settingsData) {
const { language, bugs_last_updated } = settingsData;
const { language, bugs_last_checked } = settingsData;
moment.locale(language).toLowerCase().replace('_', '-');
const dbLastUpdated = moment(bugs_last_updated).format('LLL');
const dbLastUpdated = moment(bugs_last_checked).format('LLL');
return dbLastUpdated;
}

@@ -266,10 +266,12 @@ const _updateSettingsCheckbox = (state, action) => {
* @return {Object} text with result of the operation
*/
const _updateTrackerDatabase = (state, action) => {
const { resultText } = action;
const { resultText, bugs_last_checked, bugs_last_updated } = action;

return {
dbUpdateText: resultText,
bugs_last_checked,
bugs_last_updated,
};
};

@@ -165,7 +165,13 @@ function checkLibraryVersion() {
conf.bugs_last_updated = nowTime;
}
}
resolve(result);
resolve({
...result,
confData: {
bugs_last_checked: conf.bugs_last_checked,
bugs_last_updated: conf.bugs_last_updated
}
});
});
}).catch((err) => {
log('Error in checkLibraryVersion', err);
@@ -383,13 +383,14 @@ class PanelData {
*/
static _getSettingsData() {
const {
bugs_last_updated, language, new_app_ids,
bugs_last_updated, bugs_last_checked, language, new_app_ids,
settings_last_exported, settings_last_imported
} = conf;

return {

bugs_last_updated,
bugs_last_checked,
categories: PanelData._buildGlobalCategories(),
language, // required for the setup page that does not have access to panelView data
new_app_ids,
ProTip! Use n and p to navigate between commits in a pull request.