diff --git a/README.md b/README.md index 74f24e8..ddaef9b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,4 @@ [![Apache License](https://img.shields.io/badge/license-Apache%202.0-orange.svg)](http://www.apache.org/licenses/LICENSE-2.0) -[![Build Status](https://travis-ci.org/JelteMX/mendix-tree-view.svg?branch=master)](https://travis-ci.org/JelteMX/mendix-tree-view) -[![Coverage Status](https://coveralls.io/repos/github/JelteMX/mendix-tree-view/badge.svg?branch=master)](https://coveralls.io/github/JelteMX/mendix-tree-view?branch=master) -[![Dependencies](https://david-dm.org/JelteMX/mendix-tree-view.svg)]([https://david-dm.org/JelteMX/mendix-tree-view](https://david-dm.org/JelteMX/mendix-tree-view)) -[![DevDependencies](https://david-dm.org/JelteMX/mendix-tree-view/dev-status.svg)]([https://david-dm.org/JelteMX/mendix-tree-view?type=dev](https://david-dm.org/JelteMX/mendix-tree-view?type=dev)) [![Support](https://img.shields.io/badge/Support-Community%20(no%20active%20support)-orange.svg)](https://docs.mendix.com/developerportal/app-store/app-store-content-support) ![WM](https://img.shields.io/badge/Webmodeler%20compatible-NO-red.svg) [![Studio](https://img.shields.io/badge/Studio%20version-8.0%2B-blue.svg)](https://appstore.home.mendix.com/link/modeler/) @@ -33,6 +29,8 @@ Show a Tree structure in your Mendix project - Load children over reference, xpath or nanoflow - On Click events - Drag & Drop (Node-Parent) +- State management (keep treestructure expansion in browser storage) +- - **Experimental** Client side search (Only on loading a complete tree) > This widget is about 300Kb uncompressed, so in your cloud deployment this widget should take about 83 Kb of network resources @@ -75,7 +73,7 @@ Tested: - Drag & Drop is only enabled for objects with a parent relation - The widget will do the changes on the object by itself -### 6. Experimental - Search +### 6. Search (experimental) ![settings](/assets/settings6.png) @@ -83,7 +81,11 @@ Tested: - It requires another helper entity, which will be used in calling a Nanoflow - The helper entity has a reference set of all the objects that are loaded, and the search query. It is up to you to create a Nanoflow that returns a list of objects to be shown (act as a filter) -### 7. Events +### 7. Misc + +- This deals with state management and exposing an external method to select an item + +### 8. Events ![settings](/assets/settings7.png) @@ -102,9 +104,6 @@ Tested: Please report your issues [here](https://github.com/JelteMX/mendix-tree-view/issues) -## Development and contribution -[specify contribute] - ## TODO These are action items on the list for future releases diff --git a/src/components/icons.js b/src/components/icons.js deleted file mode 100644 index c5460bd..0000000 --- a/src/components/icons.js +++ /dev/null @@ -1,7 +0,0 @@ -// This is a hack to keep Antdesign Table package small. -export { default as LoadingOutlined } from "@ant-design/icons/lib/outline/LoadingOutline"; -export { default as SearchOutlined } from "@ant-design/icons/lib/outline/SearchOutline"; -export { default as MinusSquareOutlined } from "@ant-design/icons/lib/outline/MinusSquareOutline"; -export { default as PlusSquareOutlined } from "@ant-design/icons/lib/outline/PlusSquareOutline"; -export { default as CaretDownFilled } from "@ant-design/icons/lib/fill/CaretDownFill"; -export { default as CloseCircleFilled } from "@ant-design/icons/lib/fill/CloseCircleFill"; diff --git a/src/store/index.ts b/src/store/index.ts index d3b3667..5f8e817 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -417,7 +417,7 @@ export class NodeStore { // Entries @computed - get treeMapping(): { [key:string]: string } { + get treeMapping(): { [key: string]: string } { const needParentMapping = this.entryObjectAttributes.relationType === "nodeChildren"; const treeMapping: { [key: string]: string } = {}; @@ -427,22 +427,21 @@ export class NodeStore { if (obj.children) { obj.children.forEach(child => { treeMapping[child] = obj.guid; - }) + }); } - }) + }); } else { this.entries.forEach(entry => { const obj = entry.obj; if (obj.parent) { - treeMapping[obj.guid] = obj.parent + treeMapping[obj.guid] = obj.parent; } - }) + }); } return treeMapping; } - @computed get entryList(): TreeObject[] { const needParentMapping = this.entryObjectAttributes.relationType === "nodeChildren";