joomla-cms
joomla-cms copied to clipboard
[4.2] Smart Search: Add debugging features
Summary of Changes
In order to gain wider adoption from third party developers, we need to provide them with improved development tools. This PR implements a few features, which become visible when the debug mode is enabled.
Display indexed item
First of all we want to be able to see what has been indexed for an item. When you enable debugging, the list of entries in the index will now be linked and clicking on such an entry will give you a view which displays the common data from indexed items, the type specific items, the indexed terms and the associated taxonomies. This allows you to understand if the content was indexed the way you expected it, as well as with the weighing you expected.
Debug indexing of one specific item
Again, when debugging is enabled, a new dropdown button in the index view appears with "Index debugging". This button goes to a new view, where you can select a finder plugin and type in an ID to index and it will then run that plugin for that ID. It will then either return what has been prepared to be indexed by the indexer in the result object or whatever output the plugin generated. This should allow a developer to better write a new finder plugin to index their content.
Testing Instructions
- Install Joomla and provide some sample data. Please note that this PR requires "npm i" to be run again after it has been applied!
- Enable debugging mode in global configuration
- Go to Smart Search and click on an entry in the list to display the data in the index for this item
- Click on "Index > Index debugging" and select a finder plugin from the list.
- Type in an ID, for example "60" in case you are using the testing sample data, and click on "Index"
Notes
- The dropdown button seems to have a styling error when using a modal button as first entry. The spacing is wrong and I couldn't find out why.
- The Javascript is most likely "not optimal". I'm happy for corrections.
- I'm open for better language strings.
- Since 4.1 is in RC, this will have to go into 4.2. Since there is no 4.2-dev branch yet, I'm pointing this towards 4.1-dev for now.
Please change branch. Thanks.
Hmm, that was a failure...
Please update the markup of the table to follow the accessibility standards used on every table in the admin
@Hackwar Do you think you can implement @brianteeman 's suggestions?
@brianteeman can you have a look if the changes which I made would be acceptable?
The tables still do not have a caption. This is essential.
I kept the caption short. Fine like so? Can you mark those conversations then as resolved?
I need to review it in the browser. Which I will di in the next day or so

width issues
I kept the caption short. Fine like so? Can you mark those conversations then as resolved?
i do nnot have the access to mark the 3 a11y issues as resolved but they as far as i am concerned

For toolback please use the same icon and code as seen in com_workflows transitions

For toolback please use the same icon and code as seen in com_workflows transitions
I don't know how you got that, but my button already looks like the correct one.
width issues
fixed.
this is what I am seeing


It is just ToolbarHelper::back() and that is returning different code here. Maybe you got some other stuff in your codebase interfering there? That is just not what is in the code and what is being returned on my end. And comparing this with our current 4.2-dev, my version and 4.2-dev agree with each other.
@Hackwar I have verified once again my previous findings by building a completely new site on a new server using the pre-built package for this PR. I will submit a PR to your branch to fix that
https://github.com/Hackwar/joomla-cms/pull/53
done
I am confused.
I expected that I can select an item in the overview then click on the debug action then come to the checker view where the Id and type of the plugin are already known from the list view and there is no need for input (can be disabled)
As it is now, I would not know how to find the Id (of course it is in the slug, but mybe users don't know that.
This pull requests has been automatically converted to the PSR-12 coding standard.
Leave ID blank or enter a non-existing ID.

@Hackwar can you fix the conflicting file here, to give a test
Thank you for your contribution, unfortunately the 4.4-dev branch doesn't get new features. When #40181 is merged this pr should be rebased to 5.0-dev. Thanks for understanding.
I would mark all debuging functions/class "@internal" since it's not intended to be used by 3rd party developer.
I would like to merge this in to j5 do we already have documentation?
No, I need to write the complete documentation for Smart Search still.
Thanks