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

Refactoring main character text #420

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Refactoring main character text #420

wants to merge 14 commits into from

Conversation

PiluVitu
Copy link
Member

@PiluVitu PiluVitu commented Feb 28, 2024

Closes #382

Feature

Refatoração do componente, exclusão de outros componentes desnecessários ao redor e melhoramento dos testes do componente.

Visual evidences 🖼️
Checklist
  • Issue linked
  • Build working correctly
  • Tests created
Additional info N/A

@PiluVitu PiluVitu self-assigned this Feb 28, 2024
Copy link
Contributor

github-actions bot commented Feb 28, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 51.09% 164 / 321
🔵 Statements 51.26% 182 / 355
🔵 Functions 50.64% 78 / 154
🔵 Branches 52.25% 81 / 155
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/components/CharacterLimitMainText/CharacterLimit.tsx 100% 100% 100% 100%
src/components/ComposerEditor/ComposerEditor.tsx 68.42% 16.66% 66.66% 68.42% 32-38, 33-35, 34, 36-37, 39-44
Generated in workflow #1208

@zoldyzdk zoldyzdk assigned zoldyzdk and unassigned PiluVitu Apr 15, 2024
@zoldyzdk zoldyzdk marked this pull request as ready for review April 16, 2024 01:18
@zoldyzdk zoldyzdk requested a review from a team April 16, 2024 01:18
Copy link
Contributor

@Alecell Alecell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vamos melhorar um pouco os testes principalmente!

.gitignore Outdated Show resolved Hide resolved
src/components/CharacterLimitMainText/CharacterLimit.tsx Outdated Show resolved Hide resolved
src/components/CharacterLimitMainText/CharacterLimit.tsx Outdated Show resolved Hide resolved
src/components/CharacterLimitMainText/CharacterLimit.tsx Outdated Show resolved Hide resolved
src/components/CharacterLimitMainText/CharacterLimit.tsx Outdated Show resolved Hide resolved
src/components/CharacterLimitMainText/CharacterLimit.tsx Outdated Show resolved Hide resolved
src/components/CharacterLimitMainText/CharacterLimit.tsx Outdated Show resolved Hide resolved
src/components/ComposerEditor/ComposerEditor.module.scss Outdated Show resolved Hide resolved
@zoldyzdk zoldyzdk requested review from zoldyzdk and removed request for zoldyzdk April 24, 2024 11:25
hxsggsz
hxsggsz previously approved these changes May 6, 2024
Copy link
Contributor

@Alecell Alecell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Só um ajuste, achei esquisito uma coisa aqui

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isso aqui não me parece estar integrado com a integração dos mocks de API

Comment on lines +11 to +16
type Social = {
id: string;
maxLength: number;
socialName: string;
svg: string;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tipos devem ser declarados do types file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdade, my bad

Comment on lines +29 to +47
const getSocialMedias = async (): Promise<void> => {
const socialMedias: SocialMedia[] = await SocialMediaService.fetch([]);
const value = socialMedias.map((socialMedia) => {
const length: number = socialMedia.postModes.reduce((acc, data) => {
if (!('text' in data.validators)) {
return 0;
}
const { maxLength } = data.validators.text;
return acc > maxLength ? acc : maxLength;
}, 0);
return {
id: socialMedia.id,
maxLength: length,
socialName: socialMedia.name,
svg: socialMedia.icon,
};
});
setSocials(value);
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caramba isso ta muito esquisito

Comment on lines +49 to +51
useEffect(() => {
void getSocialMedias();
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não precisamos disso

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Pending Approval
Development

Successfully merging this pull request may close these issues.

Character limit deve ser refatorado para componente principal de main text
5 participants