diff --git a/app/client/src/ce/api/UserApi.tsx b/app/client/src/ce/api/UserApi.tsx index 82697968b445..2dcadbe8e4fb 100644 --- a/app/client/src/ce/api/UserApi.tsx +++ b/app/client/src/ce/api/UserApi.tsx @@ -57,7 +57,6 @@ export interface UpdateUserRequest { name?: string; email?: string; proficiency?: string; - role?: string; useCase?: string; intercomConsentGiven?: boolean; } diff --git a/app/client/src/ce/sagas/userSagas.tsx b/app/client/src/ce/sagas/userSagas.tsx index 42f5cfa8379e..51baf2931703 100644 --- a/app/client/src/ce/sagas/userSagas.tsx +++ b/app/client/src/ce/sagas/userSagas.tsx @@ -417,14 +417,13 @@ export function* inviteUsers( export function* updateUserDetailsSaga(action: ReduxAction) { try { - const { email, intercomConsentGiven, name, proficiency, role, useCase } = + const { email, intercomConsentGiven, name, proficiency, useCase } = action.payload; const response: ApiResponse = yield callAPI(UserApi.updateUser, { email, name, proficiency, - role, useCase, intercomConsentGiven, }); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/UserData.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/UserData.java index c7e8362a9bef..6daca7445769 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/UserData.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/UserData.java @@ -33,11 +33,6 @@ public class UserData extends BaseDomain { @JsonView(Views.Internal.class) String userId; - // Role of the user in their workspace, example, Designer, Developer, Product Lead etc. - @JsonView(Views.Public.class) - @Deprecated - private String role; - // The development proficiency of the user for example, Beginner, Novice, Intermediate, Advanced. @JsonView(Views.Public.class) private String proficiency; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/UserSignupRequestDTO.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/UserSignupRequestDTO.java index 1ef47a488822..e37213905b2d 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/UserSignupRequestDTO.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/UserSignupRequestDTO.java @@ -19,9 +19,6 @@ public class UserSignupRequestDTO { private String password; - @Deprecated - private String role; - private String proficiency; private String useCase; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ce/UserUpdateCE_DTO.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ce/UserUpdateCE_DTO.java index be2ae09ee4c8..9a289ea1dc56 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ce/UserUpdateCE_DTO.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ce/UserUpdateCE_DTO.java @@ -9,8 +9,6 @@ public class UserUpdateCE_DTO { private String name; - private String role; - private String proficiency; private String useCase; @@ -22,6 +20,6 @@ public boolean hasUserUpdates() { } public boolean hasUserDataUpdates() { - return role != null || proficiency != null || useCase != null || isIntercomConsentGiven; + return proficiency != null || useCase != null || isIntercomConsentGiven; } } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCE.java index 3dcd578b4c3d..8c6153f94888 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCE.java @@ -17,13 +17,7 @@ public interface AnalyticsServiceCE { Mono identifyUser(User user, UserData userData, String recentlyUsedWorkspaceId); void identifyInstance( - String instanceId, - String role, - String proficiency, - String useCase, - String adminEmail, - String adminFullName, - String ip); + String instanceId, String proficiency, String useCase, String adminEmail, String adminFullName, String ip); Mono sendEvent(String event, String userId, Map properties); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCEImpl.java index 8c41a2fc8514..6887c468d162 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCEImpl.java @@ -141,7 +141,7 @@ public Mono identifyUser(User user, UserData userData, String recentlyUsed "isSuperUser", isSuperUser, "instanceId", instanceId, "mostRecentlyUsedWorkspaceId", tuple.getT4(), - "role", ObjectUtils.defaultIfNull(userData.getRole(), ""), + "role", "", "proficiency", ObjectUtils.defaultIfNull(userData.getProficiency(), ""), "goal", ObjectUtils.defaultIfNull(userData.getUseCase(), "")))); analytics.flush(); @@ -150,13 +150,7 @@ public Mono identifyUser(User user, UserData userData, String recentlyUsed } public void identifyInstance( - String instanceId, - String role, - String proficiency, - String useCase, - String adminEmail, - String adminFullName, - String ip) { + String instanceId, String proficiency, String useCase, String adminEmail, String adminFullName, String ip) { if (!isActive()) { return; } @@ -167,7 +161,7 @@ public void identifyInstance( "isInstance", true, // Is this "identify" data-point for a user or an instance? ROLE, - ObjectUtils.defaultIfNull(role, ""), + "", PROFICIENCY, ObjectUtils.defaultIfNull(proficiency, ""), GOAL, diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java index 1589daf14bde..9cede7c2f620 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java @@ -618,9 +618,6 @@ public Mono updateCurrentUser(final UserUpdateDTO allUpdates, ServerWebExc if (allUpdates.hasUserDataUpdates()) { final UserData updates = new UserData(); - if (StringUtils.hasLength(allUpdates.getRole())) { - updates.setRole(allUpdates.getRole()); - } if (StringUtils.hasLength(allUpdates.getProficiency())) { updates.setProficiency(allUpdates.getProficiency()); } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java index 75133d866d02..b60a7faae798 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java @@ -300,7 +300,6 @@ public Mono signupAndLoginSuper( }) .flatMap(user -> { final UserData userData = new UserData(); - userData.setRole(userFromRequest.getRole()); userData.setProficiency(userFromRequest.getProficiency()); userData.setUseCase(userFromRequest.getUseCase()); @@ -380,9 +379,6 @@ public Mono signupAndLoginSuperFromFormData(String originHeader, ServerWeb if (formData.containsKey(FieldName.NAME)) { user.setName(formData.getFirst(FieldName.NAME)); } - if (formData.containsKey("role")) { - user.setRole(formData.getFirst("role")); - } if (formData.containsKey("proficiency")) { user.setProficiency(formData.getFirst("proficiency")); } @@ -446,7 +442,7 @@ private Mono sendInstallationSetupAnalytics( analyticsProps.put(DISABLE_TELEMETRY, !userFromRequest.isAllowCollectingAnonymousData()); analyticsProps.put(SUBSCRIBE_MARKETING, userFromRequest.isSignupForNewsletter()); analyticsProps.put(EMAIL, newsletterSignedUpUserEmail); - analyticsProps.put(ROLE, ObjectUtils.defaultIfNull(userData.getRole(), "")); + analyticsProps.put(ROLE, ""); analyticsProps.put(PROFICIENCY, ObjectUtils.defaultIfNull(userData.getProficiency(), "")); analyticsProps.put(GOAL, ObjectUtils.defaultIfNull(userData.getUseCase(), "")); // ip is a reserved keyword for tracking events in Mixpanel though this is allowed in @@ -460,7 +456,6 @@ private Mono sendInstallationSetupAnalytics( analyticsService.identifyInstance( instanceId, - userData.getRole(), userData.getProficiency(), userData.getUseCase(), newsletterSignedUpUserEmail, diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/configurations/CommonConfigTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/configurations/CommonConfigTest.java index 6975f764cd61..6d29deb3eb3b 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/configurations/CommonConfigTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/configurations/CommonConfigTest.java @@ -22,7 +22,6 @@ public class CommonConfigTest { @Test public void objectMapper_BeanCreated_WithPublicJsonViewAsDefault() throws JsonProcessingException { UserData userData = new UserData(); - userData.setRole("new_role"); userData.setProficiency("abcd"); // this is public field userData.setUserId("userId"); // this is internal field userData.setUserPermissions(null); diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserServiceTest.java index 03b2cdd7105a..7edad2e12835 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserServiceTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserServiceTest.java @@ -425,21 +425,6 @@ public void updateNameOfUser_WithAccentedCharacters_IsValid() { .verifyComplete(); } - @Test - @WithUserDetails(value = "api_user") - public void updateRoleOfUser() { - UserUpdateDTO updateUser = new UserUpdateDTO(); - updateUser.setRole("New role of user"); - final Mono resultMono = - userService.updateCurrentUser(updateUser, null).then(userDataService.getForUserEmail("api_user")); - StepVerifier.create(resultMono) - .assertNext(userData -> { - assertNotNull(userData); - assertThat(userData.getRole()).isEqualTo("New role of user"); - }) - .verifyComplete(); - } - @Test @WithUserDetails(value = "api_user") public void updateIntercomConsentOfUser() { @@ -499,10 +484,9 @@ public void getIntercomConsentOfUserOnCloudHosting_AlwaysTrue() { @Test @WithUserDetails(value = "api_user") - public void updateNameRoleAndUseCaseOfUser() { + public void updateNameAndUseCaseOfUser() { UserUpdateDTO updateUser = new UserUpdateDTO(); updateUser.setName("New name of user here"); - updateUser.setRole("New role of user"); updateUser.setUseCase("New use case"); final Mono> resultMono = userService .updateCurrentUser(updateUser, null) @@ -514,7 +498,6 @@ public void updateNameRoleAndUseCaseOfUser() { assertNotNull(user); assertNotNull(userData); assertEquals("New name of user here", user.getName()); - assertEquals("New role of user", userData.getRole()); assertEquals("New use case", userData.getUseCase()); }) .verifyComplete();