diff --git a/packages/nc-gui/components/nc/ErrorBoundary.vue b/packages/nc-gui/components/nc/ErrorBoundary.vue
index 83da1797ed..98474d193e 100644
--- a/packages/nc-gui/components/nc/ErrorBoundary.vue
+++ b/packages/nc-gui/components/nc/ErrorBoundary.vue
@@ -29,7 +29,7 @@ export default {
const copyError = async () => {
try {
- if (error.value) await copy(`message: ${error.value.message}\n\n${error.value.stack}`)
+ if (error.value) await copy(`message: ${error.value?.message}\n\n${error.value?.stack}`)
message.info('Error message copied to clipboard.')
} catch (e) {
message.error('Something went wrong while copying to clipboard, please copy from browser console.')
@@ -95,9 +95,9 @@ export default {
>
-
Message: {{ error.message }}
+
Message: {{ error?.message }}
-
{{ error.stack }}
+
{{ error?.stack }}
@@ -107,7 +107,7 @@ export default {
Copy Error
-
+
Reload
diff --git a/packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue b/packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue
index 7d6e5c8864..82fe9a7977 100644
--- a/packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue
+++ b/packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue
@@ -183,6 +183,17 @@ const dropEvent = (event: DragEvent) => {
updateRowProperty(newRow, updateProperty, false)
}
}
+
+// TODO: Add Support for multiple ranges when multiple ranges are supported
+const newRecord = () => {
+ if (!isUIAllowed('dataEdit') || !calendarRange.value?.length) return
+ const record = {
+ row: {
+ [calendarRange.value[0].fk_from_col!.title!]: selectedDate.value.format('YYYY-MM-DD HH:mm:ssZ'),
+ },
+ }
+ emit('newRecord', record)
+}
@@ -191,6 +202,7 @@ const dropEvent = (event: DragEvent) => {
ref="container"
class="w-full relative h-[calc(100vh-10.8rem)] overflow-y-auto nc-scrollbar-md"
data-testid="nc-calendar-day-view"
+ @dblclick="newRecord"
@drop="dropEvent"
>
{
ref="container"
class="w-full h-full flex text-md font-bold text-gray-500 items-center justify-center"
@drop="dropEvent"
+ @dblclick="newRecord"
>
No records in this day
diff --git a/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue b/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue
index 8f1e6c55e3..3af93de23e 100644
--- a/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue
+++ b/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue
@@ -108,7 +108,7 @@ const recordsAcrossAllRange = computed<{
if (fromCol && endCol) {
for (const record of sortedFormattedData) {
// We use this id during the drag and drop operation and to keep track of the number of records that overlap at a given time
- const id = generateRandomNumber()
+ const id = record.rowMeta?.id ?? generateRandomNumber()
let startDate = dayjs(record.row[fromCol.title!])
let endDate = dayjs(record.row[endCol.title!])
@@ -202,7 +202,7 @@ const recordsAcrossAllRange = computed<{
}
} else if (fromCol) {
for (const record of sortedFormattedData) {
- const id = generateRandomNumber()
+ const id = record.rowMeta?.id ?? generateRandomNumber()
const startDate = dayjs(record.row[fromCol.title!])
@@ -611,11 +611,26 @@ const viewMore = (hour: dayjs.Dayjs) => {
selectedTime.value = hour
showSideMenu.value = true
}
+
+const selectHour = (hour: dayjs.Dayjs) => {
+ selectedTime.value = hour
+ dragRecord.value = null
+}
+
+// TODO: Add Support for multiple ranges when multiple ranges are supported
+const newRecord = (hour: dayjs.Dayjs) => {
+ if (!isUIAllowed('dataEdit') || !calendarRange.value?.length) return
+ const record = {
+ row: {
+ [calendarRange.value[0].fk_from_col!.title!]: hour.format('YYYY-MM-DD HH:mm:ssZ'),
+ },
+ }
+ emit('newRecord', record)
+}
-
- No records in this day