Skip to content
Draft
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
4 changes: 4 additions & 0 deletions src/plugins/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import viewGanttEditor from "./web_view_gantt/FNAbviewganttEditor.js";
import viewGanttProperties from "./web_view_gantt/FNAbviewganttProperties.js";
import viewCarouselProperties from "./web_view_carousel/FNAbviewcarousel.js";
import viewCarouselEditor from "./web_view_carousel/FNAbviewcarouselEditor.js";
import viewCommentProperties from "./web_view_comment/FNAbviewcomment.js";
Expand Down Expand Up @@ -46,6 +48,8 @@ const AllPlugins = [
viewTabEditor,
viewTextProperties,
viewTextEditor,
viewGanttProperties,
viewGanttEditor,
];

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ const defaultValues = {
},
};

import UI_Class from "../../ui_class";

export default function (AB, ibase) {
const UIClass = UI_Class(AB);
const L = UIClass.L();
export default function (AB, ABUIPlugin, ibase) {
const UIClass = ABUIPlugin.ClassUI;
const L = AB.Label();

const ABFieldDate = AB.Class.ABFieldManager.fieldByKey("date");
const ABFieldNumber = AB.Class.ABFieldManager.fieldByKey("number");
Expand Down Expand Up @@ -184,7 +182,7 @@ export default function (AB, ibase) {
$$(ids.endDateFieldID).define(
"value",
settings.endDateFieldID ||
defaultValues.settings.endDateFieldIDFieldID
defaultValues.settings.endDateFieldIDFieldID
);
$$(ids.endDateFieldID).refresh();
this.syncCommonLists(
Expand All @@ -197,7 +195,7 @@ export default function (AB, ibase) {
$$(ids.durationFieldID).define(
"value",
settings.durationFieldID ||
defaultValues.settings.durationFieldID
defaultValues.settings.durationFieldID
);
$$(ids.durationFieldID).refresh();
this.syncCommonLists(
Expand Down Expand Up @@ -573,7 +571,7 @@ export default function (AB, ibase) {
*/
fromSettings(data) {
for (const key in defaultValues)
this[v] = data[key] || defaultValues[key];
this[key] = data[key] || defaultValues[key];

this.settings = Object.assign(
{},
Expand Down
56 changes: 56 additions & 0 deletions src/plugins/web_view_gantt/FNAbviewganttEditor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// FNAbviewgantt Editor
// An Editor wrapper for the ABView Component.
// The Editor is displayed in the ABDesigner as a view is worked on.
// The Editor allows a widget to be moved and placed on the canvas.
//
export default function FNAbviewganttEditor({ AB, ABViewEditorPlugin }) {
const BASE_ID = "interface_editor_viewgantt";

return class ABAbviewganttEditor extends ABViewEditorPlugin {
static getPluginKey() {
return this.key;
}

/**
* @method getPluginType
* return the plugin type for this editor.
* plugin types are how our ClassManager knows how to store
* the plugin.
* @return {string} plugin type
*/
static getPluginType() {
return "editor-view";
// editor-view : will display in the editor panel of the ABDesigner
}

static get key() {
return "gantt";
}

constructor(view, base = BASE_ID) {
// base: {string} unique base id reference
super(view, base, {
label: "",
});
}

ui() {
return this.component.ui();
}

async init(AB) {
this.AB = AB;
this.component.ignoreLocal = true;
// in our editor, we provide accessLv = 2
await this.component.init(AB, 2);
}

detatch() {
this.component.detatch?.();
}

onShow() {
this.component.onShow?.();
}
};
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
/*
* ABViewGantt
* A Property manager for our ABViewGantt definitions
*/

import FABView from "./ABView";

import FABViewGanttWorkspaceView from "../workspaceViews/ABViewGantt";

import FPopupNewDataField from "../../ui_work_object_workspace_popupNewDataField";

export default function (AB) {
import FABViewGanttWorkspaceView from "./Abganttworkspace.js";
import FPopupNewDataField from "../../rootPages/Designer/ui_work_object_workspace_popupNewDataField";

// FNAbviewgantt Properties
// A properties side import for an ABView.
//
export default function FNAbviewganttProperties({
AB,
ABViewPropertiesPlugin,
ABUIPlugin,
}) {
const BASE_ID = "properties_abview_gantt";

const ABView = FABView(AB);
const uiConfig = AB.Config.uiSettings();
const L = ABView.L();

const L = AB.Label();
const ABViewGanttWorkspaceView = FABViewGanttWorkspaceView(
AB,
ABUIPlugin,
`${BASE_ID}_workspaceView_gantt`
);

class ABViewGanttProperty extends ABView {
return class ABAbviewganttProperties extends ABViewPropertiesPlugin {
static getPluginKey() {
return this.key;
}

static getPluginType() {
return "properties-view";
// properties-view : will display in the properties panel of the ABDesigner
}

constructor() {
super(BASE_ID, {
dataviewID: "",
Expand Down Expand Up @@ -206,7 +213,5 @@ export default function (AB) {
ViewClass() {
return super._ViewClass("gantt");
}
}

return ABViewGanttProperty;
};
}
1 change: 0 additions & 1 deletion src/rootPages/Designer/editors/EditorManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default function (AB) {
require("./views/ABViewDocxBuilder"),
require("./views/ABViewForm"),
require("./views/ABViewFormUrl"),
require("./views/ABViewGantt"),
require("./views/ABViewGrid"),
require("./views/ABViewKanban"),
// require("./views/ABViewLabel"),
Expand Down
56 changes: 0 additions & 56 deletions src/rootPages/Designer/editors/views/ABViewGantt.js

This file was deleted.

1 change: 0 additions & 1 deletion src/rootPages/Designer/properties/PropertyManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export default function (AB) {
require("./views/ABViewFormTextbox"),
require("./views/ABViewFormTree"),
require("./views/ABViewFormUrl"),
require("./views/ABViewGantt"),
require("./views/ABViewGrid"),
// require("./views/ABViewImage"),
require("./views/ABViewKanban"),
Expand Down
20 changes: 4 additions & 16 deletions src/rootPages/Designer/ui_work_object_workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
import UI_Class from "./ui_class";
import UI_Warnings from "./ui_warnings";
// const ABWorkspaceGantt = require("./ab_work_object_workspace_gantt");

// const ABWorkspaceIndex = require("./ab_work_object_workspace_index");

Expand All @@ -26,7 +25,6 @@ import FPopupFilterDataTable from "./ui_work_object_workspace_popupFilter";
import FWorkspaceViews from "./ui_work_object_workspace_workspaceviews";

import FWorkspaceDatatable from "./ui_work_object_workspace_view_grid";
import FWorkspaceGantt from "./ui_work_object_workspace_view_gantt";
import FWorkspaceKanban from "./ui_work_object_workspace_view_kanban";

import FWorkspaceTrack from "./ui_work_object_workspace_popupTrack";
Expand All @@ -38,7 +36,6 @@ export default function (AB, ibase, init_settings) {
var L = UIClass.L();

var Datatable = FWorkspaceDatatable(AB, `${ibase}_view_grid`, init_settings);
var Gantt = FWorkspaceGantt(AB, `${ibase}_view_gantt`);
var Kanban = FWorkspaceKanban(AB, `${ibase}_view_kanban`);

var Warnings = UI_Warnings(AB, `${ibase}_view_warnings`, init_settings);
Expand Down Expand Up @@ -156,9 +153,6 @@ export default function (AB, ibase, init_settings) {
object.save();
});

// The Gantt Object View
this.hashViews["gantt"] = Gantt;

// The Kanban Object View.
this.hashViews["kanban"] = Kanban;

Expand Down Expand Up @@ -652,7 +646,7 @@ export default function (AB, ibase, init_settings) {
{
view: "multiview",
animate: false,
cells: [Datatable.ui(), Kanban.ui(), Gantt.ui()],
cells: [Datatable.ui(), Kanban.ui()],
},
// this.settings.isInsertable
// ?
Expand Down Expand Up @@ -691,7 +685,6 @@ export default function (AB, ibase, init_settings) {
allInits.push(this.workspaceViews.init(AB));

allInits.push(Datatable.init(AB));
allInits.push(Gantt.init(AB));
allInits.push(Kanban.init(AB));

allInits.push(Track.init(AB));
Expand All @@ -704,7 +697,6 @@ export default function (AB, ibase, init_settings) {
allInits.push(this.PopupCustomIndex.init(AB));

Datatable.datacollectionLoad(this.mockDataCollection);
Gantt.datacollectionLoad(this.mockDataCollection);
Kanban.datacollectionLoad(this.mockDataCollection);
// Gantt.datacollectionLoad(this.mockDataCollection);

Expand Down Expand Up @@ -911,9 +903,6 @@ export default function (AB, ibase, init_settings) {
this.warningsRefresh(this.CurrentObject);
var currentView = this.workspaceViews.getCurrentView();
switch (currentView.type) {
case "gantt":
Gantt.show(currentView);
break;

case "grid":
Datatable.refreshHeader(
Expand Down Expand Up @@ -1384,13 +1373,12 @@ export default function (AB, ibase, init_settings) {
var currentView = this.workspaceViews.getCurrentView();
// {WorkspaceView}
// The current workspace view that is being displayed in our work area
// currentView.component {ABViewGrid | ABViewKanBan | ABViewGantt}
// currentView.component {ABViewGrid | ABViewKanBan }

this.mockDataCollection.datasource = object;

Datatable.objectLoad(object);
Kanban.objectLoad(object);
Gantt.objectLoad(object);

if (!this.isReadOnly) {
this.PopupNewDataFieldComponent.objectLoad(object);
Expand Down Expand Up @@ -1523,7 +1511,7 @@ export default function (AB, ibase, init_settings) {

// WORKAROUND: load all data becuase kanban does not support pagination now
let view = this.workspaceViews.getCurrentView();
if (view.type === "gantt" || view.type === "kanban") {
if (view.type === "kanban") {
this.mockDataCollection.settings.loadAll = true;
this.mockDataCollection.loadData(0);
} else {
Expand Down Expand Up @@ -1643,7 +1631,7 @@ export default function (AB, ibase, init_settings) {
/**
* @method refreshWorkspaceViewMenu()
* On the top of our workspace, we show a list if different views
* of our current object: Grid, Kanban, Gantt, etc...
* of our current object: Grid, Kanban, etc...
* This method will redraw those selectors based upon our current
* settings.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*/
import UI_Class from "./ui_class";
import FormABViewGantt from "./properties/workspaceViews/ABViewGantt";
import FABViewGanttWorkspaceView from "../../plugins/web_view_gantt/Abganttworkspace.js";
import FormABViewGrid from "./properties/workspaceViews/ABViewGrid";
import FormABViewKanBan from "./properties/workspaceViews/ABViewKanban";

Expand Down Expand Up @@ -41,7 +41,11 @@ export default function (AB, ibase, isettings) {
this._newFieldSource = "comKanban";
this.emit("new.field", key);
});
this.comGantt = FormABViewGantt(AB, `${base}_gantt`);
this.comGantt = FABViewGanttWorkspaceView(
AB,
AB.pluginAPI().ABUIPlugin,
`${base}_gantt`
);
this.comGantt.on("new.field", (key) => {
this._newFieldSource = "comGantt";
this.emit("new.field", key);
Expand Down
Loading
Loading