Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Organizational Chart #26893

Merged
merged 49 commits into from
Aug 16, 2021
Merged

Conversation

ruchamahabal
Copy link
Member

Port of: #26261

Organizational Charts

An organizational chart shows the organizational structure by depicting connections between different employees with their designation, image, and name. In large organizations where it's difficult to remember names, people can interact with the org chart and know the hierarchy through faces and other info. The Edit button navigates to the employee master.

Desktop View

Interactions:

org-chart.mp4

Expand All and Export

  1. Option to expand all the nodes. Interaction is disabled until you collapse all.
  2. Export to PNG
org-chart-export.mp4

Mobile View

image

Untitled 2

After clicking on sibling group:

node-group

Documentation PR: frappe/erpnext_documentation#364

ToDo

  • Optimise rendering
  • Handle multiple root nodes / orphan nodes
  • Expand all nodes
  • Export Chart
  • Tests
  • Documentation

- remove all connectors while expanding a group node
- method to return the node data

- wrapper for showing the hierarchy
- optimise get_children function

- use promises instead of callbacks

- optimise selectors

- use const wherever possible

- use pure js instead of jquery for connectors for faster rendering
fix(mobile): detach node before emptying hierarchy

fix(mobile): sibling group not rendering for first level
@surajshetty3416
Copy link
Member

@ruchamahabal please add changes in this PR as well.

@ruchamahabal
Copy link
Member Author

Unrelated POS Invoice test case failing

@ruchamahabal ruchamahabal merged commit 39efc62 into frappe:develop Aug 16, 2021
asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
* feat: Organizational Chart

* feat: org chart mobile interactions

* feat(mobile): sibling node group expansion and rendering

* fix: expanded node group interactions and visibility

* feat: connectors for mobile node cards

* fix: don't refresh connections for same node

- remove all connectors while expanding a group node

* chore: create separate files for Desktop and Mobile view and bundle assets

* refactor: add options to chart

- method to return the node data

- wrapper for showing the hierarchy

* feat: setup node edit action

* fix: revert changes in employee descendants query

* refactor: use arcs instead of bezier curves for cleaner connectors

* feat: add arc to connectors in mobile view

* fix: edit node button overflowing

* fix: sider

* fix: removing orphaned connectors

* fix: unnecessary variables

* feat: handle multiple root / orphan nodes

* perf: Optimise Rendering

- optimise get_children function

- use promises instead of callbacks

- optimise selectors

- use const wherever possible

- use pure js instead of jquery for connectors for faster rendering

* fix: do not sort by number of connections

* feat: use icon for connections on mobile view

* fix: exclude active node while fetching sibling group

* fix: sibling group expansion not working for root nodes

* fix(mobile): collapsed nodes not expanding

* fix: sider

* test: UI tests for org chart desktop

* test: UI tests for org chart mobile

fix(mobile): detach node before emptying hierarchy

fix(mobile): sibling group not rendering for first level

* fix: sider

* ci(cypress): use env variable for key

documentation ref: https://docs.cypress.io/guides/guides/command-line\#cypress-run

* fix(tests): clear filter before typing

* fix(tests): apply filters correctly

* fix: tests

* fix: tests

* fix: tests

* fix(test): increase timeout for record creation

* fix: sider

* fix: sider

* feat: Expand All nodes option in Desktop view

* feat: add html2canvas for easily exporting html to images using canvas

* feat: Export chart option in desktop view

* fix(style): longer titles overflowing

* fix: remove unnecessary imports

* fix: test

* fix: make bundled assets for hierarchy chart

* fix(style): apply svg container margin only in desktop view

* fix: Nest `.level` class style under `.hierarchy` class (frappe#26905)

fix: Nest `.level` class style under `.hierarchy` class

* fix: add z-index to filter to avoid svg wrapper overlapping

* fix: expand all nodes not working when there are only 2 levels

- added dom freeze while expanding all nodes and exporting

* fix: test

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants