Webhook trigger update by column (#832)

Add functionality to filter webhooks based on a column or columns.
This commit is contained in:
CamilleLegeron
2024-04-12 22:04:37 +02:00
committed by GitHub
parent 73a02fdebd
commit 76ef4d54f8
13 changed files with 270 additions and 58 deletions

View File

@@ -34,6 +34,7 @@ describe('WebhookOverflow', function () {
enabled: true,
name: 'test webhook',
tableId: 'Table2',
watchedColIds: []
};
await docApi.addWebhook(webhookDetails);
await docApi.addWebhook(webhookDetails);

View File

@@ -55,6 +55,7 @@ describe('WebhookPage', function () {
'URL',
'Table',
'Ready Column',
'Filter for changes in these columns (semicolon-separated ids)',
'Webhook Id',
'Enabled',
'Status',
@@ -80,15 +81,17 @@ describe('WebhookPage', function () {
await gu.waitToPass(async () => {
assert.equal(await getField(1, 'Webhook Id'), id);
});
// Now other fields like name and memo are persisted.
// Now other fields like name, memo and watchColIds are persisted.
await setField(1, 'Name', 'Test Webhook');
await setField(1, 'Memo', 'Test Memo');
await setField(1, 'Filter for changes in these columns (semicolon-separated ids)', 'A; B');
await gu.waitForServer();
await driver.navigate().refresh();
await waitForWebhookPage();
await gu.waitToPass(async () => {
assert.equal(await getField(1, 'Name'), 'Test Webhook');
assert.equal(await getField(1, 'Memo'), 'Test Memo');
assert.equal(await getField(1, 'Filter for changes in these columns (semicolon-separated ids)'), 'A;B');
});
// Make sure the webhook is actually working.
await docApi.addRows('Table1', {A: ['zig'], B: ['zag']});