Skip to content

Commit 092f468

Browse files
committed
feat(calendar-web): editorconfig edits
1 parent e30529c commit 092f468

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

packages/pluggableWidgets/calendar-web/src/Calendar.editorPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function preview(props: CalendarPreviewProps): ReactElement {
8080
<div className={classnames("widget-events-preview", "widget-calendar", className)} style={wrapperStyle}>
8181
<Calendar
8282
components={{ toolbar: CustomToolbar }}
83-
defaultView={props.defaultView}
83+
defaultView={props.defaultViewStandard}
8484
events={events}
8585
localizer={localizer}
8686
messages={{ ...localizer.messages, work_week: "Custom" }}

packages/pluggableWidgets/calendar-web/src/Calendar.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
</property>
8686
<property key="defaultViewCustom" type="enumeration" defaultValue="month">
8787
<caption>Initial selected view</caption>
88-
<description>Work week and agenda are only available in custom views</description>
88+
<description>The default view to show when the calendar is loaded</description>
8989
<enumerationValues>
9090
<enumerationValue key="day">Day</enumerationValue>
9191
<enumerationValue key="week">Week</enumerationValue>
@@ -95,7 +95,7 @@
9595
</enumerationValues>
9696
</property>
9797
<property key="defaultViewStandard" type="enumeration" defaultValue="month">
98-
<caption>Default view</caption>
98+
<caption>Initial selected view</caption>
9999
<description>The default view to show when the calendar is loaded</description>
100100
<enumerationValues>
101101
<enumerationValue key="day">Day</enumerationValue>
@@ -119,9 +119,8 @@
119119
<description>The hour at which the day view ends (1-24)</description>
120120
</property>
121121
<!-- Custom week caption -->
122-
<property key="customViewCaption" type="translatableString" required="false">
122+
<property key="customViewCaption" type="textTemplate" required="false">
123123
<caption>Custom view caption</caption>
124-
<category>View</category>
125124
<description>Label used for the custom work-week button and title. Defaults to "Custom".</description>
126125
<translations>
127126
<translation lang="en_US">Custom</translation>

packages/pluggableWidgets/calendar-web/src/__tests__/Calendar.spec.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ const defaultProps: CalendarContainerProps = {
1111
databaseDataSource: new ListValueBuilder().withItems([]).build(),
1212
titleType: "attribute",
1313
view: "custom",
14-
defaultView: "work_week",
14+
defaultViewStandard: "month",
15+
defaultViewCustom: "work_week",
1516
editable: "default",
1617
enableCreate: true,
1718
widthUnit: "percentage",

packages/pluggableWidgets/calendar-web/src/utils/calendar-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ interface DragAndDropCalendarProps<TEvent extends object = Event, TResource exte
6969
export function extractCalendarProps(props: CalendarContainerProps): DragAndDropCalendarProps<CalEvent, object> {
7070
const isCustomView = props.view === "custom";
7171
const defaultView = isCustomView ? props.defaultViewCustom : props.defaultViewStandard;
72-
const customCaption: string = props.customViewCaption ?? "Custom";
72+
const customCaption: string = props.customViewCaption?.value ?? "Custom";
7373
const visibleSet = new Set<number>();
7474
const dayProps = [
7575
{ prop: props.showSunday, day: 0 },

packages/pluggableWidgets/calendar-web/typings/CalendarProps.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @author Mendix Widgets Framework Team
55
*/
66
import { CSSProperties } from "react";
7-
import { ActionValue, EditableValue, ListValue, Option, ListActionValue, ListAttributeValue, ListExpressionValue } from "mendix";
7+
import { ActionValue, DynamicValue, EditableValue, ListValue, Option, ListActionValue, ListAttributeValue, ListExpressionValue } from "mendix";
88

99
export type TitleTypeEnum = "attribute" | "expression";
1010

@@ -47,7 +47,7 @@ export interface CalendarContainerProps {
4747
startDateAttribute?: EditableValue<Date>;
4848
minHour: number;
4949
maxHour: number;
50-
customViewCaption?: any;
50+
customViewCaption?: DynamicValue<string>;
5151
showMonday: boolean;
5252
showTuesday: boolean;
5353
showWednesday: boolean;
@@ -99,7 +99,7 @@ export interface CalendarPreviewProps {
9999
startDateAttribute: string;
100100
minHour: number | null;
101101
maxHour: number | null;
102-
customViewCaption: any;
102+
customViewCaption: string;
103103
showMonday: boolean;
104104
showTuesday: boolean;
105105
showWednesday: boolean;

0 commit comments

Comments
 (0)