Skip to content

feat(User Registrations): Migrate user registrations fab view #33631

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

Open
wants to merge 4 commits into
base: template_less
Choose a base branch
from

Conversation

msyavuz
Copy link
Member

@msyavuz msyavuz commented May 30, 2025

SUMMARY

Move user registrations fab view to frontend for themeability.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
image
After:
image

TESTING INSTRUCTIONS

Here's a sample config to access the page:

AUTH_USER_REGISTRATION = True
# The default user self registration role
AUTH_USER_REGISTRATION_ROLE = "Admin"
RECAPTCHA_PUBLIC_KEY = ""
RECAPTCHA_PRIVATE_KEY = ""
CSRF_ENABLED = True

MAIL_SERVER = "localhost"
MAIL_PORT = 1025
MAIL_USE_TLS = False
MAIL_USERNAME = "[email protected]"
MAIL_PASSWORD = "passwordformail"
MAIL_DEFAULT_SENDER = "[email protected]"
  1. Register as another user
  2. Don't confirm the registration email
  3. Log in as admin
  4. Go to User Registrations from the right menu.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

msyavuz added 2 commits May 30, 2025 15:36
…tend

file update

feat: add an api endpoint

feat(UserRegistrations): Working copy
Copy link

korbit-ai bot commented May 30, 2025

Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment /korbit-review.

Your admin can change your review schedule in the Korbit Console

@github-actions github-actions bot added the api Related to the REST API label May 30, 2025
@msyavuz msyavuz marked this pull request as ready for review May 30, 2025 16:00
@dosubot dosubot bot added the change:frontend Requires changing the frontend label May 30, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Security Sensitive Registration Hash Exposure ▹ view 🧠 Not in standard
Documentation Missing documentation for registration_hash field ▹ view 🧠 Not in scope
Performance Untyped Table Cell Components ▹ view 🧠 Incorrect
Error Handling Delete Modal Closes on Error ▹ view 🧠 Not in scope
Functionality Unformatted Date Display ▹ view 🧠 Incorrect
Files scanned
File Path Reviewed
superset/views/user_registrations.py
superset-frontend/src/views/routes.tsx
superset/security/api.py
superset-frontend/src/pages/UserRegistrations/index.tsx
superset/initialization/init.py
superset/security/manager.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines +350 to +358
list_columns = [
"id",
"username",
"email",
"first_name",
"last_name",
"registration_date",
"registration_hash",
]

This comment was marked as resolved.

Comment on lines +35 to +43
export type UserRegistration = {
id: number;
username: string;
first_name: string;
last_name: string;
email: string;
registration_date: string;
registration_hash: string;
};

This comment was marked as resolved.

Comment on lines +86 to +93
const columns = useMemo(
() => [
{
accessor: 'username',
id: 'username',
Header: t('Username'),
Cell: ({ row: { original } }: any) => original.username,
},

This comment was marked as resolved.

Comment on lines 66 to 82
const handleUserRegistrationDelete = async ({
id,
username,
}: UserRegistration) => {
try {
await SupersetClient.delete({
endpoint: `/api/v1/user_registrations/${id}`,
});
refreshData();
setUserRegistrationCurrentlyDeleting(null);
addSuccessToast(t('Deleted user registration for user: %s', username));
} catch (error) {
addDangerToast(
t('There was an issue deleting registration for user: %s', username),
);
}
};

This comment was marked as resolved.

accessor: 'registration_date',
id: 'registration_date',
Header: t('Registration date'),
Cell: ({ row: { original } }: any) => original.registration_date,

This comment was marked as resolved.

@rusackas rusackas requested review from rusackas and justinpark May 30, 2025 16:57
Copy link
Contributor

github-actions bot commented Jun 3, 2025

@geido Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments

Copy link
Contributor

github-actions bot commented Jun 3, 2025

@geido Ephemeral environment spinning up at http://44.248.206.145:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.

label=__("User Registrations"),
category="Security",
category_label=__("Security"),
icon="fa-user-plus",
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove this

@geido
Copy link
Member

geido commented Jun 3, 2025

Thanks for this! Let's fix conflicts and let's put it behind the registrations enablement feature flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the REST API change:frontend Requires changing the frontend size/L testenv-up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants