Skip to content

Conversation

@rajatofficial
Copy link
Contributor

No description provided.

@rajatofficial rajatofficial changed the base branch from master to dev May 7, 2025 05:07
@codecov
Copy link

codecov bot commented May 7, 2025

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...q/forms/core/components/models/form/FileInput.java 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@rajatofficial rajatofficial force-pushed the FORMS-18927-AllowExtensionsSupportInFileInput branch from 920a278 to c10b1e9 Compare May 7, 2025 09:46
@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 94 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

mimeTypeField.find('coral-multifield-item:not(:first)').remove();

// Set value of first item to */*
firstItem.find('input').val('*/*');
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this "firstItem.find('input').val('/');" means all mimetypes are allowed or ignored?

}

if(mimeTypeFieldInfoIcon.length > 0) {
// show the info icon
Copy link
Contributor

Choose a reason for hiding this comment

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

Info icon should be present by default, not based on condition

Copy link
Collaborator

Choose a reason for hiding this comment

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

@rajatofficial To confirm - this is need because it is behind FT?

isInvalidFileName = isCurrentInvalidFileName = true;
inValidNamefileNames = currFileName + "," + inValidNamefileNames;
} else {
// Now size is in MB
Copy link
Collaborator

Choose a reason for hiding this comment

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

@rajatofficial why this formatting change - the previous one looks correct..


// Disable the entire multifield and its contents
mimeTypeField.css({
'pointer-events': hasExtensions ? 'none' : 'auto',
Copy link
Collaborator

@nit23uec nit23uec May 27, 2025

Choose a reason for hiding this comment

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

Pls manage css by adding relevant classes rather inside the js itself.

mimeTypeField.prop('disabled', hasExtensions);

// Disable delete icons and their SVGs
mimeTypeField.find('coral-icon[icon="delete"], ._coral-Icon--svg').css({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Anything that starts with a underscore is an internal coral selector. We should not use any coral internals in the code.

// If no first item exists, create one
if (firstItem.length === 0) {
// Click the add button to create a new item
mimeTypeField.find('button[coral-multifield-add]').click();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rather than simulating clicks we should be using add API for Multi field.

});

// Handle MIME type items if extensions exist
if (hasExtensions) {
Copy link
Collaborator

@nit23uec nit23uec May 27, 2025

Choose a reason for hiding this comment

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

It's not immediately clear from this code that what, why and when do we intend to do this
Is it just to reset the mimetype with just 1 item whose value is */* whenever extensions exist/added? Im suspecting it's due to avoidance of gng into complexities wrt conflict in server side validation. Am I correct?

public static final String PN_UNCHECKED_VALUE = "uncheckedValue";
public static final String PN_MAX_FILE_SIZE = "maxFileSize";
public static final String PN_FILE_ACCEPT = "accept";
public static final String PN_FILE_ACCEPT_EXTENSIONS = "acceptExtensions";
Copy link
Collaborator

@nit23uec nit23uec May 27, 2025

Choose a reason for hiding this comment

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

Any new prop persisted in jcr should being with fd:

let hasExtensions = extensionsField.find('coral-multifield-item').length > 0;
if (hasExtensions) {
mimeTypeField.css({
'pointer-events': 'none',
Copy link
Collaborator

@nit23uec nit23uec May 27, 2025

Choose a reason for hiding this comment

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

Html5 file accept allows mimetypes and extensions to be set simultaneously. is there any specific reason for this otherwise behavior in our component?

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
aria-required-attr critical
empty-heading minor
label-title-only serious
target-size serious

1 similar comment
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
aria-required-attr critical
empty-heading minor
label-title-only serious
target-size serious

@rajatofficial rajatofficial force-pushed the FORMS-18927-AllowExtensionsSupportInFileInput branch from 050d43c to 5e64bc4 Compare December 15, 2025 04:51
@github-actions github-actions bot force-pushed the FORMS-18927-AllowExtensionsSupportInFileInput branch from 5e64bc4 to a5b7748 Compare December 15, 2025 04:51
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.

7 participants