2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 23:00:56 +00:00

incr: add feature flag for custom fields

- also add page and sidebar item
This commit is contained in:
18alantom 2023-07-28 11:40:07 +05:30
parent 544b8a14b1
commit 202612b57a
5 changed files with 42 additions and 0 deletions

View File

@ -15,6 +15,7 @@ export class AccountingSettings extends Doc {
enableDiscounting?: boolean;
enableInventory?: boolean;
enablePriceList?: boolean;
enableFormCustomization?: boolean;
static filters: FiltersMap = {
writeOffAccount: () => ({

View File

@ -86,6 +86,13 @@
"default": false,
"section": "Features"
},
{
"fieldname": "enableFormCustomization",
"label": "Enable Form Customization",
"fieldtype": "Check",
"default": false,
"section": "Features"
},
{
"fieldname": "fiscalYearStart",
"label": "Fiscal Year Start Date",

View File

@ -0,0 +1,21 @@
<template>
<div>
<PageHeader :title="t`Customize Form`">
<DropdownWithActions :actions="[]" :disabled="false" :title="t`More`" />
<Button :title="t`Save Customizations`" type="primary">
{{ t`Save` }}
</Button>
</PageHeader>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import DropdownWithActions from 'src/components/DropdownWithActions.vue';
import Button from 'src/components/Button.vue';
import PageHeader from 'src/components/PageHeader.vue';
export default defineComponent({
components: { PageHeader, Button, DropdownWithActions },
});
</script>

View File

@ -10,6 +10,7 @@ import QuickEditForm from 'src/pages/QuickEditForm.vue';
import Report from 'src/pages/Report.vue';
import Settings from 'src/pages/Settings/Settings.vue';
import TemplateBuilder from 'src/pages/TemplateBuilder/TemplateBuilder.vue';
import CustomizeForm from 'src/pages/CustomizeForm/CustomizeForm.vue';
import type { HistoryState } from 'vue-router';
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import { historyState } from './utils/refs';
@ -106,6 +107,11 @@ const routes: RouteRecordRaw[] = [
component: TemplateBuilder,
props: true,
},
{
path: '/customize-form',
name: 'Customize Form',
component: CustomizeForm,
},
{
path: '/settings',
name: 'Settings',

View File

@ -284,6 +284,13 @@ function getCompleteSidebar(): SidebarConfig {
name: 'print-template',
route: `/list/PrintTemplate/${t`Print Templates`}`,
},
{
label: t`Customize Form`,
name: 'customize-form',
route: `/customize-form`,
hidden: () =>
!fyo.singles.AccountingSettings?.enableFormCustomization,
},
{
label: t`Settings`,
name: 'settings',