Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"None of these labels" column has a display issue when used on Template:Person #21

Open
2 of 7 tasks
darenwelsh opened this issue Sep 11, 2019 · 10 comments
Open
2 of 7 tasks

Comments

@darenwelsh
Copy link
Collaborator

darenwelsh commented Sep 11, 2019

  • Update Template:Actionable board column cargo to be all cargo, no SMW
  • Update Template:Actionable board row (Person and User) to use cargo instead of SMW
  • Update Template:Actionable board column label button to use cargo instead of SMW
  • Update Template:Label button to use cargo instead of SMW
  • Add link to Special:Drilldown/Actionable with other action board buttons (add and search) so users can drill down on all actions
  • On Template:Person, change from false to true to display the left column
  • Update the README to show examples of how to use it, including Special:Drilldown
@darenwelsh
Copy link
Collaborator Author

It looks like this column is exceeding some limit due to trying to parse so many actions, especially when not filtered by Property:Related article.

@darenwelsh
Copy link
Collaborator Author

In playing around with an action board and using the MediaWiki preview feature, if I leave the filter for Related article field blank I get the following message:

Warning: Template include size is too large. Some templates will not be included.

@darenwelsh
Copy link
Collaborator Author

One option would be to count the number of actions returned for the optional left column and if that number exceeds some limit, it only parses some and provides a link for more.

This can also be helped by making the templates more efficient, but it will never solve the problem for a system with thousands of actions.

For example:

Template:Actionable board column can be modified to include ?Summary in the results and pass them to Template:Actionable board row and remove two instances of {{#show:{{{1|}}}|?Summary}}

@darenwelsh
Copy link
Collaborator Author

In case it gets overwritten from the dev server, here's a way to maybe do this using Cargo:

In Template:Actionable, add the following in the <noinclude> section (and move that noinclude section to the top before includeonly):

<!--

DECLARE CARGO TABLE

-->{{#cargo_declare:_table=Actionable
|Action_ID=Integer
|Page_title_text=String
|Summary=Searchtext
|Assigned_to=List (,) of Page
|Action_status=String
|Due_date=Date
|Related_article=List (,) of Page
|Label=List (,) of String
|Resolution=Wikitext
|Details=Wikitext
}}

In the same template, in the <includeonly> section later in the page, add:

<!--

SET CARGO TABLE DATA

-->{{#cargo_store:_table=Actionable
|Action_ID={{#sub:{{FULLPAGENAME}}|7|0}} 
|Page_title_text=Action:{{#sub:{{FULLPAGENAME}}|7|0}}
|Summary={{{SUMMARY|}}}
|Assigned_to={{{ASSIGNED_TO|}}}
|Action_status={{{ACTION_STATUS|Open}}}
|Due_date={{{DUE_DATE|}}}
|Related_article={{{RELATED_ARTICLE|}}}
|Label={{#replace:{{{LABEL|}}}|Label:|}}
|Resolution={{{RESOLUTION|}}}
|Details={{{DETAILS|}}}
}}

Then here is a sample query:

{{#cargo_query:
tables=Actionable
|fields=_pageName,Action_ID,Page_title_text,Summary,Assigned_to,Action_status,Due_date,Related_article,Label__full,Resolution,Details
|where=(Action_status='Open' AND Actionable.Label__full NOT RLIKE ".*(^{{!}},\s*)In work(${{!}}\s*,).*" AND Actionable.Label__full NOT RLIKE ".*(^{{!}},\s*)Long Term(${{!}}\s*,).*" AND Actionable.Label__full NOT RLIKE ".*(^{{!}},\s*)Near Term(${{!}}\s*,).*")
|group by=
|having=
|order by=
|limit=5000
|offset=
|intro=
|outro=
|default=
|more results text=
|max display chars=
|format=
}}

@darenwelsh
Copy link
Collaborator Author

If I go with Cargo, consider linking to Special:Drilldown/Actionable so users can drill down on all actions

@darenwelsh
Copy link
Collaborator Author

When this is all fixed, on Template:Person change from false to true to display the left column.

@darenwelsh
Copy link
Collaborator Author

Template:Actionable board column will need:

{{#cargo_query:
tables=Actionable
|fields=_pageName,Action_ID,Due_date,Assigned_to__full,Label__full,Related_article__full
|where=(Action_ID > 0 
{{#switch:{{{1|}}} | Open = AND Action_status='Open' | Closed = AND Action_status='Closed' | }}
{{#if:{{{2|}}}|{{#arraymap:{{{2|}}}|,|VAR| AND Related_article__full RLIKE ".*(^{{!}},\s*)'VAR'(${{!}}\s*,).*" | }} |}}
{{#if:{{{4|}}}|{{#arraymap:{{{4|}}}|,|VAR| AND Label__full NOT RLIKE ".*(^{{!}},\s*){{#replace:VAR|Label:|}}(${{!}}\s*,).*" | \s\s}} |}}
)
|group by=
|having=
|order by=
|limit=5000
|offset=
|intro=
|outro=
|default=
|more results text=
|max display chars=
|format=template
|template=Actionable board row
}}

@darenwelsh
Copy link
Collaborator Author

Once Cargo is added, update the README to show examples of how to use it, including Special:Drilldown

@darenwelsh
Copy link
Collaborator Author

c0d8c5c added cargo versions of the action board and action board column templates. More work will need to be done to make these completely cargo. For now it just improves the situation for the left column by using cargo.

@darenwelsh
Copy link
Collaborator Author

Some thought needs to be put into whether adding Cargo support is a good idea. One important thing to note is that Cargo has one flaw for this use case, in my opinion. Cargo queries do not include results where values are redirects.

Let's say there's a page called Action:60 and it has the value of "Puppy" as a value for Related_article. But "Puppy" is just a redirect to the page called "Dog". Action:60 will not show up in the results of a query filtering on the value of the redirected-to page "Dog".

Such a query would look like the following example.

{{#cargo_query:
tables=Actionable
|fields=Action_ID, _pageName, Related_article__full = Related article
|where=Related_article HOLDS 'Dog'
|group by=Related_article
}}

Demo

Cargo

Query for "Puppy" value of Related_article

{{#cargo_query: tables=Actionable |fields=Action_ID, _pageName, Related_article__full = Related article |where=Related_article HOLDS 'Puppy' |group by=Related_article }}

Query for "Dog" value of Related_article

{{#cargo_query: tables=Actionable |fields=Action_ID, _pageName, Related_article__full = Related article |where=Related_article HOLDS 'Dog' |group by=Related_article }}

SMW

Query for "Puppy" value of Related_article

{{#ask: [[Related article::Puppy]] |?Action ID |?Related article }}

Query for "Dog" value of Related_article

{{#ask: [[Related article::Dog]] |?Action ID |?Related article }}

Discussion

This is because Cargo treats a redirect to a page and that redirect-to page as separate entities. Technically speaking, they are. But when using SMW they are treated as equal. We have 8+ years of treating redirects as equal to the redirected-to pages.

This means two very important things if you are going to use Cargo:

  1. Users cannot use redirect pages as values in cargo properties if they want to query based on the redirect-to page.
  2. Any time a page is moved and a redirect is left behind, you must use Special:ReplaceText to find that pagename in any template fields and updated it.

See related discussion topic (mediawiki.org).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant