Skip to content

Commit 3de9006

Browse files
committed
conflicts resolved
2 parents 0d15cc7 + 7bd15c6 commit 3de9006

File tree

10 files changed

+11113
-6198
lines changed

10 files changed

+11113
-6198
lines changed

client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx

Lines changed: 195 additions & 47 deletions
Large diffs are not rendered by default.

client/packages/lowcoder-comps/src/comps/calendarComp/calendarConstants.tsx

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,6 @@ export const Event = styled.div<{
769769
}
770770
`;
771771

772-
773-
774772
export const FormWrapper = styled(Form)<{
775773
$modalStyle?: EventModalStyleType
776774
}>`
@@ -938,10 +936,10 @@ export const FirstDayOptions = [
938936
},
939937
];
940938

941-
export const defaultData = [
939+
export const defaultEvents = [
942940
{
943941
id: "1",
944-
title: "Coding",
942+
label: "Coding",
945943
start: dayjs().hour(10).minute(0).second(0).format(DATE_TIME_FORMAT),
946944
end: dayjs().hour(12).minute(30).second(0).format(DATE_TIME_FORMAT),
947945
color: "#079968",
@@ -960,34 +958,58 @@ export const defaultData = [
960958
},
961959
{
962960
id: "2",
963-
title: "Rest",
961+
label: "Rest",
964962
start: dayjs().hour(24).format(DATE_FORMAT),
965963
end: dayjs().hour(48).format(DATE_FORMAT),
966964
color: "#079968",
967965
allDay: true,
968966
},
967+
{
968+
id: "3",
969+
resourceId: "d1",
970+
label: "event 1",
971+
start: dayjs().hour(10).minute(0).second(0).format(DATE_TIME_FORMAT),
972+
end: dayjs().hour(17).minute(30).second(0).format(DATE_TIME_FORMAT),
973+
color: "#079968",
974+
},
975+
{
976+
id: "4",
977+
resourceId: "b",
978+
label: "event 5",
979+
start: dayjs().hour(8).minute(0).second(0).format(DATE_TIME_FORMAT),
980+
end: dayjs().hour(16).minute(30).second(0).format(DATE_TIME_FORMAT),
981+
color: "#079968",
982+
},
983+
{
984+
id: "5",
985+
resourceId: "a",
986+
label: "event 3",
987+
start: dayjs().hour(12).minute(0).second(0).format(DATE_TIME_FORMAT),
988+
end: dayjs().hour(21).minute(30).second(0).format(DATE_TIME_FORMAT),
989+
color: "#079968",
990+
},
969991
];
970992
export const resourcesEventsDefaultData = [
971993
{
972994
id: "1",
973995
resourceId: "d1",
974-
title: "event 1",
996+
label: "event 1",
975997
start: dayjs().hour(10).minute(0).second(0).format(DATE_TIME_FORMAT),
976998
end: dayjs().hour(17).minute(30).second(0).format(DATE_TIME_FORMAT),
977999
color: "#079968",
9781000
},
9791001
{
9801002
id: "2",
9811003
resourceId: "b",
982-
title: "event 5",
1004+
label: "event 5",
9831005
start: dayjs().hour(8).minute(0).second(0).format(DATE_TIME_FORMAT),
9841006
end: dayjs().hour(16).minute(30).second(0).format(DATE_TIME_FORMAT),
9851007
color: "#079968",
9861008
},
9871009
{
9881010
id: "3",
9891011
resourceId: "a",
990-
title: "event 3",
1012+
label: "event 3",
9911013
start: dayjs().hour(12).minute(0).second(0).format(DATE_TIME_FORMAT),
9921014
end: dayjs().hour(21).minute(30).second(0).format(DATE_TIME_FORMAT),
9931015
color: "#079968",
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
import {
2+
MultiCompBuilder,
3+
StringControl,
4+
BoolControl,
5+
ColorControl,
6+
optionsControl,
7+
NewChildren,
8+
RecordConstructorToComp,
9+
controlItem
10+
} from 'lowcoder-sdk';
11+
import { default as Divider } from "antd/es/divider";
12+
import { trans } from "../../i18n/comps";
13+
import styled from "styled-components";
14+
import { defaultEvents } from './calendarConstants';
15+
16+
const PropertyViewWrapper = styled.div`
17+
max-height: 80vh;
18+
height: 100%;
19+
overflow-y: auto;
20+
display: flex;
21+
flex-direction: column;
22+
gap: 8px;
23+
`;
24+
25+
type NewChildren<T> = typeof NewChildren;
26+
type RecordConstructorToComp<T> = typeof RecordConstructorToComp;
27+
28+
const eventChildrenMap = {
29+
id: StringControl,
30+
label: StringControl,
31+
detail: StringControl,
32+
groupId: StringControl,
33+
resourceId: StringControl,
34+
start: StringControl, // TODO: Create Date,Time & DateTime Controls
35+
end: StringControl,
36+
allDay: BoolControl,
37+
color: ColorControl,
38+
backgroundColor: ColorControl,
39+
titleColor: ColorControl,
40+
detailColor: ColorControl,
41+
titleFontWeight: StringControl,
42+
titleFontStyle: StringControl,
43+
detailFontWeight: StringControl,
44+
detailFontStyle: StringControl,
45+
animation: StringControl,
46+
animationDelay: StringControl,
47+
animationDuration: StringControl,
48+
animationIterationCount: StringControl,
49+
};
50+
51+
type EventChildrenType = NewChildren<RecordConstructorToComp<typeof eventChildrenMap>>;
52+
53+
const EventGeneral = ({ childrenMap }: { childrenMap: EventChildrenType }) => (
54+
<>
55+
{controlItem({filterText: 'general'}, (
56+
<><b>{trans("calendar.general")}</b></>
57+
))}
58+
{childrenMap.id.propertyView({
59+
label: trans("calendar.eventId"),
60+
tooltip: trans("calendar.eventIdTooltip"),
61+
})}
62+
{childrenMap.label.propertyView({
63+
label: trans("calendar.eventName"),
64+
})}
65+
{childrenMap.detail.propertyView({
66+
label: trans("calendar.eventdetail"),
67+
})}
68+
{childrenMap.groupId.propertyView({
69+
label: trans("calendar.eventGroupId"),
70+
tooltip: trans("calendar.groupIdTooltip"),
71+
})}
72+
{childrenMap.resourceId.propertyView({
73+
label: trans("calendar.eventResourceId"),
74+
})}
75+
{childrenMap.start.propertyView({
76+
label: trans("calendar.eventStartTime"),
77+
})}
78+
{childrenMap.end.propertyView({
79+
label: trans("calendar.eventEndTime"),
80+
})}
81+
{childrenMap.allDay.propertyView({
82+
label: trans("calendar.eventAllDay"),
83+
})}
84+
</>
85+
);
86+
87+
const EventColorStyles = ({ childrenMap }: { childrenMap: EventChildrenType }) => (
88+
<>
89+
{controlItem({filterText: 'colorStyles'}, (
90+
<><b>{trans("calendar.colorStyles")}</b></>
91+
))}
92+
{childrenMap.titleColor.propertyView({
93+
label: trans("calendar.eventTitleColor"),
94+
})}
95+
{childrenMap.detailColor.propertyView({
96+
label: trans("calendar.eventdetailColor"),
97+
})}
98+
{childrenMap.color.propertyView({
99+
label: trans("calendar.eventColor"),
100+
})}
101+
{childrenMap.backgroundColor.propertyView({
102+
label: trans("calendar.eventBackgroundColor"),
103+
})}
104+
</>
105+
);
106+
107+
const EventFontStyles = ({ childrenMap }: { childrenMap: EventChildrenType }) => (
108+
<>
109+
{controlItem({filterText: 'fontStyles'}, (
110+
<><b>{trans("calendar.fontStyles")}</b></>
111+
))}
112+
{childrenMap.titleFontWeight.propertyView({
113+
label: trans("calendar.eventTitleFontWeight"),
114+
})}
115+
{childrenMap.titleFontStyle.propertyView({
116+
label: trans("calendar.eventTitleFontStyle"),
117+
})}
118+
{childrenMap.detailFontWeight.propertyView({
119+
label: trans("calendar.eventdetailFontWeight"),
120+
})}
121+
{childrenMap.detailFontStyle.propertyView({
122+
label: trans("calendar.eventdetailFontStyle"),
123+
})}
124+
</>
125+
);
126+
127+
const EventAnimations = ({ childrenMap }: { childrenMap: EventChildrenType }) => (
128+
<>
129+
{controlItem({filterText: 'animations'}, (
130+
<><b>{trans("calendar.animations")}</b></>
131+
))}
132+
{childrenMap.animation.propertyView({
133+
label: trans("calendar.animationType"),
134+
})}
135+
{childrenMap.animationDelay.propertyView({
136+
label: trans("calendar.animationDelay"),
137+
})}
138+
{childrenMap.animationDuration.propertyView({
139+
label: trans("calendar.animationDuration"),
140+
})}
141+
{childrenMap.animationIterationCount.propertyView({
142+
label: trans("calendar.animationIterationCount"),
143+
})}
144+
</>
145+
);
146+
147+
let EventOption = new MultiCompBuilder(eventChildrenMap,
148+
(props: any) => props
149+
)
150+
.setPropertyViewFn((children: EventChildrenType) => (
151+
<PropertyViewWrapper>
152+
<EventGeneral childrenMap={children} />
153+
<Divider style={{ margin: '12px 0' }} />
154+
<EventColorStyles childrenMap={children} />
155+
<Divider style={{ margin: '12px 0' }} />
156+
<EventFontStyles childrenMap={children} />
157+
<Divider style={{ margin: '12px 0' }} />
158+
<EventAnimations childrenMap={children} />
159+
</PropertyViewWrapper>
160+
))
161+
.build();
162+
163+
export const EventOptionControl = optionsControl(
164+
EventOption,
165+
{
166+
initOptions: defaultEvents,
167+
uniqField: "id",
168+
}
169+
);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ export const en = {
329329
eventIdRequire: "Enter Event ID",
330330
eventIdTooltip: "Unique ID for each event",
331331
eventIdExist: "ID Exists",
332+
eventStartTime: "Start Time",
333+
eventEndTime: "End Time",
334+
eventAllDay: "All Day",
335+
eventResourceId: "Resource ID",
332336
dragDropEventHandlers: "Drag/Drop Event Handlers",
333337
general: "General",
334338
colorStyles:"Color Styles",

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,7 @@ const childrenMap = {
9696
name: "{{currentUser.name}}",
9797
email: "{{currentUser.email}}",
9898
}),
99-
mentionList: jsonControl(checkMentionListData, {
100-
"@": ["Li Lei", "Han Meimei"],
101-
"#": ["123", "456", "789"],
102-
}),
99+
mentionList: jsonControl(checkMentionListData, {"@":["John Doe","Jane Doe","Michael Smith","Emily Davis","Robert Johnson","Patricia Brown","William Jones","Jennifer Miller","David Wilson","Linda Moore"],"#":["#lowcode","#automation","#appbuilder","#nocode","#workflow","#draganddrop","#rapiddevelopment","#digitaltransformation","#integration","#api"]}),
103100
onEvent: eventHandlerControl(EventOptions),
104101
style: styleControl(CommentStyle , 'style'),
105102
animationStyle: styleControl(AnimationStyle , 'animationStyle'),

client/packages/lowcoder/src/comps/comps/commentComp/commentConstants.tsx

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,7 @@ export const CommentUserDataTooltip = (
4545
</li>
4646
)
4747

48-
export const commentDate = [
49-
{
50-
user: {
51-
name: "Li Lei",
52-
avatar:
53-
"https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png",
54-
},
55-
value: "What is the use of this component?",
56-
createdAt: "2023-06-15T08:40:41.658Z",
57-
},
58-
{
59-
user: { name: "mou" },
60-
value: "This component allows you to post or delete comments, as well as mention people who appear in the chat.",
61-
createdAt: "2023-06-16T08:43:42.658Z",
62-
},
63-
{
64-
user: { name: "Han Meimei", displayName: "Han" },
65-
value: "I want to give it a try",
66-
createdAt: "2023-06-17T08:49:01.658Z",
67-
},
68-
{
69-
user: { name: "mou" },
70-
value: "Enter the content in the input box below and press shift+enter to send it immediately",
71-
createdAt: "2023-06-18T08:50:11.658Z",
72-
},
73-
];
48+
export const commentDate = [{"user":{"name":"John Doe","avatar":"https://ui-avatars.com/api/?name=John+Doe"},"value":"Has anyone tried using Lowcode for our new internal tool yet?","createdAt":"2024-09-20T10:15:41.658Z"},{"user":{"name":"Jane Smith","avatar":"https://ui-avatars.com/api/?name=Jane+Smith"},"value":"Yes, I’ve been experimenting with it for automating our workflows. It's super quick to set up.","createdAt":"2024-09-20T10:17:12.658Z"},{"user":{"name":"Michael Brown","displayName":"Michael","avatar":"https://ui-avatars.com/api/?name=Michael+Brown"},"value":"That sounds interesting! What kind of automation are you building?","createdAt":"2024-09-20T10:18:45.658Z"},{"user":{"name":"Jane Smith","avatar":"https://ui-avatars.com/api/?name=Jane+Smith"},"value":"Mostly automating form submissions and integrating them with our CRM. It's easy to drag-and-drop components.","createdAt":"2024-09-20T10:20:30.658Z"},{"user":{"name":"John Doe","avatar":"https://ui-avatars.com/api/?name=John+Doe"},"value":"We should look into using it for API integrations as well. Lowcode could save a lot of development time.","createdAt":"2024-09-20T10:22:05.658Z"},{"user":{"name":"Michael Brown","displayName":"Michael","avatar":"https://ui-avatars.com/api/?name=Michael+Brown"},"value":"I agree. Let’s plan a session next week to dive deeper into the possibilities.","createdAt":"2024-09-20T10:23:55.658Z"}];
7449

7550
export function convertCommentData(data: any) {
7651
return data === "" ? [] : checkDataNodes(data) ?? [];

client/packages/lowcoder/src/comps/comps/textInputComp/mentionComp.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,7 @@ let MentionTmpComp = (function () {
9898
autoHeight: AutoHeightControl,
9999
style: styleControl(InputLikeStyle , 'style'),
100100
animationStyle: styleControl(AnimationStyle , 'animationStyle'),
101-
mentionList: jsonControl(checkMentionListData, {
102-
"@": ["Li Lei", "Han Meimei"],
103-
"#": ["123", "456", "789"],
104-
}),
101+
mentionList: jsonControl(checkMentionListData, {"@":["John Doe","Jane Doe","Michael Smith","Emily Davis","Robert Johnson","Patricia Brown","William Jones","Jennifer Miller","David Wilson","Linda Moore"],"#":["#lowcode","#automation","#appbuilder","#nocode","#workflow","#draganddrop","#rapiddevelopment","#digitaltransformation","#integration","#api"]}),
105102
onEvent: eventHandlerControl(EventOptions),
106103
invalid: booleanExposingStateControl("invalid"),
107104
};

client/packages/lowcoder/src/pages/editor/AppEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const AppEditor = React.memo(() => {
115115
if (currentUser && application) {
116116
const lastEditedAt = dayjs(application?.lastEditedAt);
117117
const lastEditedDiff = dayjs().diff(lastEditedAt, 'minutes');
118-
const shouldBlockEditing = currentUser.id !== application?.editingUserId && lastEditedDiff < 3;
118+
const shouldBlockEditing = Boolean(application?.editingUserId) && currentUser.id !== application?.editingUserId && lastEditedDiff < 3;
119119
setBlockEditing(shouldBlockEditing);
120120
}
121121
}, [application, currentUser]);

0 commit comments

Comments
 (0)