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

Unified admin grid columns and added XML configuration #4225

Merged
merged 37 commits into from
Oct 22, 2024

Conversation

sreichel
Copy link
Contributor

@sreichel sreichel commented Sep 24, 2024

Description (*)

  • makes all entity_id grid columns searchable from to
  • disallow/ignore non-numeric input on price/currency/range grid columns (*)
  • removed useless "'sortable' => true"
  • bugfix: revmoved return parent::renderCss() . ' a-right';

(*) Note: instead of having zero results, as suggested in mentioned issue, it will ignore input and return all products.

Fixed Issues (if relevant)

  1. Fixes Filtering columns grid - Issue with products having the price zero #3158

Update

The configuratuion for grid column default values went from php-property to XML config.

To customize see ... app/code/core/Mage/Adminhtml/etc/config.xml

    <grid>
        <column>
            <default>
                <index>
                    <entity_id>
                        <align>right</align>
                        <type>number</type>
                    </entity_id>
                </index>
                <type>
                    <action>
                        <filter>false</filter>
                        <sortable>false</sortable>
                        <width>40</width>
                    </action>
                    <currency>
                        <align>right</align>
                        <index>price</index>
                    </currency>
                    <date>
                        <width>140</width>
                    </date>
                    <datetime>
                        <width>170</width>
                    </datetime>
                    <number>
                        <align>right</align>
                    </number>
                    <price>
                        <align>right</align>
                        <index>price</index>
                    </price>
                    <store>
                        <index>store_id</index>
                        <store_view>true</store_view>
                        <width>160</width>
                    </store>
                </type>
            </default>
        </column>
    </grid>

@github-actions github-actions bot added the Component: Adminhtml Relates to Mage_Adminhtml label Sep 24, 2024
@addison74
Copy link
Contributor

If we fix this problem, all the grids in the Backend will have to be revised. For example, the Manage Customers grid, we are allowed to input strings on the ID column for the From and To inputs.

@sreichel
Copy link
Contributor Author

sreichel commented Sep 24, 2024

If we fix this problem, all the grids in the Backend will have to be revised

Yes, i know, but please not here in this PR.

Better make small steps ...

edit:

Pls collect all the grids that need changes, make new issue and we move on.

@addison74
Copy link
Contributor

addison74 commented Sep 29, 2024

@sreichel - This is the grids list which have columns that allow searching strings and return zero as results. In order to check I had to change records in the database. I hope I did not miss anything. This PR solves only one of the issues Catalog > Products - Price column.

Sales > Orders

  • G.T. (Base) column
  • G.T. (Purchased) column

Sales > Invoices

  • Amount column

Sales > Shipments

  • Total Qty column

Sales > Credit Memos

  • Refunded column

Sales > Tax > Manage Tax Zone & Rates

  • Rate column

Catalog > Products

  • Price column

Catalog > Products > Edit Product > Related Products tab

  • Price column
  • Position colum

Catalog > Products > Edit Product > Up-sells Products tab

  • Price column
  • Position colum

Catalog > Products > Edit Product > Cross-sells Products tab

  • Price column
  • Position colum

Catalog > Products > Edit Product > Product Tags tab

  • # of Use column

Catalog > Products > Edit Product > Associated Products tab (configurable)

  • Price column

Catalog > Categories > Category Products tab

  • Price column
  • Position column

Catalog > Search Terms

  • Results column
  • Number of Uses column

Promotions > Shopping Cart Price Rules

  • Times used column

Newsletter > Newsletter Queue

  • Processed column
  • Recipients column

Newsletter > Newsletter Problem Reports

  • Error Code column

Reports > Shopping Cart > Abandoned carts

  • Number of Items column
  • Quantity of Items column
  • Subtotal column

Reports > Producs > Low stock

  • Stock Qty column

Reports > Search Terms

  • Results column
  • Hits column

- makes all "entity_id" grid columns searchable "from" "to"
- disallow/ignore non-numeric input on price/currency/range grid columns
- removed useless "'sortable' => true"
@github-actions github-actions bot added Component: Eav Relates to Mage_Eav Component: Oauth Relates to Mage_Oauth Component: Bundle Relates to Mage_Bundle Component: Api2 Relates to Mage_Api2 phpstan labels Sep 29, 2024
@sreichel sreichel changed the title Fixes price filter with non-numeric input Unified admin grid columns Sep 29, 2024
@github-actions github-actions bot added Component: Sales Relates to Mage_Sales Component: Index Relates to Mage_Index labels Oct 2, 2024
addison74
addison74 previously approved these changes Oct 4, 2024
Copy link
Contributor

@addison74 addison74 left a comment

Choose a reason for hiding this comment

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

Nice work. I checked all the files and the result in the Backend.

@addison74
Copy link
Contributor

I have identified a problem. In Catalog > Manage Products on the ID column it is now possible to search within a range. Similar grids are in Related Products, Up-sells, Cross-sells, Associate Products and many more, but which only remained with the search for an ID. Shouldn't they also be modified to be unified?

@sreichel
Copy link
Contributor Author

sreichel commented Oct 4, 2024

Not all grids are covered yet (having another index then entity_id)

If you find some, please list them.

@addison74
Copy link
Contributor

addison74 commented Oct 4, 2024

Grids with ID columns which should have From/To inputs.

  • Catalog > Manage Products > Product Edit > Related Products

  • Catalog > Manage Products > Product Edit > Up-sells

  • Catalog > Manage Products > Product Edit > Cross-sells

  • Catalog > Manage Products > Product Edit > Product Reviews

  • Catalog > Manage Products > Product Edit > Associated Products (configurable)

  • Catalog > Manage Categories > Category Products tab

  • Catalog > URL Rewrite Management

  • Catalog > Search Terms

  • Catalog > Review and Ratings > Customer Reviews > Pending Reviews

  • Catalog > Review and Ratings > Customer Reviews > All Reviews

  • Catalog > Google Sitemap

  • Promotions > Catalog Price Rules

  • Promotions > Shopping Cart Price Rules

  • Newsletter > Newsletter Templates

  • Newsletter > Newsletter Queue

  • Newsletter > Newsletter Subscribers

  • Newsletter > Newsletter Problems Reports

  • System > Webservices > SOAP Users

  • System > Webservices > SOAP Roles

  • System > Webservices > Rest Roles

  • System > Webservices > OAuth Consumers

  • System > Webservices > OAuth Authorized Tokens

  • System > Webservices > My Applications

  • System > Import/Export > Dataflow Profiles

  • System > Import/Export > Advanced Profiles

  • System > Transactional Emails

  • System > Permissions > Users

  • System > Permissions > Roles

  • System > Permissions > Variables

  • System > Permissions > Blocks

Before moving on to the changes, I think we should evaluate these grids, because not all of them need changes, but those where the need to search within a rage is really helpful.

@sreichel
Copy link
Contributor Author

sreichel commented Oct 4, 2024

Thanks. I'll do it step by step :)

@sreichel
Copy link
Contributor Author

sreichel commented Oct 5, 2024

Please checkout latest commit.

This was fixed in app/code/core/Mage/Adminhtml/Block/Widget/Grid.php

@sreichel
Copy link
Contributor Author

sreichel commented Oct 8, 2024

Date-placeholder should have "From Date", or "dd/mm/yy" to make it perfect ...

PR welcome.

@sreichel
Copy link
Contributor Author

sreichel commented Oct 8, 2024

@addison74 thanks for your reviews. If you have improvements, please use githubs "suggestion"-feature or make a PR to my repo.

For me, current version looks okay.

If you want to remove/improve labels/placeholders, please create a PR. All these mini-changes takes a lot of time - wasting my time.

@sreichel
Copy link
Contributor Author

sreichel commented Oct 9, 2024

It is pretty strange to see two times the same text, From From, To To

Made placeholders invisible in legacy theme.

@addison74
Copy link
Contributor

It is pretty strange to see two times the same text, From From, To To

Made placeholders invisible in legacy theme.

It is much better.

@kiatng
Copy link
Contributor

kiatng commented Oct 15, 2024

@sreichel Conflict to resolve.

@kiatng kiatng merged commit d34be82 into OpenMage:main Oct 22, 2024
19 checks passed
@sreichel sreichel deleted the fix-3158 branch October 22, 2024 05:00
fballiano added a commit to MahoCommerce/maho that referenced this pull request Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Adminhtml Relates to Mage_Adminhtml Component: Api2 Relates to Mage_Api2 Component: Bundle Relates to Mage_Bundle Component: Core Relates to Mage_Core Component: Directory Relates to Mage_Directory Component: Eav Relates to Mage_Eav Component: Index Relates to Mage_Index Component: Oauth Relates to Mage_Oauth Component: Sales Relates to Mage_Sales composer Relates to composer.json new feature phpstan Template : admin Relates to admin template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filtering columns grid - Issue with products having the price zero
3 participants