This is an automated email from the ASF dual-hosted git repository.
aicam pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to refs/heads/main by this push:
new a1397135ec chore: improving naming of endpoint listWithActivity and
class UserWithLastLogin (#3682)
a1397135ec is described below
commit a1397135ecd8ed427cb8419d302af44f865773de
Author: Jaeyun Kim <[email protected]>
AuthorDate: Sat Aug 23 13:23:53 2025 -0700
chore: improving naming of endpoint listWithActivity and class
UserWithLastLogin (#3682)
## Summary
In effort to improve the naming convention of variables and api
endpoints of previous PR #3625, this PR is raised to change
`UserWithLastLogin` to `UserInfo` and `/listWIthActivity` to `/list`.
## Changes
1. The code inside the api endpoint `/listWithActivity` has been moved
to `/list`. `/listWithActivity` has been removed.
2. The class name `UserWithLastLogin` is changed to `UserInfo`.
## Notes
Fixes Issue #3624.
After discussion, we decided to change the api endpoint as the code in
`/list` was no longer used and `/listWithActivity` has a too specific
name. To make the name more intuitive and generalized, we decided to
move the code into `/list` to make it more clear.
Same thing happens to `UserWithLastLogin`. It has a specific name and we
decided it to change it into `UserInfo` so it can be generally used and
be added with more attributes.
---------
Co-authored-by: ali risheh <[email protected]>
---
.../dashboard/admin/user/AdminUserResource.scala | 20 ++++----------------
.../service/admin/user/admin-user.service.ts | 2 +-
2 files changed, 5 insertions(+), 17 deletions(-)
diff --git
a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/admin/user/AdminUserResource.scala
b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/admin/user/AdminUserResource.scala
index 9a5486430a..12311b8df3 100644
---
a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/admin/user/AdminUserResource.scala
+++
b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/admin/user/AdminUserResource.scala
@@ -36,7 +36,7 @@ import javax.annotation.security.RolesAllowed
import javax.ws.rs._
import javax.ws.rs.core.{MediaType, Response}
-case class UserWithLastLogin(
+case class UserInfo(
uid: Int,
name: String,
email: String,
@@ -61,24 +61,12 @@ class AdminUserResource {
/**
* This method returns the list of users
*
- * @return a list of users
+ * @return a list of UserInfo
*/
@GET
@Path("/list")
@Produces(Array(MediaType.APPLICATION_JSON))
- def listUser(): util.List[User] = {
- userDao.fetchRangeOfUid(Integer.MIN_VALUE, Integer.MAX_VALUE)
- }
-
- /**
- * This method returns the list of users with lastLogin time
- *
- * @return a list of UserWithLastLogin
- */
- @GET
- @Path("/listWithActivity")
- @Produces(Array(MediaType.APPLICATION_JSON))
- def listUserWithActivity(): util.List[UserWithLastLogin] = {
+ def listUserWithActivity(): util.List[UserInfo] = {
AdminUserResource.context
.select(
USER.UID,
@@ -93,7 +81,7 @@ class AdminUserResource {
.from(USER)
.leftJoin(TIME_LOG)
.on(USER.UID.eq(TIME_LOG.UID))
- .fetchInto(classOf[UserWithLastLogin])
+ .fetchInto(classOf[UserInfo])
}
@PUT
diff --git
a/core/gui/src/app/dashboard/service/admin/user/admin-user.service.ts
b/core/gui/src/app/dashboard/service/admin/user/admin-user.service.ts
index c43202072f..203cc0bbed 100644
--- a/core/gui/src/app/dashboard/service/admin/user/admin-user.service.ts
+++ b/core/gui/src/app/dashboard/service/admin/user/admin-user.service.ts
@@ -25,7 +25,7 @@ import { Role, User, File, Workflow, ExecutionQuota } from
"../../../../common/t
import { DatasetQuota } from
"src/app/dashboard/type/quota-statistic.interface";
export const USER_BASE_URL = `${AppSettings.getApiEndpoint()}/admin/user`;
-export const USER_LIST_URL = `${USER_BASE_URL}/listWithActivity`;
+export const USER_LIST_URL = `${USER_BASE_URL}/list`;
export const USER_UPDATE_URL = `${USER_BASE_URL}/update`;
export const USER_ADD_URL = `${USER_BASE_URL}/add`;
export const USER_CREATED_FILES = `${USER_BASE_URL}/uploaded_files`;