-
Notifications
You must be signed in to change notification settings - Fork 90
'Canvas View': pfCanvas & pfCanvasEditor - Contribution from MiQ/SUI #410
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
'Canvas View': pfCanvas & pfCanvasEditor - Contribution from MiQ/SUI #410
Conversation
@dtaylor113 thanks for finishing this off so quickly! AFAIK, the remaining issues in PTNFLY-2197 are not needed. @catrobson, can you confirm? |
@serenamarie125, @catrobson, ok on PTNFLY-2197, but just want to make sure you see the other 'Canvas View' stories which are linked to PTNFLY-2197:
|
@bleathem @jeff-phillips-18 @dlabrecq @dgutride is it possible to get some eyes on this? This is something that we pushed to get @dtaylor113 to complete last week, since once of Cat's products is waiting for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of code! I went through it best I could given the size and time constraints.
There are directives being added which should be components. This version of angular patternfly should have no directives (or at least only those that are not components).
Concerned about including JQuery but since the module is optional, I guess it's OK as long as we don't pull any jquery packages by default.
package.json
Outdated
@@ -12,6 +12,9 @@ | |||
"angular-animate": "1.5.*", | |||
"angular-sanitize": "1.5.*", | |||
"angular-ui-bootstrap": "2.3.x", | |||
"angular-dragdrop": "1.0.13", | |||
"angular-svg-base-fix": "2.0.0", | |||
"angular-dragdrop": "1.0.13", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included angular-dragdrop twice. Should this be a dependency or devDependency? If it is Opt In, maybe better to be a devDependency so applications not using the canvas do not get this, those that opt in will have to specifically include it.
newNodeCount++; | ||
newNode.x = event.clientX - 600; | ||
newNode.y = event.clientY - 200; | ||
newNode.backgroundColor = newNode.backgroundColor ? newNode.backgroundColor : '#fff'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use pfUtils.colorPalette.white
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird, but there isn't a 'white' in patternfly.pfPaletteColors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that is silly...
newNodeCount++; | ||
newNode.x = 250 + (newNodeCount * 4 + 160); | ||
newNode.y = 200 + (newNodeCount * 4 + 160); | ||
newNode.backgroundColor = newNode.backgroundColor ? newNode.backgroundColor : '#fff'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use pfUtils.colorPalette.white
} | ||
} | ||
.not-draggable { | ||
background-color: #ebebeb; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Palette color?
// Directive that generates the rendered chart from the data model. | ||
// | ||
.directive('pfCanvas', function ($document) { | ||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, however it is not a requirement for this initial PR which requires pfCavnasView to be a component to be accessed in an Angular2 'hybrid mode'. Converting pfCanvas to a component would allow Angular2 folks to access the basic canvas component (without toolbox & zoom) -which I'm not sure is a use case. I've captured this in PTNFLY-2197: Remaining Issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the requirement for the 4.x release was to use components. We converted all the directives to components and don't think we should, at this point, introduce new directives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I agree, but it will take a significant rewrite of that core directive in order to convert it to a component. The main pfCanvasEditor is a component and is what end users can/will access from a hybrid angular 2 setup. @dgutride and I talked about that child/sub directives used in component templates were ok (not ideal), as long as the parent was a component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I would have preferred not to introduce directives but I guess this could be refactored at a later time.
src/canvas-view/canvas/canvas.less
Outdated
.invalid-node-header { | ||
fill: #b1b3b6; | ||
color: #b1b3b6; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Palette colors
src/canvas-view/canvas/canvas.less
Outdated
fill: transparent; | ||
stroke-width: 2; | ||
stroke: #0000ff; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Palette color?
src/canvas-view/canvas/canvas.less
Outdated
position: relative; | ||
&::after { | ||
border-bottom-color: @color-pf-white; | ||
border-color: #333333; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Palette color
src/canvas-view/examples/canvas.js
Outdated
width: 99%; | ||
} | ||
</style> | ||
<div ng-controller="CanvasDemoCtrl" class="example-container"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These styles should go into the examples css
"y": 67, | ||
"id": 1, | ||
"image": "/img/OpenShift-logo.svg", | ||
"width": 150, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid using project related images and use generic images and names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are included in core Patternfly dist/img.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. My suggestion was to use generic items rather than storage specific items ie 'Dolor' rather than 'OpenShift'
Some alignment issues here: Hide connectors is not centered on the toggle |
Besides clicking on the Add Item again to close the add area, we should put a dismiss button in the upper right (x). Clicking on anywhere on the Canvas will close the Toolbox as well. |
It is odd to me to have the filter below the items, everywhere else we have filtering above. |
Hi, addressed most issues raised by Jeff. @serenamarie125 , please let me know your thoughts on Jeff's last two comments on the 'X' to close the toolbox and the placement of the toolbox filter. Please let me know if you'd like me to work on these now, or add them to the JIRA story. -thanks |
@@ -39,7 +39,7 @@ | |||
vertical-align: middle; | |||
} | |||
.show-hide-connectors-label { | |||
vertical-align: text-bottom; | |||
vertical-align: 2px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the vertical-align setting all together seems to make it line up better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
position: relative; | ||
width: 100%; | ||
.canvas-editor-toolbox { | ||
background-color: rgba(255, 255, 255, 0.94); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want less than full opacity for this? It looks odd to me having the node items bleed through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm..the original mockups specifically showed the items showing through the toolbox...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking at https://github.com/patternfly/patternfly-design/blob/master/pattern-library/content-views/canvas-view/design/design.md
I see the x to dismiss and a gray background not translucent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I'm talking way back to Colleen's original InVision mockups. I'm not sure the current design you mention above actually shows nodes behind the toolbox, and that they are hidden by the toolbox.
Either way is fine with me, easy enough to change the value 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That design is rather recent, and is somewhat incomplete as it doesn't show the Filter in the Toolbox or the Hide Connections checkbox.
Thanks for the thorough review @jeff-phillips-18! |
@dtaylor113 those two remaining issues @jeff-phillips-18 requested sound to be low hanging fruit. Are they things that could be knocked off quickly ? |
@serenamarie125, it was more a question of if you agree with the changes. I can start work on them now. Just don't know if this is holding up a release? ( @bleathem ) |
ced8a7a
to
982290f
Compare
I meant the "x" to close the add and the vertical alignment of the hide connectors :) @dtaylor113 |
I think the other things we can hold off. Media Drive should be able to use these, and we can do a secondary review on this later on, imo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I'm going to note that we need to schedule a design review of this after this merge, and if additional issues are found, we will create an Issue or add to pivotal. Thanks @dtaylor113 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Ok, this is HUGE! -as in a lot of code 😄 Six months work plus the original open source core lib code.
pfCanvasEditor

In Connection Mode:
Some Notes:
PTNFLY-2193: Unit Tests
PTNFLY-2197: Remaining Issues (contains links to the other Canvas View JIRA stories)
@serenamarie125, @bleathem, @catrobson