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

Use config manager in Importers #54

Merged
merged 13 commits into from Jun 12, 2020
Merged

Use config manager in Importers #54

merged 13 commits into from Jun 12, 2020

Conversation

baruchiro
Copy link
Collaborator

In this change, I'm using Vuex (the official state manage for Vue) to hold and represent the config object from configManager.

Then, I'm using vuex-persist. This is a little library to create a Vuex Plugin- a function that called every time the state is changed. With vuex-persist I can define a handler for a specific module, so I created a handler for the config Vuex module, to load this state from configManager and save it with configManager every time it changes.

This leads us to the fact that the state will always be the same as the config. We have to remember this in both directions.

@baruchiro baruchiro requested a review from brafdlog June 10, 2020 11:50
@baruchiro
Copy link
Collaborator Author

Merge #53 to make these validations pass

@brafdlog
Copy link
Owner

brafdlog commented Jun 12, 2020

The consistent naming convention in the repo is camelCase for directories and files so I would rename:

config-manager -> configManager
default-config -> defaultConfig

@@ -1,14 +1,7 @@
/* eslint-disable max-len */
import { createScraper, SCRAPERS } from 'israeli-bank-scrapers-core';
import { createScraper } from 'israeli-bank-scrapers-core';
import getChrome from './downloadChromium';

Copy link
Owner

@brafdlog brafdlog Jun 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change broke the import in Launch.spec.js and importers.vue.spec.js

@@ -76,34 +68,23 @@ export default {
data() {
return {
importing: false,
// TODO: show browser should be in config. Also maybe one for all accounts
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and yes. In general I think the common usecase is scrape all importers and then this type of configuration is global

Copy link
Owner

@brafdlog brafdlog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. See comments


// Remove when https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/625 closed
const skip = process.env.GITHUB_ACTIONS && process.platform === 'win32';
// const skip = process.env.GITHUB_ACTIONS && process.platform === 'win32';
const skip = true;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test got stuck both locally and in the ci. When debugging locally it seems it got stuck running testWithSpectron. Didn't even get to the tests themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants