Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

🐛 Preserve integer types in Admin Portal filters (release/10.0) - #4122

Merged
Findeton merged 2 commits into
release/10.0from
fix/meta-14609/release/10.0
Oct 31, 2026
Merged

Findeton merged 2 commits into
release/10.0from
fix/meta-14609/release/10.0

Conversation

@Findeton

@Findeton Findeton commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Parent issue: https://github.com/sequentech/meta/issues/14609

Admin Portal list filters can send min_votes: "42" as _eq: "42", which GraphQL rejects for an integer column. Convert valid signed 32-bit decimal strings for schema-declared Int/Int! fields to numbers before building the query. Numeric-looking text fields retain their strings and leading zeroes; invalid/out-of-range input is not silently rounded or replaced.

Scope: plain top-level GET_LIST field filters. Raw filters, arrays, operator-suffixed keys, other scalar types and Keycloak voter attributes retain their existing behavior. There is no confirmed Worker ID reproducer, so this PR does not claim to fix that separate case.

Named archive and delete confirmations

This PR also names the target in the Admin Portal side tree's event archive, unarchive and delete confirmations, and its election, contest and candidate delete confirmations. Instead of the generic "Are you sure to delete this item?", the dialog asks, for example, Are you sure you want to delete "Board 2026"?.

  • The name is the one the tree already shows, from the existing alias helper (useAliasRenderer: alias, then name, in the admin's language, then the fallback languages). An item with neither an alias nor a name keeps the existing generic message.
  • New archiveNamed, unarchiveNamed and deleteNamed keys with {{name}} in all eight Admin Portal languages (en, es, cat, eu, fr, gl, nl, tl), quoting names with straight double quotes as these files already do. The existing generic messages are unchanged.
  • The message is rendered as React text, so markup in a name is shown literally, not interpreted.
  • These actions use the shared side-tree menu; no separate list or detail-page action required changes.

Validation of this addition on felix3 at c582fbb2b64ccd75b6713b7303787e2226f998f0 (synthetic data only; no record was archived or deleted and no dialog was confirmed):

  • New menuActionConfirmMessage.test.ts (real en/es/fr translations and the real alias helper): alias, admin-language name, English fallback, missing/blank names, and markup rendered with renderToStaticMarkup as escaped text: 6 passed.
  • Full Admin Portal suite: 48 suites, 310 tests passed.
  • npx tsc --noEmit -p . for the Admin Portal: exit 0, no errors.
  • Prettier and ESLint pass on the changed files.

Independent review: a separate Claude reviewer subagent in this Claude Code session reviewed all four variants of this addition. It found no bugs. Its points were fixed where they applied to this branch (listed above), and two wording nits were left for consistency with the existing strings: the Catalan "segur de que" phrasing, and straight rather than French « » quotes. This is an automated review, not a human approval.

Validation on felix4 at d82170beb6886675644a92232650cfacb618c8b9:

  • Six regression cases failed on the original base and pass with the fix, using the real query builder and this branch's checked-in schema.
  • npx jest src/queries/customBuildQuery: 25 passed. Full Admin Portal suite: 304 tests passed.
  • Changed-file ESLint, Prettier and REUSE checks pass.
  • Full TypeScript checking has pre-existing errors; the normalized error set is identical before/after, with none in the changed files. Tests used Node 22.23.3 and locked dependencies.

Implementation: Claude RC on felix4. Independent review completed on 2026-10-31 in the separate Claude RC session on felix4: no blocking findings or regressions within the stated scope. At d82170beb6886675644a92232650cfacb618c8b9, the reviewer independently reproduced six failures on the original base and passed all 26 focused tests and probes on the fix. ESLint, Prettier and REUSE checks passed. The independently rerun head TypeScript error set matches the previously recorded base set, with no errors in the changed files. All eight screenshots were visually inspected and cross-checked against independent probe outputs. The filter-form limitations stated above remain unchanged. This is an automated review result, not a human approval.

Actual Chromium screenshots below show a focused synthetic query-builder fixture, not the full Admin Portal UI or a live Hasura server. Fixture source, captured JSON and limitations.

Before / after: release/10.0

Before: quoted integer rejected

After: integer accepted, text preserved

ra-data-hasura forwards filter values as they are, so a text input or a
filter restored from the URL sends a GraphQL Int column a string such as
{_eq: "42"}, which the GraphQL API rejects. Before delegating a GET_LIST,
convert filter values that are valid GraphQL Int literals to numbers for
columns the introspected schema types as Int. String columns, values that
are already numbers, raw Hasura filters, and anything that is not a valid
32-bit integer are left exactly as typed.

Parent issue: sequentech/meta#14609

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PPURaZn5c7HpSmmqmgF39
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…release/10.0)

The tree's archive, unarchive and delete confirmations for election
events, elections, contests and candidates now name the item, using the
alias the tree shows (useAliasRenderer), e.g. 'Are you sure you want to
delete "Board 2026"?'. Items with neither an alias nor a name keep the
generic message. New archiveNamed, unarchiveNamed and deleteNamed keys
are added in every Admin Portal language.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0129Cs8ygVE7UH6N1XzXk8WP
@Findeton
Findeton marked this pull request as ready for review October 31, 2026 23:26
@Findeton
Findeton merged commit fac98c3 into release/10.0 Oct 31, 2026
32 checks passed
@Findeton
Findeton deleted the fix/meta-14609/release/10.0 branch October 31, 2026 23:26
BelSequent added a commit that referenced this pull request Nov 2, 2026
Brings the electoral-log outbox (#3637), the signed CastVote stored with
the vote (#4104) and the admin-portal integer filters (#4122).

Conflicts, resolved as in the topics' PRs, which merged the same
release/10.0 first:
- packages/windmill/src/tasks/electoral_log.rs: taken from C120's PR
  (meta-13964, step#3633). Its internal-message check now sits in
  prepare_log_event(); a message that fails it goes to the dead-letter
  queue. No other topic touches the file.
- insert_cast_vote_database_tests.rs: release's outbox test module, then
  C124's and C66's appended tests.

Every line where the branch differs from release/10.0 comes from a
topic's current PR diff, apart from the CI commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant