From 8d33fa9b963b76f71f76c9e217cb2c85ab7495e1 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 16 May 2022 16:00:36 +0530 Subject: [PATCH] Feat : UIDT impmporovements (#2026) * wip: rating cell ui implementation Signed-off-by: Pranav C * wip: migration for meta column data field Signed-off-by: Pranav C * wip: rating column options Signed-off-by: Pranav C * feat: rating cell creation and mapping metadata Signed-off-by: Pranav C * refactor: change default type to int for rating Signed-off-by: Pranav C * feat: add email cell Signed-off-by: Pranav C * feat: accept invalid values for columns if validation disabled Signed-off-by: Pranav C * refactor: remove additional options Signed-off-by: Pranav C * feat: checkbox customization Signed-off-by: Pranav C * refactor: move validate checkbox to advance option Signed-off-by: Pranav C * refactor: add tick icon in checkbox Signed-off-by: Pranav C * refactor: start rating max value from 1 Signed-off-by: Pranav C * refactor: minor ui corrections Signed-off-by: Pranav C * fix: load rating component in gallery view Signed-off-by: Pranav C * fix: use default icon and color if meta missing(checkbox and rating) re #2036 Signed-off-by: Pranav C * fix: cache column with parsed metadata re #2038 Signed-off-by: Pranav C * fix: convert old rating column to number type Signed-off-by: Pranav C * refactor: migration filename correction Signed-off-by: Pranav C * refactor: component name Signed-off-by: Pranav C --- .../project/spreadsheet/components/Cell.vue | 11 ++- .../spreadsheet/components/EditColumn.vue | 38 +++++++ .../spreadsheet/components/EditableCell.vue | 19 +++- .../spreadsheet/components/cell/EmailCell.vue | 22 +++++ .../spreadsheet/components/cell/UrlCell.vue | 14 ++- .../components/editColumn/RatingOptions.vue | 98 +++++++++++++++++++ .../components/editColumn/checkboxOptions.vue | 95 ++++++++++++++++++ .../components/editableCell/BooleanCell.vue | 36 +++++-- .../editableCell/EditableUrlCell.vue | 9 +- .../components/editableCell/RatingCell.vue | 71 ++++++++++++++ .../project/spreadsheet/mixins/cell.js | 6 ++ .../project/spreadsheet/views/GridView.vue | 70 +++++++------ packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts | 84 ++++++++-------- packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts | 74 +++++++------- packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts | 36 +++---- packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts | 97 +++++++++--------- packages/nocodb-sdk/src/lib/sqlUi/SqliteUi.ts | 94 +++++++++--------- .../lib/dataMapper/lib/sql/BaseModelSqlv2.ts | 3 + packages/nocodb/src/lib/noco-models/Column.ts | 40 +++++++- .../lib/noco/common/XcMigrationSourcev2.ts | 6 +- .../nc_015_add_meta_col_in_column_table.ts | 38 +++++++ .../jobs/ncProjectUpgraderV2_0090000.ts | 4 + 22 files changed, 728 insertions(+), 237 deletions(-) create mode 100644 packages/nc-gui/components/project/spreadsheet/components/cell/EmailCell.vue create mode 100644 packages/nc-gui/components/project/spreadsheet/components/editColumn/RatingOptions.vue create mode 100644 packages/nc-gui/components/project/spreadsheet/components/editColumn/checkboxOptions.vue create mode 100644 packages/nc-gui/components/project/spreadsheet/components/editableCell/RatingCell.vue create mode 100644 packages/nocodb/src/lib/noco/migrationsv2/nc_015_add_meta_col_in_column_table.ts diff --git a/packages/nc-gui/components/project/spreadsheet/components/Cell.vue b/packages/nc-gui/components/project/spreadsheet/components/Cell.vue index d19ab48087..260e721fc4 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/Cell.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/Cell.vue @@ -11,11 +11,14 @@ + - + + + {{ value }} @@ -30,12 +33,14 @@ import SetListCell from '~/components/project/spreadsheet/components/cell/SetLis import EnumCell from '~/components/project/spreadsheet/components/cell/EnumCell' import EditableAttachmentCell from '~/components/project/spreadsheet/components/editableCell/EditableAttachmentCell' import BooleanCell from '~/components/project/spreadsheet/components/cell/BooleanCell' +import EmailCell from '~/components/project/spreadsheet/components/cell/EmailCell' +import RatingCell from '~/components/project/spreadsheet/components/editableCell/RatingCell' export default { name: 'TableCell', - components: { TimeCell, DateTimeCell, DateCell, JsonCell, UrlCell, EditableAttachmentCell, EnumCell, SetListCell, BooleanCell }, + components: { RatingCell, EmailCell, TimeCell, DateTimeCell, DateCell, JsonCell, UrlCell, EditableAttachmentCell, EnumCell, SetListCell, BooleanCell }, mixins: [cell], - props: ['value', 'dbAlias', 'isLocked', 'selected'], + props: ['value', 'dbAlias', 'isLocked', 'selected', 'column'], computed: { title() { if (typeof this.value === 'string') { return this.value } diff --git a/packages/nc-gui/components/project/spreadsheet/components/EditColumn.vue b/packages/nc-gui/components/project/spreadsheet/components/EditColumn.vue index 0f1b4d1f6a..c426556905 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/EditColumn.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/EditColumn.vue @@ -137,6 +137,21 @@ @input="newColumn.altered = newColumn.altered || 2" /> + + + + + + + + + + +