Skip to content

Commit

Permalink
Breadcrump: Add initial version of breadcrump
Browse files Browse the repository at this point in the history
(reference #56)
  • Loading branch information
piotrzarzycki21 committed Jun 10, 2024
1 parent b789b2c commit 12caa8e
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package Super.Human.Portal_Royale.views.modules.DocumentationForm.DocumentationF
import org.apache.royale.events.EventDispatcher;
import org.apache.royale.jewel.Snackbar;
import org.apache.royale.net.events.FaultEvent;
import model.vo.TileViewVO;

public class DocumentationFormProxy extends EventDispatcher
{
Expand Down Expand Up @@ -81,6 +82,25 @@ package Super.Human.Portal_Royale.views.modules.DocumentationForm.DocumentationF
_items = value;
}

private var _mainItems:Array = new Array(
new TileViewVO("usingThisPortal", "Using this Portal", "Run your Notes application in the cloud from any browser. Add bookmarks to key company resources for your employees -- both Domino databases and external URLs to for example your payroll time tracking system.", null, MaterialIconType.HOME, 3),
new TileViewVO("appMarketplace", "Application Marketplace", "Explore free and paid applications you can add to your environment. These range from simple utility apps to complex CRMs.", null, MaterialIconType.STORE, 3),
new TileViewVO("cloudAndMobileEmail", "Cloud Desktops & Mobile e-mail", "Mobile e-mail is just the first step. Your entire set of Windows applications can be run in Cloud Desktops. This gives all of your staff a consistent interface and aids in recovery from ransomware attacks.", null, MaterialIconType.CLOUD, 3),
new TileViewVO("devCenter", "Developer's Corner", "Do you want to build a new app for Domino? Browser based, Mobile first, REST, JSON, native Mac, Windows, Linux, and more? There are more ways than ever to deliver compelling user experiences with Domino.", null, MaterialIconType.CODE, 3),
new TileViewVO("mfaSecurity", "MFA, Security & Compliance", "Multi-Factor Authentication is critical in today's world. Security training for your employees. Assess compliance needs ahead of your annual cyber liability insurance policy renewals.", null, MaterialIconType.SECURITY, 3),
new TileViewVO("verseCalndarAndMeetings", "Verse, Calendaring & Meetings", "Group calendaring helps your team stay organized and connected to vendors and customers. Schedule integration with MS Teams, Zoom, WebEx, GoToMeting, and Sametime directly from Notes and Verse. The Verse e-mail interface groups your key communications automatically.", null, MaterialIconType.PERM_CONTACT_CALENDAR, 3));

[Bindable]
public function get mainItems():Array
{
return _mainItems;
}

public function set mainItems(value:Array):void
{
_mainItems = value;
}

private var _selectedIndex:int;
public function get selectedIndex():int
{
Expand All @@ -100,6 +120,66 @@ package Super.Human.Portal_Royale.views.modules.DocumentationForm.DocumentationF
}
}

private var _breadcrumpItems:Object = {gettingStarted: {
id: "gettingStarted",
parent: null,
hash: null,
label: "Getting Started",
visited: -1,
icon: "folder_open",
data: {},
children: []
}};

public function get breadcrumpItems():Object
{
return _breadcrumpItems;
}

public function getBreadcrumpModel():Object
{
var breadcrumpItems:Array = [];

var bItem:Object = null;
for each (var tileItem:TileViewVO in mainItems)
{
bItem = {
id: tileItem.id,
parent: "gettingStarted",
hash: null,
label: tileItem.title,
visited: -1,
icon: tileItem.imageIcon,
data: {},
children: []
};

breadcrumpItems.push(bItem.id);
_breadcrumpItems[bItem.id] = bItem;
}

_breadcrumpItems.children = breadcrumpItems;

/*for each (var docItem:DocumentationFormVO in items)
{
bItem = {
id: docItem.DominoUniversalID,
parent: "gettingStarted",
hash: null,
label: docItem.DocumentationName,
visited: -1,
icon: docItem.image ? docItem.image : docItem.emptyImage,
data: docItem,
children: []
};
breadcrumpItems.push(bItem.id);
rootBreadcrump[bItem.id] = bItem;
}*/

return _breadcrumpItems;
}

public function submitItem(value:DocumentationFormVO):void
{
// simple in-memory add/update for now
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:js="library://ns.apache.org/royale/basic" xmlns:html="library://ns.apache.org/royale/html"
xmlns:dataGrid="Super.Human.Portal_Royale.classes.dataGrid.*"
xmlns:components="Super.Human.Portal_Royale.views.components.*" xmlns:htmlEditor="Super.Human.Portal_Royale.classes.htmlEditor.*"
xmlns:tileView="classes.com.devexpress.js.tileView.*"
xmlns:tileView="classes.com.devexpress.js.tileView.*" xmlns:breadcrump="classes.breadcrump.*"
currentState="startview" gap="5" stateChangeComplete="{this.dispatchEvent(new Event('valueChange'))}"
itemsVerticalAlign="itemsTop" initComplete="onViewInitComplete(event)" percentHeight="100" className="bodyPadding">
<j:beads>
Expand All @@ -24,7 +24,7 @@
import Super.Human.Portal_Royale.classes.htmlEditor.helpers.ToolbarItems;
import model.vo.TileViewVO;
[Bindable] private var proxy:DocumentationFormProxy = DocumentationFormProxy.getInstance();
[Bindable] private var proxy:DocumentationFormProxy;
[Bindable] private var itemVO:DocumentationFormVO;
[Bindable] private var isDisabled:Boolean = false;
Expand All @@ -33,18 +33,13 @@
private function onViewInitComplete(event:Event):void
{
proxy = DocumentationFormProxy.getInstance();
proxy.addEventListener(ErrorEvent.SERVER_ERROR, onServerError);
proxy.addEventListener(DocumentationFormProxy.EVENT_ITEM_UPDATED, onServerItemChanged);
proxy.addEventListener(DocumentationFormProxy.EVENT_ITEM_REMOVED, onServerItemChanged);
tileGettingStarted.dataProvider = [
new TileViewVO("Using this Portal", "Run your Notes application in the cloud from any browser. Add bookmarks to key company resources for your employees -- both Domino databases and external URLs to for example your payroll time tracking system.", null, MaterialIconType.HOME, 3),
new TileViewVO("Application Marketplace", "Explore free and paid applications you can add to your environment. These range from simple utility apps to complex CRMs.", null, MaterialIconType.STORE, 3),
new TileViewVO("Cloud Desktops & Mobile e-mail", "Mobile e-mail is just the first step. Your entire set of Windows applications can be run in Cloud Desktops. This gives all of your staff a consistent interface and aids in recovery from ransomware attacks.", null, MaterialIconType.CLOUD, 3),
new TileViewVO("Developer's Corner", "Do you want to build a new app for Domino? Browser based, Mobile first, REST, JSON, native Mac, Windows, Linux, and more? There are more ways than ever to deliver compelling user experiences with Domino.", null, MaterialIconType.CODE, 3),
new TileViewVO("MFA, Security & Compliance", "Multi-Factor Authentication is critical in today's world. Security training for your employees. Assess compliance needs ahead of your annual cyber liability insurance policy renewals.", null, MaterialIconType.SECURITY, 3),
new TileViewVO("Verse, Calendaring & Meetings", "Group calendaring helps your team stay organized and connected to vendors and customers. Schedule integration with MS Teams, Zoom, WebEx, GoToMeting, and Sametime directly from Notes and Verse. The Verse e-mail interface groups your key communications automatically.", null, MaterialIconType.PERM_CONTACT_CALENDAR, 3)
];
breadcrumpGettingStarted.model = proxy.breadcrumpItems;
breadcrumpGettingStarted.buildBreadcrump(proxy.breadcrumpItems.gettingStarted);
}
public function resetDocumentationForm():void
Expand All @@ -61,6 +56,8 @@
}
this.itemVO = null;
breadcrumpGettingStarted.buildBreadcrump(proxy.breadcrumpItems.gettingStarted);
}
public function refreshItems():void
Expand Down Expand Up @@ -139,6 +136,12 @@
{
this.currentState = 'dataGridState';
this.dg.dataProvider = this.proxy.items;
breadcrumpGettingStarted.model = proxy.getBreadcrumpModel();
if (tileGettingStarted.selectedItem)
{
breadcrumpGettingStarted.buildBreadcrump(breadcrumpGettingStarted.model[tileGettingStarted.selectedItem.id]);
}
// this.dg.refreshCurrentDataProvider();
}
Expand Down Expand Up @@ -172,6 +175,8 @@
}
]]></fx:Script>
<breadcrump:Breadcrump localId="breadcrumpGettingStarted"/>

<j:HGroup percentWidth="100" itemsHorizontalAlign="itemsLeft" gap="2" includeIn="dataGridState">
<j:style>
<js:SimpleCSSStyles padding="10"/>
Expand Down Expand Up @@ -224,46 +229,47 @@
</j:Button>
</j:HGroup>

<j:VGroup includeIn="contentState" percentWidth="100" percentHeight="100" xmlns:j="library://ns.apache.org/royale/jewel"
gap="6">

<j:beads>

<j:ScrollingViewport/>

</j:beads>

<j:HGroup gap="2" itemsVerticalAlign="itemsCenter">

<components:DominoTextInputMultiline text="{itemVO.DocumentationName}" change="{itemVO.DocumentationName = event.currentTarget.text;}"
isDisabled="{isDisabled}" xmlns:components="Super.Human.Portal_Royale.views.components.*"
isTextArea="true" fontSize="x-large"/>

<j:Label text="(" className="cursor-pointer" visible="{isDisabled &amp;&amp; this.proxy.showUnid}"/>

<components:DominoTextInputMultiline text="{itemVO.DocumentationUNID}" change="{itemVO.DocumentationUNID = event.currentTarget.text;}"
isDisabled="{isDisabled}" xmlns:components="Super.Human.Portal_Royale.views.components.*"
isTextArea="false" visible="{this.proxy.showUnid}"/>

<j:Label text="{isDisabled ? ')' : '(DocumentationUNID)'}" className="cursor-pointer" visible="{this.proxy.showUnid}"/>

</j:HGroup>

<j:HGroup percentWidth="100">
<htmlEditor:HtmlEditor data="{itemVO.DocumentationBody}" readOnly="{isDisabled}"
toolbarItems="{isDisabled ? [] : ToolbarItems.ALL_ITEMS}"
textChange="onHtmlEditorTextChange(event)" />
</j:HGroup>

</j:VGroup>
<j:VGroup includeIn="contentState" percentWidth="100" percentHeight="100" xmlns:j="library://ns.apache.org/royale/jewel"
gap="6">

<j:beads>
<j:ScrollingViewport/>
</j:beads>

<j:HGroup gap="2" itemsVerticalAlign="itemsCenter">

<components:DominoTextInputMultiline text="{itemVO.DocumentationName}" change="{itemVO.DocumentationName = event.currentTarget.text;}"
isDisabled="{isDisabled}" xmlns:components="Super.Human.Portal_Royale.views.components.*"
isTextArea="true" fontSize="x-large"/>

<j:Label text="(" className="cursor-pointer" visible="{isDisabled &amp;&amp; this.proxy.showUnid}"/>

<components:DominoTextInputMultiline text="{itemVO.DocumentationUNID}" change="{itemVO.DocumentationUNID = event.currentTarget.text;}"
isDisabled="{isDisabled}" xmlns:components="Super.Human.Portal_Royale.views.components.*"
isTextArea="false" visible="{this.proxy.showUnid}"/>

<j:Label text="{isDisabled ? ')' : '(DocumentationUNID)'}" className="cursor-pointer" visible="{this.proxy.showUnid}"/>

</j:HGroup>

<j:HGroup percentWidth="100">
<htmlEditor:HtmlEditor data="{itemVO.DocumentationBody}" readOnly="{isDisabled}"
toolbarItems="{isDisabled ? [] : ToolbarItems.ALL_ITEMS}"
textChange="onHtmlEditorTextChange(event)" />
</j:HGroup>

</j:VGroup>


<!--<dataGrid:DataGrid columns="{[{caption: 'DocumentationName', dataField: 'DocumentationName', allowSorting: false, allowFiltering: true, filterType: 'exclude'},
{caption: 'DocumentationUNID', dataField: 'DocumentationUNID', dataType: 'number', alignment: 'left', sortOrder: 'asc', allowFiltering: false, visible: this.proxy.showUnid}]}" dataProvider="{this.proxy.items}"
filterRow="{ {visible: true, applyFilter: 'auto'} }" localId="dg" includeIn="dataGridState" className="dxDataGrid scrollHeightDocFormGridJS" percentWidth="100" doubleClick="onGridDoubleClick(event)"/>-->
<tileView:TileView localId="dg" includeIn="dataGridState" className="tileViewJS"

<tileView:TileView localId="dg" className="tileViewJS"
percentWidth="100" baseItemWidth="245" baseItemHeight="300" itemMargin="5" direction="vertical"
itemRenderer="Super.Human.Portal_Royale.views.renderers.DocumentationTileRenderer"/>
itemRenderer="Super.Human.Portal_Royale.views.renderers.DocumentationTileRenderer"
includeIn="dataGridState"/>
<tileView:TileView localId="tileGettingStarted" className="tileViewJS" direction="vertical" includeIn="startview"
percentWidth="100" baseItemHeight="350" itemMargin="10" itemRenderer="Super.Human.Portal_Royale.views.renderers.CardTileRenderer"/>
percentWidth="100" baseItemHeight="350" itemMargin="10" itemRenderer="Super.Human.Portal_Royale.views.renderers.CardTileRenderer"
dataProvider="{proxy.mainItems}"/>
</j:VGroup>
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ package model.vo
public var link:String;
public var imageIcon:String;
public var widthRatio:Number;

public function TileViewVO(title:String = "", description:String = "", link:String = null, imageIcon:String = null, widthRatio:Number = 1)

private var _id:String;

public function get id():String
{
return _id;
}

public function TileViewVO(id:String = "", title:String = "", description:String = "", link:String = null, imageIcon:String = null, widthRatio:Number = 1)
{
this._id = id;
this.title = title;
this.description = description;
this.link = link;
Expand Down

0 comments on commit 12caa8e

Please sign in to comment.