polygerrit-ui: improve flow email validation UX and contextual error handling
This change resolves b/537010867 by introducing client-side email account validation during flow creation, suppressing disruptive global error dialogs, and providing inline feedback.
Product & Technical Decisions:
1. Debouncing Keystroke Lookups:
- Debounced stage parsing ('parseStagesFromRawFlow') by 300ms during raw flow editing to avoid hammering the backend 'getAccountDetails' REST API on every keystroke.
2. Contextual In-Modal Error Banners:
- Suppressed PolyGerrit's global 404 error toasts/dialogs during account lookups by passing a no-op error handler ('errFn').
- Replaced global error popups with a contextual '.error-banner' inside the modal itself, keeping the error state local to the authoring UI.
3. Live Preview Error Display:
- Updated '<gr-flow-rule>' parameter rendering to detect non-existent or invalid user IDs / email addresses and render an error state directly on the parameter chip in the live preview using 'EMAIL_PATTERN'.
4. Synchronous Flush on Submission:
- On clicking "Create Flow", any pending debounced parsing task is flushed synchronously ('parseStagesDebounced.flush()'), guaranteeing that inputs are validated immediately prior to dispatching the request.
Screenshots:
Error preview chip: https://screenshot-v2.corp.google.com/1vefvmslk6og0
Failure banner on attempted 'create flow': https://screenshot-v2.corp.google.com/174o5jb3kaepo
Success on valid userId: https://screenshot-v2.corp.google.com/74uk8q4itf86o
Release-Notes: Added client-side email validation and in-modal error handling when creating change flows in PolyGerrit UI.
TAG=agy
Google-Bug-Id: b/537010867
BUG=537010867
CONV=92d49428-aab5-4177-b1d2-6dc20cfe445a
Change-Id: I55af56aaf9e5365564259757c6068c8d4b975bd2Gerrit is a code review and project management tool for Git based projects.
Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.
Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.
For information about how to install and use Gerrit, refer to the documentation.
Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.
Please report bugs on the issue tracker.
Gerrit is the work of hundreds of contributors. We appreciate your help!
Please read the contribution guidelines.
Note that we do not accept Pull Requests via the Github mirror.
The Developer Mailing list is repo-discuss on Google Groups.
Gerrit is provided under the Apache License 2.0.
Install Bazel and run the following:
git clone --recurse-submodules https://gerrit.googlesource.com/gerrit
cd gerrit && bazel build release
The instruction how to configure GerritForge/BinTray repositories is here
On Debian/Ubuntu run:
apt-get update && apt-get install gerrit=<version>-<release>
NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.
On CentOS/RedHat run:
yum clean all && yum install gerrit-<version>[-<release>]
On Fedora run:
dnf clean all && dnf install gerrit-<version>[-<release>]
Docker images of Gerrit are available on DockerHub
To run a CentOS 8 based Gerrit image:
docker run -p 8080:8080 gerritcodereview/gerrit[:version]-centos8
To run a Ubuntu 20.04 based Gerrit image:
docker run -p 8080:8080 gerritcodereview/gerrit[:version]-ubuntu20
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.