Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejpass committed Nov 8, 2023
1 parent fcfb492 commit 8a73d1e
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './any-content-element.response';
export * from './create-content-element.body.params';
export * from './drawing-element.response';
export * from './external-tool-element.response';
export * from './file-element.response';
export * from './link-element.response';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe(ContentElementResponseFactory.name, () => {
});

it('should return instance of DrawingElementResponse', () => {
const { drawingElement } = drawingElementFactory.build();
const drawingElement = drawingElementFactory.build();

const result = ContentElementResponseFactory.mapToResponse(drawingElement);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
isRichTextElementResponse,
} from '../dto';
import { BaseResponseMapper } from './base-mapper.interface';
import { DrawingElementResponseMapper } from '@src/modules/board/controller/mapper/drawing-element-response.mapper';
import { DrawingElementResponseMapper } from './drawing-element-response.mapper';
import { ExternalToolElementResponseMapper } from './external-tool-element-response.mapper';
import { FileElementResponseMapper } from './file-element-response.mapper';
import { LinkElementResponseMapper } from './link-element-response.mapper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
BoardCompositeVisitorAsync,
Card,
Column,
ColumnBoard, DrawingElement,
ColumnBoard,
DrawingElement,
EntityId,
ExternalToolElement,
FileElement,
Expand Down Expand Up @@ -123,15 +124,14 @@ export class RecursiveCopyVisitor implements BoardCompositeVisitorAsync {
this.copyMap.set(original.id, copy);
}


async visitDrawingElementAsync(original: DrawingElement): Promise<void> {
const copy = new DrawingElement({
id: new ObjectId().toHexString(),
description: original.description,
drawingName: original.drawingName,
children: [],
createdAt: new Date(),
updatedAt: new Date()
updatedAt: new Date(),
});
this.resultMap.set(original.id, {
copyEntity: copy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ describe(ContentElementUpdateVisitor.name, () => {
});

describe('when component is a drawing-item', () => {
it('should throw an error', () => {
it('should throw an error', async () => {
const { drawingItem, updater } = setup();
expect(() => updater.visitDrawingElement(drawingItem)).toThrow();
await expect(() => updater.visitDrawingElementAsync(drawingItem)).rejects.toThrow();
});
});
});
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/modules/board/uc/card.uc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { AuthorizationService } from '@modules/authorization';
import { ObjectId } from 'bson';
import { BoardDoAuthorizableService, ContentElementService, CardService } from '../service';
import { CardUc } from './card.uc';
import { HttpService } from '@nestjs/axios';

Check failure on line 11 in apps/server/src/modules/board/uc/card.uc.spec.ts

View workflow job for this annotation

GitHub Actions / nest_lint

`@nestjs/axios` import should occur before import of `../service`

describe(CardUc.name, () => {
let module: TestingModule;
Expand Down
9 changes: 5 additions & 4 deletions apps/server/src/modules/board/uc/element.uc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ForbiddenException, forwardRef, Inject, Injectable, UnprocessableEntityException } from '@nestjs/common';
import {
AnyBoardDo,
AnyContentElementDo, DrawingElement,
AnyContentElementDo,
DrawingElement,
EntityId,
isSubmissionContainerElement,
isSubmissionItem,
Expand All @@ -14,9 +15,9 @@ import { AnyElementContentBody } from '../controller/dto';
import { BoardDoAuthorizableService, ContentElementService } from '../service';
import { SubmissionItemService } from '../service/submission-item.service';
import { BaseUc } from './base.uc';
import {firstValueFrom} from "rxjs";
import {HttpService} from "@nestjs/axios";
import {Configuration} from "@hpi-schul-cloud/commons/lib";
import { firstValueFrom } from 'rxjs';

Check failure on line 18 in apps/server/src/modules/board/uc/element.uc.ts

View workflow job for this annotation

GitHub Actions / nest_lint

`rxjs` import should occur before import of `../controller/dto`
import { HttpService } from '@nestjs/axios';

Check failure on line 19 in apps/server/src/modules/board/uc/element.uc.ts

View workflow job for this annotation

GitHub Actions / nest_lint

`@nestjs/axios` import should occur before import of `../controller/dto`
import { Configuration } from '@hpi-schul-cloud/commons/lib';

Check failure on line 20 in apps/server/src/modules/board/uc/element.uc.ts

View workflow job for this annotation

GitHub Actions / nest_lint

`@hpi-schul-cloud/commons/lib` import should occur before import of `../controller/dto`

@Injectable()
export class ElementUc extends BaseUc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable, NotImplementedException } from '@nestjs/common';
import { InputFormat } from '@shared/domain/types';
import { ObjectId } from 'bson';
import { ExternalToolElement } from './external-tool-element.do';
import { DrawingElement } from '@shared/domain/domainobject/board/drawing-element.do';
import { DrawingElement } from './drawing-element.do';
import { FileElement } from './file-element.do';
import { LinkElement } from './link-element.do';
import { RichTextElement } from './rich-text-element.do';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
import type { CardNode } from '../card-node.entity';
import type { ColumnBoardNode } from '../column-board-node.entity';
import type { ColumnNode } from '../column-node.entity';
import { DrawingElementNode } from '@shared/domain/entity/boardnode/drawing-element-node.entity';
import { DrawingElementNode } from '../drawing-element-node.entity';
import type { ExternalToolElementNodeEntity } from '../external-tool-element-node.entity';
import type { FileElementNode } from '../file-element-node.entity';
import type { LinkElementNode } from '../link-element-node.entity';
Expand Down

0 comments on commit 8a73d1e

Please sign in to comment.