Problem/Motivation

When an index is set to "read-only", there is no indicator on the index view page, that gives a hint.
The only other indicator is that the buttons to reindex are missing.

Unfortunately my index wasn't set to read only by hand, but because of an migration post import event. So I was just wondering why there are no buttons to reindex. It took me a lot of time figuring out that the cause was the read only state of the index.

Therefore it would be nice to have an indicator that states directly that this index is read only.

Steps to reproduce

1. Set index to read-only
2. Look at the index view page
3. Apart from the missing buttons to reindex, there is no other indicator that the index is read only

Proposed resolution

Add an additional row to the summary table on the view page that indicates the read only state of the index.
Screenshot of the new feature

Remaining tasks

Please review my changes

CommentFileSizeAuthor
search_api_read_only_1.png44.11 KBkulmjens

Issue fork search_api-3432090

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kulmjens created an issue. See original summary.

kulmjens’s picture

Status: Needs work » Needs review

drunken monkey made their first commit to this issue’s fork.

drunken monkey’s picture

Thanks a lot for the suggestion, makes sense!
However, it seems Core uses the spelling “read-only” (with hyphen) in the vast majority of cases, so we should go with that, too. I also updated the existing strings (one of them, unfortunately, user-facing).

Then, I think it makes sense to also add a note to the progress bar, and to hide the “Cron batch size” row (since, in fact, nothing will be indexed during cron runs).
I also moved the new row way up, right beneath “Status”.

Finally, you made me realize that the CSS classes we’re using in those tables (ok/warning/error) are actually ignored by at least the Claro default admin theme. I’d guess they were probably used by Seven, which is why we added them, but we failed to notice that Claro changed that. The new classes are the color-* classes. So, I updated also all existing rows that use either the warning or error class to also have the corresponding color-* class. (I kept the existing classes, too, in case someone’s custom admin theme relies on those. Not quite sure about that, though.)
In any case, the index being read-only might be something we want to warn people about so they do notice it, but it’s definitely not an error (generally speaking, that is), so I downgraded the new message accordingly.

Please tell me what you think about these changes!
I realize that some are a bit out of scope, but I think it’s OK to make this a general “lets improve the ’View’ tabs a bit” issue.

kulmjens’s picture

Thank you very much for your changes!
For each of your points I give a thumbs-up.
I applied the changes, tested them a bit and they work like a charm.

drunken monkey’s picture

Status: Needs review » Fixed

Great to hear, thanks for reporting back!
Merged. Thanks again!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.