Browse Source

qrcode: fix 'qr code not updating on row change'

pull/4142/head
Daniel Spaude 2 years ago
parent
commit
7138cd2c11
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 12
      packages/nc-gui/components/virtual-cell/QrCode.vue
  2. 26
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

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

@ -3,13 +3,13 @@ import { useQRCode } from '@vueuse/integrations/useQRCode'
const value = inject(CellValueInj)
const qrCode =
value?.value &&
useQRCode(value?.value, {
width: 150,
})
const qrValue = computed(() => value?.value)
const qrCode = useQRCode(qrValue, {
width: 150,
})
</script>
<template>
<img v-if="qrCode" :src="qrCode" alt="QR Code" class="qr-code" />
<img v-if="qrValue" :src="qrCode" alt="QR Code" class="qr-code" />
</template>

26
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

@ -1381,36 +1381,10 @@ class BaseModelSqlv2 {
null,
this.dbDriver,
this.model
// this.aliasToColumn
);
// todo: verify syntax of as ? / ??
// qb.select(
// this.dbDriver.raw(`?? as ??`, [
// selectQb.builder,
// sanitize(column.title),
// ])
// );
// qb.select({
// [column.column_name]: this.dbDriver.raw(`?? as ??`, [
// selectQb.builder,
// sanitize(column.title),
// ]),
// });
qb.select({
[column.column_name]: selectQb.builder,
});
// const formulOption = await col.getColOptions<FormulaColumn>();
// const { builder } = await formulaQueryBuilderv2(
// formulOption.formula,
// alias,
// knex,
// model,
// { ...aliasToColumn, [col.id]: null }
// );
// builder.sql = '(' + builder.sql + ')';
// aliasToColumn[col.id] = builder;
}
break;
default: {

Loading…
Cancel
Save