-
Notifications
You must be signed in to change notification settings - Fork 11
feat: string enum table cell renderer #787
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
Conversation
box-sizing: border-box; | ||
} | ||
|
||
strong { |
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.
Unrelated to this change, but needed for another.
Codecov Report
@@ Coverage Diff @@
## main #787 +/- ##
==========================================
+ Coverage 85.40% 85.42% +0.01%
==========================================
Files 791 792 +1
Lines 16156 16161 +5
Branches 2060 2060
==========================================
+ Hits 13798 13805 +7
+ Misses 2327 2325 -2
Partials 31 31
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
changeDetection: ChangeDetectionStrategy.OnPush, | ||
template: ` | ||
<div | ||
[ngClass]="{ clickable: this.clickable, 'first-column': this.isFirstColumn }" |
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.
what advantage do we get compared to directly supplying the startcased enum value to a regular string cell renderer?
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.
Nothing other than this does the text presentation for you. It has been coming up more and more, so this is a convenience, but it also feels (at least to me) more correct to have the presentation logic in the cell renderer rather than pre-formatting it before passing it in.
@import 'color-palette'; | ||
|
||
:host { | ||
overflow: hidden; |
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.
why is this needed?
alignment: TableCellAlignmentType.Left, | ||
parser: CoreTableCellParserType.String | ||
}) | ||
export class StringEnumTableCellRendererComponent extends TableCellRendererBase<string> {} |
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.
nit: IMO, the name 'String Enum' is not very clear. Or we can at least add similar comments from htDisplayStringEnum
here too
// This removes dashes and underscores and gives all words initial caps
// We only want the first word capitalized.
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 always struggle with names, but also always open to suggestions.
I've added the comment in my local. That should help some. Not worth holding up this PR for, but I'll commit them in whatever next HT PR I have.
This comment has been minimized.
This comment has been minimized.
padding: 2px 4px; | ||
} | ||
|
||
q { |
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.
what are these for?
Description
Added table cell renderer to format string enums into more human readable text.