-
Notifications
You must be signed in to change notification settings - Fork 187
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
Migrate Records Page to React #10623
base: main
Are you sure you want to change the base?
Conversation
Did a lot of refactoring to reduce code reuse |
<Button.Group id="state" size="small" compact primary> | ||
<Button.Group id="state" size="large" primary> |
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 intentional? It's unrelated to the records page.
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.
It's a change that Gregor did in the other PR and it affects the styling of the filter box. I will remove it when the other PR is merged
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 did? 😇 Please point me in the right direction, or at least explain when you want to undo it
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.
I don't think this file should have any changes at this point?
app/webpacker/components/Results/Records/SeparateRecordsTable.jsx
Outdated
Show resolved
Hide resolved
import { Table } from 'semantic-ui-react'; | ||
import I18n from '../../lib/i18n'; | ||
|
||
const headerConfig = { |
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.
Slightly confused why there are 4 configs and 4 header components but 5 'show categories'. Probably mixed-history re-uses either mixed or history, but it's not immediate to trace down.
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.
Yes, history and mixed history have the same headers, just with one more column for events so it has the conditional rendering
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.
Chiming in to note that I'd be happy to see a short comment explaining the Array(4).fill('')
s. (Probably one comment to explain all of them is enough)
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.
<Button.Group id="state" size="small" compact primary> | ||
<Button.Group id="state" size="large" primary> |
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 did? 😇 Please point me in the right direction, or at least explain when you want to undo it
import { Table } from 'semantic-ui-react'; | ||
import I18n from '../../lib/i18n'; | ||
|
||
const headerConfig = { |
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.
Chiming in to note that I'd be happy to see a short comment explaining the Array(4).fill('')
s. (Probably one comment to explain all of them is enough)
if (region !== 'world') { | ||
queryParams.append('region', region); | ||
} | ||
|
||
if (gender !== 'All') { | ||
queryParams.append('gender', gender); | ||
} | ||
|
||
if (eventId){ | ||
queryParams.append('event_id', eventId) | ||
} | ||
|
||
if (show){ | ||
queryParams.append('show', show) | ||
} |
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.
See my comment on the Rankings PR about redundant-but-not-redundant parameters ;)
58e2216
to
2a0eac4
Compare
2a0eac4
to
e299904
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.
I can/will make some improvements to my recent Competitors tanstack table PR based on what I've seen here.
<Button.Group id="state" size="small" compact primary> | ||
<Button.Group id="state" size="large" primary> |
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 think this file should have any changes at this point?
} | ||
|
||
export default function ResultsFilter({ | ||
filterState, filterActions, showCategories, isRecords, |
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 the prop names should be declarative rather than assuming information about the parent. So I'd rename isRecords
to selectAllEventsIsAllowed
or allowSelectingAllEvents
. But then the logic is kind of mixed between this prop and the filterActions
, which feels a bit off. And that might change based on the outcome of my previous comment.
cell.column.columnDef.isMultiAttemptsHack | ||
? ( | ||
<React.Fragment key={cell.id}> |
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 was wondering how this was going to work - and seems the answer is 'not well'.
I also thought this was some kind of exception for mbf for a long time.
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.
Hm... I could play around with trying to align it using a sub-header, but if the answer is not forthcoming after ~30 minutes I will just let it be.
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.
Hm, it is easy to specify but cumbersome to style. If you have a definition similar to
[
{ accessorKey: 'competitionName' },
{ accessorKey: 'personName' },
{ header: 'Successful solves', columns: [
{ accessorKey: 'value1' },
{ accessorKey: 'value2' },
{ accessorKey: 'value3' },
] }
]
then Tanstack pushes the competition name and person name header down to be on the same level as the header for value1
, value2
, etc.
In other words, it always pushes down individual column headings as far down as possible. If we could instead set this to pull them up as far as possible, I can adjust the rowSpan
to make it look nice.
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.
Couldn't find anything in their documentation, so I will go ahead and raise an Issue / discussion
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 there is TanStack/table#5051 but no official word on whether or when this will be officially supported.
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.
I think the header margins make this look a bit bloated... Also, it's gonna be tricky figuring out which results to wrap
Co-authored-by: Kevin Matthews <[email protected]>
Still need to do some of the other table types, but it's very similar to the rankings page