Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use conditions filter #4195

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/api/src/app/events/e2e/trigger-event.e2e.ts
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we have the execution detail of the filter action.

Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ describe(`Trigger event - ${eventTriggerPath} (POST)`, function () {
detail: DetailEnum.FILTER_STEPS,
});

expect(executionDetails).to.not.be.ok;
expect(executionDetails?.detail).to.be.equal('Step was filtered based on steps filters');
});

it('should not filter delay step', async function () {
Expand Down Expand Up @@ -388,7 +388,7 @@ describe(`Trigger event - ${eventTriggerPath} (POST)`, function () {
detail: DetailEnum.FILTER_STEPS,
});

expect(executionDetails).to.not.be.ok;
expect(executionDetails?.detail).to.be.equal('Step was filtered based on steps filters');
});

it('should use conditions to select integration', async function () {
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/app/shared/dtos/step-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ type FilterParts =

export class StepFilter {
@ApiProperty()
isNegated: boolean;
isNegated?: boolean;

@ApiProperty({
enum: ['BOOLEAN', 'TEXT', 'DATE', 'NUMBER', 'STATEMENT', 'LIST', 'MULTI_LIST', 'GROUP'],
})
type: BuilderFieldType;
type?: BuilderFieldType;

@ApiProperty({
enum: ['AND', 'OR'],
Expand Down
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On create workflow we use Partial where we have IMessageFilter with optional isNegated and type therefore I aligned those types to be optional as well.

Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ export class NotificationStep extends NotificationStepVariant {
}

export class MessageFilter {
isNegated: boolean;
isNegated?: boolean;

@IsString()
type: BuilderFieldType;
type?: BuilderFieldType;

@IsString()
value: BuilderGroupValues;
Expand Down
Loading