-
Notifications
You must be signed in to change notification settings - Fork 4
Allow primary columns without getLink #68
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
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.
Seems sensible enough, just a few non-blocking questions.
@@ -174,7 +174,7 @@ docs = unit # make component { initialState, render } | |||
, filterLabel: notNull "Product title" | |||
, sortBy: null | |||
, style: css {} | |||
, getLink: _.link | |||
, getLink: null -- notNull _.link |
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.
Did you mean to uncomment this?
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.
Doesn't matter too much either way
src/Lumi/Components/Table.purs
Outdated
primaryColumn = toMaybe self.props.primaryColumn | ||
primaryColumn = cleanUpNullables <$> toMaybe self.props.primaryColumn | ||
where | ||
cleanUpNullables |
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.
Was there a particular reason not to write this as cleanUpNullables r = r { getLink = toMaybe r.getLink }
?
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.
Ohh, I forgot you could change the record type if the labels have the same names, thanks
@@ -77,7 +77,7 @@ type TableProps row = | |||
, filterLabel :: Nullable String | |||
, sortBy :: Nullable ColumnName | |||
, style :: R.CSS | |||
, getLink :: row -> URL | |||
, getLink :: Nullable (row -> URL) |
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.
Is this Nullable (as opposed to Maybe) because it's still being used from JS?
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 think we've just recently migrated all the JS usage, so this is just matching the existing API until we change them all to Maybes
Primary columns offer a few features besides row linking, like not being sortable or hideable. This allows the use of these primary column features without entire row linking.