Skip to content

MOTECH-2739 Style empty state for motech-list#37

Merged
jredlarski merged 8 commits into
motech:masterfrom
PJSosnowski:MOTECH-2793
Sep 1, 2016
Merged

MOTECH-2739 Style empty state for motech-list#37
jredlarski merged 8 commits into
motech:masterfrom
PJSosnowski:MOTECH-2793

Conversation

@PJSosnowski
Copy link
Copy Markdown
Contributor

No description provided.

@jredlarski jredlarski self-assigned this Jul 25, 2016
Comment thread src/common/base/base.alert.scss Outdated
@@ -0,0 +1,4 @@
.alert {
text-align: center;
color: red;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@PJSosnowski -- let's not use red -- please use a Sass variable so we can redefine this value later -- I'd call this color $errorColor (or something)

You should define variables over here

@nickdotreid
Copy link
Copy Markdown
Contributor

@PJSosnowski

Question
Did you try using ng-transclude or adding a directive attribute for the motech-list element? I feel that the less logic we need to implement per-page the better (ie DRYer the better)

Edits
Can we remove the space between the alert and the bottom of the list?
image

Could we also style the alert so that it looks like a bootstrap alert-warning? I feel that an empty list is more of a warning rather then a red-colored error.

You should be able to @extend .alert-warning (instead of actually copying the styles)
image

@jredlarski jredlarski removed their assignment Jul 26, 2016
@PJSosnowski
Copy link
Copy Markdown
Contributor Author

@nickdotreid
I'm not sure whats on your mind - create a new directive for empty list injected by attribute or extend already existing directive for motech list with an extra attribute?

@nickdotreid
Copy link
Copy Markdown
Contributor

Extend the existing motech-list directive, but add an attribute for an empty list message

That way we can hide the <ul> element if there are no list items in it

@motech-gerrit
Copy link
Copy Markdown

Can one of the admins verify this patch?

@sebbrudzinski
Copy link
Copy Markdown
Member

test this please

@jredlarski
Copy link
Copy Markdown
Collaborator

@PJSosnowski After your changes if a list is empty there is no alert shown.

controller.$inject = ['$scope'];
function controller($scope){
var ctrl = this;
$scope.emptyListMessage = "Nothing Found";
Copy link
Copy Markdown
Collaborator

@jredlarski jredlarski Aug 3, 2016

Choose a reason for hiding this comment

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

@PJSosnowski Could we define this string in messages file so it could be easy translated?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@PJSosnowski Please remove the unused variable

@PJSosnowski
Copy link
Copy Markdown
Contributor Author

PJSosnowski commented Aug 8, 2016

@jredlarski I can't find proper place where I could put that message, all messages files are assigned to specific modules but motech-list is under common
zrzut ekranu z 2016-08-08 14-09-49

@nickdotreid
Copy link
Copy Markdown
Contributor

@PJSosnowski

I just saw this thread (sorry) — I've started some documentation about adding message strings to the UI here — but you also might want to check one of the existing property files

@PJSosnowski
Copy link
Copy Markdown
Contributor Author

@nickdotreid Actually I've tried to use directive but it didnt work well. Now this alert is hidden/shown by css

@nickdotreid
Copy link
Copy Markdown
Contributor

@PJSosnowski - oh that's a pretty cool.... I totally didn't think of using CSS

@jredlarski
Copy link
Copy Markdown
Collaborator

test this please

@jredlarski
Copy link
Copy Markdown
Collaborator

test this please

@jredlarski
Copy link
Copy Markdown
Collaborator

@PJSosnowski Please add the empty list warning to the rest of the lists in Motech in the second PR.

@jredlarski jredlarski merged commit 795c470 into motech:master Sep 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants