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

Implement exporters config ui #107

Merged
merged 33 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5b9e3ec
Add Json Exporter
Arielgordon123 Aug 19, 2020
40a903e
Merge remote-tracking branch 'origin/unifyRepos' into exportersBaruch
baruchiro Aug 26, 2020
1ceb9e7
fix merge lint
baruchiro Aug 26, 2020
e32f357
main.ts remove @ts-nocheck use composition
baruchiro Aug 31, 2020
9a48ff0
Merge branch 'unifyRepos' into exportersBaruch
baruchiro Aug 31, 2020
508914c
Wrap exporters with ExpansionPanel
baruchiro Sep 1, 2020
a121a48
Merge branch 'unifyRepos' into exportersBaruch
baruchiro Sep 8, 2020
1974ef0
Merge branch 'direct-vuex' into exportersBaruch
baruchiro Sep 8, 2020
ee613b6
Merge remote-tracking branch 'origin/unifyRepos' into exportersBaruch
baruchiro Sep 9, 2020
b50f477
Create JsonExporter (not saving)
baruchiro Sep 11, 2020
49cd140
JsonExporter
baruchiro Sep 15, 2020
c5c7d9f
Merge remote-tracking branch 'origin/unifyRepos' into exportersBaruch
baruchiro Sep 15, 2020
3fb7392
Initial implementation of google sheets exporter configuration component
brafdlog Sep 16, 2020
a11dce9
Initialize YnabExporter with almost nothing differ from JsonExporter
baruchiro Sep 16, 2020
91cb9f6
Merge branch 'exportersBaruch' of https://github.com/brafdlog/budget-…
baruchiro Sep 16, 2020
36d393d
Extract common exporter form logic to a common function
brafdlog Sep 16, 2020
7f265b0
Add budget id input to ynab config
brafdlog Sep 16, 2020
0a5ff4d
Allow saving when changing text in ynab exporter form
brafdlog Sep 20, 2020
ff03f32
Add ui for configuration of ynab account mapping
brafdlog Sep 20, 2020
8abef66
Align the plus button to the right
brafdlog Sep 20, 2020
e1b30b6
Add required validation to account mapping fields
brafdlog Sep 20, 2020
ee0d950
Extract ynab account mapping table to a separate component
brafdlog Sep 20, 2020
9a7dcb2
Don't set state to be the default config - fix issue with wrong accou…
brafdlog Sep 21, 2020
360be86
Unify the two definitions of OutputVendorName
brafdlog Sep 21, 2020
8eb9632
Make naming consistent
brafdlog Sep 21, 2020
a1bb31a
use emit from setup
baruchiro Oct 4, 2020
62d4026
Apply suggestions from code review
baruchiro Oct 4, 2020
eff92df
Custom event name 'mappingChanged' must be kebab-case.eslint-plugin-vue
baruchiro Oct 4, 2020
e958ec1
change instead of custom name
baruchiro Oct 4, 2020
8934166
Work with v-model
baruchiro Oct 5, 2020
91feae6
Cleanup
baruchiro Oct 5, 2020
3c4f936
change to input
baruchiro Oct 5, 2020
9bc42d1
meaningful names
baruchiro Oct 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = {
// 'no-param-reassign': ['error', { ignorePropertyModificationsFor: ['state'] }],
'no-param-reassign': 'off',
'no-shadow': ['error', { allow: ['state'] }],
'import/extensions': ['error', { js: 'never', vue: 'never', json: 'always' }],
'import/extensions': ['off'],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
// allow debugger during development
'no-debugger': productionError,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@brafdlog/israeli-bank-scrapers-core": "^0.9.2",
"@getstation/electron-google-oauth2": "2.1.0",
"@sentry/electron": "^1.3.0",
"@vue/composition-api": "^1.0.0-beta.11",
"core-js": "^3.4.4",
"direct-vuex": "^0.12.0",
"download-chromium": "^2.2.0",
Expand Down
5 changes: 3 additions & 2 deletions src/components/app/ConfigEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<script lang="ts">
import Vue from 'vue';
import { VForm } from '@/types/vuetify';
import { required, positive } from '@/components/shared/formValidations';
import store from '@/store';

export default Vue.extend({
Expand All @@ -64,8 +65,8 @@ export default Vue.extend({
this.reset();
},
methods: {
required: (value) => !!value || 'Required.',
positive: (value: number) => value > 0 || 'Must be grater than 0',
required,
positive,
updateGlobalConfig: store.dispatch.Config.updateGlobalConfig,
reset() {
this.globalConfig = JSON.parse(JSON.stringify(this.storeGlobalConfig));
Expand Down
42 changes: 20 additions & 22 deletions src/components/app/Exporters.vue
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
<template>
<div>
<v-toolbar>
<v-toolbar-title>
Exporters
</v-toolbar-title>
<v-toolbar-title>Exporters</v-toolbar-title>
</v-toolbar>
<exporter
v-for="vendor in vendors"
:key="vendor.name"
:vendor="vendor"
/>
<expansion-panel title="Json">
<json-exporter />
</expansion-panel>
<expansion-panel title="Ynab">
<ynab-exporter />
</expansion-panel>
<expansion-panel title="Google Sheets">
<google-sheets-exporter />
</expansion-panel>
</div>
</template>

<script>
import { outputVendors } from '@/originalBudgetTrackingApp';
import Exporter from './exporters/Exporter';
<script lang="ts">
import Vue from 'vue';
import JsonExporter from './exporters/JsonExporter.vue';
import GoogleSheetsExporter from './exporters/GoogleSheetsExporter.vue';
import YnabExporter from './exporters/YnabExporter.vue';
import ExpansionPanel from './exporters/ExpansionPanel.vue';

export default {
components: { Exporter },
data() {
return {
accordionActiveItem: '',
statuses: {},
};
export default Vue.extend({
components: {
ExpansionPanel, JsonExporter, GoogleSheetsExporter, YnabExporter
},
computed: {
vendors: () => outputVendors,
},
};
});
</script>

<style scoped>
Expand Down
29 changes: 29 additions & 0 deletions src/components/app/exporters/ExpansionPanel.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<template>
<v-expansion-panels>
<v-expansion-panel>
<v-expansion-panel-header disable-icon-rotate>
{{ title }}
</v-expansion-panel-header>
<v-expansion-panel-content>
<slot />
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
</template>

<script lang="ts">
import Vue from 'vue';

export default Vue.extend({
name: 'ExpansionPanel',
props: {
title: {
type: String,
required: true,
}
}
});
</script>

<style>
</style>
76 changes: 0 additions & 76 deletions src/components/app/exporters/Exporter.vue

This file was deleted.

59 changes: 59 additions & 0 deletions src/components/app/exporters/GoogleSheetsExporter.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<template>
<v-form
ref="vForm"
v-model="validated"
>
<v-checkbox
v-model="exporter.active"
label="Active"
hide-details="auto"
@change="changed = true"
/>
<v-text-field
v-model="exporter.options.credentialsFilePath"
label="Credentials file path"
hint="Path to google service account json file"
@change="changed = true"
/>
<v-text-field
v-model="exporter.options.spreadsheetId"
label="Spreadsheet id"
hint="The id of the google spreadsheet"
@change="changed = true"
/>
<v-text-field
v-model="exporter.options.sheetName"
label="Sheet name"
hint="The name of the sheet inside the spreadsheet to export to"
@change="changed = true"
/>
<v-btn
color="primary"
:disabled="!readyToSave.value"
@click="submit()"
>
Save
</v-btn>
</v-form>
</template>

<script lang="ts">
import Vue from 'vue';
import { OutputVendorName } from '@/originalBudgetTrackingApp/commonTypes';
import { setupExporterConfigForm } from '@/components/app/exporters/exportersCommon';

export default Vue.extend({
name: 'GoogleSheetsExporter',

setup() {
return {
...setupExporterConfigForm(OutputVendorName.GOOGLE_SHEETS)
};
}
});

</script>

<style scoped>

</style>
45 changes: 45 additions & 0 deletions src/components/app/exporters/JsonExporter.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<template>
<v-form
ref="vForm"
v-model="validated"
>
<v-checkbox
v-model="exporter.active"
label="Active"
@change="changed = true"
/>
<v-text-field
v-model="exporter.options.filePath"
label="JSON file"
outlined
@change="changed = true"
/>
<v-btn
color="primary"
:disabled="!readyToSave.value"
@click="submit()"
>
Save
</v-btn>
</v-form>
</template>

<script lang="ts">
import Vue from 'vue';
import { setupExporterConfigForm } from '@/components/app/exporters/exportersCommon';
import { OutputVendorName } from '@/originalBudgetTrackingApp/commonTypes';

export default Vue.extend({
name: 'JsonExporter',

setup() {
return {
...setupExporterConfigForm(OutputVendorName.JSON)
};
}
});
</script>

<style scoped>

</style>
Loading