Browse Source

chore(gui): lint

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4514/head
Pranav C 2 years ago
parent
commit
5c36a3e9d6
  1. 4
      packages/nc-gui/components/cell/SingleSelect.vue
  2. 2
      packages/nc-gui/components/smartsheet/Grid.vue
  3. 2
      packages/nc-gui/composables/useMultiSelect/convertCellData.ts

4
packages/nc-gui/components/cell/SingleSelect.vue

@ -59,7 +59,7 @@ const options = computed<(SelectOptionType & { value: string })[]>(() => {
if (column?.value.colOptions) {
const opts = column.value.colOptions
? // todo: fix colOptions type, options does not exist as a property
(column.value.colOptions as any).options.filter((el: SelectOptionType) => el.title !== '') || []
(column.value.colOptions as any).options.filter((el: SelectOptionType) => el.title !== '') || []
: []
for (const op of opts.filter((el: any) => el.order === null)) {
op.title = op.title.replace(/^'/, '').replace(/'$/, '')
@ -143,7 +143,7 @@ async function addIfMissingAndSave() {
// Mysql escapes single quotes with backslash so we keep quotes but others have to unescaped
if (!isMysql.value) {
updatedColMeta.cdf = updatedColMeta.cdf.replace(/''/g, '\'')
updatedColMeta.cdf = updatedColMeta.cdf.replace(/''/g, "'")
}
}

2
packages/nc-gui/components/smartsheet/Grid.vue

@ -271,7 +271,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa
}
}
},
async (ctx: { row: number; col?: number, updatedColumnTitle?: string }) => {
async (ctx: { row: number; col?: number; updatedColumnTitle?: string }) => {
const rowObj = data.value[ctx.row]
const columnObj = (ctx.col !== null && ctx.col !== undefined) ? fields.value[ctx.col] : null

2
packages/nc-gui/composables/useMultiSelect/convertCellData.ts

@ -14,7 +14,7 @@ export default function convertCellData(args: { from: UITypes; to: UITypes; valu
case UITypes.Date:
return new Date(value)
case UITypes.Attachment: {
let parsedVal;
let parsedVal
try {
parsedVal = typeof value === 'string' ? JSON.parse(value) : value
parsedVal = Array.isArray(parsedVal) ? parsedVal : [parsedVal]

Loading…
Cancel
Save