Preview Language Processing Screen doesn't respect Post Types Settings.
Describe the bug
Language Processing under IBM Watson has 'Preview Language Processing' screen to show preview of language processing.
This preview screen always shows the content from WP Post although both Post Types (Post and Pages) are disabled from setting.
Current Behaviour
- When Post Type is selected, it shows All WP Post
- When Page Type is selected, it shows all WP Pages
- But when nothing is selected, it shows all WP Posts by default.
Expected Behaviour
When no post type is selected, it should show a message like "Please select at least one Post Type to see preview"
Steps to Reproduce
Please watch the attached video
Screenshots, screen recording, code snippet
https://github.com/10up/classifai/assets/6384299/f36a11e4-1be1-46ec-b923-a448329a100e
Environment information
No response
WordPress information
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
In my opinion, previewing serves the purpose of "showcasing" the assigned terms for a particular post, irrespective of the settings. Therefore, I believe it's acceptable to display WordPress posts by default.
I do think one thing that might be a nice enhancement for the previewer would be to allow it to change between enabled post types for classification to see how Watson/Embeddings works for those?
After discussing this with @faisal-alvi we agreed that the best approach for a scenario where someone disables all Post Types there is to display a message there like:
In order to utilize the post classification feature, please enable at least one post type.
We could, if desired, also hide the settings section below if someone has no post type enabled but that's less important as showing a warning message like above.