Skip to content

Manage Insights screen#9501

Merged
planarvoid merged 74 commits intofeature/manage_insights_readonlyfrom
issue/9464-manage-insights
Apr 23, 2019
Merged

Manage Insights screen#9501
planarvoid merged 74 commits intofeature/manage_insights_readonlyfrom
issue/9464-manage-insights

Conversation

@0nko
Copy link
Copy Markdown
Contributor

@0nko 0nko commented Apr 1, 2019

Fixes #9464.

To test:

  1. Go to Stats
  2. Tap the Manage toolbar button
  3. Try adding and removing the insights by tapping on the + or - button
  4. Tap the Save button
  5. Notice the Insights list is updated and data is refreshed
  6. Go back to the management screen
  7. Try reordering the added insights by drag & dropping of list items
  8. Tap the Save button
  9. Notice the Insights list is reordered accordingly

image

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

0nko added 29 commits March 25, 2019 21:06
Copy link
Copy Markdown
Contributor

@planarvoid planarvoid left a comment

Choose a reason for hiding this comment

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

Looks pretty good! Check my comments about the LinkButton block and let me know what you think

popupMenuHandler
)
) {
override val uiModel: LiveData<UiModel> = super.uiModel.map { model ->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this belongs to the org.wordpress.android.ui.stats.refresh.lists.UiModelMapper#mapInsights method cause that's where we build the UiModel. You can either pass the mutableNavigationTarget as a parameter to the mapInsights function. What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point!

}
}

enum class InsightsTypes : StatsTypes {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd remove the StatsTypes from the base StatsBlock implementation. I think the Control block doesn't need type. We just need to do a bit of casting in the StatsBlockAdapter and modify the DiffUtils so they don't check the statsTypes when it's comparing the Control block

@0nko 0nko requested a review from planarvoid April 16, 2019 10:07
@planarvoid
Copy link
Copy Markdown
Contributor

Everything looks pretty great!

One thing is that adding a new block still keeps it in a permanent loading state (the first time you add it). Do you want to tackle this in a separate PR?

@SylvesterWilmott
Copy link
Copy Markdown

Thanks @0nko

Dragging items in the list feels so good now, it's looking really solid, few things:

  • Manage view: Let's reuse the maximum width from the detail views for landscape/tablet
  • Insights view: Is there a reason we're not using the system text button for "Edit" at the bottom of the list? If yes then can we recreate the styling of a system button ie. Medium text weight, 36dp height, 20dp left and right padding
  • Manage view: There's an odd transitional movement within the manage insights list whenever you open the view, it looks as though the "Add insights" section is moving downwards.
  • Manage view: Let's add an additional 16dp of space between the top section footer and the next section:

Screenshot 2019-04-17 at 14 44 53

Regarding the functionality, there still seems to be one issue:

  1. Visit stats view of a site that has insights set fo default layout
  2. Use the block menu (from the insights view) to move any card up/down
  3. Go to the manage insights view
  4. Notice that "Add insights" section is missing and cannot be restored even by killing the app

0nko added 14 commits April 17, 2019 19:27
…e-insights

# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsFragment.kt
#	WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsViewModel.kt
#	WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/BaseListUseCase.kt
#	WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListViewModel.kt
#	WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/ItemPopupMenuHandler.kt
@SylvesterWilmott
Copy link
Copy Markdown

This looks and feels amazing @0nko , thanks!

@SylvesterWilmott SylvesterWilmott removed the [Status] Needs Design Review A designer needs to sign off on the implemented design. label Apr 23, 2019
Copy link
Copy Markdown
Contributor

@planarvoid planarvoid left a comment

Choose a reason for hiding this comment

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

Looks good 👍 , as discussed, we'll move the fix for the infinitely loading blocks to a separate PR/issue

@planarvoid planarvoid merged commit 96de67f into feature/manage_insights_readonly Apr 23, 2019
@planarvoid planarvoid deleted the issue/9464-manage-insights branch April 23, 2019 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants