-
Notifications
You must be signed in to change notification settings - Fork 4
kanban_plugin #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
kanban_plugin #720
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule core
updated
from 692e24 to e3784f
This file contains hidden or 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
131 changes: 131 additions & 0 deletions
131
AppBuilder/platform/plugins/included/view_kanban/FNABViewKanban.js
This file contains hidden or 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,131 @@ | ||
| import FNABViewKanbanComponent from "./FNABViewKanbanComponent.js"; | ||
| import FNABViewKanbanDetachedFormSave from "./FNABViewKanbanForm.js"; | ||
| import FNABViewKanbanFormSidePanel from "./FNABViewKanbanFormSidePanel.js"; | ||
|
|
||
| // FNABViewKanban Web | ||
| // A web side import for an ABView. | ||
| // | ||
| export default function FNABViewKanban({ | ||
| AB, | ||
| ABViewWidgetPlugin, | ||
| ABViewComponentPlugin, | ||
| ABViewPropertyLinkPage, | ||
| ABViewPlugin, | ||
| }) { | ||
| const ABViewKanbanDetachedFormSave = FNABViewKanbanDetachedFormSave({ | ||
| AB, | ||
| ABViewPlugin, | ||
| ABViewComponentPlugin, | ||
| }); | ||
| const KanbanFormSidePanel = FNABViewKanbanFormSidePanel({ | ||
| ABViewComponentPlugin, | ||
| ABViewKanbanDetachedFormSave, | ||
| }); | ||
| const ABViewKanbanComponent = FNABViewKanbanComponent({ | ||
| AB, | ||
| ABViewComponentPlugin, | ||
| FNABViewKanbanFormSidePanel: KanbanFormSidePanel, | ||
| }); | ||
|
|
||
| const ABViewKanbanPropertyComponentDefaults = { | ||
| dataviewID: null, // uuid ABDataCollection; DC resolves ABObject | ||
| editFields: [], // ABField.id[] fields shown in editor | ||
| verticalGroupingField: "", // ABField.id vertical lanes | ||
| horizontalGroupingField: "", // ABField.id optional horizontal grouping | ||
| ownerField: "", // ABFieldUser.id card owner | ||
| template: "", // json ABViewText card body; placeholders {field.id} | ||
| }; | ||
|
|
||
| const ABViewDefaults = { | ||
| key: "kanban", // {string} unique view key | ||
| icon: "columns", // {string} font-awesome (no fa- prefix) | ||
| labelKey: "Kanban", // {string} multilingual label key → L(labelKey) | ||
| }; | ||
|
|
||
| class ABViewKanbanCore extends ABViewWidgetPlugin { | ||
| constructor(values, application, parent, defaultValues) { | ||
| super(values, application, parent, defaultValues || ABViewDefaults); | ||
| } | ||
|
|
||
| /// | ||
| /// Instance Methods | ||
| /// | ||
|
|
||
| /** | ||
| * @method componentList | ||
| * return the list of components available on this view to display in the editor. | ||
| */ | ||
| componentList() { | ||
| return []; | ||
| } | ||
|
|
||
| fromValues(values) { | ||
| super.fromValues(values); | ||
|
|
||
| // set a default .template value | ||
| if (!this.settings.template) { | ||
| this.settings.template = { id: `${this.id}_template`, key: "text" }; | ||
| this.settings.template.text = this.settings.textTemplate; | ||
| } | ||
|
|
||
| this.TextTemplate = AB.viewNewDetatched(this.settings.template); | ||
| } | ||
|
|
||
| toObj() { | ||
| var obj = super.toObj(); | ||
| obj.settings.template = this.TextTemplate.toObj(); | ||
| // NOTE: this corrects the initial save where this.id == undefined | ||
| // all the rest will set the .id correctly. | ||
| obj.settings.template.id = `${this.id}_template`; | ||
| return obj; | ||
| } | ||
|
|
||
| static common() { | ||
| return ABViewDefaults; | ||
| } | ||
|
|
||
| static defaultValues() { | ||
| return ABViewKanbanPropertyComponentDefaults; | ||
| } | ||
| } | ||
|
|
||
| return class ABViewKanban extends ABViewKanbanCore { | ||
| /** | ||
| * @method getPluginKey | ||
| * return the plugin key for this view. | ||
| * @return {string} plugin key | ||
| */ | ||
| static getPluginKey() { | ||
| return this.common().key; | ||
| } | ||
| get linkPageHelper() { | ||
| if (this.__linkPageHelper == null) | ||
| this.__linkPageHelper = new ABViewPropertyLinkPage(); | ||
|
|
||
| return this.__linkPageHelper; | ||
| } | ||
|
|
||
| /** | ||
| * @method component() | ||
| * return a UI component based upon this view. | ||
| * @return {obj} UI component | ||
| */ | ||
| component(parentId) { | ||
| return new ABViewKanbanComponent(this, parentId); | ||
| } | ||
|
|
||
| // | ||
| // Editor Related | ||
| // | ||
|
|
||
| warningsEval() { | ||
| super.warningsEval(); | ||
| let DC = this.datacollection; | ||
| if (!DC) { | ||
| this.warningsMessage( | ||
| `can't resolve it's datacollection[${this.settings.dataviewID}]` | ||
| ); | ||
| } | ||
| } | ||
| }; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.