Skip to content

Commit a59dd49

Browse files
author
th37rose
authored
Merge branch 'dev' into feature/bundle
2 parents 0c4ac50 + e0383d8 commit a59dd49

File tree

15 files changed

+239
-32
lines changed

15 files changed

+239
-32
lines changed

client/packages/lowcoder/src/comps/comps/columnLayout/columnLayout.tsx

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,20 @@ import { disabledPropertyView, hiddenPropertyView } from "comps/utils/propertyUt
4242
import { DisabledContext } from "comps/generators/uiCompBuilder";
4343

4444
const ContainWrapper = styled.div<{
45-
$style: ContainerStyleType | undefined;
45+
$style: ContainerStyleType & {
46+
display: string,
47+
gridTemplateColumns: string,
48+
columnGap: string,
49+
gridTemplateRows: string,
50+
rowGap: string,
51+
} | undefined;
4652
}>`
53+
display: ${(props) => props.$style?.display};
54+
grid-template-columns: ${(props) => props.$style?.gridTemplateColumns};
55+
grid-template-rows: ${(props) => props.$style?.gridTemplateRows};
56+
column-gap: ${(props) => props.$style?.columnGap};
57+
row-gap: ${(props) => props.$style?.rowGap};
58+
4759
background-color: ${(props) => props.$style?.background} !important;
4860
border-radius: ${(props) => props.$style?.radius};
4961
border-width: ${(props) => props.$style?.borderWidth};
@@ -59,7 +71,7 @@ const ColWrapper = styled(Col)<{
5971
$matchColumnsHeight: boolean,
6072
}>`
6173
> div {
62-
height: ${(props) => props.$matchColumnsHeight ? '100%' : 'auto'};
74+
height: ${(props) => props.$matchColumnsHeight ? `calc(100% - ${props.$style?.padding || 0} - ${props.$style?.padding || 0})` : 'auto'};
6375
background-color: ${(props) => props.$style?.background} !important;
6476
border-radius: ${(props) => props.$style?.radius};
6577
border-width: ${(props) => props.$style?.borderWidth};
@@ -121,17 +133,24 @@ const ColumnLayout = (props: ColumnLayoutProps) => {
121133
} = props;
122134

123135
return (
124-
<BackgroundColorContext.Provider value={"none"}>
136+
<BackgroundColorContext.Provider value={props.style.background}>
125137
<DisabledContext.Provider value={props.disabled}>
126-
<ContainWrapper $style={props.style}>
127-
<div style={{display: "grid", gridTemplateColumns: templateColumns, columnGap, gridTemplateRows: templateRows, rowGap}}>
128-
{columns.map(column => {
129-
const id = String(column.id);
130-
const childDispatch = wrapDispatch(wrapDispatch(dispatch, "containers"), id);
131-
if(!containers[id]) return null
132-
const containerProps = containers[id].children;
133-
const noOfColumns = columns.length;
134-
return (
138+
<ContainWrapper $style={{
139+
...props.style,
140+
display: "grid",
141+
gridTemplateColumns: templateColumns,
142+
columnGap,
143+
gridTemplateRows: templateRows,
144+
rowGap,
145+
}}>
146+
{columns.map(column => {
147+
const id = String(column.id);
148+
const childDispatch = wrapDispatch(wrapDispatch(dispatch, "containers"), id);
149+
if(!containers[id]) return null
150+
const containerProps = containers[id].children;
151+
const noOfColumns = columns.length;
152+
return (
153+
<BackgroundColorContext.Provider value={props.columnStyle.background}>
135154
<ColWrapper
136155
key={id}
137156
$style={props.columnStyle}
@@ -147,12 +166,12 @@ const ColumnLayout = (props: ColumnLayoutProps) => {
147166
style={columnStyle}
148167
/>
149168
</ColWrapper>
150-
)
151-
})
152-
}
153-
</div>
169+
</BackgroundColorContext.Provider>
170+
)
171+
})
172+
}
154173
</ContainWrapper>
155-
</DisabledContext.Provider>
174+
</DisabledContext.Provider>
156175
</BackgroundColorContext.Provider>
157176
);
158177
};

client/packages/lowcoder/src/layout/gridItem.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,12 @@ export function GridItem(props: GridItemProps) {
441441
cssTransforms: true,
442442
}),
443443
style: {
444-
...setTransform(pos,props.name),
444+
...setTransform(
445+
pos,
446+
props.name,
447+
props.autoHeight,
448+
Boolean(draggingUtils.isDragging())
449+
),
445450
opacity: layoutHide ? 0 : undefined,
446451
pointerEvents: layoutHide ? "none" : "auto",
447452
},

client/packages/lowcoder/src/layout/utils.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,21 @@ export function getStatics(layout: Layout): Layout {
199199
return _.pickBy(layout, (l) => l.static);
200200
}
201201

202-
export function setTransform({ top, left, width, height }: Position,name?:string): Record<string, any> {
202+
export function setTransform(
203+
{top, left, width, height }: Position,
204+
name ?: string,
205+
autoHeight?: boolean,
206+
isDragging?: boolean,
207+
): Record<string, any> {
203208
// Replace unitless items with px
204209
const translate = `translate(${left}px,${top}px)`;
205210
function containsChart(str:string) {
206211
return /chart/i.test(str);
207212
}
213+
let updatedHeight = 'auto';
214+
if (isDragging || !autoHeight || (name && containsChart(name))) {
215+
updatedHeight = `${height}px`;
216+
}
208217

209218
return {
210219
transform: translate,
@@ -213,7 +222,7 @@ export function setTransform({ top, left, width, height }: Position,name?:string
213222
msTransform: translate,
214223
OTransform: translate,
215224
width: `${width}px`,
216-
height: name ?containsChart(name)?`${height}px`:'auto':`${height}px`,
225+
height: updatedHeight,
217226
position: 'absolute',
218227
};
219228
}

deploy/docker/docker-compose.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ services:
6666
LOWCODER_ADMIN_SMTP_PORT: 587
6767
LOWCODER_ADMIN_SMTP_USERNAME:
6868
LOWCODER_ADMIN_SMTP_PASSWORD:
69-
LOWCODER_ADMIN_SMTP_AUTH: true
70-
LOWCODER_ADMIN_SMTP_SSL_ENABLED: false
71-
LOWCODER_ADMIN_SMTP_STARTTLS_ENABLED: true
72-
LOWCODER_ADMIN_SMTP_STARTTLS_REQUIRED: true
69+
LOWCODER_ADMIN_SMTP_AUTH: "true"
70+
LOWCODER_ADMIN_SMTP_SSL_ENABLED: "false"
71+
LOWCODER_ADMIN_SMTP_STARTTLS_ENABLED: "true"
72+
LOWCODER_ADMIN_SMTP_STARTTLS_REQUIRED: "true"
7373
# Email used as sender in lost password email
7474
LOWCODER_EMAIL_NOTIFICATIONS_SENDER: info@localhost
7575
volumes:

server/api-service/lowcoder-plugins/restApiPlugin/src/test/java/org/lowcoder/plugin/restapi/RestApiEngineTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public void testEncodingParams() {
180180
assertTrue(result.isSuccess());
181181
assertNotNull(result.getData());
182182
JsonNode url = ((ObjectNode) result.getData()).get("url");
183-
assertEquals("\"https://postman-echo.com/post?param=value+with+blank\"", url.toString());
183+
assertEquals("\"http://postman-echo.com/post?param=value+with+blank\"", url.toString());
184184
})
185185
.verifyComplete();
186186
}

server/api-service/lowcoder-server/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@
240240
<groupId>org.springframework</groupId>
241241
<artifactId>spring-aspects</artifactId>
242242
</dependency>
243+
<dependency>
244+
<groupId>org.wiremock</groupId>
245+
<artifactId>wiremock-jetty12</artifactId>
246+
<version>3.6.0</version>
247+
<scope>test</scope>
248+
</dependency>
243249
</dependencies>
244250

245251
<dependencyManagement>

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/authentication/request/oauth2/request/GenericAuthRequest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.lowcoder.api.authentication.request.oauth2.request;
22

3+
import lombok.Setter;
34
import org.lowcoder.api.authentication.request.AuthException;
45
import org.lowcoder.api.authentication.request.oauth2.GenericOAuthProviderSource;
56
import org.lowcoder.api.authentication.request.oauth2.OAuth2RequestContext;
@@ -75,6 +76,7 @@ protected Mono<AuthToken> refreshAuthToken(String refreshToken) {
7576

7677
@Override
7778
protected Mono<AuthUser> getAuthUser(AuthToken authToken) {
79+
if(!config.getUserInfoIntrospection()) return Mono.just(AuthUser.builder().build());
7880
return WebClientBuildHelper.builder()
7981
.systemProxy()
8082
.timeoutMs(HTTP_TIMEOUT)

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/authentication/service/AuthenticationApiServiceImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ public void updateConnection(AuthUser authUser, User user) {
224224
Optional.ofNullable(authUser.getAuthToken()).map(ConnectionAuthToken::of).orElse(null));
225225
oldConnection.setRawUserInfo(authUser.getRawUserInfo());
226226

227+
//if auth by google, set refresh token
228+
if (StringUtils.isEmpty(authUser.getAuthToken().getRefreshToken()) && StringUtils.isNotEmpty(oldConnection.getAuthConnectionAuthToken().getRefreshToken())) {
229+
authUser.getAuthToken().setRefreshToken(oldConnection.getAuthConnectionAuthToken().getRefreshToken());
230+
}
231+
227232
user.setActiveAuthId(oldConnection.getAuthId());
228233
}
229234

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/bundle/BundleApiServiceImpl.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
import org.lowcoder.api.permission.view.PermissionItemView;
1717
import org.lowcoder.api.usermanagement.OrgDevChecker;
1818
import org.lowcoder.domain.application.model.Application;
19+
import org.lowcoder.domain.application.model.ApplicationStatus;
1920
import org.lowcoder.domain.application.model.ApplicationType;
2021
import org.lowcoder.domain.application.repository.ApplicationRepository;
2122
import org.lowcoder.domain.application.service.ApplicationServiceImpl;
22-
import org.lowcoder.domain.bundle.model.Bundle;
23-
import org.lowcoder.domain.bundle.model.BundleApplication;
24-
import org.lowcoder.domain.bundle.model.BundleRequestType;
25-
import org.lowcoder.domain.bundle.model.BundleStatus;
23+
import org.lowcoder.domain.bundle.model.*;
2624
import org.lowcoder.domain.bundle.repository.BundleRepository;
2725
import org.lowcoder.domain.bundle.service.BundleElementRelationService;
2826
import org.lowcoder.domain.bundle.service.BundleService;
@@ -45,7 +43,9 @@
4543
import reactor.core.scheduler.Schedulers;
4644

4745
import java.util.*;
48-
import java.util.function.Function;
46+
import java.util.function.Function;=
47+
import java.util.function.ToLongFunction;
48+
import java.util.stream.Collectors;
4949

5050
import static org.lowcoder.domain.bundle.model.BundleStatus.NORMAL;
5151
import static org.lowcoder.domain.permission.model.ResourceAction.*;
@@ -452,7 +452,6 @@ public Mono<BundleInfoView> getEditingBundle(String bundleId) {
452452
.description(bundle.getDescription())
453453
.image(bundle.getImage())
454454
.editingBundleDSL(bundle.getEditingBundleDSL())
455-
// .publishedBundleDSL(bundle.getPublishedBundleDSL())
456455
.publicToMarketplace(bundle.getPublicToMarketplace())
457456
.publicToAll(bundle.getPublicToAll())
458457
.agencyProfile(bundle.getAgencyProfile())

server/api-service/lowcoder-server/src/main/java/org/lowcoder/runner/migrations/DatabaseChangelog.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.lowcoder.runner.migrations.job.AddSuperAdminUser;
2424
import org.lowcoder.runner.migrations.job.CompleteAuthType;
2525
import org.lowcoder.runner.migrations.job.MigrateAuthConfigJob;
26+
import org.springframework.context.annotation.Profile;
2627
import org.springframework.data.domain.Sort;
2728
import org.springframework.data.mongodb.UncategorizedMongoDbException;
2829
import org.springframework.data.mongodb.core.index.CompoundIndexDefinition;
@@ -35,6 +36,7 @@
3536
@SuppressWarnings("all")
3637
@Slf4j
3738
@ChangeLog(order = "001")
39+
@Profile("!test")
3840
public class DatabaseChangelog {
3941

4042
@ChangeSet(order = "001", id = "init-indexes", author = "")

0 commit comments

Comments
 (0)