• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teableio / teable / 8538004962

03 Apr 2024 11:36AM CUT coverage: 18.233% (-3.3%) from 21.535%
8538004962

Pull #528

github

web-flow
Merge c1a248a6f into 45ee7ebb3
Pull Request #528: feat: Kanban view

575 of 1136 branches covered (50.62%)

29 of 2908 new or added lines in 83 files covered. (1.0%)

5 existing lines in 5 files now uncovered.

6439 of 35315 relevant lines covered (18.23%)

3.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

21.43
/packages/sdk/src/model/record/record.ts
1
/* eslint-disable @typescript-eslint/naming-convention */
1✔
2
import type { IRecord } from '@teable/core';
1✔
3
import { RecordOpBuilder, RecordCore } from '@teable/core';
1✔
4
import { createRecords, getRecords, updateRecord, updateRecordOrders } from '@teable/openapi';
1✔
5
import type { Doc } from 'sharedb/lib/client';
1✔
6
import { requestWrap } from '../../utils/requestWrap';
1✔
7
import type { IFieldInstance } from '../field/factory';
1✔
8

1✔
9
export class Record extends RecordCore {
1!
10
  static createRecords = requestWrap(createRecords);
×
11

×
12
  static getRecords = requestWrap(getRecords);
×
13

×
NEW
14
  static updateRecord = requestWrap(updateRecord);
×
NEW
15

×
16
  static updateRecordOrders = requestWrap(updateRecordOrders);
✔
17

×
18
  constructor(
×
19
    protected doc: Doc<IRecord>,
×
20
    protected fieldMap: { [fieldId: string]: IFieldInstance }
×
21
  ) {
×
22
    super(fieldMap);
×
23
  }
×
24

×
25
  async updateCell(fieldId: string, cellValue: unknown) {
×
26
    const operation = RecordOpBuilder.editor.setRecord.build({
×
27
      fieldId,
×
28
      newCellValue: cellValue,
×
29
      oldCellValue: this.fields[fieldId],
×
30
    });
×
31

×
32
    try {
×
33
      return await new Promise((resolve, reject) => {
×
34
        this.doc.submitOp([operation], undefined, (error) => {
×
35
          error ? reject(error) : resolve(undefined);
×
36
        });
×
37
      });
×
38
    } catch (error) {
×
39
      return error;
×
40
    }
×
41
  }
×
42
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc