-
Notifications
You must be signed in to change notification settings - Fork 31
Action Items widget type #465
Action Items widget type #465
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for giving an example of pluralization.
</div> | ||
<div class="md-list-item-text"> | ||
<p ng-if="item.quantity == 1">{{ item.textSingular }}</p> | ||
<p ng-if="item.quantity != 1">{{ item.textPlural }}</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a simple messages calculating singular vs plural in template may work.
Managing pluralization, gender, and date formatting in templates can become challenging long term.
The ICU message format could provide a good way to extract that formatting out of the application logic.
reference:
http://userguide.icu-project.org/formatparse/messages
https://formatjs.io/
https://github.com/yahoo/intl-messageformat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some additional context: The "textSingular" and "textPlural" widget config options bubbled up during the grooming discussion for this story, so I went with that. It's something we will specifically expect to receive in the widget configuration (a la the example in uportal-home#652).
I think extracting the formatting out of the application logic is a great idea, and something we should do eventually, but I think it falls outside the scope of this particular story (because we should do it everywhere).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info. 👍
I do not have access to the MUMUP board, so I was missing some context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminds me that the widget type docs should migrate back from http://uw-madison-doit.github.io/angularjs-portal/widgets.html to uw-frame
.
}) | ||
.catch(function(error) { | ||
// Log a service failure error | ||
$log.warn('Problem getting action item data from feed url'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a stronger log message if it included the broken feed URL.
// For each entry in actionItems, get the number of items | ||
for (var i = 0; i < $scope.config.actionItems.length; i++) { | ||
// Make sure the current item has required fields configured | ||
if ($scope.config.actionItems[i].textSingular |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why .textPlural
wouldn't also be required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops!
MUMUP-2979: "As a user, I would like a widget type that shows a labeled quantity ("8 pending approvals") so that developers are more likely to offer me focused, attractive, consistent, accessible, usable widgets."
In this PR:
Screenshots (mocked data)
Demo (mocked data)
Contributor License Agreement adherence: