-
Notifications
You must be signed in to change notification settings - Fork 113
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
Updates to desktop dashboard grid layout #3670
Conversation
5d43cf8
to
01d3abb
Compare
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.
working great for me locally!!
<h3>Check-in History <span *ngIf="showCheckinDebug">(debug)</span></h3> | ||
<div class="heading-actions"> | ||
<chef-button secondary (click)="showCheckinDebug = !showCheckinDebug"> | ||
<chef-icon>settings</chef-icon> | ||
</chef-button> | ||
<chef-button secondary (click)="checkinNumDays = (checkinNumDays === 14 ? 28 : 14)"> | ||
<span>Last {{ (checkinNumDays === 14 ? 2 : 4) }} Weeks</span> | ||
<chef-icon>expand_more</chef-icon> | ||
</chef-button> | ||
<chef-button secondary> | ||
<span>Download</span> | ||
<chef-icon>expand_more</chef-icon> | ||
</chef-button> | ||
</div> | ||
</div> | ||
<div class="debug-actions" *ngIf="showCheckinDebug"> |
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.
Huh could've sworn I deleted that .log
. But yea, I did want to leave in the rest of the bits for demo and debugging purposes while the final checkin graph area is still being worked on.
<chef-td [ngSwitch]="day.daysAgo"> | ||
<ng-container *ngSwitchCase="0">Today</ng-container> | ||
<ng-container *ngSwitchCase="1">Yesterday</ng-container> | ||
<ng-container *ngSwitchDefault>{{ day.daysAgo }} days ago</ng-container> | ||
</chef-td> |
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.
never seen ngSwitchCase before - this is sweet 🥇
} | ||
|
||
.dashboard-grid { | ||
@extend .bx--grid; |
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.
extend rules 👍
for anyone looking for more info: https://css-tricks.com/the-extend-concept/
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.
Agreed. This pattern is pretty much required for this view anyway. The first iterations I had used the grid classNames directly in the HTML. It quickly became a bit unwieldy to have chunks of code like [ngClass]="{'bx--col-lg-8': !insightVisible, 'bx--col-lg-16': insightVisible}"
all over the place
components/automate-ui/src/app/modules/desktop/desktop-detail/desktop-detail.component.html
Outdated
Show resolved
Hide resolved
<div class="button-toggle"> | ||
<chef-button secondary (click)="checkinTableType = 'grid'"> | ||
<chef-icon>view_module</chef-icon> | ||
</chef-button> | ||
<chef-button secondary (click)="checkinTableType = 'list'"> | ||
<chef-icon>view_list</chef-icon> | ||
</chef-button> | ||
<chef-button secondary (click)="checkinTableType = 'json'"> | ||
<chef-icon>code</chef-icon> | ||
</chef-button> | ||
<span>{{ checkinTableType }}</span> | ||
</div> | ||
|
||
<div class="button-toggle"> | ||
<span>{{ checkinGridFlexType }}</span> | ||
<chef-button secondary (click)="checkinGridFlexType = 'wrap'"> | ||
<chef-icon>wrap_text</chef-icon> | ||
</chef-button> | ||
<chef-button secondary (click)="checkinGridFlexType = 'stretch'"> | ||
<chef-icon>dehaze</chef-icon> | ||
</chef-button> |
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 don't see this in the mockup but this is rad and I hope becomes a feature.
components/automate-ui/src/app/modules/desktop/desktop-detail/desktop-detail.component.html
Outdated
Show resolved
Hide resolved
components/automate-ui/src/app/modules/desktop/insight/insight.component.html
Outdated
Show resolved
Hide resolved
const historyTypes = [ | ||
{ text: 'converged', icon: 'check_box' }, | ||
{ text: 'unchanged', icon: 'indeterminate_check_box' }, | ||
{ text: 'error', icon: 'error' }, | ||
{ text: 'unknown', icon: 'help' } | ||
]; | ||
|
||
const checkinHistory = Array.from(new Array(29)).map((_v, i) => { | ||
const historyType = historyTypes[Math.floor(Math.random() * historyTypes.length)]; | ||
const date = new Date(); | ||
return { ...historyType, date: new Date(date.setDate(date.getDate() - i)) }; | ||
}); |
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 know this pr is more about the Grid - but maybe add some Types if for this, unless this is planning to change later
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 was just for demo purposes. I'm not sure yet what the API responses are/will be for the desktop checkin history graph. Most of the code changes made in .component.ts
files are either to be replaced by ngrx related stuff and/or only for demo purposes.
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.
#3639 -- just linking that here as a reference for the future work
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 is coming together so amazing. Left a few comments but nothing serious - Mostly just some debugger/commented out code left behind that may still be there on purpose.
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.
@scottopherson can you make the card headings h2's instead of divs? also it would be rad if we can get those big filter buttons to be tabbable along with the table rows that you can select to open the additional cards.
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.
Looking Sharp!
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.
Looks Awesome 🙌🏻
a272325
to
bb8a74b
Compare
@susanev made those heading updates and made the various selectable filters/rows keyboard selectable. Though I believe there's probably some more details to work out with the focus behavior between the opened/closed panels but I'd like to address those in later iterations. |
c2c1565
to
8460d5c
Compare
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.
thanks for all of ur work on this!!!
This commit contains an incremental update to the layout skeleton of the Desktop dashboard view and to the components displayed within it. It utilizes the Carbon grid system and some generic components already available within Automate to bring the functionality and styling of this view a little bit closer to the final production implementation. Signed-off-by: Scott Christopherson <scott@chef.io>
8460d5c
to
774f12b
Compare
Shoutout @lancewf it has been easy and low-friction to build on top of his work. |
🔩 Description: What code changed, and why?
This commit contains an incremental style update to the layout skeleton of the Desktop dashboard view and to the components displayed within it. It utilizes the Carbon grid system and some generic components already available within Automate to bring the functionality and styling of this view a little bit closer to the final production implementation.
More screenshots
⛓️ Related Resources
https://github.com/chef/chef-design-system/issues/11
#3517
👟 How to Build and Test the Change
npm install
if you haven't updated from master recently to get new Carbon grid depa2-dev.test/desktop
✅ Checklist