Skip to content

Dev -> Main - v2.3.1 Fix #737

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 49 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
bc9d45c
Merge branch 'dev' of https://github.com/lowcoder-org/lowcoder into dev
freddysundowner Feb 19, 2024
c60dcce
Merge branch 'dev' of https://github.com/lowcoder-org/lowcoder into dev
freddysundowner Feb 21, 2024
ebfbdfd
added licence key data field
freddysundowner Feb 22, 2024
e7014bb
Merge branch 'dev' of https://github.com/lowcoder-org/lowcoder into c…
freddysundowner Feb 23, 2024
df156a5
fixed access of licence in the full calendar
freddysundowner Feb 23, 2024
0e95abd
fixed bug on licence key input filled
freddysundowner Feb 23, 2024
a1918e5
"add premium and free calendar options drop down"
freddysundowner Feb 26, 2024
4b86584
removed hand coded licence key
freddysundowner Feb 26, 2024
50f87fc
Mention component height issue fix, checkbox component hover backgrou…
imtananikhwa Feb 26, 2024
658e299
Add logs for debugging
aq-ikhwa-tech Feb 27, 2024
4890116
fix for comps hide on adding to modal/drawer
raheeliftikhar5 Feb 27, 2024
6b8a497
Fixes and introduction of text-decoration and text transform property…
imtananikhwa Feb 27, 2024
f501802
CSS styles and propeties added to tabbed container while ensuring the…
imtananikhwa Feb 27, 2024
2c80045
CSS properties and their control added for segment control
imtananikhwa Feb 27, 2024
8e9ab45
Toasts Notification & Loading Mesages
sudoischenny Feb 27, 2024
36ccf9a
Merge branch 'lowcoder-org:main' into main
sudoischenny Feb 27, 2024
683179c
Update Toasts Image
sudoischenny Feb 27, 2024
3708c30
Added toast.destroy()
sudoischenny Feb 27, 2024
791cff1
Toast Dismiss
sudoischenny Feb 27, 2024
9857111
Add migration to fix existing application public view bug
aq-ikhwa-tech Feb 28, 2024
e5bbd35
Remove unnecessary logs
aq-ikhwa-tech Feb 28, 2024
a85f478
fixed styledcomponent warning in drawerComp
raheeliftikhar5 Feb 28, 2024
08b675a
added app meta fields
raheeliftikhar5 Feb 28, 2024
27d870d
Merge pull request #1 from lowcoder-org/dev
sudoischenny Feb 28, 2024
220c0cc
Merge branch 'lowcoder-org:main' into main
sudoischenny Feb 28, 2024
f30fdf2
TS issue fixed
imtananikhwa Feb 28, 2024
6e81667
Tab container type removal, due to compiler error
imtananikhwa Feb 28, 2024
a6be0ab
Merge pull request #718 from lowcoder-org/add-logs-to-debug-api-stats…
FalkWolsky Feb 28, 2024
2f7487b
Merge branch 'dev' into imtanan-task1
FalkWolsky Feb 28, 2024
b395356
Merge pull request #719 from imtananikhwa/imtanan-task1
FalkWolsky Feb 28, 2024
56d2086
Merge branch 'dev' into main
FalkWolsky Feb 28, 2024
eb3854b
Merge pull request #721 from sudoischenny/main
FalkWolsky Feb 28, 2024
8d6bf63
Merge branch 'dev' into fix_modal_comps_invisible
FalkWolsky Feb 28, 2024
5e5f73c
Merge pull request #724 from raheeliftikhar5/fix_modal_comps_invisible
FalkWolsky Feb 28, 2024
fa20094
Merge branch 'dev' into app_meta_field
FalkWolsky Feb 28, 2024
e379627
Merge pull request #725 from raheeliftikhar5/app_meta_field
FalkWolsky Feb 28, 2024
b6e1e2c
Added Comments to Marketplace Use
Feb 29, 2024
877f9f5
Add Support as App Category
Feb 29, 2024
4f58b96
Adding Admin Area Icons
Mar 1, 2024
1c44f3a
Changing Readme for latest ENV Variables
Mar 1, 2024
c96bb7e
Rounding Up Marketplace and Multi-Icon Component
Mar 3, 2024
cc5333c
Added comments based on common discussion
Feb 29, 2024
120fbc9
fix: sorted out application view rights for all cases
ludomikula Feb 29, 2024
de03572
fix: update location of marketplace app settings
ludomikula Mar 1, 2024
d5c9c32
fix: for now, allow to view non-published apps for logged in users
ludomikula Mar 1, 2024
35472c0
Adding mn height for App Cards in Marketplace
Mar 4, 2024
73ea344
Merge branch 'dev' into calendar-licenc-key
FalkWolsky Mar 4, 2024
3452d4b
Merge pull request #736 from lowcoder-org/calendar-licenc-key
FalkWolsky Mar 4, 2024
f31c4f9
Increase Lowcoder Comps Version
Mar 4, 2024
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
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#2A3012",
"titleBar.activeBackground": "#3B431A",
"titleBar.activeForeground": "#F9FAF2"
}
}
6 changes: 5 additions & 1 deletion client/packages/lowcoder-comps/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"name": "lowcoder-comps",
"version": "0.0.24",
"version": "0.0.26",
"type": "module",
"license": "MIT",
"dependencies": {
"@fullcalendar/adaptive": "^6.1.11",
"@fullcalendar/core": "^6.1.6",
"@fullcalendar/daygrid": "^6.1.6",
"@fullcalendar/interaction": "^6.1.6",
"@fullcalendar/list": "^6.1.9",
"@fullcalendar/moment": "^6.1.6",
"@fullcalendar/react": "^6.1.6",
"@fullcalendar/resource": "^6.1.11",
"@fullcalendar/resource-timegrid": "^6.1.11",
"@fullcalendar/resource-timeline": "^6.1.11",
"@fullcalendar/timegrid": "^6.1.6",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
Expand Down
118 changes: 94 additions & 24 deletions client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ import { default as Form } from "antd/es/form";
import { default as Input } from "antd/es/input";
import { trans, getCalendarLocale } from "../../i18n/comps";
import { createRef, useContext, useRef, useState } from "react";
import resourceTimelinePlugin from "@fullcalendar/resource-timeline";
import resourceTimeGridPlugin from "@fullcalendar/resource-timegrid";
import adaptivePlugin from "@fullcalendar/adaptive";

import FullCalendar from "@fullcalendar/react";
import dayGridPlugin from "@fullcalendar/daygrid";
import timeGridPlugin from "@fullcalendar/timegrid";
Expand All @@ -35,7 +39,8 @@ import allLocales from "@fullcalendar/core/locales-all";
import { EventContentArg, DateSelectArg } from "@fullcalendar/core";
import momentPlugin from "@fullcalendar/moment";
import {
DefaultViewOptions,
DefaultWithFreeViewOptions,
DefaultWithPremiumViewOptions,
FirstDayOptions,
Wrapper,
Event,
Expand All @@ -52,20 +57,28 @@ import {
} from "./calendarConstants";
import dayjs from "dayjs";

function filterViews() {}

const childrenMap = {
events: jsonValueExposingStateControl("events", defaultData),
onEvent: ChangeEventHandlerControl,

editable: withDefault(BoolControl, true),
defaultDate: withDefault(StringControl, "{{ new Date() }}"),
defaultView: dropdownControl(DefaultViewOptions, "timeGridWeek"),
defaultFreeView: dropdownControl(DefaultWithFreeViewOptions, "timeGridWeek"),
defaultPremiumView: dropdownControl(
DefaultWithPremiumViewOptions,
"timeGridWeek"
),

firstDay: dropdownControl(FirstDayOptions, "1"),
showEventTime: withDefault(BoolControl, true),
showWeekends: withDefault(BoolControl, true),
showAllDay: withDefault(BoolControl, true),
dayMaxEvents: withDefault(NumberControl, 2),
eventMaxStack: withDefault(NumberControl, 0),
style: styleControl(CalendarStyle),
licenceKey: withDefault(StringControl, ""),
};

let CalendarBasicComp = (function () {
Expand All @@ -83,14 +96,17 @@ let CalendarBasicComp = (function () {
start: dayjs(item.start, DateParser).format(),
end: dayjs(item.end, DateParser).format(),
allDay: item.allDay,
color: isValidColor(item.color || "") ? item.color : theme?.theme?.primary,
color: isValidColor(item.color || "")
? item.color
: theme?.theme?.primary,
...(item.groupId ? { groupId: item.groupId } : null),
};
});

const {
defaultDate,
defaultView,
defaultFreeView,
defaultPremiumView,
showEventTime,
showWeekends,
showAllDay,
Expand All @@ -99,13 +115,19 @@ let CalendarBasicComp = (function () {
style,
firstDay,
editable,
licenceKey,
} = props;

function renderEventContent(eventInfo: EventContentArg) {
const isList = eventInfo.view.type === "listWeek";
let sizeClass = "";
if ([ViewType.WEEK, ViewType.DAY].includes(eventInfo.view.type as ViewType)) {
const duration = dayjs(eventInfo.event.end).diff(dayjs(eventInfo.event.start), "minutes");
if (
[ViewType.WEEK, ViewType.DAY].includes(eventInfo.view.type as ViewType)
) {
const duration = dayjs(eventInfo.event.end).diff(
dayjs(eventInfo.event.start),
"minutes"
);
if (duration <= 30 || eventInfo.event.allDay) {
sizeClass = "small";
} else if (duration <= 60) {
Expand Down Expand Up @@ -137,7 +159,9 @@ let CalendarBasicComp = (function () {
onClick={(e) => {
e.stopPropagation();
props.onEvent("change");
const event = events.filter((item: EventType) => item.id !== eventInfo.event.id);
const event = events.filter(
(item: EventType) => item.id !== eventInfo.event.id
);
props.events.onChange(event);
}}
onMouseDown={(e) => {
Expand Down Expand Up @@ -195,7 +219,9 @@ let CalendarBasicComp = (function () {
};

const showModal = (event: EventType, ifEdit: boolean) => {
const modalTitle = ifEdit ? trans("calendar.editEvent") : trans("calendar.creatEvent");
const modalTitle = ifEdit
? trans("calendar.editEvent")
: trans("calendar.creatEvent");
form && form.setFieldsValue(event);
const eventId = editEvent.current?.id;
CustomModal.confirm({
Expand All @@ -209,14 +235,18 @@ let CalendarBasicComp = (function () {
</Tooltip>
}
name="id"
rules={[{ required: true, message: trans("calendar.eventIdRequire") }]}
rules={[
{ required: true, message: trans("calendar.eventIdRequire") },
]}
>
<Input />
</Form.Item>
<Form.Item
label={trans("calendar.eventName")}
name="title"
rules={[{ required: true, message: trans("calendar.eventNameRequire") }]}
rules={[
{ required: true, message: trans("calendar.eventNameRequire") },
]}
>
<Input />
</Form.Item>
Expand All @@ -239,9 +269,13 @@ let CalendarBasicComp = (function () {
form.submit();
return form.validateFields().then(() => {
const { id, groupId, color, title = "" } = form.getFieldsValue();
const idExist = props.events.value.findIndex((item: EventType) => item.id === id);
const idExist = props.events.value.findIndex(
(item: EventType) => item.id === id
);
if (idExist > -1 && id !== eventId) {
form.setFields([{ name: "id", errors: [trans("calendar.eventIdExist")] }]);
form.setFields([
{ name: "id", errors: [trans("calendar.eventIdExist")] },
]);
throw new Error();
}
if (ifEdit) {
Expand Down Expand Up @@ -287,6 +321,10 @@ let CalendarBasicComp = (function () {
} catch (error) {
initialDate = undefined;
}
let defaultView = defaultFreeView;
if (licenceKey != "") {
defaultView = defaultPremiumView;
}

return (
<Wrapper
Expand All @@ -306,7 +344,16 @@ let CalendarBasicComp = (function () {
locale={getCalendarLocale()}
locales={allLocales}
firstDay={Number(firstDay)}
plugins={[dayGridPlugin, timeGridPlugin, interactionPlugin, listPlugin, momentPlugin]}
plugins={[
dayGridPlugin,
timeGridPlugin,
interactionPlugin,
listPlugin,
momentPlugin,
resourceTimelinePlugin,
resourceTimeGridPlugin,
adaptivePlugin,
]}
headerToolbar={headerToolbar}
moreLinkClick={(info) => {
let left = 0;
Expand All @@ -319,15 +366,19 @@ let CalendarBasicComp = (function () {
}
} else {
if (info.allDay) {
left = ele.offsetParent?.parentElement?.parentElement?.offsetLeft || 0;
left =
ele.offsetParent?.parentElement?.parentElement?.offsetLeft ||
0;
} else {
left =
ele.offsetParent?.parentElement?.parentElement?.parentElement?.offsetLeft || 0;
ele.offsetParent?.parentElement?.parentElement?.parentElement
?.offsetLeft || 0;
}
}
setLeft(left);
}}
buttonText={buttonText}
schedulerLicenseKey={licenceKey}
views={views}
eventClassNames={() => (!showEventTime ? "no-time" : "")}
slotLabelFormat={slotLabelFormat}
Expand All @@ -346,7 +397,9 @@ let CalendarBasicComp = (function () {
eventContent={renderEventContent}
select={(info) => handleCreate(info)}
eventClick={(info) => {
const event = events.find((item: EventType) => item.id === info.event.id);
const event = events.find(
(item: EventType) => item.id === info.event.id
);
editEvent.current = event;
setTimeout(() => {
editEvent.current = undefined;
Expand Down Expand Up @@ -385,10 +438,18 @@ let CalendarBasicComp = (function () {
);
})
.setPropertyViewFn((children) => {
let licence = children.licenceKey.getView();
return (
<>
<Section name={sectionNames.basic}>{children.events.propertyView({})}</Section>
<Section name={sectionNames.interaction}>{children.onEvent.getPropertyView()}</Section>
<Section name={sectionNames.basic}>
{children.events.propertyView({})}
</Section>
<Section name={sectionNames.interaction}>
{children.licenceKey.propertyView({
label: trans("calendar.licence"),
})}
{children.onEvent.getPropertyView()}
</Section>
<Section name={sectionNames.advanced}>
{children.editable.propertyView({
label: trans("calendar.editable"),
Expand All @@ -397,10 +458,15 @@ let CalendarBasicComp = (function () {
label: trans("calendar.defaultDate"),
tooltip: trans("calendar.defaultDateTooltip"),
})}
{children.defaultView.propertyView({
label: trans("calendar.defaultView"),
tooltip: trans("calendar.defaultViewTooltip"),
})}
{licence == ""
? children.defaultFreeView.propertyView({
label: trans("calendar.defaultView"),
tooltip: trans("calendar.defaultViewTooltip"),
})
: children.defaultPremiumView.propertyView({
label: trans("calendar.defaultView"),
tooltip: trans("calendar.defaultViewTooltip"),
})}
{children.firstDay.propertyView({
label: trans("calendar.startWeek"),
})}
Expand All @@ -424,8 +490,12 @@ let CalendarBasicComp = (function () {
tooltip: trans("calendar.eventMaxStackTooltip"),
})}
</Section>
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
<Section name={sectionNames.style}>{children.style.getPropertyView()}</Section>
<Section name={sectionNames.layout}>
{hiddenPropertyView(children)}
</Section>
<Section name={sectionNames.style}>
{children.style.getPropertyView()}
</Section>
</>
);
})
Expand Down
Loading