Browse Source

fix: webhook triggers

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/2438/head
mertmit 2 years ago
parent
commit
5622b5b49d
  1. 17
      packages/nc-gui/components/project/spreadsheet/components/EditableCell.vue
  2. 3
      packages/nc-gui/components/project/spreadsheet/components/editableCell/TimePickerCell.vue
  3. 24
      packages/nc-gui/components/project/spreadsheet/mixins/cell.js

17
packages/nc-gui/components/project/spreadsheet/components/EditableCell.vue

@ -74,6 +74,7 @@
v-else-if="isTime"
v-model="localState"
v-on="parentListeners"
@save="$emit('save')"
/>
<date-time-picker-cell
@ -95,7 +96,6 @@
:is-form="isForm"
:column="column"
v-on="parentListeners"
@input="$emit('save')"
/>
<json-editable-cell
@ -111,7 +111,6 @@
v-model="localState"
:column="column"
v-on="parentListeners"
@input="$emit('save')"
/>
<set-list-cell
v-else-if="isSet"
@ -210,10 +209,10 @@ export default {
if (val !== this.value) {
this.changed = true
this.$emit('input', val)
if (this.isAttachment || this.isBoolean || this.isRating || this.isTime || this.isDateTime || this.isDate || this.isDuration) {
this.syncData()
} else if (!this.isCurrency && !this.isEnum && !this.isSet) {
if (this.isAutoSaved) {
this.syncDataDebounce(this)
} else if (!this.isManualSaved) {
this.saveData()
}
}
}
@ -241,7 +240,7 @@ export default {
// this.$refs.input.focus();
},
beforeDestroy() {
if (this.changed && !(this.isAttachment || this.isBoolean || this.isRating || this.isTime || this.isDateTime || this.isDuration)) {
if (this.changed && this.isAutoSaved) {
this.changed = false
this.$emit('change')
}
@ -253,6 +252,12 @@ export default {
this.changed = false
this.$emit('update')
}
},
saveData() {
if (this.changed && !this.destroyed) {
this.changed = false
this.$emit('save')
}
}
}
}

3
packages/nc-gui/components/project/spreadsheet/components/editableCell/TimePickerCell.vue

@ -5,7 +5,7 @@
</template>
<div class="d-flex flex-column justify-center" @click.stop>
<v-time-picker v-model="localState" v-on="parentListeners" />
<v-btn small color="primary" @click="$emit('update')">
<v-btn small color="primary" @click="$emit('save')">
<!-- Save -->
{{ $t('general.save') }}
</v-btn>
@ -15,7 +15,6 @@
<script>
import dayjs from 'dayjs'
import { MysqlUi } from 'nocodb-sdk'
export default {
name: 'TimePickerCell',

24
packages/nc-gui/components/project/spreadsheet/mixins/cell.js

@ -70,6 +70,30 @@ export default {
},
isDuration() {
return this.uiDatatype === UITypes.Duration
},
isAutoSaved() {
return [
UITypes.SingleLineText,
UITypes.LongText,
UITypes.PhoneNumber,
UITypes.Email,
UITypes.URL,
UITypes.Number,
UITypes.Decimal,
UITypes.Percent,
UITypes.Duration,
UITypes.Count,
UITypes.AutoNumber,
UITypes.SpecificDBType,
UITypes.Geometry
].includes(this.uiDatatype)
},
isManualSaved() {
return [
UITypes.Currency,
UITypes.Year,
UITypes.Time
].includes(this.uiDatatype)
}
}
}

Loading…
Cancel
Save