mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
[post-modularisation] fixing yjs errors (#12623)
* fixed: yjs/events module issue * fixed: added commit file
This commit is contained in:
parent
8e6326f6c8
commit
6f12ec47bb
7 changed files with 31 additions and 22 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 04839761243719f881c4a9ebbb052fc09ab6b967
|
||||
Subproject commit df736e11aa0246e704ec7433cc2025d10fdad0f3
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 2cd39bdde430a78b4d6ebcd119d02a6fda924739
|
||||
Subproject commit e62dbb822ddbe86e35f2405edbf830711632cf7b
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { EventsGateway } from './events.gateway';
|
||||
import { YjsGateway } from './yjs.gateway';
|
||||
import { SessionModule } from '@modules/session/module';
|
||||
|
||||
const providers = [];
|
||||
|
||||
providers.unshift(YjsGateway);
|
||||
if (process.env.COMMENT_FEATURE_ENABLE !== 'false') {
|
||||
providers.unshift(EventsGateway);
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [SessionModule],
|
||||
providers,
|
||||
})
|
||||
export class EventsModule {}
|
||||
|
|
@ -41,6 +41,7 @@ import { TooljetDbModule } from '@modules/tooljet-db/module';
|
|||
import { WorkflowsModule } from '@modules/workflows/module';
|
||||
import { AiModule } from '@modules/ai/module';
|
||||
import { CustomStylesModule } from '@modules/custom-styles/module';
|
||||
import { EventsModule } from '@modules/events/module';
|
||||
|
||||
export class AppModule implements OnModuleInit {
|
||||
static async register(configs: { IS_GET_CONTEXT: boolean }): Promise<DynamicModule> {
|
||||
|
|
@ -94,6 +95,7 @@ export class AppModule implements OnModuleInit {
|
|||
await WorkflowsModule.register(configs),
|
||||
await AiModule.register(configs),
|
||||
await CustomStylesModule.register(configs),
|
||||
await EventsModule.register(configs),
|
||||
];
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import {
|
|||
} from '@nestjs/websockets';
|
||||
import { Server } from 'ws';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { maybeSetSubPath } from '../helpers/utils.helper';
|
||||
import { maybeSetSubPath } from '../../helpers/utils.helper';
|
||||
import { SessionUtilService } from '@modules/session/util.service';
|
||||
|
||||
@WebSocketGateway({ path: maybeSetSubPath('/ws') })
|
||||
24
server/src/modules/events/module.ts
Normal file
24
server/src/modules/events/module.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { DynamicModule } from '@nestjs/common';
|
||||
import { SessionModule } from '@modules/session/module';
|
||||
import { getImportPath } from '@modules/app/constants';
|
||||
|
||||
export class EventsModule {
|
||||
static async register(configs?: { IS_GET_CONTEXT: boolean }): Promise<DynamicModule> {
|
||||
const providers = [];
|
||||
|
||||
const importPath = await getImportPath(configs?.IS_GET_CONTEXT);
|
||||
const { EventsGateway } = await import(`${importPath}/events/events.gateway`);
|
||||
const { YjsGateway } = await import(`${importPath}/events/yjs.gateway`);
|
||||
|
||||
providers.unshift(YjsGateway);
|
||||
if (process.env.COMMENT_FEATURE_ENABLE !== 'false') {
|
||||
providers.unshift(EventsGateway);
|
||||
}
|
||||
|
||||
return {
|
||||
module: EventsModule,
|
||||
imports: [await SessionModule.register(configs)],
|
||||
providers,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -2,8 +2,8 @@ import http from 'http';
|
|||
import { WebSocketGateway, WebSocketServer, OnGatewayConnection, OnGatewayDisconnect } from '@nestjs/websockets';
|
||||
import { Server } from 'ws';
|
||||
import { setupWSConnection, setPersistence } from 'y-websocket/bin/utils';
|
||||
import { RedisPubSub } from '../helpers/redis';
|
||||
import { maybeSetSubPath } from '../helpers/utils.helper';
|
||||
import { RedisPubSub } from '../../helpers/redis';
|
||||
import { maybeSetSubPath } from '../../helpers/utils.helper';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { SessionUtilService } from '@modules/session/util.service';
|
||||
|
||||
Loading…
Reference in a new issue