Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: validation text area on change #828

Merged
merged 2 commits into from
Jan 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/src/modules/cards/controller/cards.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { CreateCardDto } from '../dto/create.card.dto';
import DeleteCardDto from '../dto/delete.card.dto';
import UnmergeCardsDto from '../dto/unmerge.dto';
import UpdateCardDto from '../dto/update.card.dto';
import { UpdateCardPositionDto } from '../dto/update-position.card..dto';
import { UpdateCardPositionDto } from '../dto/update-position.card.dto';
import { CreateCardApplication } from '../interfaces/applications/create.card.application.interface';
import { DeleteCardApplication } from '../interfaces/applications/delete.card.application.interface';
import { MergeCardApplication } from '../interfaces/applications/merge.card.application.interface';
Expand Down
40 changes: 0 additions & 40 deletions backend/src/modules/cards/dto/update-position.card..dto.ts

This file was deleted.

31 changes: 29 additions & 2 deletions backend/src/modules/cards/dto/update-position.card.dto.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
import { IsMongoId, IsNotEmpty, IsNumber, IsString } from 'class-validator';
import { IsBoolean, IsMongoId, IsNotEmpty, IsNumber, IsString } from 'class-validator';
import { BaseDto } from 'src/libs/dto/base.dto';

export class UpdateCardPositionDto extends BaseDto {
@IsNotEmpty()
@IsString()
@IsMongoId()
@IsString()
nunocaseiro marked this conversation as resolved.
Show resolved Hide resolved
targetColumnId!: string;

@IsNotEmpty()
@IsNumber()
newPosition!: number;

@IsNotEmpty()
@IsMongoId()
@IsString()
boardId!: string;

@IsNotEmpty()
@IsMongoId()
@IsString()
colIdOfCard: string;

@IsNotEmpty()
@IsNumber()
cardPosition: number;

@IsNotEmpty()
@IsMongoId()
@IsString()
cardId: string;

@IsNotEmpty()
@IsString()
socketId: string;

@IsNotEmpty()
@IsBoolean()
sorted: boolean;
}
2 changes: 1 addition & 1 deletion backend/src/modules/socket/gateway/socket.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
WebSocketServer
} from '@nestjs/websockets';
import { Server, Socket } from 'socket.io';
import { UpdateCardPositionDto } from 'src/modules/cards/dto/update-position.card..dto';
import { UpdateCardPositionDto } from 'src/modules/cards/dto/update-position.card.dto';
import VoteDto from 'src/modules/votes/dto/vote.dto';
import JoinPayload from '../interfaces/joinPayload.interface';
import JoinPayloadBoards from '../interfaces/joinPayloadBoards.interface';
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/Primitives/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,14 @@ const TextArea: React.FC<ResizableTextAreaProps> = ({ id, placeholder, disabled

useEffect(() => {
textAreaAdjust(textareaRef.current);
}, []);
}, [value]);

return (
<StyledTextArea
{...rest}
css={{ minHeight: '$80', backgroundColor: '$primary50', py: '$12', px: '$16' }}
disabled={disabled}
id={id}
onChange={() => textAreaAdjust(textareaRef.current)}
placeholder={placeholder}
variant={currentState}
ref={(e) => {
Expand Down