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/ABFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import Network from "../resources/Network.js";
import Storage from "../resources/Storage.js";
// Storage: manages our interface for local storage

import ABViewManager from "./core/ABViewManagerCore";
import ABViewManager from "./platform/ABViewManager";

import Tenant from "../resources/Tenant.js";
// Tenant: manages the Tenant information of the current instance
Expand Down
2 changes: 1 addition & 1 deletion AppBuilder/core
Submodule core updated from a7b2f3 to 692e24
3 changes: 2 additions & 1 deletion AppBuilder/platform/plugins/included/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
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";
Expand Down Expand Up @@ -27,7 +28,7 @@ const AllPlugins = [
viewPdfImporter,
viewTab,
viewText,
];
, viewDataview];

export default {
load: (AB) => {
Expand Down
151 changes: 151 additions & 0 deletions AppBuilder/platform/plugins/included/view_dataview/FNAbviewdataview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
import FNAbviewdataviewComponent from "./FNAbviewdataviewComponent.js";
import FNABViewDetail from "../view_detail/FNAbviewdetail.js";

// FNAbviewdataview Web
// A web side import for an ABView.
//
export default function FNAbviewdataview({
/*AB,*/
ABViewComponentPlugin,
ABViewContainer,
ABViewContainerComponent,
ABViewPropertyLinkPage,
}) {
const ABAbviewdataviewComponent = FNAbviewdataviewComponent({
ABViewComponentPlugin,
ABViewContainerComponent,
ABViewPropertyLinkPage,
});

const ABViewDataviewPropertyComponentDefaults = {
xCount: 1, // {int} the number of columns per row (need at least one)
detailsPage: "",
detailsTab: "",
editPage: "",
editTab: "",
};

const ABViewDataviewDefaults = {
key: "dataview", // {string} unique key for this view
icon: "th", // {string} fa-[icon] reference for this view
labelKey: "Data view(plugin)", // {string} the multilingual label key for the class label
};

const ABViewDetail = FNABViewDetail({
ABViewContainer,
ABViewContainerComponent,
});

class ABViewDataviewCore extends ABViewDetail {
/**
* @param {obj} values key=>value hash of ABView values
* @param {ABApplication} application the application object this view is under
* @param {ABView} parent the ABView this view is a child of. (can be null)
*/
constructor(values, application, parent, defaultValues) {
super(
values,
application,
parent,
defaultValues || ABViewDataviewDefaults
);
}

static common() {
return ABViewDataviewDefaults;
}

static defaultValues() {
return ABViewDataviewPropertyComponentDefaults;
}

///
/// Instance Methods
///

/**
* @method fromValues()
*
* initialze this object with the given set of values.
* @param {obj} values
*/
fromValues(values) {
super.fromValues(values);

this.settings.xCount = parseInt(
this.settings.xCount ||
ABViewDataviewPropertyComponentDefaults.xCount
);
this.settings.detailsPage =
this.settings.detailsPage ||
ABViewDataviewPropertyComponentDefaults.detailsPage;
this.settings.editPage =
this.settings.editPage ||
ABViewDataviewPropertyComponentDefaults.editPage;
this.settings.detailsTab =
this.settings.detailsTab ||
ABViewDataviewPropertyComponentDefaults.detailsTab;
this.settings.editTab =
this.settings.editTab ||
ABViewDataviewPropertyComponentDefaults.editTab;
}

parentDetailComponent() {
let dataview = null;

let curr = this;
while (curr.key != "dataview" && !curr.isRoot() && curr.parent) {
curr = curr.parent;
}

if (curr.key == "dataview") {
dataview = curr;
}

return dataview;
}
}

return class ABViewDataview extends ABViewDataviewCore {
/**
* @method getPluginKey
* return the plugin key for this view.
* @return {string} plugin key
*/
static getPluginKey() {
return this.common().key;
}

/**
* @method component()
* return a UI component based upon this view.
* @return {obj} UI component
*/
component(parentId) {
return new ABAbviewdataviewComponent(this, parentId);
}

// constructor(values, application, parent, defaultValues) {
// super(values, application, parent, defaultValues);
// }

/**
* @method fromValues()
*
* initialze this object with the given set of values.
* @param {obj} values
*/
fromValues(values) {
super.fromValues(values);

this.settings.detailsPage =
this.settings.detailsPage ?? ABViewDataviewDefaults.detailsPage;
this.settings.editPage =
this.settings.editPage ?? ABViewDataviewDefaults.editPage;
this.settings.detailsTab =
this.settings.detailsTab ?? ABViewDataviewDefaults.detailsTab;
this.settings.editTab =
this.settings.editTab ?? ABViewDataviewDefaults.editTab;
}
};
}
Loading
Loading