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

Fix #2344 improve catalog loading spinner #4075

Merged
merged 2 commits into from
Aug 23, 2019

Conversation

kasongoyo
Copy link
Contributor

@kasongoyo kasongoyo commented Aug 8, 2019

Description

Catalog loading spinner was small and placed in such a way that it was
difficult to see it. This commit make it bigger and easy to notice that
the catalog is loading.

Improve catalog loading spinner

Issues

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)
see #2344

What is the new behavior?

MapStore HomePage

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@tdipisa tdipisa requested a review from allyoucanmap August 8, 2019 09:39
@tdipisa tdipisa added this to the 2019.02.01 milestone Aug 8, 2019
@coveralls
Copy link

coveralls commented Aug 9, 2019

Coverage Status

Coverage increased (+0.03%) to 82.334% when pulling 741e0e6 on kasongoyo:feature/2344 into c6e014a on geosolutions-it:master.

Copy link
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

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

The result is not yet enough visible. I asked @allyoucanmap to provide you more details.

Don't forget the unit test at the end.

Copy link
Contributor

@allyoucanmap allyoucanmap left a comment

Choose a reason for hiding this comment

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

This could be the result:

loader

@@ -360,7 +362,7 @@ class Catalog extends React.Component {
</Form>)}
footer={this.renderPagination()}>
<div>
{this.renderResult()}
{ this.props.loading ? <div className="catalog-results empty"><Spinner spinnerName="circle" noFadeIn overrideSpinnerClassName="spinner"/></div> : this.renderResult() }
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of Spinner we should use Loader from /misc folder to keep the style aligned with other loader.
I suggest to use size 176px similar to the main spinner of Loading MapStore.
Probably it's better to use a different class for the container that describe the loading action:
proposal -> catalog-results-loading instead of catalog-results empty

Copy link
Contributor

Choose a reason for hiding this comment

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

@allyoucanmap what about removing the spinner inside the search button?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think @allyoucanmap has forgotten to remove it in the snapshot but we agreed it before that I should remove all other spinners in favour of a single visible large spinner

@@ -360,7 +359,9 @@ class Catalog extends React.Component {
</Form>)}
footer={this.renderPagination()}>
<div>
{this.renderResult()}
{ this.props.loading ? <div className="catalog-results loading"><Loader size="176" /><h4>
Copy link
Contributor

Choose a reason for hiding this comment

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

i would keep the new loading stuff in the renderLoading function

Copy link
Contributor Author

@kasongoyo kasongoyo Aug 19, 2019

Choose a reason for hiding this comment

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

Initial, it was in dedicated function because it was used in multiple places but currently it is used in only one place. Besides the Loader by itself is already a component and the surrounding container make sense in that place only. What do you think @MV88

Copy link
Contributor

Choose a reason for hiding this comment

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

I know it is used only there, but i think is clearer to use a function if the condition of the ternary is true. it is just a matter of reability taste.

{ this.props.loading ? this.renderLoading() : this.renderResult() }
i think this is more readable then your solution. as I said is a matter of code style.

Also renderResult is used only once but we can decide to leave it there in order to shrink the render method

Copy link
Contributor

@MV88 MV88 left a comment

Choose a reason for hiding this comment

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

Can you share a gif to see the new behaviour ?

@kasongoyo
Copy link
Contributor Author

@MV88 I have attached the gif with the new behaviour in PR description page under new behaviour

Copy link
Contributor

@MV88 MV88 left a comment

Choose a reason for hiding this comment

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

  • I can see a loading text that stefano did not provided, please remove it.
  • one other thing is the alignment, it should be centered vertically and horizontally
    @allyoucanmap confirm?

Catalog loading spinned was small and placed in such a way that it was
difficult to see it. This commit make it bigger and easy to notice that
the catalog is loading
@MV88 MV88 merged commit 7204116 into geosolutions-it:master Aug 23, 2019
@tdipisa
Copy link
Member

tdipisa commented Aug 30, 2019

@kaso please, can you backport this to 2019.02.xx stable branch ?

kasongoyo added a commit to kasongoyo/MapStore2 that referenced this pull request Sep 13, 2019
…s-it#4075)

* Fix geosolutions-it#2344 improve catalog loading spinner

Catalog loading spinned was small and placed in such a way that it was
difficult to see it. This commit make it bigger and easy to notice that
the catalog is loading

* make the spinner vertical center aligned
tdipisa pushed a commit that referenced this pull request Sep 13, 2019
* Fix #2344 improve catalog loading spinner

Catalog loading spinned was small and placed in such a way that it was
difficult to see it. This commit make it bigger and easy to notice that
the catalog is loading

* make the spinner vertical center aligned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants