Skip to content

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

Merged
merged 3 commits into from
Jun 28, 2019

Conversation

maddie927
Copy link
Member

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.

@maddie927 maddie927 self-assigned this Jun 25, 2019
Copy link
Contributor

@hdgarrood hdgarrood left a 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
Copy link
Contributor

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?

Copy link
Member Author

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

primaryColumn = toMaybe self.props.primaryColumn
primaryColumn = cleanUpNullables <$> toMaybe self.props.primaryColumn
where
cleanUpNullables
Copy link
Contributor

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 }?

Copy link
Member Author

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)
Copy link
Contributor

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?

Copy link
Member Author

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

@maddie927 maddie927 merged commit 8b2ea04 into master Jun 28, 2019
@maddie927 maddie927 deleted the madeline/optional-table-links branch June 28, 2019 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants