Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Action Items widget type #465

Merged
merged 6 commits into from
Jun 29, 2017

Conversation

thevoiceofzeke
Copy link
Contributor

@thevoiceofzeke thevoiceofzeke commented Jun 29, 2017

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:

  • Created new "Action Items" widget type with all the necessary goodies
  • Added example widget JSON
  • Documented how to use the widget type (in a separate PR)

Screenshots (mocked data)

screen shot 2017-06-29 at 10 54 28 am

screen shot 2017-06-29 at 11 16 30 am

Demo (mocked data)

action-item-demo

Contributor License Agreement adherence:

@thevoiceofzeke thevoiceofzeke changed the title Quant widget Action Items widget type Jun 29, 2017
Copy link
Contributor

@ChristianMurphy ChristianMurphy left a 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>
Copy link
Contributor

@ChristianMurphy ChristianMurphy Jun 29, 2017

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

Copy link
Contributor Author

@thevoiceofzeke thevoiceofzeke Jun 29, 2017

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).

Copy link
Contributor

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.

Copy link
Contributor

@apetro apetro left a 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');
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops!

@thevoiceofzeke thevoiceofzeke merged commit 465a9d3 into uPortal-Attic:master Jun 29, 2017
@davidmsibley davidmsibley modified the milestone: 5.0.0 Aug 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants