Skip to content

Commit

Permalink
update Notifier name and method
Browse files Browse the repository at this point in the history
  • Loading branch information
alensiljak committed Nov 22, 2024
1 parent 5f41b2e commit 981e3c9
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/components/CloudBackupJournalCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import useCloudBackup from 'src/lib/CloudBackup'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import appService from '../appService'
import { Scroll } from 'lucide-vue-next'
Expand Down
2 changes: 1 addition & 1 deletion src/components/CloudBackupSchTxCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import { onMounted, Ref, ref } from 'vue'
import useCloudBackup from 'src/lib/CloudBackup'
import db from 'src/store/db';
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import { CalendarClock } from 'lucide-vue-next'
const { scheduledTxBackup: backup } = useCloudBackup()
Expand Down
2 changes: 1 addition & 1 deletion src/components/CloudBackupSettingsCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<script lang="ts" setup>
import { onMounted, Ref, ref } from 'vue'
import useCloudBackup from 'src/lib/CloudBackup'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import { settings, SettingKeys } from '../lib/settings'
import { Cog, Star } from 'lucide-vue-next'
Expand Down
2 changes: 1 addition & 1 deletion src/components/JournalCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import { onMounted, Ref, ref } from 'vue'
import { useRouter } from 'vue-router'
import appService from '../appService'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import { AccountBalance, Transaction } from 'src/model'
import { TransactionAugmenter } from 'src/lib/transactionAugmenter'
import { FileUp, Scroll } from 'lucide-vue-next'
Expand Down
2 changes: 1 addition & 1 deletion src/components/ScheduledTxCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import { onMounted, Ref, ref } from 'vue'
import moment, { Moment } from 'moment'
import { useRouter } from 'vue-router'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import appService from '../appService'
import { TransactionAugmenter } from 'src/lib/transactionAugmenter'
import { ScheduledTransaction, Transaction } from 'src/model'
Expand Down
4 changes: 2 additions & 2 deletions src/lib/CashierNotification.ts → src/lib/Notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export default function useNotifications() {
$q.notify({ color: 'accent', message: message })
}

function positive(message: string): void {
function success(message: string): void {
$q.notify({ color: 'positive', message: message })
}

return { custom, info, negative, neutral, positive }
return { custom, info, negative, neutral, success }
}
2 changes: 1 addition & 1 deletion src/pages/AssetClassDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { useRoute } from 'vue-router'
import { AssetClass, StockSymbol } from 'src/lib/AssetClass'
import { Collection } from 'dexie'
import { Account } from 'src/model'
import useNotifications from '../lib/CashierNotification'
import useNotifications from '../lib/Notifier'
const $route = useRoute()
const Notification = useNotifications()
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Cache.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { CashierSync } from '../lib/cashier-sync'
import { useQuasar } from 'quasar'
import { SettingKeys, settings, Constants } from '../lib/settings'
import CashierCache from '../lib/CashierCache'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
const Notification = useNotifications()
const $q = useQuasar()
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CloudBackup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import Toolbar from '../components/CashierToolbar.vue'
import useNotifications from '../lib/CashierNotification'
import useNotifications from '../lib/Notifier'
import useCloudBackup from '../lib/CloudBackup'
import JournalCard from '../components/CloudBackupJournalCard.vue'
import SettingsCard from 'src/components/CloudBackupSettingsCard.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/DemoData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<script setup lang="ts">
import CashierToolbar from 'src/components/CashierToolbar.vue'
import { ref } from 'vue'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import { AccountService } from 'src/lib/accountsService'
import { SettingKeys, settings } from '../lib/settings'
import {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/FavouritesReorder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ import { settings, SettingKeys } from '../lib/settings'
import appService from '../appService'
import { useRouter } from 'vue-router'
import draggable from 'vuedraggable'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import { Check, Menu as IconMenu } from 'lucide-vue-next'
const $q = useQuasar()
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ import JournalCard from '../components/JournalCard.vue'
import ScheduledCard from '../components/ScheduledTxCard.vue'
import { onMounted, Ref, ref } from 'vue'
import { CardNames, SettingKeys, settings } from '../lib/settings'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import { Menu as IconMenu, MoreVertical, Plus as PlusIcon, Settings as IconSettings, X as IconX } from 'lucide-vue-next'
const router = useRouter()
Expand Down
2 changes: 1 addition & 1 deletion src/pages/LedgerWasm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue';
import Toolbar from '../components/CashierToolbar.vue'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
// import * as ledger from 'ledger-rs-lib'
// import * as cashierWasm from 'cashier-wasm'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Payees.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { SET_SELECTED_ID } from '../mutations'
import PayeesToolbar from '../components/PayeesToolbar.vue'
import { RecycleScroller } from 'vue-virtual-scroller'
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import CashierDAL from 'src/store/dal'
import { Payee } from 'src/model'
import { ListSearch } from 'src/ListSearch'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PostingsDelete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import { useMainStore } from 'src/store/mainStore';
import { Ref, onMounted, ref } from 'vue';
import { useRouter } from 'vue-router';
import { useStore } from 'vuex';
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
const router = useRouter()
const mainStore = useMainStore()
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { SelectionModeMetadata, SettingKeys, settings } from '../lib/settings'
import { Account, Posting } from 'src/model'
import { TransactionParser } from 'src/lib/transactionParser'
import { TransactionAugmenter } from 'src/lib/transactionAugmenter'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import { Plus as IconPlus } from 'lucide-vue-next'
import { AccountService } from 'src/lib/accountsService'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReorderPostings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { useQuasar } from 'quasar'
import { useRouter } from 'vue-router'
import { storeToRefs } from 'pinia'
import { Posting, Transaction } from 'src/model'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import draggable from 'vuedraggable'
import { Check as IconCheck, Menu as IconMenu } from 'lucide-vue-next'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ import { onMounted, Ref, ref } from 'vue'
import db from '../store/db'
import Toolbar from '../components/CashierToolbar.vue'
import { SettingKeys, settings } from '../lib/settings'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import { useRouter } from 'vue-router'
import { useQuasar } from 'quasar'
import { engine } from '../lib/AssetAllocation'
Expand Down
20 changes: 10 additions & 10 deletions src/pages/Sync.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ import appService from '../appService'
import { CashierSync } from '../lib/cashier-sync'
import { SettingKeys, settings, Constants } from '../lib/settings'
import Toolbar from '../components/CashierToolbar.vue'
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
import { Activity, MoreVertical, Power, RefreshCw } from 'lucide-vue-next'
import CashierDAL from '../store/dal'
Expand Down Expand Up @@ -137,10 +137,10 @@ async function onConnectClicked() {
try {
const response = await sync.healthCheck()
Notification.positive(response)
Notifier.success(response)
} catch (error: any) {
console.error(error)
Notification.negative('Connecting to CashierSync: ' + error.message)
Notifier.negative('Connecting to CashierSync: ' + error.message)
}
}
Expand All @@ -158,18 +158,18 @@ async function saveSyncServerUrl() {
// sync server.
await settings.set(SettingKeys.syncServerUrl, serverUrl.value)
Notification.info('sync server saved')
Notifier.info('sync server saved')
}
async function synchronizeAaValues() {
const sync = new CashierSync(serverUrl.value)
try {
await sync.readCurrentValues()
Notification.positive('Asset Allocation values loaded')
Notifier.success('Asset Allocation values loaded')
} catch (error: any) {
console.error(error)
Notification.negative(error.message)
Notifier.negative(error.message)
}
}
Expand All @@ -181,15 +181,15 @@ async function synchronizeAccounts() {
const report = await sync.readAccounts()
if (!report || report.length == 0) {
Notification.negative('Invalid response received: ' + report)
Notifier.negative('Invalid response received: ' + report)
return
}
// delete all accounts only after we have retrieved the new ones.
await appService.deleteAccounts()
await appService.importBalanceSheet(report)
Notification.positive('accounts fetched from Ledger')
Notifier.success('accounts fetched from Ledger')
}
async function onSyncClicked() {
Expand Down Expand Up @@ -220,7 +220,7 @@ async function onSyncClicked() {
} catch (error: any) {
console.error(error)
Notification.negative(error.message)
Notifier.negative(error.message)
// reset all progress indicators
showAccountProgress.value = false
Expand All @@ -245,7 +245,7 @@ async function synchronizePayees() {
await appService.importPayees(response)
Notifier.positive('Payees fetched from Ledger')
Notifier.success('Payees fetched from Ledger')
}
async function shutdown() {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/WebDAV.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import { createClient } from 'webdav';
import Toolbar from '../components/CashierToolbar.vue'
import { ref } from 'vue';
import useNotifications from 'src/lib/CashierNotification'
import useNotifications from 'src/lib/Notifier'
const Notification = useNotifications()
Expand Down

0 comments on commit 981e3c9

Please sign in to comment.