mirror of
https://github.com/hanzoai/helpdesk.git
synced 2026-10-12 16:56:02 +00:00
fix: better list view
This commit is contained in:
@@ -816,7 +816,10 @@ function handleScrollPosition() {
|
||||
}, 200);
|
||||
}
|
||||
|
||||
function handleColumnResize() {
|
||||
function handleColumnResize({ key, width, save } = {}) {
|
||||
const column = columns.value.find((c) => c.key === key);
|
||||
if (column) column.width = width;
|
||||
if (!save) return;
|
||||
isViewUpdated.value = true;
|
||||
defaultParams.columns = columns.value;
|
||||
if (!defaultParams.is_default) return;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { isCustomerPortal } from "@/utils";
|
||||
import { createResource } from "frappe-ui";
|
||||
import { computed, h } from "vue";
|
||||
|
||||
@@ -13,6 +14,7 @@ interface App {
|
||||
* Dropdown submenu options (each with the app's logo as the row prefix).
|
||||
*/
|
||||
export function useApps() {
|
||||
if (isCustomerPortal.value) return { apps: null, appsSubmenu: null };
|
||||
const apps = createResource({
|
||||
url: "frappe.apps.get_apps",
|
||||
cache: "apps",
|
||||
|
||||
@@ -54,7 +54,7 @@ const options = computed(() => {
|
||||
},
|
||||
},
|
||||
mobile_no: {
|
||||
prefix: PhoneIcon,
|
||||
prefix: ({ row }) => (row.mobile_no ? h(PhoneIcon) : null),
|
||||
},
|
||||
},
|
||||
emptyState: {
|
||||
|
||||
@@ -60,7 +60,7 @@ const options = computed(() => {
|
||||
},
|
||||
},
|
||||
mobile_no: {
|
||||
prefix: PhoneIcon,
|
||||
prefix: ({ row }) => (row.mobile_no ? h(PhoneIcon) : null),
|
||||
},
|
||||
},
|
||||
emptyState: {
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"allowUnreachableCode": false,
|
||||
"target": "es2022",
|
||||
"module": "esnext",
|
||||
"moduleResolution":"node",
|
||||
"jsx": "preserve",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
|
||||
@@ -88,7 +88,7 @@ def move_to_category(category: str, articles: list[str]):
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_categories():
|
||||
categories = frappe.get_all(
|
||||
categories = frappe.get_list(
|
||||
"HD Article Category",
|
||||
fields=["name", "category_name", "modified"],
|
||||
)
|
||||
@@ -104,7 +104,7 @@ def get_categories():
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_category_articles(category: str):
|
||||
articles = frappe.get_all(
|
||||
articles = frappe.get_list(
|
||||
"HD Article",
|
||||
filters={"category": category, "status": "Published"},
|
||||
fields=["name", "title", "published_on", "modified", "author", "content"],
|
||||
|
||||
@@ -1,138 +1,148 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "hash",
|
||||
"creation": "2022-02-08 18:13:42.994713",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"title",
|
||||
"status",
|
||||
"published_on",
|
||||
"views",
|
||||
"column_break_7",
|
||||
"category",
|
||||
"author",
|
||||
"title_slug",
|
||||
"content_section",
|
||||
"content"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"allow_in_quick_entry": 1,
|
||||
"fieldname": "title",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Title",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "category",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Category",
|
||||
"options": "HD Article Category"
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 1,
|
||||
"fieldname": "content_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Content"
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 1,
|
||||
"fieldname": "content",
|
||||
"fieldtype": "Text Editor",
|
||||
"label": "Content"
|
||||
},
|
||||
{
|
||||
"depends_on": "author",
|
||||
"fieldname": "author",
|
||||
"fieldtype": "Link",
|
||||
"label": "Author",
|
||||
"options": "User",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.status === \"Published\"",
|
||||
"fieldname": "published_on",
|
||||
"fieldtype": "Datetime",
|
||||
"label": "Published On",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_7",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"default": "Draft",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"in_standard_filter": 1,
|
||||
"label": "Status",
|
||||
"options": "Published\nDraft\nArchived"
|
||||
},
|
||||
{
|
||||
"fieldname": "title_slug",
|
||||
"fieldtype": "Data",
|
||||
"is_virtual": 1,
|
||||
"label": "Title Slug"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "views",
|
||||
"fieldtype": "Int",
|
||||
"label": "Views",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"make_attachments_public": 1,
|
||||
"modified": "2026-03-24 20:11:47.835393",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Helpdesk",
|
||||
"name": "HD Article",
|
||||
"naming_rule": "Random",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Agent",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HD Customer",
|
||||
"share": 1
|
||||
}
|
||||
],
|
||||
"row_format": "Dynamic",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
"actions": [],
|
||||
"allow_bulk_edit": 1,
|
||||
"autoname": "hash",
|
||||
"creation": "2022-02-08 18:13:42.994713",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"title",
|
||||
"status",
|
||||
"published_on",
|
||||
"views",
|
||||
"column_break_7",
|
||||
"category",
|
||||
"author",
|
||||
"title_slug",
|
||||
"content_section",
|
||||
"content"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"allow_in_quick_entry": 1,
|
||||
"fieldname": "title",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Title",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "category",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Category",
|
||||
"options": "HD Article Category"
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 1,
|
||||
"fieldname": "content_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Content"
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 1,
|
||||
"fieldname": "content",
|
||||
"fieldtype": "Text Editor",
|
||||
"label": "Content"
|
||||
},
|
||||
{
|
||||
"depends_on": "author",
|
||||
"fieldname": "author",
|
||||
"fieldtype": "Link",
|
||||
"label": "Author",
|
||||
"options": "User",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.status === \"Published\"",
|
||||
"fieldname": "published_on",
|
||||
"fieldtype": "Datetime",
|
||||
"label": "Published On",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_7",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"default": "Draft",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"in_standard_filter": 1,
|
||||
"label": "Status",
|
||||
"options": "Published\nDraft\nArchived"
|
||||
},
|
||||
{
|
||||
"fieldname": "title_slug",
|
||||
"fieldtype": "Data",
|
||||
"is_virtual": 1,
|
||||
"label": "Title Slug"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "views",
|
||||
"fieldtype": "Int",
|
||||
"label": "Views",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"make_attachments_public": 1,
|
||||
"modified": "2026-06-28 13:55:21.075010",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Helpdesk",
|
||||
"name": "HD Article",
|
||||
"naming_rule": "Random",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Agent",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HD Customer",
|
||||
"share": 1
|
||||
},
|
||||
{
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HD Customer Manager",
|
||||
"share": 1
|
||||
}
|
||||
],
|
||||
"row_format": "Dynamic",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_bulk_edit": 1,
|
||||
"allow_guest_to_view": 1,
|
||||
"autoname": "hash",
|
||||
"creation": "2022-02-08 18:13:42.039744",
|
||||
@@ -37,7 +38,7 @@
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2026-03-24 10:38:20.749980",
|
||||
"modified": "2026-06-28 13:55:47.056437",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Helpdesk",
|
||||
"name": "HD Article Category",
|
||||
@@ -72,6 +73,10 @@
|
||||
{
|
||||
"read": 1,
|
||||
"role": "HD Customer"
|
||||
},
|
||||
{
|
||||
"read": 1,
|
||||
"role": "HD Customer Manager"
|
||||
}
|
||||
],
|
||||
"row_format": "Dynamic",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_bulk_edit": 1,
|
||||
"allow_import": 1,
|
||||
"autoname": ".####",
|
||||
"creation": "2023-10-17 14:27:11.078679",
|
||||
@@ -487,7 +488,7 @@
|
||||
"icon": "fa fa-issue",
|
||||
"idx": 61,
|
||||
"links": [],
|
||||
"modified": "2026-05-11 18:25:54.352721",
|
||||
"modified": "2026-06-28 13:51:31.692161",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Helpdesk",
|
||||
"name": "HD Ticket",
|
||||
@@ -518,17 +519,6 @@
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "All",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
@@ -540,6 +530,28 @@
|
||||
"role": "Agent Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HD Customer",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HD Customer Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
|
||||
Reference in New Issue
Block a user