Skip to content

Commit a770aaa

Browse files
committed
feat: Allow disabling article search on customer portal
1 parent 4ebd2ab commit a770aaa

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

desk/src/pages/ticket/TicketNew.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
/>
5252
</div>
5353
<SearchArticles
54-
v-if="isCustomerPortal"
54+
v-if="isCustomerPortal && !hideSuggestedArticles"
5555
:query="subject"
5656
class="shadow"
5757
/>
@@ -139,6 +139,7 @@ import { computed, onMounted, reactive, ref } from "vue";
139139
import { useRoute, useRouter } from "vue-router";
140140
import SearchArticles from "../../components/SearchArticles.vue";
141141
import TicketTextEditor from "./TicketTextEditor.vue";
142+
import { useConfigStore } from "@/stores/config";
142143
143144
interface P {
144145
templateId?: string;
@@ -153,6 +154,7 @@ const router = useRouter();
153154
const { $dialog } = globalStore();
154155
const { updateOnboardingStep } = useOnboarding("helpdesk");
155156
const { isManager, userId: userID } = useAuthStore();
157+
const { hideSuggestedArticles } = useConfigStore();
156158
157159
const subject = ref("");
158160
const description = ref("");

desk/src/stores/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export const useConfigStore = defineStore("config", () => {
2323
const isFeedbackMandatory = computed(
2424
() => !!parseInt(config.value.is_feedback_mandatory)
2525
);
26+
const hideSuggestedArticles = computed(
27+
() => !!parseInt(config.value.hide_suggested_articles)
28+
);
2629

2730
socket.on("helpdesk:settings-updated", () => configRes.reload());
2831

@@ -33,5 +36,6 @@ export const useConfigStore = defineStore("config", () => {
3336
skipEmailWorkflow,
3437
isFeedbackMandatory,
3538
teamRestrictionApplied,
39+
hideSuggestedArticles,
3640
};
3741
});

helpdesk/api/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def get_config():
1010
"skip_email_workflow",
1111
"is_feedback_mandatory",
1212
"restrict_tickets_by_agent_group",
13+
"hide_suggested_articles",
1314
]
1415
res = frappe.get_value(doctype="HD Settings", fieldname=fields, as_dict=True)
1516
return res

helpdesk/helpdesk/doctype/hd_settings/hd_settings.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"base_support_rotation",
1717
"knowledge_base_section",
1818
"prefer_knowledge_base",
19+
"hide_suggested_articles",
1920
"ticket_tab",
2021
"ticket_type_section",
2122
"default_ticket_type",
@@ -281,12 +282,18 @@
281282
"fieldtype": "Int",
282283
"label": "Auto-close after (Days)",
283284
"mandatory_depends_on": "auto_close_tickets"
285+
},
286+
{
287+
"default": "0",
288+
"fieldname": "hide_suggested_articles",
289+
"fieldtype": "Check",
290+
"label": "Hide suggested articles on ticket form"
284291
}
285292
],
286293
"grid_page_length": 50,
287294
"issingle": 1,
288295
"links": [],
289-
"modified": "2025-04-23 20:17:23.058689",
296+
"modified": "2025-05-05 13:28:08.085962",
290297
"modified_by": "Administrator",
291298
"module": "Helpdesk",
292299
"name": "HD Settings",

0 commit comments

Comments
 (0)