Page MenuHomePhabricator

Handle empty Jade pages
Closed, ResolvedPublic

Description

We need to render the UI for all empty pages under the Jade namespace. It should display the "Propose New Label" button for the top facet.

One possible approach is to use the TitleIsAlwaysKnown hook and then render a Jade Entity with an empty 'editquality' facet on the front-end.

Here's a good example of how to use the hook:
https://github.com/wikimedia/mediawiki-extensions-GlobalUserPage/commit/78bbe09e013ab2ca4f3acc67cbbff0047828ac2d

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 24 2020, 7:41 PM
ACraze updated the task description. (Show Details)

After some initial research, it seems that the TitleIsAlwaysKnown hook is not what we need.

Maybe we can reverse engineer https://www.mediawiki.org/wiki/Extension:Special404 to get something similar?

ACraze updated the task description. (Show Details)Mar 2 2020, 6:07 PM

Change 577013 had a related patch set uploaded (by Accraze; owner: Accraze):
[mediawiki/extensions/Jade@master] Handle empty EntityContent object

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

Just added a patchset that contains a shortcut for us to create an empty entity page on the fly by creating a page with an empty object: {}

Here's a gif showing the process:

The above patchset doesn't get us 100% to our goal, but it's a step in the right direction.

Currently looking at using parser hooks to auto-create pages within the Jade namespace, similar to this extension: https://www.mediawiki.org/wiki/Extension:AutoCreatePage

https://github.com/mkroetzsch/AutoCreatePage

Change 577013 merged by jenkins-bot:
[mediawiki/extensions/Jade@master] Handle empty EntityContent object

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

Change 579116 had a related patch set uploaded (by Accraze; owner: Accraze):
[mediawiki/extensions/Jade@master] Show empty facet on non-existing entity pages

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

Ok, so I finally got this working using the ShowMissingArticle hook and submitted the above patchset.
Basically, we check if the missing article in question is in the Jade namespace and if it is, then we load all the JS resources and hide the noarticletext div on page load.

Change 579116 merged by jenkins-bot:
[mediawiki/extensions/Jade@master] Show empty facet on non-existing entity pages

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

Change 579447 had a related patch set uploaded (by Accraze; owner: Accraze):
[mediawiki/extensions/Jade@master] Render header and diff on empty Jade page

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

Change 579447 merged by jenkins-bot:
[mediawiki/extensions/Jade@master] Render header and diff on empty Jade page

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

Change 579661 had a related patch set uploaded (by Accraze; owner: Accraze):
[mediawiki/extensions/Jade@master] view split on empty entity page

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

Change 579661 merged by jenkins-bot:
[mediawiki/extensions/Jade@master] view split on empty entity page

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

Halfak closed this task as Resolved.Mon, Jun 22, 4:35 PM