Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
a4fe86b
feat: custom-component auto expanding of menus & actions
deepak-64742 Oct 12, 2023
284952f
refactor: custom-component-revert revert configuration
deepak-64742 Oct 12, 2023
01a4501
test: custom-component removed logging
deepak-64742 Oct 12, 2023
c015db9
Merge branch 'custom-component' of https://github.com/deepak-64742/Me…
deepak-64742 Oct 12, 2023
2b4bb49
Merge branch 'main' of https://github.com/deepak-64742/Menu-Generatin…
deepak-64742 Oct 17, 2023
97e5822
fix: custom-component added 'rightIcon' property to the json & functi…
deepak-64742 Oct 18, 2023
97dc188
test: custom-component removing log function
deepak-64742 Oct 18, 2023
7eb125b
doc: custom-component adding some documentation points
deepak-64742 Oct 18, 2023
dfdb8c5
refactor: custom-component removing unnecessary code
deepak-64742 Oct 18, 2023
df6ad84
Merge branch 'custom-component' of https://github.com/deepak-64742/Me…
deepak-64742 Oct 18, 2023
1fe87f6
fix: custom-component conflict resolved
deepak-64742 Oct 30, 2023
ae1b8b7
feat: custom-component adding functinality to block menu & action aft…
deepak-64742 Oct 30, 2023
55cdf9e
fix: custom-component resolved right icon issue due to menu & action …
deepak-64742 Oct 30, 2023
15261fd
refactor: custom-component removing logs
deepak-64742 Oct 30, 2023
bd93363
fix: custom-component fixed removing rightIcon on selecting no-icon i…
deepak-64742 Oct 30, 2023
43b3f8e
Merge branch 'custom-component' of https://github.com/deepak-64742/Me…
deepak-64742 Oct 30, 2023
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
22 changes: 16 additions & 6 deletions src/x-759224-menu-builder-uic/components/menu-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import iconlist from "../icons";

const view = (
{
properties: { id, choice, label, type, page, sysId, href, expandParent, rightIcon },
properties: { id, choice, label, type, page, sysId, href, expandParent, rightIcon, level },
labelInput,
typeInput,
pageInput,
Expand Down Expand Up @@ -112,7 +112,7 @@ const view = (
<now-dropdown
// mapping iconlist for required data in now-dropdown
// adding no-icon as a no selection
items={[{ id: null, label: "no-icon" }, ...iconlist.map(e => ({ id: e, label: e }))]}
items={[{ id: null, label: "no-icon", type: 'icon' }, ...iconlist.map(e => ({ id: e, label: e, type: 'icon' }))]}
selectedItems={[iconValue]}
name="iconInput"
select="single"
Expand All @@ -135,9 +135,12 @@ const view = (
</p>
}
</div>
<div className="rightMenu">
<menu-editor parent={id} expandParent={expandParent}></menu-editor>
</div>
{
level < 4 ? <div className="rightMenu">
<menu-editor parent={id} expandParent={expandParent}></menu-editor>
</div> : <div></div>
}

</div>
<now-collapse expanded={editMode}>
<div className="menu-row">
Expand Down Expand Up @@ -251,6 +254,9 @@ createCustomElement("menu-item", {
},
rightIcon: {
default: null
},
level: {
default: 0
}
},
// Keeps track of any changes made during editing
Expand All @@ -272,13 +278,17 @@ createCustomElement("menu-item", {
* Only handle this event if called from this component
* Since menu-editor also uses this event
*/

switch (payload.item.id) {
case "route":
case "external":
updateState({ typeInput: payload.item.id });
break;
default:
updateState({ iconInput: payload.item.id }); // action on icon selection
}

if(payload.item.type === 'icon'){
updateState({ iconInput: payload.item.id }); // action on icon selection
}
},
// Text input field has changed (someone typed in the field or cleared value for example)
Expand Down
8 changes: 6 additions & 2 deletions src/x-759224-menu-builder-uic/components/menu-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "./menu-item";
// File description: This displays a top-level menu item (and child items), expand/collapse functionality for the container


const view = ({ properties: { tree }, expanded }, { updateState }) => {
const view = ({ properties: { tree, level }, expanded }, { updateState }) => {
const { id, children, parent, choice, label, type, page, sys_id, href, rightIcon } =
tree;

Expand Down Expand Up @@ -43,14 +43,15 @@ const view = ({ properties: { tree }, expanded }, { updateState }) => {
rightIcon={rightIcon}
className="menu-item"
expandParent={EXPAND_PARENT}
level={level}
></menu-item>
</div>
{/* Render child menu items in a collapsible container if they exist */}
{hasChildren ? (
<ul>
<now-collapse expanded={expanded}>
{children.map((child) => {
return <menu-tree key={child.id} tree={child}></menu-tree>;
return <menu-tree key={child.id} tree={child} level={level + 1}></menu-tree>;
})}
</now-collapse>
</ul>
Expand All @@ -68,6 +69,9 @@ createCustomElement("menu-tree", {
tree: {
default: {},
},
level: {
default: 1
}
},
initialState: {
expanded: true,
Expand Down