Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user email prefix to the console user create #2623

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

ptkach
Copy link
Collaborator

@ptkach ptkach commented Dec 12, 2024

This change is Reviewable

@ptkach ptkach requested a review from gbrodman December 12, 2024 20:30
Copy link
Collaborator

@gbrodman gbrodman left a comment

Choose a reason for hiding this comment

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

Reviewed 11 of 11 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ptkach)


console-webapp/src/app/users/users.service.ts line 63 at r1 (raw file):

  }

  createOrAddNewUser(maybeExistingUser: User) {

nit, but can rename this field to remove "maybe"


core/src/main/java/google/registry/ui/server/console/ConsoleUsersAction.java line 149 at r1 (raw file):

  private void runPostInTransaction() throws IOException {
    validateRequestParams();
    if (tm().loadByKeyIfPresent(VKey.create(User.class, this.userData.get().emailAddress))

can just use tm().exists right?


core/src/main/java/google/registry/ui/server/console/ConsoleUsersAction.java line 201 at r1 (raw file):

    String newEmailPrefix = userData.get().emailAddress.trim();

    if (newEmailPrefix.length() != 3 || !newEmailPrefix.matches("^\\p{Alnum}+$")) {

what's this prefix regex?


core/src/main/java/google/registry/ui/server/console/ConsoleUsersAction.java line 270 at r1 (raw file):

  private User verifyUserExists(String email) {
    return tm().loadByKeyIfPresent(VKey.create(User.class, email))

same here w/r/t exists

Copy link
Collaborator Author

@ptkach ptkach left a comment

Choose a reason for hiding this comment

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

Reviewable status: 8 of 12 files reviewed, 4 unresolved discussions (waiting on @gbrodman)


core/src/main/java/google/registry/ui/server/console/ConsoleUsersAction.java line 149 at r1 (raw file):

Previously, gbrodman wrote…

can just use tm().exists right?

Right


core/src/main/java/google/registry/ui/server/console/ConsoleUsersAction.java line 201 at r1 (raw file):

Previously, gbrodman wrote…

what's this prefix regex?

It's a way to match any alphanumeric caracters, including cyrillic. After giving it some more thoughts I've updated it.


core/src/main/java/google/registry/ui/server/console/ConsoleUsersAction.java line 270 at r1 (raw file):

Previously, gbrodman wrote…

same here w/r/t exists

Unlike the other one before, this one actually should stay as it is. Exists wouldn't fit here, because we want to return the user or throw

Copy link
Collaborator

@gbrodman gbrodman left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ptkach)


core/src/main/java/google/registry/ui/server/console/ConsoleUsersAction.java line 270 at r1 (raw file):

Previously, ptkach (Pavlo Tkach) wrote…

Unlike the other one before, this one actually should stay as it is. Exists wouldn't fit here, because we want to return the user or throw

oof yeah sorry


console-webapp/src/app/shared/services/backend.service.ts line 196 at r2 (raw file):

        catchError((err) =>
          this.errorCatcher<User>(err, {
            emailAddress: '[email protected]',

heh i think this snuck in


console-webapp/src/app/shared/services/backend.service.ts line 166 at r3 (raw file):

    return this.http
      .get<User[]>(`/console-api/users?registrarId=${registrarId}`)
      .pipe(

i think these snuck in from testing?

Copy link
Collaborator

@gbrodman gbrodman left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ptkach)

Copy link
Collaborator Author

@ptkach ptkach left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ptkach)


console-webapp/src/app/shared/services/backend.service.ts line 196 at r2 (raw file):

Previously, gbrodman wrote…

heh i think this snuck in

Yep


console-webapp/src/app/shared/services/backend.service.ts line 166 at r3 (raw file):

Previously, gbrodman wrote…

i think these snuck in from testing?

Yep

@ptkach ptkach enabled auto-merge December 13, 2024 18:55
@ptkach ptkach added this pull request to the merge queue Dec 13, 2024
Merged via the queue into google:master with commit f649d96 Dec 13, 2024
9 checks passed
@ptkach ptkach deleted the consoleUserName branch December 13, 2024 20:50
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