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

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

Merged
merged 8 commits into from
Sep 1, 2016

Conversation

PJSosnowski
Copy link
Contributor

No description provided.

@jredlarski jredlarski self-assigned this Jul 25, 2016
@@ -0,0 +1,4 @@
.alert {
text-align: center;
color: red;
Copy link
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
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
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
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

Can one of the admins verify this patch?

@sebbrudzinski
Copy link
Member

test this please

@jredlarski
Copy link
Collaborator

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

@@ -17,6 +17,7 @@
controller.$inject = ['$scope'];
function controller($scope){
var ctrl = this;
$scope.emptyListMessage = "Nothing Found";
Copy link
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
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
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
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
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
Contributor

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

@jredlarski
Copy link
Collaborator

test this please

@jredlarski
Copy link
Collaborator

test this please

@jredlarski
Copy link
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