Merge branch 'master' into fix-empty-conditions
This commit is contained in:
commit
bfc9e20bac
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
||||
"version": "2.32.5",
|
||||
"version": "2.32.6",
|
||||
"npmClient": "yarn",
|
||||
"packages": [
|
||||
"packages/*",
|
||||
|
|
|
@ -143,6 +143,7 @@ const environment = {
|
|||
POSTHOG_TOKEN: process.env.POSTHOG_TOKEN,
|
||||
POSTHOG_PERSONAL_TOKEN: process.env.POSTHOG_PERSONAL_TOKEN,
|
||||
POSTHOG_API_HOST: process.env.POSTHOG_API_HOST || "https://us.i.posthog.com",
|
||||
POSTHOG_FEATURE_FLAGS_ENABLED: process.env.POSTHOG_FEATURE_FLAGS_ENABLED,
|
||||
ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS,
|
||||
TENANT_FEATURE_FLAGS: process.env.TENANT_FEATURE_FLAGS,
|
||||
CLOUDFRONT_CDN: process.env.CLOUDFRONT_CDN,
|
||||
|
|
|
@ -6,7 +6,12 @@ import tracer from "dd-trace"
|
|||
|
||||
let posthog: PostHog | undefined
|
||||
export function init(opts?: PostHogOptions) {
|
||||
if (env.POSTHOG_TOKEN && env.POSTHOG_API_HOST && !env.SELF_HOSTED) {
|
||||
if (
|
||||
env.POSTHOG_TOKEN &&
|
||||
env.POSTHOG_API_HOST &&
|
||||
!env.SELF_HOSTED &&
|
||||
env.POSTHOG_FEATURE_FLAGS_ENABLED
|
||||
) {
|
||||
console.log("initializing posthog client...")
|
||||
posthog = new PostHog(env.POSTHOG_TOKEN, {
|
||||
host: env.POSTHOG_API_HOST,
|
||||
|
|
|
@ -148,6 +148,7 @@ describe("feature flags", () => {
|
|||
const env: Partial<typeof environment> = {
|
||||
TENANT_FEATURE_FLAGS: environmentFlags,
|
||||
SELF_HOSTED: false,
|
||||
POSTHOG_FEATURE_FLAGS_ENABLED: "true",
|
||||
}
|
||||
|
||||
if (posthogFlags) {
|
||||
|
|
|
@ -138,7 +138,7 @@ async function processDeleteRowsRequest(ctx: UserCtx<DeleteRowRequest>) {
|
|||
const { tableId } = utils.getSourceId(ctx)
|
||||
|
||||
const processedRows = request.rows.map(row => {
|
||||
let processedRow: Row = typeof row == "string" ? { _id: row } : row
|
||||
let processedRow: Row = typeof row == "string" ? { _id: row, tableId } : row
|
||||
return !processedRow._rev
|
||||
? addRev(fixRow(processedRow, ctx.params), tableId)
|
||||
: fixRow(processedRow, ctx.params)
|
||||
|
|
|
@ -1138,6 +1138,18 @@ describe.each([
|
|||
await assertRowUsage(isInternal ? rowUsage - 1 : rowUsage)
|
||||
})
|
||||
|
||||
it("should be able to delete a row with ID only", async () => {
|
||||
const createdRow = await config.api.row.save(table._id!, {})
|
||||
const rowUsage = await getRowUsage()
|
||||
|
||||
const res = await config.api.row.bulkDelete(table._id!, {
|
||||
rows: [createdRow._id!],
|
||||
})
|
||||
expect(res[0]._id).toEqual(createdRow._id)
|
||||
expect(res[0].tableId).toEqual(table._id!)
|
||||
await assertRowUsage(isInternal ? rowUsage - 1 : rowUsage)
|
||||
})
|
||||
|
||||
it("should be able to bulk delete rows, including a row that doesn't exist", async () => {
|
||||
const createdRow = await config.api.row.save(table._id!, {})
|
||||
const createdRow2 = await config.api.row.save(table._id!, {})
|
||||
|
|
Loading…
Reference in New Issue