Skip to content

Commit

Permalink
BC-7695 Update typescript (#5142)
Browse files Browse the repository at this point in the history
  • Loading branch information
bischofmax authored Jul 25, 2024
1 parent 56607ad commit d1200fc
Show file tree
Hide file tree
Showing 9 changed files with 487 additions and 460 deletions.
4 changes: 2 additions & 2 deletions apps/server/src/modules/board/service/column-board.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CopyStatus } from '@modules/copy-helper';
import { Injectable } from '@nestjs/common';
import { EntityId } from '@shared/domain/types';
import { CopyStatus } from '@modules/copy-helper';
import { BoardExternalReference, BoardExternalReferenceType, ColumnBoard, isColumnBoard } from '../domain';
import { BoardNodeRepo } from '../repo';
import { BoardNodeService } from './board-node.service';
Expand All @@ -27,7 +27,7 @@ export class ColumnBoardService {

const boards = boardNodes.filter((bn) => isColumnBoard(bn));

return boards as ColumnBoard[];
return boards;
}

async updateVisibility(columbBoard: ColumnBoard, visibility: boolean): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export class ColumnBoardReferenceService {

const boards = boardNodes.filter((bn) => isColumnBoard(bn));

return boards as ColumnBoard[];
return boards;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export class CopyHelperService {
return name;
}
let num = 1;
const matches = name.match(/^(?<name>.*) \((?<number>\d+)\)$/);
if (matches && matches.groups) {
({ name } = matches.groups);
num = Number(matches.groups.number) + 1;
const matches = name.match(/^(.*) \((\d+)\)$/);
if (matches) {
name = matches[1];
num = Number(matches[2]) + 1;
}
const composedName = `${name} (${num})`;
if (existingNames.includes(composedName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class CommonCartridgeExportService {

column.children
.filter((child) => isCard(child))
.forEach((card) => this.addCardToOrganization(card as Card, columnOrganization));
.forEach((card) => this.addCardToOrganization(card, columnOrganization));
}

private addCardToOrganization(card: Card, columnOrganization: CommonCartridgeOrganizationNode): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ export class SchulconnexResponseMapper {
let otherUsers: ExternalGroupUserDto[] | undefined;
if (this.configService.get('FEATURE_OTHER_GROUPUSERS_PROVISIONING_ENABLED')) {
otherUsers = group.sonstige_gruppenzugehoerige
? (group.sonstige_gruppenzugehoerige
? group.sonstige_gruppenzugehoerige
.map((relation): ExternalGroupUserDto | null => this.mapToExternalGroupUser(relation))
.filter((otherUser: ExternalGroupUserDto | null) => otherUser !== null) as ExternalGroupUserDto[])
.filter((otherUser: ExternalGroupUserDto | null) => otherUser !== null)
: [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class ExternalToolService {
})
);

tools.data = resolvedTools.filter((tool) => tool !== undefined) as ExternalTool[];
tools.data = resolvedTools.filter((tool) => tool !== undefined);

return tools;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/shared/repo/importuser/importuser.repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class ImportUserRepo extends BaseRepo<ImportUser> {
const [importUserEntities, count] = await this._em.findAndCount(ImportUser, query, queryOptions);
const userMatches = importUserEntities.map((importUser) => importUser.user).filter((user) => user != null);
// load role names of referenced users
await this._em.populate(userMatches as User[], ['roles']);
await this._em.populate(userMatches, ['roles']);
return [importUserEntities, count];
}

Expand Down
Loading

0 comments on commit d1200fc

Please sign in to comment.