Skip to content

Allow displaying children on Chrono node subview - #6117

Merged
CarolineDenis merged 3 commits into
productionfrom
issue-6086
Jan 22, 2025
Merged

Allow displaying children on Chrono node subview#6117
CarolineDenis merged 3 commits into
productionfrom
issue-6086

Conversation

@CarolineDenis

@CarolineDenis CarolineDenis commented Jan 17, 2025

Copy link
Copy Markdown
Contributor

Fixes #6086

Added a filterChronostrat param to specify_rows so that Chronostrats are only filtered when using the age picklist.

A potentially cleaner way to do this could be to pass an advancedFilter to fetchRows so that the filters we need (

filters.update({
'startperiod__isnull': False,
'endperiod__isnull': False,
'startperiod__gte': F('endperiod')
})
) can be passed directly from the frontend but I don't think it supports F expressions and so we would need a prop anyway. I figure this solution should suffice until there's a requirement for more flexible advancedFilters.
return fetchRows(tableName as keyof Tables, {
limit,
fields: { [fieldName]: ['string', 'number', 'boolean', 'null'] },
distinct: true,
domainFilter: true,
}).then((rows) =>
rows
.map((row) => row[fieldName] ?? '')
.map((value) => ({ value, title: value }))
);
}

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone

Testing instructions

@CarolineDenis CarolineDenis added this to the 7.9.11 milestone Jan 17, 2025
@sharadsw
sharadsw marked this pull request as ready for review January 21, 2025 19:15
@sharadsw
sharadsw requested a review from a team January 21, 2025 19:15

@emenslin emenslin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Verify that the child node does appear under the Child Nodes subview
  • Re-test #5411

Looks good

@emenslin
emenslin requested a review from a team January 21, 2025 21:49

@pashiav pashiav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Verify that the child node does appear under the Child Nodes subview
  • Re-test #5411

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

New Chronostrat nodes do not appear in Child Nodes subview

5 participants