Skip to content

Dev -> Main for 2.6.1 Release #1498

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

Merged
merged 51 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
338a8fa
Added query variables on Query Dialogue, added parameters on Run a Da…
Imiss-U1025 Jan 22, 2025
afa744b
fixed indexedDB queries + handle drop database queries
raheeliftikhar5 Jan 23, 2025
a88d70f
Add category and description to ApplicationCommonEvent
dragonpoo Jan 23, 2025
507b869
Add from-folder to application related event
dragonpoo Jan 23, 2025
a1880a2
Add environmentId always to details
dragonpoo Jan 23, 2025
8190bea
Merge pull request #1461 from lowcoder-org/environment
FalkWolsky Jan 24, 2025
2c73080
Added Variables to every queries of Data Queries in your App of left …
Imiss-U1025 Jan 24, 2025
6f9ae41
Added console to query.
Imiss-U1025 Jan 25, 2025
cdb1ee1
#1445: API: Create user and add to org
dragonpoo Jan 27, 2025
3543827
#1445: API: Update user profile info
dragonpoo Jan 27, 2025
4c9c247
#1445: API: Delete/Update user profile photo
dragonpoo Jan 27, 2025
8564f79
overwrite variables before executeQuery
Imiss-U1025 Jan 27, 2025
845f9c1
key to label on event handler popup
Imiss-U1025 Jan 27, 2025
6b1be52
#1453: Remove client secret from /home api
dragonpoo Jan 28, 2025
5e1cf9e
use overwritten variable in query request
Imiss-U1025 Jan 28, 2025
63faec2
show query variables in event handlers popup
raheeliftikhar5 Jan 29, 2025
e43aba8
Fix label and remove del button
Imiss-U1025 Jan 29, 2025
68d7c83
Merge pull request #1470 from lowcoder-org/feature-dataQuery
FalkWolsky Jan 29, 2025
c38fb82
Merge pull request #1468 from lowcoder-org/fix/client_secret
FalkWolsky Jan 29, 2025
7260aa7
Merge pull request #1464 from lowcoder-org/user_manangement_api
FalkWolsky Jan 29, 2025
4dc007d
limit datasource name to 16ch
Imiss-U1025 Jan 29, 2025
2b0ff80
Merge pull request #1471 from lowcoder-org/datasourcename
FalkWolsky Jan 29, 2025
e72b15d
Change query name width at bottom panel
Imiss-U1025 Jan 30, 2025
7b9568b
Fix issues when application settings has null values for category, de…
dragonpoo Jan 30, 2025
ae595bc
Merge pull request #1475 from lowcoder-org/fix/null_settings_value
FalkWolsky Jan 30, 2025
7c7ea52
Add indicator to all headers in event popup
Imiss-U1025 Jan 30, 2025
cc29011
Fixing Link for Documentation in translation files
Jan 31, 2025
b44d37a
Merge pull request #1476 from lowcoder-org/event_header_indicator
FalkWolsky Jan 31, 2025
a59f015
Merge pull request #1473 from lowcoder-org/fix/query_name_width
FalkWolsky Jan 31, 2025
8fcb346
Updating SDK version
Jan 31, 2025
afac639
Taking out Query Comp from testing - to build current DEV images
Jan 31, 2025
8071763
Taking out more frontent tests from testing - to build current DEV im…
Jan 31, 2025
84e1903
Adapting KeyValueListControl for better imports
Jan 31, 2025
38e96be
Updating Translations
Jan 31, 2025
bcdc3ab
Updating translation for Page Load Trigger
Jan 31, 2025
c35b94c
Updating translation for Input Change & Page Load Trigger
Jan 31, 2025
cb1c3a1
Modifications on SDK build to splitup chunks
Jan 31, 2025
7836970
further Modifications on SDK build to splitup chunks
Jan 31, 2025
f6dc050
data option for candleStickChart
Imiss-U1025 Feb 3, 2025
77b63e8
Add missing data fields and default values
Imiss-U1025 Feb 3, 2025
1730e6d
Delete old artefacts
Feb 3, 2025
29de1f6
Merge pull request #1493 from lowcoder-org/echart_data_option
FalkWolsky Feb 3, 2025
b9f94ad
Fixed cors issues by adding custom CorsOptions
dragonpoo Feb 4, 2025
7ee5a7b
fix importing errors in tests
raheeliftikhar5 Feb 4, 2025
343f688
Merge pull request #1496 from lowcoder-org/fix/cors
FalkWolsky Feb 4, 2025
b1c8799
fixed query variables loses focus while typing
raheeliftikhar5 Feb 4, 2025
f23e901
fixed onQueryExec trigger to run dep queries on success only
raheeliftikhar5 Feb 4, 2025
6828af9
#1322: Added API: /email/bind
dragonpoo Jan 28, 2025
2655e5c
#1322: Expose email in currentUser endpoint.
dragonpoo Jan 30, 2025
3c08837
Updating Lowcoder Comps
Feb 4, 2025
6a3d7d3
Updating Lowcoder Versions for small release
Feb 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.lowcoder.api.usermanagement.view.OrgView;
import org.lowcoder.api.usermanagement.view.UpdateOrgRequest;
import org.lowcoder.api.usermanagement.view.UpdateRoleRequest;
import org.lowcoder.domain.organization.model.OrgMember;
import org.lowcoder.domain.organization.model.Organization;
import org.lowcoder.domain.organization.model.Organization.OrganizationCommonSettings;
import org.lowcoder.infra.annotation.NonEmptyMono;
Expand All @@ -23,8 +24,12 @@ public interface OrgApiService {

Mono<Boolean> updateRoleForMember(String orgId, UpdateRoleRequest updateRoleRequest);

Mono<OrgMember> checkVisitorAdminRole(String orgId);

Mono<Boolean> switchCurrentOrganizationTo(String orgId);

Mono<Boolean> switchCurrentOrganizationTo(String userId, String orgId);

Mono<Boolean> deleteLogo(String orgId);

Mono<Boolean> uploadLogo(String orgId, Mono<Part> fileMono);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public Mono<Boolean> updateRoleForMember(String orgId, UpdateRoleRequest updateR
MemberRole.fromValue(updateRoleRequest.getRole())));
}

private Mono<OrgMember> checkVisitorAdminRole(String orgId) {
@Override
public Mono<OrgMember> checkVisitorAdminRole(String orgId) {
return sessionUserService.getVisitorId()
.flatMap(visitor -> orgMemberService.getOrgMember(orgId, visitor))
.filter(it -> it.getRole() == MemberRole.ADMIN || it.getRole() == MemberRole.SUPER_ADMIN)
Expand All @@ -177,15 +178,18 @@ private Mono<Void> checkDeveloperCount(String orgId, String role, String userId)
@Override
public Mono<Boolean> switchCurrentOrganizationTo(String nextCurrentOrgId) {
return sessionUserService.getVisitorId()
.flatMap(it -> orgMemberService.getAllActiveOrgs(it).collectList())
.flatMap(it -> switchCurrentOrganizationTo(it, nextCurrentOrgId));
}

@Override
public Mono<Boolean> switchCurrentOrganizationTo(String userId, String nextCurrentOrgId) {
return orgMemberService.getAllActiveOrgs(userId).collectList()
.defaultIfEmpty(Collections.emptyList())
.flatMap(orgMembers -> {
if (!collectSet(orgMembers, OrgMember::getOrgId).contains(nextCurrentOrgId)) {
return Mono.error(new BizException(BizError.INVALID_ORG_ID, "INVALID_ORG_ID"));
}

String userId = orgMembers.get(0).getUserId();

Optional<OrgMember> previousCurrentOrgMember = orgMembers.stream()
.filter(OrgMember::isCurrentOrg)
.findFirst();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.lowcoder.api.authentication.dto.OrganizationDomainCheckResult;
import org.lowcoder.api.authentication.service.AuthenticationApiService;
import org.lowcoder.api.framework.view.ResponseView;
import org.lowcoder.api.home.SessionUserService;
import org.lowcoder.api.home.UserHomeApiService;
import org.lowcoder.api.usermanagement.view.UpdateUserRequest;
import org.lowcoder.api.usermanagement.view.UserProfileView;
import org.lowcoder.domain.organization.model.MemberRole;
import org.lowcoder.domain.organization.service.OrgMemberService;
import org.lowcoder.domain.user.constant.UserStatusType;
import org.lowcoder.domain.user.model.User;
import org.lowcoder.domain.user.model.UserDetail;
import org.lowcoder.domain.user.service.UserService;
import org.lowcoder.domain.user.service.UserStatusService;
import org.lowcoder.sdk.config.CommonConfig;
import org.lowcoder.sdk.constants.AuthSourceConstants;
import org.lowcoder.sdk.exception.BizError;
import org.springframework.http.HttpStatus;
import org.springframework.http.codec.multipart.Part;
Expand All @@ -35,6 +39,19 @@ public class UserController implements UserEndpoints
private final UserStatusService userStatusService;
private final UserApiService userApiService;
private final CommonConfig commonConfig;
private final AuthenticationApiService authenticationApiService;
private final OrgMemberService orgMemberService;

@Override
public Mono<ResponseView<?>> createUserAndAddToOrg(@PathVariable String orgId, CreateUserRequest request) {
return orgApiService.checkVisitorAdminRole(orgId).flatMap(__ ->
authenticationApiService.authenticateByForm(request.email(), request.password(),
AuthSourceConstants.EMAIL, true, null, orgId))
.flatMap(authUser -> userService.createNewUserByAuthUser(authUser, false))
.delayUntil(user -> orgMemberService.tryAddOrgMember(orgId, user.getId(), MemberRole.MEMBER))
.delayUntil(user -> orgApiService.switchCurrentOrganizationTo(user.getId(), orgId))
.map(ResponseView::success);
}

@Override
public Mono<ResponseView<?>> getUserProfile(ServerWebExchange exchange) {
Expand Down Expand Up @@ -67,19 +84,27 @@ public Mono<ResponseView<Boolean>> markStatus(@RequestBody MarkUserStatusRequest
@Override
public Mono<ResponseView<UserProfileView>> update(@RequestBody UpdateUserRequest updateUserRequest, ServerWebExchange exchange) {
return sessionUserService.getVisitorId()
.flatMap(uid -> {
User updateUser = new User();
if (StringUtils.isNotBlank(updateUserRequest.getName())) {
updateUser.setName(updateUserRequest.getName());
updateUser.setHasSetNickname(true);
}
if (StringUtils.isNotBlank(updateUserRequest.getUiLanguage())) {
updateUser.setUiLanguage(updateUserRequest.getUiLanguage());
}
return userService.update(uid, updateUser);
})
.flatMap(user -> userHomeApiService.buildUserProfileView(user, exchange))
.map(ResponseView::success);
.flatMap(uid -> updateUser(uid, updateUserRequest, exchange));
}

@Override
public Mono<ResponseView<UserProfileView>> update(@PathVariable String orgId, @PathVariable String userId, @RequestBody UpdateUserRequest updateUserRequest, ServerWebExchange exchange) {
return orgApiService.checkVisitorAdminRole(orgId)
.flatMap(__ -> updateUser(userId, updateUserRequest, exchange));
}

public Mono<ResponseView<UserProfileView>> updateUser(String userId, @RequestBody UpdateUserRequest updateUserRequest, ServerWebExchange exchange) {
User updateUser = new User();
if (StringUtils.isNotBlank(updateUserRequest.getName())) {
updateUser.setName(updateUserRequest.getName());
updateUser.setHasSetNickname(true);
}
if (StringUtils.isNotBlank(updateUserRequest.getUiLanguage())) {
updateUser.setUiLanguage(updateUserRequest.getUiLanguage());
}
return userService.update(userId, updateUser)
.flatMap(user -> userHomeApiService.buildUserProfileView(user, exchange))
.map(ResponseView::success);
}

@Override
Expand All @@ -89,13 +114,28 @@ public Mono<ResponseView<Boolean>> uploadProfilePhoto(@RequestPart("file") Mono<
.map(ResponseView::success);
}

@Override
public Mono<ResponseView<Boolean>> uploadProfilePhotoById(@PathVariable String orgId, @PathVariable String userId, @RequestPart("file") Mono<Part> fileMono) {
return orgApiService.checkVisitorAdminRole(orgId).flatMap(__ -> userService.findById(userId))
.zipWith(fileMono)
.flatMap(tuple -> userService.saveProfilePhoto(tuple.getT2(), tuple.getT1()))
.map(ResponseView::success);
}

@Override
public Mono<ResponseView<Void>> deleteProfilePhoto() {
return sessionUserService.getVisitor()
.flatMap(visitor -> userService.deleteProfilePhoto(visitor)
.map(ResponseView::success));
}

@Override
public Mono<ResponseView<Void>> deleteProfilePhotoById(@PathVariable String orgId, @PathVariable String userId) {
return orgApiService.checkVisitorAdminRole(orgId).flatMap(__ -> userService.findById(userId))
.flatMap(user -> userService.deleteProfilePhoto(user)
.map(ResponseView::success));
}

@Override
public Mono<Void> getProfilePhoto(ServerWebExchange exchange) {
return sessionUserService.getVisitorId()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,20 @@

@RestController
@RequestMapping(value = {Url.USER_URL, NewUrl.USER_URL})
public interface UserEndpoints
public interface UserEndpoints
{
public static final String TAG_USER_MANAGEMENT = "User APIs";
public static final String TAG_USER_PASSWORD_MANAGEMENT = "User Password APIs";
public static final String TAG_USER_PROFILE_PHOTO_MANAGEMENT = "User Profile Photo APIs";

@Operation(
tags = TAG_USER_MANAGEMENT,
operationId = "createUserAndAddToOrg",
summary = "Create user and add to the org",
description = "Create a new user and add to specified organization."
)
@PostMapping("/new/{orgId}")
public Mono<ResponseView<?>> createUserAndAddToOrg(@PathVariable String orgId, @RequestBody CreateUserRequest request);

@Operation(
tags = TAG_USER_MANAGEMENT,
operationId = "getUserProfile",
Expand Down Expand Up @@ -67,6 +75,15 @@ public interface UserEndpoints
@PutMapping
public Mono<ResponseView<UserProfileView>> update(@RequestBody UpdateUserRequest updateUserRequest, ServerWebExchange exchange);

@Operation(
tags = TAG_USER_MANAGEMENT,
operationId = "updateUser",
summary = "Update selected User",
description = "Update specified user profile information within Lowcoder, ensuring accuracy and relevance."
)
@PutMapping("/{orgId}/{userId}")
public Mono<ResponseView<UserProfileView>> update(@PathVariable String orgId, @PathVariable String userId, @RequestBody UpdateUserRequest updateUserRequest, ServerWebExchange exchange);

@Operation(
tags = TAG_USER_PROFILE_PHOTO_MANAGEMENT,
operationId = "uploadUserProfilePhoto",
Expand All @@ -78,12 +95,30 @@ public interface UserEndpoints

@Operation(
tags = TAG_USER_PROFILE_PHOTO_MANAGEMENT,
operationId = "deleteUserProfilePhoto",
summary = "Delete current users profile photo",
description = "Remove the profile Photo associated with the current User within Lowcoder."
operationId = "uploadUserProfilePhotoById",
summary = "Upload specific Users profile photo",
description = "Upload or change specific profile photo within Lowcoder for personalization."
)
@PostMapping(value = "/photo/{orgId}/{userId}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public Mono<ResponseView<Boolean>> uploadProfilePhotoById(@PathVariable String orgId, @PathVariable String userId, @RequestPart("file") Mono<Part> fileMono);

@Operation(
tags = TAG_USER_PROFILE_PHOTO_MANAGEMENT,
operationId = "deleteUserProfilePhotoById",
summary = "Delete specific users profile photo",
description = "Remove the profile Photo associated with the specific User within Lowcoder."
)
@DeleteMapping("/photo")
public Mono<ResponseView<Void>> deleteProfilePhoto();

@DeleteMapping("/photo/{orgId}/{userId}")
public Mono<ResponseView<Void>> deleteProfilePhotoById(@PathVariable String orgId, @PathVariable String userId);
@Operation(
tags = TAG_USER_PROFILE_PHOTO_MANAGEMENT,
operationId = "deleteUserProfilePhoto",
summary = "Delete current users profile photo",
description = "Remove the profile Photo associated with the current User within Lowcoder."
)
@DeleteMapping("/photo")
public Mono<ResponseView<Void>> deleteProfilePhoto();

@Operation(
tags = TAG_USER_PROFILE_PHOTO_MANAGEMENT,
Expand Down Expand Up @@ -181,4 +216,7 @@ public record UpdatePasswordRequest(String oldPassword, String newPassword) {
public record MarkUserStatusRequest(String type, Object value) {
}

public record CreateUserRequest(String email, String password) {
}

}
Loading