6071 return only updated fields of records in zapier update trigger (#8193)
- move webhook triggers into `entity-events-to-db.listener.ts` - refactor event management - add a `@OnDatabaseEvent` decorator to manage database events - add updatedFields in updated events - update openApi webhooks docs - update zapier integration
This commit is contained in:
@ -1,20 +1,14 @@
|
||||
import { findAvailableTimeZoneOption } from '@/localization/utils/findAvailableTimeZoneOption';
|
||||
jest.useFakeTimers().setSystemTime(new Date('2024-01-01T00:00:00.000Z'));
|
||||
|
||||
describe('findAvailableTimeZoneOption', () => {
|
||||
it('should find the matching available IANA time zone select option from a given IANA time zone', () => {
|
||||
const ianaTimeZone = 'Europe/Paris';
|
||||
const expectedValue = 'Europe/Paris';
|
||||
const expectedLabelWinter =
|
||||
'(GMT+01:00) Central European Standard Time - Paris';
|
||||
const expectedLabelSummer =
|
||||
'(GMT+02:00) Central European Summer Time - Paris';
|
||||
const value = 'Europe/Paris';
|
||||
const label = '(GMT+01:00) Central European Standard Time - Paris';
|
||||
|
||||
const option = findAvailableTimeZoneOption(ianaTimeZone);
|
||||
|
||||
expect(option.value).toEqual(expectedValue);
|
||||
expect(
|
||||
expectedLabelWinter === option.label ||
|
||||
expectedLabelSummer === option.label,
|
||||
).toBeTruthy();
|
||||
expect(option).toEqual({ value, label });
|
||||
});
|
||||
});
|
||||
|
||||
@ -1,19 +1,14 @@
|
||||
import { formatTimeZoneLabel } from '@/localization/utils/formatTimeZoneLabel';
|
||||
jest.useFakeTimers().setSystemTime(new Date('2024-01-01T00:00:00.000Z'));
|
||||
|
||||
describe('formatTimeZoneLabel', () => {
|
||||
it('should format the time zone label correctly when location is included in the label', () => {
|
||||
const ianaTimeZone = 'Europe/Paris';
|
||||
const expectedLabelSummer =
|
||||
'(GMT+02:00) Central European Summer Time - Paris';
|
||||
const expectedLabelWinter =
|
||||
'(GMT+01:00) Central European Standard Time - Paris';
|
||||
const expectedLabel = '(GMT+01:00) Central European Standard Time - Paris';
|
||||
|
||||
const formattedLabel = formatTimeZoneLabel(ianaTimeZone);
|
||||
|
||||
expect(
|
||||
expectedLabelSummer === formattedLabel ||
|
||||
expectedLabelWinter === formattedLabel,
|
||||
).toBeTruthy();
|
||||
expect(expectedLabel).toEqual(formattedLabel);
|
||||
});
|
||||
|
||||
it('should format the time zone label correctly when location is not included in the label', () => {
|
||||
|
||||
@ -63,7 +63,7 @@ export const DateTimeSettingsTimezone: Story = {
|
||||
await canvas.findByText('Date and time');
|
||||
|
||||
const timezoneSelect = await canvas.findByText(
|
||||
'(GMT-04:00) Eastern Daylight Time - New York',
|
||||
'(GMT-05:00) Eastern Standard Time - New York',
|
||||
);
|
||||
|
||||
userEvent.click(timezoneSelect);
|
||||
|
||||
@ -29,7 +29,7 @@ const meta: Meta<PageDecoratorArgs> = {
|
||||
targetUrl: 'https://example.com/webhook',
|
||||
description: 'A Sample Description',
|
||||
updatedAt: '2021-08-27T12:00:00Z',
|
||||
operation: 'create',
|
||||
operation: 'created',
|
||||
__typename: 'Webhook',
|
||||
},
|
||||
},
|
||||
|
||||
@ -121,9 +121,9 @@ export const SettingsDevelopersWebhooksDetail = () => {
|
||||
|
||||
const actionOptions: SelectOption<string>[] = [
|
||||
{ value: '*', label: 'All Actions', Icon: IconNorthStar },
|
||||
{ value: 'create', label: 'Created', Icon: IconPlus },
|
||||
{ value: 'update', label: 'Updated', Icon: IconRefresh },
|
||||
{ value: 'delete', label: 'Deleted', Icon: IconTrash },
|
||||
{ value: 'created', label: 'Created', Icon: IconPlus },
|
||||
{ value: 'updated', label: 'Updated', Icon: IconRefresh },
|
||||
{ value: 'deleted', label: 'Deleted', Icon: IconTrash },
|
||||
];
|
||||
|
||||
const { updateOneRecord } = useUpdateOneRecord<Webhook>({
|
||||
|
||||
Reference in New Issue
Block a user