Skip to content

Add a button to cancel a pending registrant change - #240

Open
OlegPhenomenon wants to merge 1 commit into
mainfrom
issue-2939-cancel-pending-registrant-change
Open

OlegPhenomenon wants to merge 1 commit into
mainfrom
issue-2939-cancel-pending-registrant-change

Conversation

@OlegPhenomenon

Copy link
Copy Markdown
Contributor

Portal side of internetee/registry#2939. Depends on internetee/registry#2946, which adds the endpoint.

What

A registrant change that went pending could not be called back from the portal — the registrar had to wait 48 hours for it to expire, or ask the registry to clear it by hand.

The registry now exposes DELETE /repp/v1/domains/:domain_id/pending_update. This wires it up:

  • ApiConnector::Domains::PendingUpdateCanceller — modelled on Renewer, the existing connector that overrides url_with_id for a sub-resource.
  • DomainsController#cancel_pending_update — same shape as regenerate_transfer_code.
  • A flat named route declared before resources :domains, as with the other domain actions.
  • The button on the domain page, shown only when the domain carries pendingUpdate, mirroring the existing gate that hides Delete for pendingDelete domains. Turbo data-turbo-method="delete" with a confirmation, as on the transfer-code regenerate link.
  • domains.show.cancel_pending_update / _confirm in both en.yml and et.yml.

Errors need no special handling: the endpoint returns 2304 with HTTP 400 when there is no pending update, which handle_error_response already turns into a flash.alert.

Drive-by fix

statuses.{en,et}.yml had a stray quote in the pendingUpdate key, so it parsed as pendingUpdate" and t("statuses.domain.pendingUpdate") never resolved — the status chip rendered an empty title while its tooltip worked. The new button sits right next to that chip, so it is fixed here.

Two related defects are not touched, to keep this PR focused:

  • the same stray quote on ~13 server* keys and clientDeleteProhibited_text;
  • statuses.en.yml declares an et: root, so it is overridden by statuses.et.yml and there are no English status labels at all.

Worth a separate cleanup PR.

Tests

spec/controllers/domains_controller_spec.rb gets an entry in the options table plus the two cassettes. The success cassette returns a real 1000 payload so the controller's @response.domain[:name] is exercised rather than short-circuited.

Full suite: 255 examples, 1 failure — spec/features/managing_account_spec.rb:11, which fails on a clean main too (verified by stashing).

A registrant change that went pending could not be called back from the
portal: the registrar had to wait 48 hours for it to expire or ask the
registry to clear it by hand.

The registry now exposes DELETE /repp/v1/domains/:domain_id/pending_update
(internetee/registry#2939). Wire it up and show the button on the domain
page whenever the domain carries pendingUpdate, next to the existing
gate that hides Delete for pendingDelete domains.

While here, fix the pendingUpdate status label. The key carried a stray
quote, so it parsed as `pendingUpdate"` and the status chip rendered an
empty title while its tooltip worked. The new button sits right next to
that chip. The same defect affects the server-side status keys, and
statuses.en.yml declares an `et:` root; both are left for a separate
cleanup.
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Deploy Complete!

Property Value
App registrar
Slot 1
URL https://registrar1-dev.cloud.tld.ee
Namespace registrar1-dev

(Environment ready for testing)

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