Skip to content

Commit

Permalink
[YW][#3429] Add additional conditional before fetching Universe table…
Browse files Browse the repository at this point in the history
…s and remove border from TaskProgress (#3440)

Summary:
Add additional check whether tables have been already fetched before calling API to fetch
tables. Remove border from TaskProgress because it was distracting and caused the spacing to look
strange.

Test Plan:
Create a backup (preferably one that takes a long time), and then navigate to the
universe-level Tasks tab and check what happens to the UI. Make sure that the stepbar does not do
any flickering.
*One symptom of the incorrect code was that a TON of network requests were being made and causing the UI to lag*

I recommend connecting local YW to customer's environment to repro. After tunneling, you can add the url to .env with `REACT_APP_YUGAWARE_API_URL=http://localhost:8080/api`

Example of fixed UI:
{F13140}

Reviewers: wesley, arnav, ram

Reviewed By: ram

Subscribers: kannan, rao, ui

Differential Revision: https://phabricator.dev.yugabyte.com/D7831
  • Loading branch information
andrewc-dev authored and Andrew Cai committed Jan 24, 2020
1 parent bc12637 commit c34358c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
}

.provider-task-progress-container {
border: 1px solid #d3d3d3;
padding: 6px 8px;
width: 100%;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ class UniverseDetail extends Component {
}
}

componentDidUpdate(prevProps, prevState, snapshot) {
const { universe: { currentUniverse } } = this.props;
componentDidUpdate(prevProps) {
const { universe: { currentUniverse }, universeTables } = this.props;
if (getPromiseState(currentUniverse).isSuccess() &&
!getPromiseState(prevProps.universe.currentUniverse).isSuccess()) {
if (hasLiveNodes(currentUniverse.data)) {
if (hasLiveNodes(currentUniverse.data) && !universeTables.length) {
this.props.fetchUniverseTables(currentUniverse.data.universeUUID);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function mapStateToProps(state, ownProps) {
customer: state.customer,
universe: state.universe,
tasks: state.tasks,
universeTables: state.tables.universeTablesList,
modal: state.modal,
providers: state.cloud.providers,
updateAvailable: isUpdateAvailable(state)
Expand Down

0 comments on commit c34358c

Please sign in to comment.