-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ux: allow to create custom list views
- Loading branch information
Showing
8 changed files
with
178 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Doc } from 'fyo/model/doc'; | ||
|
||
export class SidebarEntry extends Doc { | ||
section?: string; | ||
route?: string; | ||
model?: string; | ||
filters?: string; | ||
|
||
fullRoute() { | ||
switch (this.route) { | ||
case '/list': | ||
return `/list/${this.model}/${this.name}`; | ||
Check failure on line 12 in models/baseModels/SidebarEntry/SidebarEntry.ts GitHub Actions / setup_and_lint
Check failure on line 12 in models/baseModels/SidebarEntry/SidebarEntry.ts GitHub Actions / setup_and_lint
Check failure on line 12 in models/baseModels/SidebarEntry/SidebarEntry.ts GitHub Actions / setup_and_lint
|
||
default: | ||
return this.route; | ||
} | ||
} | ||
|
||
parsedFilters() { | ||
return JSON.parse(this.filters); | ||
Check failure on line 19 in models/baseModels/SidebarEntry/SidebarEntry.ts GitHub Actions / setup_and_lint
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "SidebarEntry", | ||
"label": "Sidebar Entry", | ||
"naming": "manual", | ||
"fields": [ | ||
{ | ||
"fieldname": "name", | ||
"section": "Default", | ||
"label": "Name", | ||
"fieldtype": "Data", | ||
"required": true, | ||
"placeholder": "Entry Name" | ||
}, | ||
{ | ||
"fieldname": "section", | ||
"section": "Default", | ||
"label": "Section", | ||
"fieldtype": "Data", | ||
"required": false | ||
}, | ||
{ | ||
"fieldname": "route", | ||
"section": "Default", | ||
"label": "Route", | ||
"fieldtype": "Data", | ||
"required": true, | ||
"default": "/list" | ||
}, | ||
{ | ||
"fieldname": "model", | ||
"section": "Default", | ||
"label": "Document Type", | ||
"fieldtype": "Data", | ||
"required": true, | ||
"default": "JournalEntry" | ||
}, | ||
{ | ||
"fieldname": "filters", | ||
"section": "Default", | ||
"label": "Filters", | ||
"fieldtype": "Data", | ||
"required": true, | ||
"default": "{}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters