Page MenuHomePhabricator

Make empty Schema not look like a small gray square
Closed, ResolvedPublic3 Estimated Story Points

Description

Problem:
Currently, when a Schema has an identifying information but is still empty the element appears as a small gray square:

Empty Schema.png (135×155 px, 2 KB)

Once we'll add the edit link inside the element, the Schema will not be empty anymore but it'll still look something like this:

Hello.png (143×195 px, 3 KB)

We want to make this nicer by not showing the gray box when no Schema text is there and replacing the edit link with a "add Schema" link.

BDD
GIVEN a Schema page
AND the Schema text is empty
THEN no gray Schema text box is shown
AND a "add Schema" link is shown instead of the usual edit link

Acceptance criteria:

  • when Schema text is empty then no gray boy is shown
  • when Schema text is empty "add Schema" link is shown

Event Timeline

Proposal: don’t render the <pre> element if the schema text is empty, and change the “edit schema” link to “add schema” (or “add schema text”?) in that case.

Change 497294 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] Show empty schema only as Add Text-link not empty <pre>

https://gerrit.wikimedia.org/r/497294

Change 497294 merged by jenkins-bot:
[mediawiki/extensions/WikibaseSchema@master] Show empty schema only as Add Text-link not empty <pre>

https://gerrit.wikimedia.org/r/497294

Looking good except one small thing. The link is a redlink. It should be a blue link like the edit link was before.

Screenshot_20190320_122823.png (240×762 px, 18 KB)

Lucas_Werkmeister_WMDE moved this task from Backlog to Doing on the Shape Expressions Sprint 4 board.
Lucas_Werkmeister_WMDE added a subscriber: Michael.

That’s odd, it’s a blue link on my dev wiki. I’ll investigate…

Lucas_Werkmeister_WMDE moved this task from Doing to Done on the Shape Expressions Sprint 4 board.

This also affects the regular “edit” link and is actually due to parser cache changes, so I’ll split it off into a separate task (edit: T218769).