Skip to content

Conversation

sakshammishra112
Copy link
Contributor

Description

In the Admin Standard License Comments section, searching by the 'Name' column was not functioning correctly. The search only worked for the Comment column but ignored the Name input field. This issue occurred because DataTables was trying to search using the full HTML string of the input field instead of its actual value.The column is easily searchable because it is <textarea>.

Screenshot from 2025-03-16 03-17-50

This fix ensures that when a search is performed, DataTables extracts the value of the input field inside the Name column instead of the raw HTML, allowing proper filtering.

Changes

  • Modified the DataTable configuration to properly extract the value from the input field in the "Name" column.
  • Used render function to ensure searching works by returning the input field value instead of its HTML content.
  • Ensured no visual changes, maintaining the original appearance.

Changes Reflected

Screencast.from.2025-03-16.03-23-27.webm

How to test

  1. Navigate to Admin Standard License Comments.
  2. Use the search bar to search for a comment by its name.
  3. Verify that results now appear when searching by Name.
  4. Ensure searching by Comment content still works as expected.

Closes

Fixes issue [#3006 ] – "Search by Name Not Working in Admin Standard License Comments"

@sakshammishra112 sakshammishra112 changed the title "Fix: Search Not Working for 'Name' Column in Admin Standard License Comments" Fix: Search Not Working for 'Name' Column in Admin Standard License Comments Mar 17, 2025
@shaheemazmalmmd
Copy link
Member

@sakshammishra112 : thank you for your contributions can you check the same issue in acknowledgement page and also in compatibility rules page ??

Please fix it there as well.

@sakshammishra112
Copy link
Contributor Author

sakshammishra112 commented Mar 21, 2025

Description

In the Admin Standard License Comments section, sorting of name column was not working.This issue occurred because of the same reason as why searching was not working.This fix solves both the searching and sorting functionality for both searching and sorting of the name column.

Changes

  1. Modified t.on('order.dt search.dt', function () {...}) to correctly renumber rows dynamically.Ensured newly added rows appear at the bottom with the correct serial number.
  2. Updated $("#addStdLicComment").on('click', function() {...})to:
    • Append new rows without disrupting order.
    • Assign correct serial numbers dynamically.
    • Automatically focus on the new input field.

Before Modification:

sortingNotWorking.webm

After Modification:

sortingFix.webm

How to test:

  1. Open the Admin License Comment Table.
  2. Try sorting the table by name column and verify that serial numbers update correctly.
  3. Search for comments and ensure that the row indexing remains accurate.
  4. Click "Add Comment" and confirm that the new row appears at the bottom with the correct number.
  5. Modify a comment and submit the form. Check if only modified inputs are updated.

@sakshammishra112
Copy link
Contributor Author

sakshammishra112 commented Mar 21, 2025

@shaheemazmalmmd

I have fixed the sorting issue that i discussed earlier with you on Slack. Also, could you please guide me or provide the link to the acknowledgment and compatibility page? I can't seem to find it.

@shaheemazmalmmd
Copy link
Member

@shaheemazmalmmd

I have fixed the sorting issue that i discussed earlier with you on Slack. Also, could you please guide me or provide the link to the acknowledgment and compatibility page? I can't seem to find it.

you could find them here admin > acknowledgments and admin > compatibility rules

@shaheemazmalmmd
Copy link
Member

@sakshammishra112 : We only accept one commit per PR and functionality can you please squash the commit message to one ?

@Kaushl2208
Copy link
Member

@sakshammishra112 , Any updates on acknowledgement and compatibilty rules????
Can you please take a look and quickly fix for others too?

@sakshammishra112 sakshammishra112 force-pushed the branch113 branch 2 times, most recently from 07909cd to aaa1923 Compare April 15, 2025 13:55
@sakshammishra112
Copy link
Contributor Author

sakshammishra112 commented Apr 15, 2025

@sakshammishra112 , Any updates on acknowledgement and compatibilty rules???? Can you please take a look and quickly fix for others too?

I have fixed the same issue for acknowledgement page. And compatibility rules page works fine

@Kaushl2208
Copy link
Member

Kaushl2208 commented Apr 16, 2025

@sakshammishra112 , Any updates on acknowledgement and compatibilty rules???? Can you please take a look and quickly fix for others too?

I have fixed the same issue for acknowledgement page. And compatibility rules page works fine

Cool, Will test :)

@Kaushl2208 Kaushl2208 closed this Apr 16, 2025
@Kaushl2208 Kaushl2208 reopened this Apr 16, 2025
@sakshammishra112
Copy link
Contributor Author

@Kaushl2208
How to fix this failing check?

@Kaushl2208
Copy link
Member

Kaushl2208 commented Apr 16, 2025

@Kaushl2208 How to fix this failing check?

DCO Signing off GitHub Commits, Take a look into this :), Also dont forget to squash!

Kaushl2208
Kaushl2208 previously approved these changes Apr 16, 2025
Copy link
Member

@Kaushl2208 Kaushl2208 left a comment

Choose a reason for hiding this comment

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

Changes looks good. Tested. Working as expected for License Acknowledgements, Standard Comments.

Can be merged once the DCO check passes

Copy link
Member

@shaheemazmalmmd shaheemazmalmmd left a comment

Choose a reason for hiding this comment

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

Reviewed-By: @Kaushl2208
Tested-By @Kaushl2208

@shaheemazmalmmd shaheemazmalmmd added this pull request to the merge queue Apr 18, 2025
Merged via the queue into fossology:master with commit db10a21 Apr 18, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants