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

Allow to filter by person #24

Closed
darenwelsh opened this issue Nov 21, 2019 · 1 comment
Closed

Allow to filter by person #24

darenwelsh opened this issue Nov 21, 2019 · 1 comment

Comments

@darenwelsh
Copy link
Collaborator

darenwelsh commented Nov 21, 2019

Edit Template:Actionable board

<includeonly><!--

SET COLSPAN

-->{{#vardefine:colspan|{{#expr:{{#arraymap:{{{3|}}}|,|VAR|1|+}}{{#ifeq:{{{4|}}}|True|+1|}}}}}}<!--

BUTTONS TO SEARCH AND ADD ACTIONS

-->{{Search actions button}} {{Add action button|{{{6|}}}}}

''See '''[[fod:Actions]]''' for more information''<!--

BUILD TABLE

--><table class="actionable_board">
<tr><th colspan="{{#var:colspan}}">{{{1|Open}}}</th></tr>
<tr>{{#ifeq:{{{4|}}}|True|<!--

IF USER WANTS COLUMN FOR ACTIONS WITHOUT LABELS IN THIS BOARD

-->{{Actionable board column|{{{1|}}}|{{{2|}}}||{{#arraymap:{{{3|}}}|,|VAR|Label:VAR|,}}|{{{5|}}}|{{{6|}}}|{{{7|}}}}} |}}<!--

ADD COLUMNS FOR EACH LABEL

-->{{#arraymap:{{{3}}}|,|VAR|{{Actionable board column|{{{1|}}}|{{{2|}}}|Label:VAR||{{{5|}}} |{{{6|}}}|{{{7|}}}}}| }}<!--

--></tr>
</table></includeonly><noinclude>This template creates a kanban board.

<nowiki>{{{1}}}</nowiki> = Open, Closed, or All (only show actions with this Action status)<br />
<nowiki>{{{2}}}</nowiki> = List of Related articles (only show actions with all of these Related articles)<br />
<nowiki>{{{3}}}</nowiki> = List of Labels to use for columns<br />
<nowiki>{{{4}}}</nowiki> = True or False (do you want a column on the left that shows actions that do not have any of the labels specified for this board?)<br />
<nowiki>{{{5}}}</nowiki> = View or Edit (do you want action links to go to the view or edit mode?)<br />
<nowiki>{{{6}}}</nowiki> = List of default Related articles for new actions created from links in this table<br />
<nowiki>{{{7}}}</nowiki> = List of Assignees (only show actions with all of these Assignees)<br />

[[Category:Page required for Actionable Extension]]</noinclude>

Edit Template:Actionable board column

<includeonly><!--

DEFINE QUERY PARAMETERS USED IN MULTIPLE PLACES

-->{{#vardefine:commonQueryPart|[[Category:Actionable]] <!--
  -->{{#switch:{{{1|}}} | Open = [[Action status::Open]] | Closed = [[Action status::Closed]] | }}<!--
  -->{{#if:{{{2|}}}|{{#arraymap:{{{2|}}}|,|VAR|[[Related article::VAR]]|}} |}}<!--
  -->{{#if:{{{7|}}}|{{#arraymap:{{{7|}}}|,|VAR|[[Assigned to::VAR]]|}} |}} }}<!--

ONLY SET THE REST FOR THE FIRST COLUMN

-->{{#if:{{{3|}}}||<!--

SET VARIABLE FOR LIST OF ACTIONS FOR THIS TABLE THAT DO NOT HAVE LABELS SELECTED FOR COLUMNS
for each action (query actions open/closed/all related articles)
show action labels
for each label
check if label is found in array of labels used for this board
if not found, add to array of actions to list in this column
-->{{#arraydefine:boardLabels|{{{4|}}}}}<!--
--><!--
-->{{#vardefine:actions|{{#ask: {{#var:commonQueryPart}} |format=plainlist |link=none |limit=5000 }}}}<!--
-->{{#vardefine:actionRepresented|}}<!--
-->{{#vardefine:actionsNotRepresented|}}<!--

BEGIN ARRAYMAP ON EACH ACTION

-->{{#arraymap:{{#var:actions}}|,|ACTION|<!--

FOR EACH ACTION DO ARRAYMAP ON LABELS OF THAT ACTION

-->{{#arraymap:{{#show:ACTION|?Label|format=plainlist|link=none}}|,|LABEL|<!--

FOR EACH LABEL IF LABEL IS IN COLUMN LABELS, ADD TO VARIABLE ACTIONREPRESENTED

-->{{#ifeq:yes|{{#arraysearch:boardLabels|LABEL|0|yes}}|<!-- THEN -->{{#vardefine:actionRepresented|True}}|<!-- ELSE NOTHING --><!--END IF-->}}<!--END ARRAYMAP-->|}}<!--

IF ACTION IS REPRESENTED IN ANOTHER COLUMN, DO NOTHING; ELSE ADD IT TO ACTIONSNOTREPRESENTED

-->{{#ifeq:{{#var:actionRepresented}}|True||{{#vardefine:actionsNotRepresented|ACTION, {{#var:actionsNotRepresented}}}}}}<!--
-->{{#vardefine:actionRepresented|}} |}} }}<!--

SET VARIABLE FOR DEFAULT RELATED ARTICLES FOR NEW ACTIONS

-->{{#vardefine:newActionDefaultRelatedArticles|{{{6|}}}}}<!--

BUILD TABLE

--><td style="background-color:#f5f5f5;"><!--

--><table class="actionable_board actionable_board_action">
<tr><th>{{#if:{{{3|}}}|{{Actionable board column label button|{{{3|}}}|{{#var:newActionDefaultRelatedArticles}}}}|None of these labels}}</th></tr>
{{#if:{{{3|}}}|<!--

IF THIS IS FOR A COLUMN WITH A LABEL HEADER, QUERY FOR ACTIONS WITH THAT LABEL

-->{{#ask: {{#var:commonQueryPart}} [[Label::{{{3}}}]]
|?Action ID
|?Due date
|?Assigned to
|?Label
|?Related article
|format=template
|template=Actionable board row
|userparam={{{5|Edit}}}
|link=none
|limit=5000
}}|<!--

ELSE QUERY FOR ACTIONS WITHOUT ANY OF THE HEADER LABELS, ONLY IF THERE ARE ANY SUCH ACTIONS

-->{{#if: {{#var:actionsNotRepresented}}|{{#ask: {{#arraymap:{{#var:actionsNotRepresented}}|,|VAR|{{#var:commonQueryPart}} [[VAR]]| OR }}
|?Action ID
|?Due date
|?Assigned to
|?Label
|?Related article
|format=template
|template=Actionable board row
|userparam={{{5|View}}}
|link=none
|limit=5000
}}|}}|}}<!--
--></table></td><!--

UNSET VARIABLES

-->{{#vardefine:commonQueryPart|}}<!--
-->{{#vardefine:actions|}}<!--
-->{{#vardefine:actionRepresented|}}<!--
-->{{#vardefine:actionsNotRepresented|}}<!--
--></includeonly><noinclude>This template creates a kanban board column.

<nowiki>{{{1}}}</nowiki> = Open, Closed, or All (only show actions with this Action status)<br />
<nowiki>{{{2}}}</nowiki> = List of Related articles (only show actions with all of these Related articles)<br />
<nowiki>{{{3}}}</nowiki> = Label to use for this column (only show actions in this column with this Label)<br />
<nowiki>{{{4}}}</nowiki> = List of "Does not have label" values to use for this column (only show actions in this column with none of these Labels)<br />
<nowiki>{{{5}}}</nowiki> = View or Edit (do you want action links to go to the view or edit mode?)<br />
<nowiki>{{{6}}}</nowiki> = List of default Related articles for new actions created from links in this table<br />
<nowiki>{{{7}}}</nowiki> = List of Assignees (only show actions with all of these Assignees)<br />

[[Category:Page required for Actionable Extension]]</noinclude>
@darenwelsh
Copy link
Collaborator Author

This is now possible. In the future (in the year 2000) it would be good to be able to filter on label, related article, and assignee per column. See #33

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