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
Correct message when all datasources filtered out #112
Conversation
e168664
to
174b2be
Compare
a3490b3
to
6d8dafd
Compare
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.
Functionality works fine. Code looks good also, but lets wait for @josemigallas to review that first before merging
6d8dafd
to
03058a1
Compare
@wojta 2 things
|
@@ -50,6 +52,8 @@ class CommonToolbar extends Component { | |||
type="text" | |||
placeholder="Filter by Name" | |||
className={toolbarFilter} | |||
value={get(this.props.filter, "name", "")} |
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 think you can avoid installing the new package for this, perhaps destructuring:
const { onFilter, filter: { name } } = this.props;
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 understand that. I'm not very experienced with JavaScript, but I think that this destructuring is particularly very confusing thing to do in this case, especially for someone coming from other languages.
@@ -19,6 +19,7 @@ import { DeleteResolverDialog } from "./DeleteResolverDialog"; | |||
import { DefaultEmptyView } from "../common/DefaultEmptyView"; | |||
|
|||
import UpsertResolver from "../../graphql/UpsertResolver.graphql"; | |||
import GetDataSources from "../../graphql/GetDataSources.graphql"; |
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 think the branch needs rebasing
@@ -50,6 +52,8 @@ class CommonToolbar extends Component { | |||
type="text" | |||
placeholder="Filter by Name" | |||
className={toolbarFilter} | |||
value={get(this.props.filter, "name", "")} | |||
style={{ height: "26px" }} |
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 should be declared in .toolbarFilter
css class, but I think it's not needed anyway.
@@ -53,6 +53,10 @@ class DataSourcesContainer extends Component { | |||
this.setState({ showDeleteModal: true, selectedDataSource: dataSource }); | |||
} | |||
|
|||
clearFilter() { | |||
this.setState({ filter: {} }); |
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.
Why is filter an object?
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.
It was like that previously, someone probably thought that there might be filters by more criteria.
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.
It's true, my bad!
@wojta Please rebase and update this. We could merge that after |
03058a1
to
99e51a4
Compare
@@ -47,6 +49,8 @@ class CommonToolbar extends Component { | |||
type="text" | |||
placeholder="Filter by Name" | |||
className={toolbarFilter} | |||
value={get(this.props.filter, "name", "")} |
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.
Why you need lodash.get
?
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.
Isn't there some other way than destructuting? I really don't like it.
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'm sure you'll get used to it after a few tries! Unfortunately, I don't think installing a whole new package just to avoid an unliked built-in feature of ES6 is justified :/
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.
ok, then :/
@@ -47,6 +49,8 @@ class CommonToolbar extends Component { | |||
type="text" | |||
placeholder="Filter by Name" | |||
className={toolbarFilter} | |||
value={get(this.props.filter, "name", "")} | |||
style={{ height: "26px" }} |
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 should removed or at least included in the css class.
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.
ok
let name = nameToFilter; | ||
if (name === "") { | ||
name = undefined; | ||
const { name, ...newFilter } = this.state.filter; |
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 think this change is needed
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.
Actually it's needed for clearing the filter.
e3540e5
to
3094daf
Compare
3094daf
to
1f56e03
Compare
Got that running and checked the code. |
1f56e03
to
fb47a0a
Compare
…erogear/data-sync-ui into AEROGEAR-7791-filtered-out-datasources
Changes to PR 112
Awesome work Josemi |
https://issues.jboss.org/browse/AEROGEAR-7791
Motivation
Better UX.
What
Searching the data sources - when searching for an item and it's not found show a
No item found on search
type message.Why
As of writing this ticket it shows the blank slate message which could be confusing for the user.
Verification Steps
No Data Sources defined
pageNo item found while filtering the data sources
and buttonClear the filter
Clear the filter
filter is cleared and all datasources are displayedChecklist:
Progress
Additional Notes
PS.: Add images and/or .gifs to illustrate what was changed if this pull request modify the appearance/output of something presented to the users.