Open filters in side panel (#13304)

In this PR:

- Open filters in the side panel for **workflows**
- Open filters in the side panel for **workflow versions**
- Preparation for opening filters in the side panel for **workflow
runs**
- Add many tests to increase the coverage

Remaining to do:

- Open filters in the side panel for **workflow runs**
- Upon filter creation, open it in the side panel

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Baptiste Devessier
2025-07-23 10:30:08 +02:00
committed by GitHub
co-authored by greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
parent eeade6e94c
commit 924e599cba
60 changed files with 2071 additions and 1509 deletions
@@ -1,6 +1,15 @@
import { getCronTriggerDefaultSettings } from '@/workflow/workflow-trigger/utils/getCronTriggerDefaultSettings';
describe('getCronTriggerDefaultSettings', () => {
it('returns correct settings for DAYS interval', () => {
const result = getCronTriggerDefaultSettings('DAYS');
expect(result).toEqual({
schedule: { day: 1, hour: 0, minute: 0 },
type: 'DAYS',
outputSchema: {},
});
});
it('returns correct settings for HOURS interval', () => {
const result = getCronTriggerDefaultSettings('HOURS');
expect(result).toEqual({
@@ -1,6 +1,7 @@
import { WorkflowManualTriggerAvailability } from '@/workflow/types/Workflow';
import { COMMAND_MENU_DEFAULT_ICON } from '@/workflow/workflow-trigger/constants/CommandMenuDefaultIcon';
import { generatedMockObjectMetadataItems } from '~/testing/mock-data/generatedMockObjectMetadataItems';
import { getManualTriggerDefaultSettings } from '../getManualTriggerDefaultSettings';
import { COMMAND_MENU_DEFAULT_ICON } from '@/workflow/workflow-trigger/constants/CommandMenuDefaultIcon';
it('returns settings for a manual trigger that can be activated from any where', () => {
expect(
@@ -28,3 +29,28 @@ it('returns settings for a manual trigger that can be activated from any where',
icon: 'IconTest',
});
});
it('returns settings for WHEN_RECORD_SELECTED with default icon when no custom icon provided', () => {
expect(
getManualTriggerDefaultSettings({
availability: 'WHEN_RECORD_SELECTED',
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
}),
).toStrictEqual({
objectType: generatedMockObjectMetadataItems[0].nameSingular,
outputSchema: {},
icon: COMMAND_MENU_DEFAULT_ICON,
});
});
it('throws error for unsupported availability type', () => {
const invalidAvailability =
'INVALID_AVAILABILITY' as WorkflowManualTriggerAvailability;
expect(() =>
getManualTriggerDefaultSettings({
availability: invalidAvailability,
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
}),
).toThrow("Didn't expect to get here.");
});
@@ -100,6 +100,42 @@ describe('getTriggerDefaultDefinition', () => {
});
});
it('returns a valid configuration for CRON trigger type', () => {
expect(
getTriggerDefaultDefinition({
defaultLabel: 'On a schedule',
type: 'CRON',
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
}),
).toStrictEqual({
type: 'CRON',
name: 'On a schedule',
settings: {
type: 'DAYS',
schedule: { day: 1, hour: 0, minute: 0 },
outputSchema: {},
},
});
});
it('returns a valid configuration for WEBHOOK trigger type', () => {
expect(
getTriggerDefaultDefinition({
defaultLabel: 'Webhook',
type: 'WEBHOOK',
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
}),
).toStrictEqual({
type: 'WEBHOOK',
name: 'Webhook',
settings: {
outputSchema: {},
httpMethod: 'GET',
authentication: null,
},
});
});
it('throws when providing an unknown trigger type', () => {
expect(() => {
getTriggerDefaultDefinition({