https://wiki.st.com/stm32mpu-ecosystem-v1/index.php?title=Template:UserDashboard&feed=atom&action=historyTemplate:UserDashboard - Revision history2024-03-29T07:09:47ZRevision history for this page on the wikiMediaWiki 1.31.16https://wiki.st.com/stm32mpu-ecosystem-v1/index.php?title=Template:UserDashboard&diff=71589&oldid=prevNathalie Sangouard: Merge articles2021-07-08T16:35:41Z<p>Merge articles</p>
<p><b>New page</b></p><div><noinclude><br />
==Usage==<br />
The [[Template:UserDashboard|UserDashboard]] template allows '''any logged-in user who has writing permissions, to build customized dashboards to follow up the state of the pages on which this user has a [[Contributors:Review process#Roles|role]] (e.g. main writer, expert...) to play'''.<br />
<br />
A dashboard is obtained thanks to a Semantic MediaWiki query<ref group="ud">[https://www.semantic-mediawiki.org/wiki/Help:Inline_queries Semantic MediaWiki Help:Inline queries]</ref>, and is displayed as a searchable and exportable table thanks to the <code>table</code> format and the <code>datatable</code> class<ref group="ud">[https://www.semantic-mediawiki.org/wiki/Help:Table_format Semantic MediaWiki Help:Table format]</ref>. The features of this class are:<br />
* nice visual appearance<br />
* search input box for searching within the table<br />
* easy export of the table's content into CSV, JSON, RSS and RDF<br />
<br />
Usage: <nowiki>{{</nowiki>UserDashboard | user={{HighlightParam|<username>}} | role={{HighlightParam|<role>}} | filter={{HighlightParam|<filter>}}}}<br />
Where:<br />
* {{HighlightParam|<username>}} is the '''optional''' username of the logged-in user who has writing permissions for whom the customized dashboard is built (if any doubt, cross-check, in your preferences, your wiki [[Special:Preferences#mw-prefsection-personal | username]]). Per default (if {{HighlightParam|<username>}} is not set), the user who is currently logged-in, is considered.<br />
* {{HighlightParam|<role>}} is the '''optional''' [[Contributors:Review process#Roles|role]] (e.g. main writer, expert...) for which the customized dashboard is built. The default value is '''MW'''. The possible values for {{HighlightParam|<role>}} are:<br />
** '''MW''': main writer<br />
** '''EX''': expert<br />
** '''TW''': technical writer<br />
** '''MT''': maintainer<br />
* {{HighlightParam|<filter>}} is the '''optional''' filter to reduce the number of listed pages. The default value is '''assignment'''. The possible value for <filter> is:<br />
** '''assignment''': the dashboard lists all the pages that match with the user and role criteria<br />
** '''action''': the dashboard lists only the pages that match with the user and role criteria, '''and''' for which an action from this user is required (e.g. follow-up, review...)<br />
<br />
Summary:<br />
{| class="st-table"<br />
! {{HighlightParam|<role>}} !! {{HighlightParam|<filter>}} !! The dashboard lists the pages<br />
|-<br />
| ''not set'' || whatever the filter || An error is displayed<br />
|-<br />
| rowspan="2" | MW<br>(or ''not set'') || assignment<br>(or ''not set'') || to which the user is assigned as main writer<br />
|-<br />
| action || to which the user is assigned as main writer, and that are not approved: therefore, a follow-up from the user is required (e.g. updating, starting a review...)<br />
|-<br />
| rowspan="2" | EX || assignment<br>(or ''not set'') || to which the user is assigned as expert<br />
|-<br />
| action || to which the user is set as reviewer, and that are "under review by experts": therefore, a review from the user is required<br />
|-<br />
| rowspan="2" | TW || assignment<br>(or ''not set'') || to which the user is assigned as technical writer<br />
|-<br />
| action || to which the user is set as reviewer, and that are "under review by technical writers": therefore, a review from the user is required<br />
|-<br />
| rowspan="2" | MT || assignment<br>(or ''not set'') || to which the user is assigned as maintainer<br />
|-<br />
| action || to which the user is set as reviewer, and that are "under maintainer approval for publication": therefore, a review from the user is required<br />
|}<br />
<br />
References:<br />
<references group="ud" /><br />
<br />
==Basic examples==<br />
{{#vardefine:usertest|Arnaud Pouliquen}}<br />
{| class="st-table"<br />
! scope="row" | You type<br />
| All pages to which the "currently logged-in user" is assigned as main writer<br />
<code><nowiki>{</nowiki>{UserDashboard | role=MW | filter=assignment}}</code><br />
|-<br />
! scope="row" | You get<br />
| The pages to which you are assigned as main writer<br />
<!-- {{UserDashboard | role=MW | filter=assignment}} --><br />
|-<br />
! scope="row" | You type<br />
| All pages to which "{{#var:usertest}}" is assigned as main writer<br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=MW | filter=assignment}}</code><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user={{#var:usertest}} | role=MW | filter=assignment}}<br />
|-<br />
! scope="row" | You type<br />
| All "not approved" pages to which the "currently logged-in user" is assigned as main writer<br />
<code><nowiki>{</nowiki>{UserDashboard | role=MW | filter=action}}</code><br />
|-<br />
! scope="row" | You get<br />
| All "not approved" pages to which you are assigned as main writer<br />
<!-- {{UserDashboard | role=MW | filter=action}} --><br />
|-<br />
! scope="row" | You type<br />
| All "not approved" pages to which "{{#var:usertest}}" is assigned as main writer<br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=MW | filter=action}}</code><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user={{#var:usertest}} | role=MW | filter=action}}<br />
|-<br />
! scope="row" | You type<br />
| All pages to which the "currently logged-in user" is assigned as expert<br />
<code><nowiki>{</nowiki>{UserDashboard | role=EX | filter=assignment}}</code><br />
|-<br />
! scope="row" | You get<br />
| The pages to which you are assigned as expert<br />
<!-- {{UserDashboard | role=EX | filter=assignment}} --><br />
|-<br />
! scope="row" | You type<br />
| All pages to which "{{#var:usertest}}" is assigned as expert<br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=EX | filter=assignment}}</code><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user={{#var:usertest}} | role=EX | filter=assignment}}<br />
|-<br />
! scope="row" | You type<br />
| All "under review by experts" pages to which the "currently logged-in user" is set as reviewer<br />
<code><nowiki>{</nowiki>{UserDashboard | role=EX | filter=action}}</code><br />
|-<br />
! scope="row" | You get<br />
| All "under review by experts" pages to which you are set as reviewer<br />
<!-- {{UserDashboard | role=EX | filter=action}} --><br />
|-<br />
! scope="row" | You type<br />
| All "under review by experts" pages to which "{{#var:usertest}}" is set as reviewer<br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=EX | filter=action}}</code><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user={{#var:usertest}} | role=EX | filter=action}}<br />
|-<br />
! scope="row" | You type<br />
| All pages to which the "currently logged-in user" is assigned as technical writer<br />
<code><nowiki>{</nowiki>{UserDashboard | role=TW | filter=assignment}}</code><br />
|-<br />
! scope="row" | You get<br />
| The pages to which you are assigned as technical writer<br />
<!-- {{UserDashboard | role=TW | filter=assignment}} --><br />
|-<br />
! scope="row" | You type<br />
| All pages to which "{{#var:usertest}}" is assigned as technical writer<br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=TW | filter=assignment}}</code><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user={{#var:usertest}} | role=TW | filter=assignment}}<br />
|-<br />
! scope="row" | You type<br />
| All "under review by technical writers" pages to which the "currently logged-in user" is set as reviewer<br />
<code><nowiki>{</nowiki>{UserDashboard | role=TW | filter=action}}</code><br />
|-<br />
! scope="row" | You get<br />
| All "under review by technical writers" pages to which you are set as reviewer<br />
<!-- {{UserDashboard | role=TW | filter=action}} --><br />
|-<br />
! scope="row" | You type<br />
| All "under review by technical writers" pages to which "{{#var:usertest}}" is set as reviewer<br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=TW | filter=action}}</code><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user={{#var:usertest}} | role=TW | filter=action}}<br />
|-<br />
! scope="row" | You type<br />
| All pages to which the "currently logged-in user" is assigned as maintainer<br />
<code><nowiki>{</nowiki>{UserDashboard | role=MT | filter=assignment}}</code><br />
|-<br />
! scope="row" | You get<br />
| The pages to which you are assigned as maintainer<br />
<!-- {{UserDashboard | role=MT | filter=assignment}} --><br />
|-<br />
! scope="row" | You type<br />
| All pages to which "{{#var:usertest}}" is assigned as maintainer<br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=MT | filter=assignment}}</code><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user={{#var:usertest}} | role=MT | filter=assignment}}<br />
|-<br />
! scope="row" | You type<br />
| All "under maintainer approval for publication" pages to which the "currently logged-in user" is set as reviewer<br />
<code><nowiki>{</nowiki>{UserDashboard | role=MT | filter=action}}</code><br />
|-<br />
! scope="row" | You get<br />
| | All "under maintainer approval for publication" pages to which you are set as reviewer<br />
<!-- {{UserDashboard | role=MT | filter=action}} --><br />
|-<br />
! scope="row" | You type<br />
| All "under maintainer approval for publication" pages to which "{{#var:usertest}}" is set as reviewer<br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=MT | filter=action}}</code><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user={{#var:usertest}} | role=MT | filter=action}}<br />
|}<br />
<br />
==More examples==<br />
{| class="st-table"<br />
! scope="row" | You type<br />
| No role and no filter specified: same as if "MW" and "assignment'' were specified<br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}}}}</code><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user={{#var:usertest}}}}<br />
|-<br />
! scope="row" | You type<br />
| No role specified: same as if "MW" was specified<br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | filter=action}}</code><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user={{#var:usertest}} | filter=action}}<br />
|-<br />
! scope="row" | You type<br />
| Unknown user<br />
<pre style="white-space: pre-wrap;"><br />
{{UserDashboard | user=Unknown user}}<br><br />
{{UserDashboard | user=Unknown user | role=MW}}<br><br />
{{UserDashboard | user=Unknown user | role=EX}}<br><br />
{{UserDashboard | user=Unknown user | role=TW}}<br><br />
{{UserDashboard | user=Unknown user | role=MT}}<br><br />
{{UserDashboard | user=Unknown user | role=MW | filter=action}}<br><br />
{{UserDashboard | user=Unknown user | role=EX | filter=action}}<br><br />
{{UserDashboard | user=Unknown user | role=TW | filter=action}}<br><br />
{{UserDashboard | user=Unknown user | role=MT | filter=action}}<br />
</pre><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user=Unknown user}}<br><br />
{{UserDashboard | user=Unknown user | role=MW}}<br><br />
{{UserDashboard | user=Unknown user | role=EX}}<br><br />
{{UserDashboard | user=Unknown user | role=TW}}<br><br />
{{UserDashboard | user=Unknown user | role=MT}}<br><br />
{{UserDashboard | user=Unknown user | role=MW | filter=action}}<br><br />
{{UserDashboard | user=Unknown user | role=EX | filter=action}}<br><br />
{{UserDashboard | user=Unknown user | role=TW | filter=action}}<br><br />
{{UserDashboard | user=Unknown user | role=MT | filter=action}}<br />
|-<br />
! scope="row" | You type<br />
| Unknown role<br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=AA}}</code><br><br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=AA | filter=action}}</code><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user={{#var:usertest}} | role=AA}}<br><br />
{{UserDashboard | user={{#var:usertest}} | role=AA | filter=action}}<br />
|-<br />
! scope="row" | You type<br />
| Unknown filter: same as if "assignment" was specified<br />
<code><nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=MW | filter=unknown}}</code><br />
|-<br />
! scope="row" | You get<br />
| {{UserDashboard | user={{#var:usertest}} | role=MW | filter=unknown}}<br />
|-<br />
! scope="row" | You type<br />
| Check that there's no space before and after the text<br />
<code>BEFORE<nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=MW}}AFTER</code><br><br />
<code>BEFORE<nowiki>{</nowiki>{UserDashboard | user={{#var:usertest}} | role=BB}}AFTER</code><br />
|-<br />
! scope="row" | You get<br />
| BEFORE{{UserDashboard | user={{#var:usertest}} | role=MW}}AFTER<br><br />
BEFORE{{UserDashboard | user={{#var:usertest}} | role=BB}}AFTER<br />
|}<br />
==Maintenance==<br />
This template is a template common to all ST wikis. <br><br />
Modifications must be done into the [[stwikimodel:Template:UserDashboard|WikiModel]]. They must be reviewed by all ST wikis maintainers.<br><br />
When approved, the template can be pushed/merged towards all ST wikis.<br />
<br />
<br />
==Code==<br />
</noinclude>{{#if: {{{user|}}} | {{#vardefine:usr|{{{user}}}}} | {{#vardefine:usr|{{CURRENTUSER}}}}}}{{#switch:{{{filter|assignment}}}<br />
| action = {{#switch:{{{role|MW}}}<br />
| MW = {{#vardefine:filter|[[Assignment/MW::User:{{#var:usr}}]] [[QM/Document state::!~Approved version]]}}{{#vardefine:main|As {{Highlight|MW}}, {{#var:usr}} is required to follow presently:}}{{#vardefine:default|As {{Highlight|MW}}, {{#var:usr}} has no specific action presently.}}<br />
| EX = {{#vardefine:filter|[[Reviewers::User:{{#var:usr}}]] [[QM/Document state::Under review by experts]]}}{{#vardefine:main|As {{Highlight|EX}}, {{#var:usr}} is required to review presently:}}{{#vardefine:default|As {{Highlight|EX}}, {{#var:usr}} has no page to review presently.}}<br />
| TW = {{#vardefine:filter|[[Reviewers::User:{{#var:usr}}]] [[QM/Document state::Under review by technical writers]]}}{{#vardefine:main|As {{Highlight|TW}}, {{#var:usr}} is required to review presently:}}{{#vardefine:default|As {{Highlight|TW}}, {{#var:usr}} has no page to review presently.}}<br />
| MT = {{#vardefine:filter|[[Reviewers::User:{{#var:usr}}]] [[QM/Document state::Under maintainer approval for publication]]}}{{#vardefine:main|As {{Highlight|MT}}, {{#var:usr}} is required to approve presently:}}{{#vardefine:default|As {{Highlight|MT}}, {{#var:usr}} has no page to approve presently.}}<br />
}}<br />
| #default = {{#ifeq: {{{filter|assignment}}} | assignment | | {{Highlight|Unknown filter ("assignment" is considered).}}&nbsp;}}{{#vardefine:main|{{#var:usr}} is assigned as {{Highlight|{{{role|MW}}}}} of}}{{#vardefine:default|{{#var:usr}} is not assigned as {{Highlight|{{{role|MW}}}}}}}{{#switch:{{{role|MW}}}<br />
| MW = {{#vardefine:filter|[[Assignment/MW::User:{{#var:usr}}]]}}<br />
| EX = {{#vardefine:filter|[[Assignment/EX::User:{{#var:usr}}]]}}<br />
| TW = {{#vardefine:filter|[[Assignment/TW::User:{{#var:usr}}]]}}<br />
| MT = {{#vardefine:filter|[[Assignment/MT::User:{{#var:usr}}]]}}<br />
}}<br />
}}{{#switch:{{{role|MW}}}<br />
| MW =<br />
{{#ask: [[:+||Contributors:+||LegalInformation:+||WikiAdmin:+||File:+||Category:+]] [[modification date::+]] {{#var:filter}}<br />
|mainlabel=Page<br />
|intro={{#var:main}}<br />
|default={{#var:default}}<br />
|?QM/Document state=Page state<br />
|?QM/Acceptance date=Date of last approved revision<br />
|?Modification date=Date of last modification<br />
|?Has reviews comments=The page has review comments<br />
|?Has under construction messages=The page has parts under construction<br />
|?QM/Document version=Number of approved revisions<br />
|?Number of revisions=Number of revisions<br />
|?Number of page views=Number of views<br />
|format=table<br />
|class=datatable st-table<br />
|headers=plain<br />
|limit=300<br />
}}<br />
| EX =<br />
{{#ask: [[:+||Contributors:+||LegalInformation:+||WikiAdmin:+||File:+||Category:+]] [[modification date::+]] {{#var:filter}}<br />
|mainlabel=Page<br />
|intro={{#var:main}}<br />
|default={{#var:default}}<br />
|?QM/Document state=Page state<br />
|?Assignment/EX=Assigned experts<br />
|?Reviewers=Reviewers (if a review is in progress)<br />
|?Has reviews comments=The page has review comments<br />
|?Has under construction messages=The page has parts under construction<br />
|format=table<br />
|class=datatable st-table<br />
|headers=plain<br />
|limit=300<br />
}}<br />
| TW =<br />
{{#ask: [[:+||Contributors:+||LegalInformation:+||WikiAdmin:+||File:+||Category:+]] [[modification date::+]] {{#var:filter}}<br />
|mainlabel=Page<br />
|intro={{#var:main}}<br />
|default={{#var:default}}<br />
|?QM/Document state=Page state<br />
|?Assignment/TW=Assigned technical writers<br />
|?Reviewers=Reviewers (if a review is in progress)<br />
|?Has reviews comments=The page has review comments<br />
|?Has under construction messages=The page has parts under construction<br />
|format=table<br />
|class=datatable st-table<br />
|headers=plain<br />
|limit=300<br />
}}<br />
| MT =<br />
{{#ask: [[:+||Contributors:+||LegalInformation:+||WikiAdmin:+||File:+||Category:+]] [[modification date::+]] {{#var:filter}}<br />
|mainlabel=Page<br />
|intro={{#var:main}}<br />
|default={{#var:default}}<br />
|?QM/Document state=Page state<br />
|?Assignment/MT=Assigned maintainers<br />
|?Reviewers=Reviewers (if a review is in progress)<br />
|?Has reviews comments=The page has review comments<br />
|?Has under construction messages=The page has parts under construction<br />
|format=table<br />
|class=datatable st-table<br />
|headers=plain<br />
|limit=300<br />
}}<br />
| #default = {{Highlight|Unknown role}}<br />
}}</div>Nathalie Sangouard