Skip to content

Commit

Permalink
fix: only show erpnext setting fields if enabled is set
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Sep 13, 2024
1 parent 078bea2 commit 020c285
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
],
"fields": [
{
"depends_on": "eval:!doc.is_erpnext_in_the_current_site",
"depends_on": "eval:doc.enabled && !doc.is_erpnext_in_the_current_site",
"fieldname": "api_key",
"fieldtype": "Data",
"label": "API Key",
"mandatory_depends_on": "eval:!doc.is_erpnext_in_the_current_site"
},
{
"depends_on": "eval:!doc.is_erpnext_in_the_current_site",
"depends_on": "eval:doc.enabled && !doc.is_erpnext_in_the_current_site",
"fieldname": "api_secret",
"fieldtype": "Data",
"label": "API Secret",
Expand All @@ -40,7 +40,7 @@
"fieldtype": "Column Break"
},
{
"depends_on": "eval:!doc.is_erpnext_in_the_current_site",
"depends_on": "eval:doc.enabled && !doc.is_erpnext_in_the_current_site",
"fieldname": "erpnext_site_url",
"fieldtype": "Data",
"label": "ERPNext Site URL",
Expand Down Expand Up @@ -74,7 +74,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2024-09-12 18:14:44.323068",
"modified": "2024-09-13 15:06:23.317262",
"modified_by": "Administrator",
"module": "FCRM",
"name": "ERPNext CRM Settings",
Expand Down
11 changes: 10 additions & 1 deletion frontend/src/components/Fields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div
v-for="section in sections"
:key="section.label"
class="first:border-t-0 first:pt-0"
class="section first:border-t-0 first:pt-0"
:class="section.hideBorder ? '' : 'border-t pt-4'"
>
<div
Expand All @@ -22,6 +22,7 @@
>
<div v-for="field in section.fields" :key="field.name">
<div
class="settings-field"
v-if="
(field.type == 'Check' ||
(field.read_only && data[field.name]) ||
Expand Down Expand Up @@ -218,4 +219,12 @@ const props = defineProps({
:deep(.form-control.prefix select) {
padding-left: 2rem;
}
.section {
display: none;
}
.section:has(.settings-field) {
display: block;
}
</style>

0 comments on commit 020c285

Please sign in to comment.