Skip to content

Require Web API 3.10#1097

Open
DavidMStraub wants to merge 2 commits intogramps-project:mainfrom
DavidMStraub:require_api_310
Open

Require Web API 3.10#1097
DavidMStraub wants to merge 2 commits intogramps-project:mainfrom
DavidMStraub:require_api_310

Conversation

@DavidMStraub
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns the frontend with a “Web API ≥ 3.10” baseline by removing conditional feature-gates and always sending/allowing parameters that were previously only enabled for v3.10+.

Changes:

  • Always append precision=1 when fetching people and families.
  • Always include/support gender value 3 (“Other”) in new-person forms and the gender edit cycle.
  • Remove now-unneeded apiVersionAtLeast imports and related branching logic.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/views/GrampsjsViewPerson.js Always requests precision=1 for person fetch URL (removes API version check).
src/views/GrampsjsViewFamily.js Always requests precision=1 for family fetch URL (removes API version check).
src/mixins/GrampsjsNewPersonMixin.js Always exposes gender option Other (value 3) instead of gating by API version.
src/components/GrampsjsEditGender.js Always cycles through gender 0→1→2→3→0 and removes backend capability check.
Comments suppressed due to low confidence (1)

src/components/GrampsjsEditGender.js:58

  • Now that the cycle always includes gender value 3, clicking will emit updates that backends < 3.10 may reject (this was previously version-gated). Because the current app-level minimum-version check only shows an error and doesn’t block usage, this can turn a “warning” into a hard failure. Either enforce the 3.10+ requirement globally, or keep a capability/version check in this component before cycling to 3.
  _handleClick() {
    const cycle = {0: 1, 1: 2, 2: 3, 3: 0}
    fireEvent(this, 'edit:action', {
      action: 'updateProp',
      data: {gender: cycle[this.gender] ?? 0},
    })

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/GrampsjsEditGender.js
Comment thread src/views/GrampsjsViewPerson.js
Comment thread src/views/GrampsjsViewFamily.js
Comment thread src/mixins/GrampsjsNewPersonMixin.js
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/components/GrampsjsEditGender.js:56

  • Gender cycling now always includes value 3 (Other). If the frontend can still run against Web API versions that don’t support this enum value, clicking the button can emit an update that the backend rejects. Either reintroduce backend-version gating here, or make the minimum API version enforcement a hard stop before users can edit data.
  _handleClick() {
    const cycle = {0: 1, 1: 2, 2: 3, 3: 0}
    fireEvent(this, 'edit:action', {
      action: 'updateProp',
      data: {gender: cycle[this.gender] ?? 0},
    })

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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