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

WIP - Improve org charts #3135

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

Conversation

VassilIordanov
Copy link
Contributor

@VassilIordanov VassilIordanov commented Aug 11, 2020

Internals:

  • We now use react for SVG rendering of the org diagrams
  • We still use d3 for the math and for the transitions

Release notes

Closes #

User changes

Super User changes

Admin changes

System admin changes

  • anet.yml needs change
  • db needs migration
  • documentation has changed
  • graphql schema has changed

Checklist

  • Described the user behavior in PR body
  • Referenced/updated all related issues
  • commits follow a repo#issue: Title title format and these 7 rules
  • commits have a clean history, otherwise PR may be squash-merged
  • Added and/or updated unit tests
  • Added and/or updated e2e tests
  • Added and/or updated data migrations
  • Updated documentation
  • Resolved all build errors and warnings
  • Opened debt issues for anything not resolved here

@VassilIordanov VassilIordanov changed the title Improve org charts WIP - Improve org charts Aug 11, 2020
@VassilIordanov VassilIordanov marked this pull request as draft August 11, 2020 01:07
… index

Also, make head positions bigger and limit depth of chart
@lgtm-com
Copy link

lgtm-com bot commented Aug 20, 2020

This pull request introduces 1 alert when merging c72f74e into 05d6382 - view on LGTM.com

new alerts:

  • 1 for Useless conditional

@lgtm-com
Copy link

lgtm-com bot commented Aug 20, 2020

This pull request introduces 1 alert when merging e00a0e9 into 05d6382 - view on LGTM.com

new alerts:

  • 1 for Useless conditional

@lgtm-com
Copy link

lgtm-com bot commented Aug 25, 2020

This pull request introduces 1 alert when merging 975d21c into a2500d4 - view on LGTM.com

new alerts:

  • 1 for Useless conditional

@lgtm-com
Copy link

lgtm-com bot commented Aug 26, 2020

This pull request introduces 1 alert when merging 90f46a9 into 228f600 - view on LGTM.com

new alerts:

  • 1 for Useless conditional

x={size[1] + 2}
y={size[1] / 2}
fontSize="9px"
fontWeight={twoRows ? "bold" : "normal"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix this warning:
Screenshot from 2020-08-26 14-29-12

minimized: PropTypes.bool,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func
}

const OrganizationalChart = ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to place top level component at the top to the lowest at the bottom, so that we don't scroll all the way to skim a file and see what is going on, high level picture, props etc. For example, I think we should structure our components in a file like this:

imports ...
TopLevelComp  = ...
MidLevelComps = ...
LowLevelComps = ...

content={
<>
<LinkTo modelType="Person" model={position.person} /> -{" "}
<LinkTo modelType="Position" model={position} />{" "}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last {" "} seems unnecessary

(size[0] - size[1]) * 0.17
)}
</Text>
{twoRows && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already check this value to be true, twoRows will always be true below

}
}
}
`
const transitionDuration = 200

const AVATAR_SIZE = 16

const ranks = Settings.fields.person.ranks.map(rank => rank.value)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is about line:71, this is the code that i am refering to:
ranks.indexOf(p1.person?.rank) > ranks.indexOf(p2.person?.rank) ? -1 : 1
We could simplify this like this:
ranks.indexOf(p2.person?.rank) - ranks.indexOf(p1.person?.rank)

@midmarch midmarch removed their request for review August 16, 2023 10:15
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

3 participants