Skip to content

Commit

Permalink
Merge branch 'main' of github.com:hpi-schul-cloud/schulcloud-server i…
Browse files Browse the repository at this point in the history
…nto BC-7261-board-websocket-metrics
  • Loading branch information
hoeppner-dataport committed Jun 14, 2024
2 parents 44b17f2 + e50d2b4 commit 7fe885e
Show file tree
Hide file tree
Showing 454 changed files with 10,642 additions and 16,835 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: npm ci
run: npm ci --prefer-offline --no-audit
- name: nest:test:cov - test all with coverage
timeout-minutes: 11
timeout-minutes: 15
run: export RUN_WITHOUT_JEST_COVERAGE='true' && export NODE_OPTIONS='--max_old_space_size=4096' && ./node_modules/.bin/jest --shard=${{ matrix.shard }}/${{ strategy.job-total }} --coverage --force-exit
- name: save-coverage
run: mv coverage/lcov.info coverage/${{matrix.shard}}.info
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MongoMemoryDatabaseModule } from '@infra/database';
import { MikroORM } from '@mikro-orm/core';
import { ObjectId } from '@mikro-orm/mongodb';
import { EntityManager, ObjectId } from '@mikro-orm/mongodb';
import { Test, TestingModule } from '@nestjs/testing';
import { createCollections } from '@shared/testing';
import { DatabaseManagementService } from './database-management.service';

const randomChars = () => new ObjectId().toHexString();
Expand All @@ -17,6 +18,9 @@ describe('DatabaseManagementService', () => {

service = module.get(DatabaseManagementService);
orm = module.get(MikroORM);

const em = module.get(EntityManager);
await createCollections(em);
});

afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Migration } from '@mikro-orm/migrations-mongodb';
import { BoardLayout } from '@shared/domain/domainobject';
import { BoardNodeType } from '@shared/domain/entity';
import { BoardLayout } from '@modules/board';
import { BoardNodeType } from '@modules/board/domain';

export class Migration20240415124640 extends Migration {
async up(): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Migration } from '@mikro-orm/migrations-mongodb';
import { MediaBoardColors, MediaBoardLayoutType } from '@modules/board/domain';
import { MediaBoardColors, BoardLayout } from '@modules/board/domain';

export class Migration20240517135008 extends Migration {
async up(): Promise<void> {
const mediaBoards = await this.driver.nativeUpdate(
'boardnodes',
{ type: 'media-board' },
{
layout: MediaBoardLayoutType.LIST,
layout: BoardLayout.LIST,
mediaAvailableLineBackgroundColor: MediaBoardColors.TRANSPARENT,
mediaAvailableLineCollapsed: false,
}
Expand Down
31 changes: 31 additions & 0 deletions apps/server/src/migrations/mikro-orm/Migration20240528140356.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Migration } from '@mikro-orm/migrations-mongodb';

export class Migration20240528140356 extends Migration {
async up(): Promise<void> {
const mediaBoards = await this.driver.nativeUpdate(
'boardnodes',
{ type: 'media-board' },
{
$rename: { mediaAvailableLineBackgroundColor: 'backgroundColor', mediaAvailableLineCollapsed: 'collapsed' },
}
);

if (mediaBoards.affectedRows > 0) {
console.info(`Additional attributes added to ${mediaBoards.affectedRows} Media boards`);
}
}

async down(): Promise<void> {
const mediaBoards = await this.driver.nativeUpdate(
'boardnodes',
{ type: 'media-board' },
{
$rename: { backgroundColor: 'mediaAvailableLineBackgroundColor', collapsed: 'mediaAvailableLineCollapsed' },
}
);

if (mediaBoards.affectedRows > 0) {
console.info(`Additional attributes removed from ${mediaBoards.affectedRows} Media boards`);
}
}
}
1 change: 1 addition & 0 deletions apps/server/src/modules/authentication/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export { Authenticate, CurrentUser, JWT } from './decorator';
export { ICurrentUser } from './interface';
export { AuthenticationService } from './services';
export { XApiKeyConfig } from './config';
export { WsJwtAuthGuard } from './guard/ws-jwt-auth.guard';
export { AuthenticationConfig } from './authentication-config';
4 changes: 2 additions & 2 deletions apps/server/src/modules/authorization/authorization.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { UserRepo } from '@shared/repo';
import { LoggerModule } from '@src/core/logger';
import { AuthorizationHelper, AuthorizationService, RuleManager } from './domain';
import {
BoardDoRule,
BoardNodeRule,
ContextExternalToolRule,
CourseGroupRule,
CourseRule,
Expand Down Expand Up @@ -35,7 +35,7 @@ import { FeathersAuthorizationService, FeathersAuthProvider } from './feathers';
RuleManager,
AuthorizationHelper,
// rules
BoardDoRule,
BoardNodeRule,
ContextExternalToolRule,
CourseGroupRule,
CourseRule,
Expand Down
Loading

0 comments on commit 7fe885e

Please sign in to comment.