Browse Source

qrcode: also show 'Not editable/clearable' message for QR codes (similar to Formula)

pull/4468/head
Daniel Spaude 2 years ago
parent
commit
dc3f9607a9
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 3
      packages/nc-gui/components/virtual-cell/Formula.vue
  2. 8
      packages/nc-gui/components/virtual-cell/QrCode.vue
  3. 6
      packages/nc-gui/lang/en.json

3
packages/nc-gui/components/virtual-cell/Formula.vue

@ -14,7 +14,8 @@ const result = computed(() => (isPg.value ? handleTZ(cellValue?.value) : cellVal
const urls = computed(() => replaceUrlsWithLink(result.value))
const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning, activateShowEditNonEditableFieldWarning } = useShowNotEditableWarning()
const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning, activateShowEditNonEditableFieldWarning } =
useShowNotEditableWarning()
</script>
<template>

8
packages/nc-gui/components/virtual-cell/QrCode.vue

@ -25,6 +25,8 @@ const showQrModal = (ev: MouseEvent) => {
}
const handleModalOkClick = () => (modalVisible.value = false)
const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning } = useShowNotEditableWarning()
</script>
<template>
@ -39,4 +41,10 @@ const handleModalOkClick = () => (modalVisible.value = false)
{{ $t('labels.qrCodeValueTooLong') }}
</div>
<img v-if="qrValue && !tooManyCharsForQrCode" :src="qrCode" alt="QR Code" @click="showQrModal" />
<div v-if="showEditNonEditableFieldWarning" class="text-left text-wrap mt-2 text-[#e65100] text-xs">
{{ $t('msg.warning.nonEditableFields.computedFieldUnableToClear') }}
</div>
<div v-if="showClearNonEditableFieldWarning" class="text-left text-wrap mt-2 text-[#e65100] text-xs">
{{ $t('msg.warning.nonEditableFields.qrFieldsCannotBeDirectlyChanged') }}
</div>
</template>

6
packages/nc-gui/lang/en.json

@ -489,6 +489,12 @@
"selectField": "Select field"
},
"msg": {
"warning": {
"nonEditableFields": {
"computedFieldUnableToClear": "Warning: Computed field - unable to clear text",
"qrFieldsCannotBeDirectlyChanged": "Warning: QR fields cannot be directly changed."
}
},
"info": {
"roles": {
"orgCreator": "Creator can create new projects and access any invited project.",

Loading…
Cancel
Save