Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AppBuilder/core
Submodule core updated from 692e24 to e3784f
8 changes: 5 additions & 3 deletions AppBuilder/platform/plugins/included/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import viewDataview from "./view_dataview/FNAbviewdataview.js";
import viewCarousel from "./view_carousel/FNAbviewcarousel.js";
import viewComment from "./view_comment/FNAbviewcomment.js";
import viewCsvExporter from "./view_csvExporter/FNAbviewcsvexporter.js";
import viewCsvImporter from "./view_csvImporter/FNAbviewcsvimporter.js";
import viewDataSelect from "./view_data-select/FNAbviewdataselect.js";
import viewDataview from "./view_dataview/FNAbviewdataview.js";
import viewDetail from "./view_detail/FNAbviewdetail.js";
import viewImage from "./view_image/FNAbviewimage.js";
import viewKanban from "./view_kanban/FNABViewKanban.js";
import viewLabel from "./view_label/FNAbviewlabel.js";
import viewLayout from "./view_layout/FNAbviewlayout.js";
import viewList from "./view_list/FNAbviewlist.js";
Expand All @@ -18,17 +19,18 @@ const AllPlugins = [
viewComment,
viewCsvExporter,
viewCsvImporter,
viewCsvImporter,
viewDataSelect,
viewDataview,
viewDetail,
viewImage,
viewKanban,
viewLabel,
viewLayout,
viewList,
viewPdfImporter,
viewTab,
viewText,
, viewDataview];
];

export default {
load: (AB) => {
Expand Down
131 changes: 131 additions & 0 deletions AppBuilder/platform/plugins/included/view_kanban/FNABViewKanban.js
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() {
Comment thread
roguisharcanetrickster marked this conversation as resolved.
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}]`
);
}
}
};
}
Loading
Loading