Skip to content

Commit f02d33f

Browse files
committed
Merge branch 'dev' of github.com:lowcoder-org/lowcoder into dev
2 parents 4bcbc11 + 2b36ad3 commit f02d33f

File tree

8 files changed

+39
-7
lines changed

8 files changed

+39
-7
lines changed

client/packages/lowcoder/src/comps/comps/listViewComp/listView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ export function ListView(props: Props) {
369369
newData.splice(toIndex, 0, movedItem);
370370

371371
children.listData.dispatchChangeValueAction(newData);
372+
children.onEvent.getView()('sortChange');
372373
};
373374

374375
// log.debug("renders: ", renders);

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
withFunction,
3030
WrapContextNodeV2,
3131
} from "lowcoder-core";
32-
import { JSONArray, JSONValue } from "util/jsonTypes";
32+
import { JSONArray, JSONObject, JSONValue } from "util/jsonTypes";
3333
import { depthEqual, lastValueIfEqual, shallowEqual } from "util/objectUtils";
3434
import { CompTree, getAllCompItems, IContainer } from "../containerBase";
3535
import { SimpleContainerComp, toSimpleContainerData } from "../containerBase/simpleContainerComp";
@@ -40,6 +40,7 @@ import { listPropertyView } from "./listViewPropertyView";
4040
import { getData } from "./listViewUtils";
4141
import { withMethodExposing } from "comps/generators/withMethodExposing";
4242
import { SliderControl } from "@lowcoder-ee/comps/controls/sliderControl";
43+
import { eventHandlerControl, sortChangeEvent } from "@lowcoder-ee/comps/controls/eventHandlerControl";
4344

4445
const childrenMap = {
4546
noOfRows: withIsLoadingMethod(NumberOrJSONObjectArrayControl), // FIXME: migrate "noOfRows" to "data"
@@ -62,6 +63,7 @@ const childrenMap = {
6263
horizontal: withDefault(BoolControl, false),
6364
minHorizontalWidth: withDefault(RadiusControl, '100px'),
6465
enableSorting: withDefault(BoolControl, false),
66+
onEvent: eventHandlerControl([sortChangeEvent] as const),
6567
};
6668

6769
const ListViewTmpComp = new UICompBuilder(childrenMap, () => <></>)
@@ -183,6 +185,15 @@ ListViewPropertyComp = withExposingConfigs(ListViewPropertyComp, [
183185
return data;
184186
},
185187
}),
188+
depsConfig({
189+
name: "sortedData",
190+
desc: trans("listView.dataDesc"),
191+
depKeys: ["listData"],
192+
func: (input) => {
193+
const { data } = getData(input.listData as JSONObject[]);
194+
return data;
195+
},
196+
}),
186197
new CompDepsConfig(
187198
"pageNo",
188199
(comp) => ({index: comp.children.pagination.children.pageNo.exposingNode() }),

client/packages/lowcoder/src/comps/comps/listViewComp/listViewPropertyView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export function listPropertyView(compType: ListCompType) {
5555

5656
{(useContext(EditorContext).editorModeStatus === "logic" || useContext(EditorContext).editorModeStatus === "both") && (
5757
<Section name={sectionNames.interaction}>
58+
{children.onEvent.getPropertyView()}
5859
{hiddenPropertyView(children)}
5960
{showDataLoadingIndicatorsPropertyView(children)}
6061
{children.enableSorting.propertyView({

client/packages/lowcoder/src/comps/controls/eventHandlerControl.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,11 @@ export const resetEvent: EventConfigType = {
489489
value: "reset",
490490
description: trans("event.resetDesc"),
491491
};
492-
492+
export const sortChangeEvent: EventConfigType = {
493+
label: trans("event.sortChange"),
494+
value: "sortChange",
495+
description: trans("event.sortChangeDesc"),
496+
};
493497

494498
// Meeting Events
495499

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,8 @@ export const en = {
463463
"resetDesc": "Triggers on Reset timer",
464464
"refresh": "Refresh",
465465
"refreshDesc": "Triggers on Refresh",
466+
"sortChange": "Sort Change",
467+
"sortChangeDesc": "Triggers on Sorting Changes",
466468
},
467469

468470

client/packages/lowcoder/src/pages/common/inviteLanding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function InviteLanding(props: InviteLandingProp) {
4545
orgId = inviteInfo.invitedOrganizationId;
4646
const inviteState = inviteInfo ? { ...inviteInfo, invitationId } : { invitationId };
4747
history.push({
48-
pathname: AUTH_LOGIN_URL,
48+
pathname: `/org/${orgId}/auth/login`,
4949
state: {
5050
inviteInfo: inviteState,
5151
},

client/packages/lowcoder/src/pages/userAuth/formLoginAdmin.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ export default function FormLogin(props: FormLoginProps) {
3131
const [password, setPassword] = useState("");
3232
const { fetchUserAfterAuthSuccess } = useContext(AuthContext);
3333

34+
const afterLoginSuccess = () => {
35+
if (props.organizationId) {
36+
localStorage.setItem("lowcoder_login_orgId", props.organizationId);
37+
}
38+
fetchUserAfterAuthSuccess?.();
39+
}
40+
3441
const { onSubmit, loading } = useAuthSubmit(
3542
() =>
3643
UserApi.formLogin({
@@ -42,7 +49,7 @@ export default function FormLogin(props: FormLoginProps) {
4249
}),
4350
false,
4451
null,
45-
fetchUserAfterAuthSuccess,
52+
afterLoginSuccess,
4653
);
4754

4855
return (

client/packages/lowcoder/src/pages/userAuth/formLoginSteps.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,16 @@ export default function FormLoginSteps(props: FormLoginProps) {
230230
}
231231
}, [isEnterpriseMode]);
232232

233-
if (isEnterpriseMode) {
233+
useEffect(() => {
234+
if (Boolean(props.organizationId)) {
235+
fetchOrgsByEmail();
236+
}
237+
}, [props.organizationId]);
238+
239+
if (isEnterpriseMode || Boolean(props.organizationId)) {
234240
return (
235241
<Spin indicator={<LoadingOutlined style={{ fontSize: 30 }} />} spinning={isFetchingConfig}>
236-
{ isEmailLoginEnabled && <FormLogin /> }
242+
{ isEmailLoginEnabled && <FormLogin organizationId={props.organizationId} /> }
237243
<ThirdPartyAuth
238244
invitationId={invitationId}
239245
invitedOrganizationId={organizationId}
@@ -244,7 +250,7 @@ export default function FormLoginSteps(props: FormLoginProps) {
244250
<Divider/>
245251
<AuthBottomView>
246252
<StyledRouteLink to={{
247-
pathname: AUTH_REGISTER_URL,
253+
pathname: props.organizationId ? `/org/${props.organizationId}/auth/register` : AUTH_REGISTER_URL,
248254
state: {...location.state || {}, email: account}
249255
}}>
250256
{trans("userAuth.register")}

0 commit comments

Comments
 (0)