Webhook wip (#6371)

This PR introduces the following changes:
- Add the ability to filter webhooks by objectSingularName and Actions
- Refactor SettingsWebhookDetails edition to not use react-hook-form
(which will be deprecated on the whole project)
- Updating the tests with a complex set of mock (we just need to fix ~30
of them now :D)

<img width="1053" alt="image"
src="https://github.com/user-attachments/assets/4e56d972-f129-4789-8d1c-4b5797a8ffd7">
This commit is contained in:
Charles Bochet
2024-08-05 23:14:29 +02:00
committed by GitHub
parent 48f4e41148
commit 8373dfdc26
10 changed files with 14156 additions and 12287 deletions

View File

@ -3,7 +3,6 @@ import {
InternalServerErrorException,
NotFoundException,
} from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';
import { Test, TestingModule } from '@nestjs/testing';
import { getRepositoryToken } from '@nestjs/typeorm';
@ -16,6 +15,7 @@ import {
AppTokenType,
} from 'src/engine/core-modules/app-token/app-token.entity';
import { JwtAuthStrategy } from 'src/engine/core-modules/auth/strategies/jwt.auth.strategy';
import { JwtWrapperService } from 'src/engine/core-modules/jwt/services/jwt-wrapper.service';
import { User } from 'src/engine/core-modules/user/user.entity';
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
import { EmailService } from 'src/engine/integrations/email/email.service';
@ -34,10 +34,8 @@ describe('TokenService', () => {
providers: [
TokenService,
{
provide: JwtService,
useValue: {
sign: jest.fn().mockReturnValue('mock-jwt-token'),
},
provide: JwtWrapperService,
useValue: {},
},
{
provide: JwtAuthStrategy,

View File

@ -1,6 +1,6 @@
import { Test, TestingModule } from '@nestjs/testing';
import { TokenService } from 'src/engine/core-modules/auth/services/token.service';
import { JwtWrapperService } from 'src/engine/core-modules/jwt/services/jwt-wrapper.service';
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
import { FileStorageService } from 'src/engine/integrations/file-storage/file-storage.service';
@ -22,7 +22,7 @@ describe('FileService', () => {
useValue: {},
},
{
provide: TokenService,
provide: JwtWrapperService,
useValue: {},
},
],

View File

@ -89,7 +89,7 @@ export class WorkspaceMigrationRunnerService {
await queryRunner.commitTransaction();
} catch (error) {
this.logger.error('Error executing migration', error);
console.error('Error executing migration', error);
await queryRunner.rollbackTransaction();
throw error;
} finally {