From 8c36b267a5cdff5d81aee70b3d3c824daf79ce8c Mon Sep 17 00:00:00 2001 From: "Enjeck C." Date: Tue, 5 Aug 2025 07:25:34 +0100 Subject: [PATCH 1/4] feat: Inline editing - Datetime Signed-off-by: Enjeck C. --- .../ncTable/partials/TableCellDateTime.vue | 226 +++++++++++++++++- .../components/ncTable/partials/TableRow.vue | 3 - 2 files changed, 222 insertions(+), 7 deletions(-) diff --git a/src/shared/components/ncTable/partials/TableCellDateTime.vue b/src/shared/components/ncTable/partials/TableCellDateTime.vue index efb50b56d1..e9d92c2b84 100644 --- a/src/shared/components/ncTable/partials/TableCellDateTime.vue +++ b/src/shared/components/ncTable/partials/TableCellDateTime.vue @@ -3,15 +3,46 @@ - SPDX-License-Identifier: AGPL-3.0-or-later --> diff --git a/src/shared/components/ncTable/partials/TableRow.vue b/src/shared/components/ncTable/partials/TableRow.vue index f3a268d7ed..1c756e213c 100644 --- a/src/shared/components/ncTable/partials/TableRow.vue +++ b/src/shared/components/ncTable/partials/TableRow.vue @@ -114,9 +114,6 @@ export default { nonInlineEditableColumnTypes() { return [ ColumnTypes.TextRich, - ColumnTypes.Datetime, - ColumnTypes.DatetimeDate, - ColumnTypes.DatetimeTime, ] }, }, From c4ac8aa1f00bfe477e786142f22b79beaf45b747 Mon Sep 17 00:00:00 2001 From: "Enjeck C." Date: Thu, 14 Aug 2025 04:48:56 +0100 Subject: [PATCH 2/4] fix: Remove unused function and label Signed-off-by: Enjeck C. --- .../ncTable/partials/TableCellDateTime.vue | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/src/shared/components/ncTable/partials/TableCellDateTime.vue b/src/shared/components/ncTable/partials/TableCellDateTime.vue index e9d92c2b84..7d6d999706 100644 --- a/src/shared/components/ncTable/partials/TableCellDateTime.vue +++ b/src/shared/components/ncTable/partials/TableCellDateTime.vue @@ -17,7 +17,6 @@
@@ -66,28 +65,12 @@ export default { computed: { getValue() { - // default value is for the form, if you want to present the date from today, you should use the calculating column if (!this.value || this.value === 'none' || this.value === 'today' || this.value === 'now') { return '' } return this.column.formatValue(this.value) }, - getDefaultValue() { - return this.column.formatValue(this.column.datetimeDefault) - }, - - getPlaceholder() { - switch (this.column.type) { - case 'datetime-date': - return t('tables', 'Select a date') - case 'datetime-time': - return t('tables', 'Select a time') - default: - return t('tables', 'Select a date and time') - } - }, - getPickerType() { switch (this.column.type) { case 'datetime-date': @@ -116,7 +99,6 @@ export default { }, 10) }) } else { - // Remove click outside listener document.removeEventListener('click', this.handleClickOutside) } }, @@ -130,7 +112,6 @@ export default { const format = this.getDateFormat() if (this.column.type === 'datetime-time') { - // For time-only values, use the same approach as DatetimeTimeForm const timeMoment = Moment(this.value, format) if (timeMoment.isValid()) { this.editDateTimeValue = timeMoment.toDate() @@ -138,19 +119,17 @@ export default { this.editDateTimeValue = new Date() } } else { - // For date and datetime values, parse normally const parsedMoment = Moment(this.value, format) this.editDateTimeValue = parsedMoment.isValid() ? parsedMoment.toDate() : null } } else if ((this.value === null || this.value === '') && this.column.datetimeDefault) { - // Handle default values if (this.column.datetimeDefault === 'now' || this.column.datetimeDefault === 'today') { this.editDateTimeValue = new Date() } else { this.editDateTimeValue = this.column.type === 'datetime-time' ? new Date() : null } } else { - // For time columns, always provide a default Date object to prevent errors + // For time columns, have default Date object to prevent errors this.editDateTimeValue = this.column.type === 'datetime-time' ? new Date() : null } }, @@ -236,6 +215,13 @@ export default { div { width: 100%; } + + /* + The fully accessible view with labels is always present in the row-editing-dialog. So it's ok if we do not have labels in inline editing. + */ + :deep(.native-datetime-picker--label) { + display: none; + } } .datetime-picker-container input { From 58943de1fb4d1b0d0fe5f5891c28572877490bff Mon Sep 17 00:00:00 2001 From: "Enjeck C." Date: Sun, 17 Aug 2025 11:08:00 +0100 Subject: [PATCH 3/4] fix: Improve editing behavior and accessibility Signed-off-by: Enjeck C. --- .../ncTable/partials/TableCellDateTime.vue | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/shared/components/ncTable/partials/TableCellDateTime.vue b/src/shared/components/ncTable/partials/TableCellDateTime.vue index 7d6d999706..d7b38e5b2b 100644 --- a/src/shared/components/ncTable/partials/TableCellDateTime.vue +++ b/src/shared/components/ncTable/partials/TableCellDateTime.vue @@ -4,7 +4,7 @@ -->