Skip to content

Conversation

@bummytime
Copy link
Contributor

@bummytime bummytime commented Sep 20, 2018

This PR addresses 3 issues with data loading in the Dashboard:

  1. Previously, if the user logged out the old data was never cleared. To fix this I added a notification observer for defaultAccountWasUpdated. If that notif is fired and the user is no longer authenticated, we clear the chart VCs

  2. After logging in or launching the app, the Dashboard data would not refresh and could possibly be blank (until the user pulled-to-refresh). Now we are looking for missing data on viewDidAppear and reloading it if needed.

  3. The Updated X minutes ago text on the chart is now cleared when pull-to-refresh is activated or the user logs out.

NOTE: Most of this ☝️☝️☝️ will be replaced when #258 is addressed. The goal here is to give our open beta users a better experience.

Fixes #260

Testing

Scenario 1: Fresh Login

  • 1. From a fresh install, log into the app
  • 2. Before the data is loaded, verify the Updated X ... ago text is blank while data is loading
  • 3. Verify the dashboard data loads after a few seconds

Scenario 2: Logout -> Login

  • 1. After scenario one is completed, log out of the app
  • 2. Log into the app again and pick a different store
  • 3. Before the data is loaded, verify:
    a. The Updated X ... ago text is blank while data is loading
    b. The Dashboard is not displaying any stale data from the previous store.
  • 4. Verify the dashboard data loads after a few seconds

Misc Other Things

  • * Switch tabs: Dashboard -> Orders -> Dashboard — verify there isn't any double animations on the charts
  • * Pull-to-refresh — verify the chart clears its data, the new orders alert hides, and everything eventually repopulates itself

@mindgraffiti and/or @jleandroperez could you take a peek at this?

@bummytime bummytime added this to the External open beta milestone Sep 20, 2018
@bummytime bummytime self-assigned this Sep 20, 2018
startListeningToNotifications()
tabBarItem.image = Gridicon.iconOfType(.statsAlt)
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Lines should not have trailing whitespace.

configureView()
reloadData()
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Lines should not have trailing whitespace.

@IBOutlet private weak var bottomBorder: UIView!

private var periodVCs = [PeriodDataViewController]()

Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Lines should not have trailing whitespace.

vc.clearAllFields()
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Lines should not have trailing whitespace.

Copy link
Contributor

@mindgraffiti mindgraffiti left a comment

Choose a reason for hiding this comment

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

✅ all testing scenarios
✅ code review

:shipit:

@bummytime
Copy link
Contributor Author

Thank you @mindgraffiti !!

@bummytime bummytime merged commit 2427b38 into develop Sep 20, 2018
@bummytime bummytime deleted the issue/260-dash-data-loading branch September 20, 2018 20:33
@jleandroperez
Copy link
Contributor

Awesome!!!!

@designsimply designsimply added feature: stats Related to stats, including Top Performers. and removed [Feat] Dashboard labels May 6, 2021
@AliSoftware AliSoftware added feature: stats Related to stats, including Top Performers. and removed feature: stats Related to stats, including Top Performers. labels May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: stats Related to stats, including Top Performers. type: bug A confirmed bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard: Not loading data after login

7 participants