2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 19:09:01 +00:00

fix(ux): documentation path

- remove unnecessary injects
This commit is contained in:
18alantom 2023-03-01 14:05:59 +05:30
parent e1920bd55e
commit 440419b367
4 changed files with 19 additions and 2 deletions

View File

@ -112,6 +112,8 @@ import FormHeader from 'src/components/FormHeader.vue';
import StatusBadge from 'src/components/StatusBadge.vue';
import { handleErrorWithDialog } from 'src/errorHandling';
import { getErrorMessage } from 'src/utils';
import { docsPathMap } from 'src/utils/misc';
import { docsPathRef, focusedDocsRef } from 'src/utils/refs';
import { ActionGroup, UIGroupedFields } from 'src/utils/types';
import {
getFieldsGroupedByTabAndSection,
@ -155,8 +157,17 @@ export default defineComponent({
}
await this.setDoc();
focusedDocsRef.add(this.docOrNull);
this.updateGroupedFields();
},
activated(): void {
docsPathRef.value = docsPathMap[this.schemaName] ?? '';
focusedDocsRef.add(this.docOrNull);
},
deactivated(): void {
docsPathRef.value = '';
focusedDocsRef.add(this.docOrNull);
},
computed: {
hasDoc(): boolean {
return !!this.docOrNull;

View File

@ -338,7 +338,6 @@ export default {
LinkedEntryWidget,
Barcode,
},
inject: ['shortcuts'],
provide() {
return {
schemaName: this.schemaName,

View File

@ -132,7 +132,6 @@ export default {
DropdownWithActions,
},
emits: ['close'],
inject: ['shortcuts'],
provide() {
return {
schemaName: this.schemaName,

View File

@ -80,6 +80,8 @@ import { handleErrorWithDialog } from 'src/errorHandling';
import { getErrorMessage } from 'src/utils';
import { evaluateHidden } from 'src/utils/doc';
import { reloadWindow } from 'src/utils/ipcCalls';
import { docsPathMap } from 'src/utils/misc';
import { docsPathRef } from 'src/utils/refs';
import { UIGroupedFields } from 'src/utils/types';
import { showToast } from 'src/utils/ui';
import { computed, defineComponent, nextTick } from 'vue';
@ -113,6 +115,12 @@ export default defineComponent({
this.update();
},
activated(): void {
docsPathRef.value = docsPathMap.Settings ?? '';
},
deactivated(): void {
docsPathRef.value = '';
},
methods: {
async sync(): Promise<void> {
const syncableDocs = this.schemas