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

teableio / teable / 10058448289

23 Jul 2024 11:58AM UTC coverage: 17.811% (-64.7%) from 82.539%
10058448289

push

github

web-flow
feat: copy and paste operations for pre-filled rows in the grid (#748)

* fix: prisma need download binary when run db-migrate

* feat: copy and paste operations for pre-filled rows in the grid

* chore: update selection operations i18n

* fix: multiple select fields cannot select multiple options in the grid

* fix: pre-filled rows in the table cannot be pasted with new select field options

---------

Co-authored-by: tea artist <artist@teable.io>

1384 of 2805 branches covered (49.34%)

0 of 370 new or added lines in 8 files covered. (0.0%)

14014 of 78680 relevant lines covered (17.81%)

1.77 hits per line

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

0.0
/packages/openapi/src/selection/temporary-paste.ts
NEW
1
import type { RouteConfig } from '@asteasolutions/zod-to-openapi';
×
NEW
2
import { fieldVoSchema, recordSchema } from '@teable/core';
×
NEW
3
import { axios } from '../axios';
×
NEW
4
import { registerRoute, urlBuilder } from '../utils';
×
NEW
5
import { z } from '../zod';
×
NEW
6
import { rangesRoSchema } from './range';
×
NEW
7

×
NEW
8
export const TEMPORARY_PASTE_URL = '/table/{tableId}/selection/temporaryPaste';
×
NEW
9

×
NEW
10
export const temporaryPasteRoSchema = rangesRoSchema
×
NEW
11
  .pick({
×
NEW
12
    viewId: true,
×
NEW
13
    ranges: true,
×
NEW
14
    excludeFieldIds: true,
×
NEW
15
  })
×
NEW
16
  .extend({
×
NEW
17
    content: z.string().openapi({
×
NEW
18
      description: 'Content to paste',
×
NEW
19
      example: 'John\tDoe\tjohn.doe@example.com',
×
NEW
20
    }),
×
NEW
21
    header: z.array(fieldVoSchema).optional().openapi({
×
NEW
22
      description: 'Table header for paste operation',
×
NEW
23
      example: [],
×
NEW
24
    }),
×
NEW
25
  });
×
NEW
26

×
NEW
27
export type ITemporaryPasteRo = z.infer<typeof temporaryPasteRoSchema>;
×
NEW
28

×
NEW
29
export const temporaryPasteVoSchema = z.array(
×
NEW
30
  recordSchema.pick({
×
NEW
31
    fields: true,
×
NEW
32
  })
×
NEW
33
);
×
NEW
34

×
NEW
35
export type ITemporaryPasteVo = z.infer<typeof temporaryPasteVoSchema>;
×
NEW
36

×
NEW
37
export const temporaryPasteRoute: RouteConfig = registerRoute({
×
NEW
38
  method: 'patch',
×
NEW
39
  path: TEMPORARY_PASTE_URL,
×
NEW
40
  description: 'Paste operation for pre-filled table rows',
×
NEW
41
  request: {
×
NEW
42
    params: z.object({
×
NEW
43
      tableId: z.string(),
×
NEW
44
    }),
×
NEW
45
    body: {
×
NEW
46
      content: {
×
NEW
47
        'application/json': {
×
NEW
48
          schema: temporaryPasteRoSchema,
×
NEW
49
        },
×
NEW
50
      },
×
NEW
51
    },
×
NEW
52
  },
×
NEW
53
  responses: {
×
NEW
54
    200: {
×
NEW
55
      description: 'Paste successfully',
×
NEW
56
      content: {
×
NEW
57
        'application/json': {
×
NEW
58
          schema: temporaryPasteVoSchema,
×
NEW
59
        },
×
NEW
60
      },
×
NEW
61
    },
×
NEW
62
  },
×
NEW
63
  tags: ['selection'],
×
NEW
64
});
×
NEW
65

×
NEW
66
export const temporaryPaste = async (tableId: string, pasteRo: ITemporaryPasteRo) => {
×
NEW
67
  return axios.patch<ITemporaryPasteVo>(
×
NEW
68
    urlBuilder(TEMPORARY_PASTE_URL, {
×
NEW
69
      tableId,
×
NEW
70
    }),
×
NEW
71
    pasteRo
×
NEW
72
  );
×
NEW
73
};
×
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

© 2026 Coveralls, Inc