Skip to content

feat(fields): inclui estado de loading nos componentes#2740

Merged
anabye merged 1 commit intomasterfrom
fields/DTHFUI-12440
Mar 24, 2026
Merged

feat(fields): inclui estado de loading nos componentes#2740
anabye merged 1 commit intomasterfrom
fields/DTHFUI-12440

Conversation

@fabiana-monteiro
Copy link
Copy Markdown
Contributor

@fabiana-monteiro fabiana-monteiro commented Feb 25, 2026

po-textarea, po-rich-text, po-upload

DTHFUI-12440


PR Checklist [Revisor]

  • Padrão de Commit (Coeso, de acordo com o que está sendo realizado)
  • Código (Boas práticas, nome de variavéis/métodos, etc.)
  • Testes unitários (Cobre a situação implementada e coverage está mantido)
  • Documentação (Clara, objetiva e com exemplos caso necessário)
  • Samples (A implementação possui exemplo no Labs/Caso de uso)
  • Rodado em navegadores suportados (Chrome, FireFox, Edge)

Qual o novo comportamento?

  • adiciona propriedade p-loading nos componentes po-rich-text, po-textarea e po-upload
  • adiciona suporte à propriedade p-disabled no po-rich-text
  • ajusta cor do loading no po-button para manter consistência com os fields

Simulação
Samples - Portal

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Upload drag-drop area not disabled during loading state

When p-loading is set to true on po-upload, the drag-drop area remains enabled, allowing users to drag and drop files while the component visually indicates a loading state.

Root Cause: Child component's isDisabled override shadows base class's loading-aware getter

The PR adds a new isDisabled getter to PoUploadBaseComponent at po-upload-base.component.ts:864-866 that includes loading:

get isDisabled(): boolean {
    return this.disabled || this.loading;
}

However, PoUploadComponent at po-upload.component.ts:173-189 already overrides isDisabled with its own complex logic that does not include loading:

get isDisabled(): boolean {
    const currentFiles = this.currentFiles || [];
    return this.requiredUrl
      ? !!(this.hasAnyFileUploading(currentFiles) || !this.url || this.disabled || ...)
      : !!(this.hasAnyFileUploading(currentFiles) || this.autoUpload || this.disabled || ...);
}

The PR correctly added isSelectButtonDisabled (which includes loading) for the select button and isFieldDisabled for the field container/bottom. But the drag-drop area at po-upload.component.html:32 still uses the unmodified isDisabled:

<po-upload-drag-drop
    [p-disabled]="isDisabled"
    ...
>

Impact: Users can drag and drop files onto the upload area while the component is in a loading state, which is inconsistent with the select button being disabled and the visual loading indication.

(Refers to line 32)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@fabiana-monteiro fabiana-monteiro force-pushed the fields/DTHFUI-12440 branch 3 times, most recently from 13ccdda to 744900e Compare March 11, 2026 19:44
@anabye anabye force-pushed the fields/DTHFUI-12440 branch from 744900e to b7ace75 Compare March 17, 2026 18:52
@anabye anabye force-pushed the fields/DTHFUI-12440 branch from d1ba598 to 64a7a47 Compare March 23, 2026 18:11
- adiciona propriedade p-loading nos componentes po-rich-text, po-textarea e po-upload
- adiciona suporte à propriedade p-disabled no po-rich-text
- ajusta cor do loading no po-button para manter consistência com os fields

fixes DTHFUI-12440
@anabye anabye force-pushed the fields/DTHFUI-12440 branch from 64a7a47 to 1472254 Compare March 24, 2026 12:14
@anabye anabye merged commit 2f4cb44 into master Mar 24, 2026
9 checks passed
@anabye anabye deleted the fields/DTHFUI-12440 branch March 24, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants