-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: progress bar in my sites #1189
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Luke McFarlane <[email protected]>
Signed-off-by: Luke McFarlane <[email protected]>
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.
Signed-off-by: Luke McFarlane <[email protected]>
Signed-off-by: Luke McFarlane <[email protected]>
@PeterBaker0 issues above resolved |
Signed-off-by: Peter Baker <[email protected]>
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.
Mildly concerned about performance implications of fetching all data for all entries in the record list on every remount. Also not sure on layout efficiency - want to wait until Ranisa's PRs are resolved to see how it could fit in updated layout.
useEffect(() => { | ||
const getData = async () => { | ||
try { | ||
if (query.length === 0) { | ||
const ma = await getMetadataForAllRecords( | ||
props.project_id, | ||
props.filter_deleted | ||
); | ||
setPouchData(ma); | ||
} else { | ||
const ra = await getRecordsWithRegex( | ||
props.project_id, | ||
query, | ||
props.filter_deleted | ||
const records = ( | ||
query.length === 0 | ||
? await getMetadataForAllRecords( | ||
props.project_id, | ||
props.filter_deleted | ||
) | ||
: await getRecordsWithRegex( | ||
props.project_id, | ||
query, | ||
props.filter_deleted | ||
) | ||
) as RecordMetaDataExtended[]; | ||
|
||
for (const record of records) { | ||
const data = await getFullRecordData( | ||
record.project_id, | ||
record.record_id, | ||
record.revision_id | ||
); | ||
setPouchData(ra); | ||
|
||
if (!data) continue; | ||
|
||
record.record = data; | ||
} | ||
|
||
setPouchData(records); |
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 is probably going to conflict with my pending PR #1199 which moves this into a react query - but that's okay we can fix it up
for (const record of records) { | ||
const data = await getFullRecordData( | ||
record.project_id, | ||
record.record_id, | ||
record.revision_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.
Performance concerns here possibly - but we'll see.
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.
For the PR to display summary fields in the record table we'll be grabbing the whole record data so this would not be necessary. A few interacting changes going on here. Can this be deferred?
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, we can defer this one
app/src/lib/queries.ts
Outdated
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.
cool - I think there is a space for hooks already though
Not what you're doing here but your earlier progress bar breaks the rules by updating the parent component (Record) while rendering the child RecordForm. The call to setProgress in RecordForm.render is the problem, it needs to move out of render and into one of the other methods. See the console when you render a form for the warning. |
JIRA Ticket
BSS-375
Description
Added progress bar to sites table in mobile view.
Proposed Changes
How to Test
Additional Information
Checklist