alexandrusoare commented on code in PR #33631:
URL: https://github.com/apache/superset/pull/33631#discussion_r2116191173


##########
superset/initialization/__init__.py:
##########
@@ -281,6 +286,15 @@ def init_views(self) -> None:
             icon="fa-lock",
         )
 
+        appbuilder.add_view(
+            UserRegistrationsView,
+            "User Registrations",
+            label=__("User Registrations"),
+            category="Security",
+            category_label=__("Security"),
+            icon="fa-user-plus",
+        )

Review Comment:
   The icon is unnecessary



##########
superset-frontend/src/pages/UserRegistrations/index.tsx:
##########
@@ -0,0 +1,238 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { useMemo, useState } from 'react';
+import { SupersetClient, t } from '@superset-ui/core';
+import { useListViewResource } from 'src/views/CRUD/hooks';
+import { useToasts } from 'src/components/MessageToasts/withToasts';
+import {
+  ListViewFilters,
+  ListViewFilterOperator,
+  ListView,
+  DeleteModal,
+} from 'src/components';
+import { ActionProps, ActionsBar } from 'src/components/ListView/ActionsBar';
+import SubMenu from 'src/features/home/SubMenu';
+
+const PAGE_SIZE = 25;
+
+export type UserRegistration = {
+  id: number;
+  username: string;
+  first_name: string;
+  last_name: string;
+  email: string;
+  registration_date: string;
+  registration_hash: string;
+};
+
+export default function UserRegistrations() {
+  const { addSuccessToast, addDangerToast } = useToasts();
+  const [
+    userRegistrationCurrentlyDeleting,
+    setUserRegistrationCurrentlyDeleting,
+  ] = useState<UserRegistration | null>(null);

Review Comment:
   I think there s also a need for bulk deletion as it is the current pattern 
for all other views too. What do you think?



##########
superset/security/api.py:
##########
@@ -333,3 +337,22 @@ def get_list(self, **kwargs: Any) -> Response:
             return self.response_403(message=str(e))
         except Exception as e:
             return self.response_500(message=str(e))
+
+
+class UserRegistrationsRestAPI(BaseSupersetModelRestApi):
+    """
+    APIs for listing user registrations (Admin only)
+    """
+
+    resource_name = "user_registrations"
+    datamodel = SQLAInterface(RegisterUser)

Review Comment:
   i think the resource name should be "security/user_registrations" since it's 
under the Security category



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to