joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[4.2] Smart Search: Add debugging features

Open Hackwar opened this issue 3 years ago • 20 comments

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

  1. Install Joomla and provide some sample data. Please note that this PR requires "npm i" to be run again after it has been applied!
  2. Enable debugging mode in global configuration
  3. Go to Smart Search and click on an entry in the list to display the data in the index for this item
  4. Click on "Index > Index debugging" and select a finder plugin from the list.
  5. Type in an ID, for example "60" in case you are using the testing sample data, and click on "Index"

Notes

  1. 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.
  2. The Javascript is most likely "not optimal". I'm happy for corrections.
  3. I'm open for better language strings.
  4. 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.

Hackwar avatar Jan 20 '22 07:01 Hackwar

Please change branch. Thanks.

Quy avatar Jan 27 '22 01:01 Quy

Hmm, that was a failure...

Hackwar avatar Jan 27 '22 01:01 Hackwar

Please update the markup of the table to follow the accessibility standards used on every table in the admin

brianteeman avatar Jan 27 '22 09:01 brianteeman

@Hackwar Do you think you can implement @brianteeman 's suggestions?

richard67 avatar Apr 22 '22 11:04 richard67

@brianteeman can you have a look if the changes which I made would be acceptable?

Hackwar avatar May 17 '22 08:05 Hackwar

The tables still do not have a caption. This is essential.

brianteeman avatar May 17 '22 10:05 brianteeman

I kept the caption short. Fine like so? Can you mark those conversations then as resolved?

Hackwar avatar May 17 '22 10:05 Hackwar

I need to review it in the browser. Which I will di in the next day or so

brianteeman avatar May 17 '22 10:05 brianteeman

image

width issues

brianteeman avatar May 17 '22 20:05 brianteeman

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

brianteeman avatar May 17 '22 20:05 brianteeman

image

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

image

brianteeman avatar May 17 '22 20:05 brianteeman

image

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

image

I don't know how you got that, but my button already looks like the correct one.

Hackwar avatar May 18 '22 08:05 Hackwar

image

width issues

fixed.

Hackwar avatar May 18 '22 08:05 Hackwar

this is what I am seeing image

image

brianteeman avatar May 18 '22 08:05 brianteeman

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 avatar May 18 '22 10:05 Hackwar

@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

brianteeman avatar May 18 '22 17:05 brianteeman

https://github.com/Hackwar/joomla-cms/pull/53

brianteeman avatar May 18 '22 17:05 brianteeman

done

Hackwar avatar May 18 '22 17:05 Hackwar

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.

chmst avatar Jun 23 '22 22:06 chmst

This pull requests has been automatically converted to the PSR-12 coding standard.

joomla-bot avatar Jun 27 '22 21:06 joomla-bot

Leave ID blank or enter a non-existing ID.

36753

Quy avatar Feb 01 '23 19:02 Quy

@Hackwar can you fix the conflicting file here, to give a test

carlitorweb avatar Mar 06 '23 13:03 carlitorweb

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.

laoneo avatar Mar 28 '23 07:03 laoneo

I would mark all debuging functions/class "@internal" since it's not intended to be used by 3rd party developer.

HLeithner avatar Apr 03 '23 09:04 HLeithner

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.

Hackwar avatar Apr 17 '23 09:04 Hackwar

Thanks

HLeithner avatar May 29 '23 08:05 HLeithner