Skip to content

Commit 7a83d8d

Browse files
removed invalid licence alert
1 parent ad9c718 commit 7a83d8d

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

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

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ const childrenMap = {
8282
dayMaxEvents: withDefault(NumberControl, 2),
8383
eventMaxStack: withDefault(NumberControl, 0),
8484
style: styleControl(CalendarStyle),
85-
licenceKey: withDefault(
86-
StringControl,
87-
"CC-Attribution-NonCommercial-NoDerivatives"
88-
),
85+
licenceKey: withDefault(StringControl, ""),
8986
};
9087

9188
let CalendarBasicComp = (function () {
@@ -346,7 +343,24 @@ let CalendarBasicComp = (function () {
346343
if (licenceKey != "") {
347344
defaultView = defaultPremiumView;
348345
}
349-
346+
const plugins = [
347+
dayGridPlugin,
348+
timeGridPlugin,
349+
interactionPlugin,
350+
listPlugin,
351+
momentPlugin,
352+
];
353+
const filteredPlugins = plugins.filter((plugin) => {
354+
if (licenceKey === "") {
355+
return ![
356+
resourceTimelinePlugin,
357+
resourceTimeGridPlugin,
358+
adaptivePlugin,
359+
].includes(plugin);
360+
} else {
361+
return true;
362+
}
363+
});
350364
return (
351365
<Wrapper
352366
ref={ref}
@@ -370,16 +384,7 @@ let CalendarBasicComp = (function () {
370384
locale={getCalendarLocale()}
371385
locales={allLocales}
372386
firstDay={Number(firstDay)}
373-
plugins={[
374-
dayGridPlugin,
375-
timeGridPlugin,
376-
interactionPlugin,
377-
listPlugin,
378-
momentPlugin,
379-
resourceTimelinePlugin,
380-
resourceTimeGridPlugin,
381-
adaptivePlugin,
382-
]}
387+
plugins={filteredPlugins}
383388
headerToolbar={toolBar(defaultView)}
384389
moreLinkClick={(info) => {
385390
let left = 0;
@@ -547,4 +552,4 @@ CalendarBasicComp = class extends CalendarBasicComp {
547552
export const CalendarComp = withExposingConfigs(CalendarBasicComp, [
548553
new NameConfig("events", trans("calendar.events")),
549554
NameConfigHidden,
550-
]);
555+
]);

0 commit comments

Comments
 (0)