Skip to content

Commit ad8114d

Browse files
authored
MDC Migration: Fix styling for runs table context menu (tensorflow#6607)
## Motivation for features / changes After migrating to the new Material Components many of the styles were broken. This cleans up the buttons in the runs table context menu. ## Screenshots of UI changes (or N/A) <img width="196" alt="Screenshot 2023-09-28 at 2 59 22 PM" src="https://github.com/tensorflow/tensorboard/assets/8672809/01ef7e8e-7ea0-4de6-ae75-c9fc232e0549"> <img width="196" alt="Screenshot 2023-09-28 at 2 59 12 PM" src="https://github.com/tensorflow/tensorboard/assets/8672809/21842916-7805-4aa2-baec-8357ac5ec77f">
1 parent c47369b commit ad8114d

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

tensorboard/webapp/widgets/data_table/data_table_component.ng.html

+14-12
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,24 @@
2626
<mat-icon svgIcon="close_24px"></mat-icon>Remove
2727
</button>
2828
<button
29-
*ngIf="contextMenuHeader?.sortable"
29+
*ngIf="contextMenuHeader?.sortable &&
30+
sortingInfo.order === SortingOrder.ASCENDING &&
31+
sortingInfo.name === contextMenuHeader?.name"
3032
class="context-menu-button sort-button"
3133
mat-button
3234
(click)="sortByHeader(contextMenuHeader?.name)"
3335
>
34-
<ng-container
35-
*ngIf="
36-
sortingInfo.order === SortingOrder.ASCENDING &&
37-
sortingInfo.name === contextMenuHeader?.name;
38-
else descending"
39-
>
40-
<mat-icon svgIcon="arrow_downward_24px"></mat-icon>Sort Descending
41-
</ng-container>
42-
<ng-template #descending>
43-
<mat-icon svgIcon="arrow_upward_24px"></mat-icon>Sort Ascending
44-
</ng-template>
36+
<mat-icon svgIcon="arrow_downward_24px"></mat-icon>Sort Descending
37+
</button>
38+
<button
39+
*ngIf="contextMenuHeader?.sortable &&
40+
(sortingInfo.order !== SortingOrder.ASCENDING ||
41+
sortingInfo.name !== contextMenuHeader?.name)"
42+
class="context-menu-button sort-button"
43+
mat-button
44+
(click)="sortByHeader(contextMenuHeader?.name)"
45+
>
46+
<mat-icon svgIcon="arrow_upward_24px"></mat-icon>Sort Ascending
4547
</button>
4648
<button
4749
*ngIf="contextMenuHeader?.filterable"

tensorboard/webapp/widgets/data_table/data_table_component.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ $_accent: map-get(mat.get-color-config($tb-theme), accent);
6666
}
6767

6868
.context-menu-button {
69-
text-align: left;
69+
justify-content: left;
7070
width: 100%;
71+
text-wrap: nowrap;
7172
}
7273

7374
.no-actions-message {

0 commit comments

Comments
 (0)