diff --git a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue index 7d9b148f76..bc88e39fbd 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue @@ -118,7 +118,7 @@ watchEffect(() => { {{ $t('general.cancel') }} - + {{ $t('general.save') }} diff --git a/packages/nc-gui-v2/components/smartsheet-header/Cell.vue b/packages/nc-gui-v2/components/smartsheet-header/Cell.vue index 4171e6b974..b1bdbc047e 100644 --- a/packages/nc-gui-v2/components/smartsheet-header/Cell.vue +++ b/packages/nc-gui-v2/components/smartsheet-header/Cell.vue @@ -6,74 +6,13 @@ import { ColumnInj, MetaInj } from '~/context' import { useProvideColumnCreateStore } from '#imports' const { column } = defineProps<{ column: ColumnType & { meta: any } }>() + provide(ColumnInj, column) + const meta = inject(MetaInj) // instantiate column update store useProvideColumnCreateStore(meta as Ref, column) - -/* -import { UITypes } from 'nocodb-sdk' -import cell from '@/components/project/spreadsheet/mixins/cell' -import EditColumn from '~/components/project/spreadsheet/components/EditColumn' - -export default { - name: 'HeaderCell', - components: { EditColumn }, - mixins: [cell], - props: [ - 'value', - 'column', - 'isForeignKey', - 'meta', - 'nodes', - 'columnIndex', - 'isForm', - 'isPublicView', - 'isVirtual', - 'required', - 'isLocked', - ], - data: () => ({ - editColumnMenu: false, - columnDeleteDialog: false, - }), - methods: { - showColumnEdit() { - if (this.column.uidt === UITypes.ID) { - return this.$toast.info('Primary key column edit is not allowed.').goAway(3000) - } - this.editColumnMenu = true - }, - async deleteColumn() { - try { - const column = { ...this.column, cno: this.column.column_name } - column.altered = 4 - const columns = this.meta.columns.slice() - columns[this.columnIndex] = column - await this.$api.dbTableColumn.delete(column.id) - - this.$emit('colDelete') - this.$emit('saved') - this.columnDeleteDialog = false - } catch (e) { - console.log(e) - } - }, - async setAsPrimaryValue() { - // todo: pass only updated fields - try { - await this.$api.dbTableColumn.primaryColumnSet(this.column.id) - this.$toast.success('Successfully updated as primary column').goAway(3000) - } catch (e) { - console.log(e) - this.$toast.error('Failed to update primary column').goAway(3000) - } - this.$emit('saved') - this.columnDeleteDialog = false - }, - }, -} */