mirror of
https://github.com/frappe/books.git
synced 2026-09-24 07:15:17 -05:00
feat: _dynamic_ help
This commit is contained in:
@@ -149,6 +149,10 @@
|
||||
<p>↑↓ {{ t`Navigate` }}</p>
|
||||
<p>↩ {{ t`Select` }}</p>
|
||||
<p><span class="tracking-tighter">esc</span> {{ t`Close` }}</p>
|
||||
<button class="flex items-center hover:text-gray-800" @click="openDocs">
|
||||
<feather-icon name="help-circle" class="w-4 h-4 mr-1" />
|
||||
{{ t`Help` }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p v-if="searcher?.numSearches" class="ml-auto mr-2">
|
||||
@@ -181,6 +185,8 @@
|
||||
<script>
|
||||
import { fyo } from 'src/initFyo';
|
||||
import { getBgTextColorClass } from 'src/utils/colors';
|
||||
import { openLink } from 'src/utils/ipcCalls';
|
||||
import { docsPathMap } from 'src/utils/misc';
|
||||
import { getGroupLabelMap, searchGroups } from 'src/utils/search';
|
||||
import { useKeys } from 'src/utils/vueUtils';
|
||||
import { getIsNullOrUndef } from 'utils/';
|
||||
@@ -241,6 +247,9 @@ export default {
|
||||
this.openModal = false;
|
||||
},
|
||||
methods: {
|
||||
openDocs() {
|
||||
openLink('https://docs.frappebooks.com/' + docsPathMap.Search);
|
||||
},
|
||||
setFilter(keys) {
|
||||
if (!keys.has('MetaLeft') && !keys.has('ControlLeft')) {
|
||||
return;
|
||||
|
||||
+10
-10
@@ -89,10 +89,12 @@
|
||||
gap-1
|
||||
items-center
|
||||
"
|
||||
@click="$emit('change-db-file')"
|
||||
@click="openDocumentation"
|
||||
>
|
||||
<feather-icon name="database" class="h-4 w-4" />
|
||||
<p>{{ t`Change DB` }}</p>
|
||||
<feather-icon name="help-circle" class="h-4 w-4" />
|
||||
<p>
|
||||
{{ t`Help` }}
|
||||
</p>
|
||||
</button>
|
||||
|
||||
<button
|
||||
@@ -103,12 +105,10 @@
|
||||
gap-1
|
||||
items-center
|
||||
"
|
||||
@click="openDocumentation"
|
||||
@click="$emit('change-db-file')"
|
||||
>
|
||||
<feather-icon name="help-circle" class="h-4 w-4" />
|
||||
<p>
|
||||
{{ t`Documentation` }}
|
||||
</p>
|
||||
<feather-icon name="database" class="h-4 w-4" />
|
||||
<p>{{ t`Change DB` }}</p>
|
||||
</button>
|
||||
|
||||
<button
|
||||
@@ -142,7 +142,7 @@ import { reportIssue } from 'src/errorHandling';
|
||||
import { fyo } from 'src/initFyo';
|
||||
import { openLink } from 'src/utils/ipcCalls';
|
||||
import { getSidebarConfig } from 'src/utils/sidebarConfig';
|
||||
import { routeTo } from 'src/utils/ui';
|
||||
import { docsPath, routeTo } from 'src/utils/ui';
|
||||
import router from '../router';
|
||||
import Icon from './Icon.vue';
|
||||
|
||||
@@ -178,7 +178,7 @@ export default {
|
||||
routeTo,
|
||||
reportIssue,
|
||||
openDocumentation() {
|
||||
openLink('https://docs.frappebooks.com/');
|
||||
openLink('https://docs.frappebooks.com/' + docsPath.value);
|
||||
},
|
||||
setActiveGroup() {
|
||||
const { fullPath } = this.$router.currentRoute.value;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
<script>
|
||||
import PageHeader from 'src/components/PageHeader';
|
||||
import { docsPath } from 'src/utils/ui';
|
||||
import Cashflow from './Cashflow';
|
||||
import Expenses from './Expenses';
|
||||
import ProfitAndLoss from './ProfitAndLoss';
|
||||
@@ -37,5 +38,11 @@ export default {
|
||||
ProfitAndLoss,
|
||||
Expenses,
|
||||
},
|
||||
activated() {
|
||||
docsPath.value = 'analytics/dashboard';
|
||||
},
|
||||
deactivated() {
|
||||
docsPath.value = '';
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -355,7 +355,8 @@ import PageHeader from 'src/components/PageHeader.vue';
|
||||
import { importable, Importer } from 'src/dataImport';
|
||||
import { fyo } from 'src/initFyo';
|
||||
import { getSavePath, saveData } from 'src/utils/ipcCalls';
|
||||
import { showMessageDialog } from 'src/utils/ui';
|
||||
import { docsPathMap } from 'src/utils/misc';
|
||||
import { docsPath, showMessageDialog } from 'src/utils/ui';
|
||||
import { IPC_ACTIONS } from 'utils/messages';
|
||||
import Loading from '../components/Loading.vue';
|
||||
|
||||
@@ -484,7 +485,11 @@ export default {
|
||||
return !!(this.file || this.importType);
|
||||
},
|
||||
},
|
||||
activated() {
|
||||
docsPath.value = docsPathMap.DataImport;
|
||||
},
|
||||
deactivated() {
|
||||
docsPath.value = '';
|
||||
if (!this.complete) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -188,11 +188,13 @@ import DropdownWithActions from 'src/components/DropdownWithActions.vue';
|
||||
import FormContainer from 'src/components/FormContainer.vue';
|
||||
import StatusBadge from 'src/components/StatusBadge.vue';
|
||||
import { fyo } from 'src/initFyo';
|
||||
import { docsPathMap } from 'src/utils/misc';
|
||||
import {
|
||||
getActionsForDocument,
|
||||
openSettings,
|
||||
routeTo,
|
||||
showMessageDialog,
|
||||
docsPath,
|
||||
getActionsForDocument,
|
||||
openSettings,
|
||||
routeTo,
|
||||
showMessageDialog
|
||||
} from 'src/utils/ui';
|
||||
import { handleErrorWithDialog } from '../errorHandling';
|
||||
|
||||
@@ -235,6 +237,12 @@ export default {
|
||||
return getDocStatus(this.doc);
|
||||
},
|
||||
},
|
||||
activated() {
|
||||
docsPath.value = docsPathMap[this.schemaName];
|
||||
},
|
||||
deactivated() {
|
||||
docsPath.value = '';
|
||||
},
|
||||
async mounted() {
|
||||
try {
|
||||
this.doc = await fyo.doc.getDoc(this.schemaName, this.name);
|
||||
|
||||
@@ -149,7 +149,9 @@ import DropdownWithActions from 'src/components/DropdownWithActions.vue';
|
||||
import FormContainer from 'src/components/FormContainer.vue';
|
||||
import StatusBadge from 'src/components/StatusBadge.vue';
|
||||
import { fyo } from 'src/initFyo';
|
||||
import { docsPathMap } from 'src/utils/misc';
|
||||
import {
|
||||
docsPath,
|
||||
getActionsForDocument,
|
||||
routeTo,
|
||||
showMessageDialog
|
||||
@@ -180,6 +182,12 @@ export default {
|
||||
doc: null,
|
||||
};
|
||||
},
|
||||
activated() {
|
||||
docsPath.value = docsPathMap.JournalEntry
|
||||
},
|
||||
deactivated() {
|
||||
docsPath.value = '';
|
||||
},
|
||||
async mounted() {
|
||||
try {
|
||||
this.doc = await fyo.doc.getDoc(this.schemaName, this.name);
|
||||
|
||||
@@ -31,7 +31,8 @@ import Button from 'src/components/Button.vue';
|
||||
import FilterDropdown from 'src/components/FilterDropdown.vue';
|
||||
import PageHeader from 'src/components/PageHeader.vue';
|
||||
import { fyo } from 'src/initFyo';
|
||||
import { routeTo } from 'src/utils/ui';
|
||||
import { docsPathMap } from 'src/utils/misc';
|
||||
import { docsPath, routeTo } from 'src/utils/ui';
|
||||
import List from './List';
|
||||
|
||||
export default {
|
||||
@@ -56,6 +57,10 @@ export default {
|
||||
}
|
||||
|
||||
this.listConfig = getListConfig(this.schemaName);
|
||||
docsPath.value = docsPathMap[this.schemaName] ?? docsPathMap.Entries;
|
||||
},
|
||||
deactivated() {
|
||||
docsPath.value = '';
|
||||
},
|
||||
methods: {
|
||||
async makeNewDoc() {
|
||||
|
||||
@@ -43,6 +43,8 @@ import DropdownWithActions from 'src/components/DropdownWithActions.vue';
|
||||
import PageHeader from 'src/components/PageHeader.vue';
|
||||
import ListReport from 'src/components/Report/ListReport.vue';
|
||||
import { fyo } from 'src/initFyo';
|
||||
import { docsPathMap } from 'src/utils/misc';
|
||||
import { docsPath } from 'src/utils/ui';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -66,6 +68,7 @@ export default defineComponent({
|
||||
},
|
||||
components: { PageHeader, FormControl, ListReport, DropdownWithActions },
|
||||
async activated() {
|
||||
docsPath.value = docsPathMap[this.reportClassName] ?? docsPathMap.Reports;
|
||||
await this.setReportData();
|
||||
|
||||
const filters = JSON.parse(this.defaultFilters);
|
||||
@@ -82,6 +85,9 @@ export default defineComponent({
|
||||
window.rep = this;
|
||||
}
|
||||
},
|
||||
deactivated() {
|
||||
docsPath.value = '';
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return reports[this.reportClassName]?.title ?? t`Report`;
|
||||
|
||||
@@ -37,7 +37,8 @@ import Icon from 'src/components/Icon.vue';
|
||||
import PageHeader from 'src/components/PageHeader.vue';
|
||||
import Row from 'src/components/Row.vue';
|
||||
import StatusBadge from 'src/components/StatusBadge.vue';
|
||||
import { showToast } from 'src/utils/ui';
|
||||
import { docsPathMap } from 'src/utils/misc';
|
||||
import { docsPath, showToast } from 'src/utils/ui';
|
||||
import { IPC_MESSAGES } from 'utils/messages';
|
||||
import { h, markRaw } from 'vue';
|
||||
import TabGeneral from './TabGeneral.vue';
|
||||
@@ -82,8 +83,10 @@ export default {
|
||||
},
|
||||
activated() {
|
||||
this.setActiveTab();
|
||||
docsPath.value = docsPathMap.Settings;
|
||||
},
|
||||
deactivated() {
|
||||
docsPath.value = '';
|
||||
if (this.fieldsChanged.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ export function getGetStartedConfig() {
|
||||
},
|
||||
fieldname: 'chartOfAccountsReviewed',
|
||||
documentation:
|
||||
'https://frappebooks.com/docs/setting-up#1-enter-bank-accounts',
|
||||
'https://docs.frappebooks.com/setting-up/initial-entries.html#add-additional-bank-accounts',
|
||||
},
|
||||
{
|
||||
key: 'Opening Balances',
|
||||
@@ -62,7 +62,7 @@ export function getGetStartedConfig() {
|
||||
fieldname: 'openingBalanceChecked',
|
||||
description: t`Setup your opening balances before performing any accounting entries`,
|
||||
documentation:
|
||||
'https://frappebooks.com/docs/setting-up#5-setup-opening-balances',
|
||||
'https://docs.frappebooks.com/setting-up/opening-balances.html',
|
||||
},
|
||||
{
|
||||
key: 'Add Taxes',
|
||||
@@ -71,7 +71,8 @@ export function getGetStartedConfig() {
|
||||
fieldname: 'taxesAdded',
|
||||
description: t`Setup your tax templates for your sales or purchase transactions`,
|
||||
action: () => routeTo('/list/Tax'),
|
||||
documentation: 'https://frappebooks.com/docs/setting-up#2-add-taxes',
|
||||
documentation:
|
||||
'https://docs.frappebooks.com/setting-up/initial-entries.html#add-taxes',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -86,7 +87,8 @@ export function getGetStartedConfig() {
|
||||
description: t`Add products or services that you sell to your customers`,
|
||||
action: () => routeTo(`/list/Item/for/Sales/${t`Sales Items`}`),
|
||||
fieldname: 'salesItemCreated',
|
||||
documentation: 'https://frappebooks.com/docs/setting-up#3-add-items',
|
||||
documentation:
|
||||
'https://docs.frappebooks.com/setting-up/initial-entries.html#add-sales-items',
|
||||
},
|
||||
{
|
||||
key: 'Add Customers',
|
||||
@@ -96,16 +98,17 @@ export function getGetStartedConfig() {
|
||||
action: () => routeTo(`/list/Party/role/Customer/${t`Customers`}`),
|
||||
fieldname: 'customerCreated',
|
||||
documentation:
|
||||
'https://frappebooks.com/docs/setting-up#4-add-customers',
|
||||
'https://docs.frappebooks.com/setting-up/initial-entries.html#add-customers',
|
||||
},
|
||||
{
|
||||
key: 'Create Invoice',
|
||||
label: t`Create Invoice`,
|
||||
key: 'Create Sales Invoice',
|
||||
label: t`Create Sales Invoice`,
|
||||
icon: 'sales-invoice',
|
||||
description: t`Create your first invoice and mail it to your customer`,
|
||||
action: () => routeTo('/list/SalesInvoice'),
|
||||
fieldname: 'invoiceCreated',
|
||||
documentation: 'https://frappebooks.com/docs/invoices',
|
||||
documentation:
|
||||
'https://docs.frappebooks.com/transactions/sales-invoices.html',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -131,13 +134,14 @@ export function getGetStartedConfig() {
|
||||
fieldname: 'supplierCreated',
|
||||
},
|
||||
{
|
||||
key: 'Create Bill',
|
||||
label: t`Create Bill`,
|
||||
key: 'Create Purchase Invoice',
|
||||
label: t`Create Purchase Invoice`,
|
||||
icon: 'purchase-invoice',
|
||||
description: t`Create your first bill and mail it to your supplier`,
|
||||
action: () => routeTo('/list/PurchaseInvoice'),
|
||||
fieldname: 'billCreated',
|
||||
documentation: 'https://frappebooks.com/docs/bills',
|
||||
documentation:
|
||||
'https://docs.frappebooks.com/transactions/purchase-invoices.html',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -79,3 +79,31 @@ export async function incrementOpenCount(dbPath: string) {
|
||||
fyo.config.set(ConfigKeys.Files, files);
|
||||
return openCount;
|
||||
}
|
||||
|
||||
export const docsPathMap: Record<string, string | undefined> = {
|
||||
// Analytics
|
||||
Dashboard: 'analytics/dashboard',
|
||||
Reports: 'analytics/reports',
|
||||
GeneralLedger: 'analytics/general-ledger',
|
||||
ProfitAndLoss: 'analytics/profit-and-loss',
|
||||
BalanceSheet: 'analytics/balance-sheet',
|
||||
TrialBalance: 'analytics/trial-balance',
|
||||
|
||||
// Transactions
|
||||
[ModelNameEnum.SalesInvoice]: 'transactions/sales-invoices',
|
||||
[ModelNameEnum.PurchaseInvoice]: 'transactions/purchase-invoices',
|
||||
[ModelNameEnum.Payment]: 'transactions/payments',
|
||||
[ModelNameEnum.JournalEntry]: 'transactions/journal-entries',
|
||||
|
||||
// Entries
|
||||
Entries: 'entries/entries',
|
||||
[ModelNameEnum.Party]: 'entries/party',
|
||||
[ModelNameEnum.Item]: 'entries/items',
|
||||
[ModelNameEnum.Tax]: 'entries/taxes',
|
||||
|
||||
// Miscellaneous
|
||||
Search: 'miscellaneous/search',
|
||||
NumberSeries: 'miscellaneous/number-series',
|
||||
DataImport: 'miscellaneous/data-import',
|
||||
Settings: 'miscellaneous/settings',
|
||||
};
|
||||
|
||||
+3
-1
@@ -13,7 +13,7 @@ import { handleErrorWithDialog } from 'src/errorHandling';
|
||||
import { fyo } from 'src/initFyo';
|
||||
import router from 'src/router';
|
||||
import { IPC_ACTIONS } from 'utils/messages';
|
||||
import { App, createApp, h } from 'vue';
|
||||
import { App, createApp, h, ref } from 'vue';
|
||||
import { RouteLocationRaw } from 'vue-router';
|
||||
import { stringifyCircular } from './';
|
||||
import {
|
||||
@@ -23,6 +23,8 @@ import {
|
||||
ToastOptions,
|
||||
} from './types';
|
||||
|
||||
export const docsPath = ref('');
|
||||
|
||||
export async function openQuickEdit({
|
||||
schemaName,
|
||||
name,
|
||||
|
||||
Reference in New Issue
Block a user