8000 NT-1231 Creator Perspective query + View your pledge updated by Arkariang · Pull Request #895 · kickstarter/android-oss · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

NT-1231 Creator Perspective query + View your pledge updated #895

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

Merged
merged 16 commits into from
Jun 5, 2020

Conversation

Arkariang
Copy link
Contributor
@Arkariang Arkariang commented Jun 3, 2020

📲 What

  • New query added for retrieving the backings with a backingId.
  • Refactor BackingActivity + BackingActivityViewModel to just load BackingFragment with the updated information.
    ⚠️ Sorry for the big PR, feel free to ping me in case of any doubt

🤔 Why

  • We will need this for retrieving Add-ons from a creator perspective
  • Unify UI removing the old UI from messages to see your pledge.

🛠 How

  • New query on checkout.graphql
  • Minor adjustments to send the BackingId from MessagesActivity, in order to have the backing information when pressing "view pledge" button
  • BackingActivity + BackingViewModel have been refactored to hold the BackingFragment and launch with the new query information.
  • Added new header, the header you see on BackingFragment when loading from the project page, is in fact the project header. No access to that header from this context.

👀 See

| Before 🐛 | After 🦋 |
|
Screen Shot 2020-06-03 at 8 42 05 AM

|
| | |

📋 QA

  • For testing the creator facing view go to PRO, log in as therealnativesquad@gmail.com, go the dashboard, select the project bugs in the office, and look fo a message from luisa, open the message, and hit the view pledge button. In this case your a seeing a Pledge from a creator perspective :)

Story 📖

NT-1231 Creator Perspective query + View your pledge view

Arkariang added 11 commits May 28, 2020 10:35
- updated gem activesupport and fastlane plugin and the list of dependencies of those two gems. (#894)
-- Getting backing from creator perspective
-- Refactored BackingActivity & BackingViewModel to fetch the backing from GraphQL
-- Load BackingFragment in BackingActivity
-- Retrieve Backing from different queries in function of having or not the backingId
-- Filtering out null objects
-- Avoid unnecessary calls
-- Changed logic for fetching the reward
-- Added toolbar
-- Add test for checking BackingWrapper.
@Arkariang Arkariang marked this pull request as ready for review June 3, 2020 15:47
.pledgedAt(backingGr?.pledgedOn())
.projectId(projectId)
.sequence(backingGr?.sequence()?.toLong() ?: 0)
.shippingAmount(backingGr?.shippingAmount()?.amount().toString().toFloat())
Copy link
Contributor

Choose a reason for hiding this comment

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

Above you are using toDouble() for the amount and in this case toFloat() would we want to perhaps stick to using toDouble()?

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 cast them to the exact same type the it's needed for the builder, the unconsistency on the types it's something we can explore as techDebt at some point I think, not sure about the impact to refactor them to use the same type at this point.
Screen Shot 2020-06-04 at 10 14 50 AM
Screen Shot 2020-06-04 at 10 15 04 AM

.switchMap { it.slug()?.let { slug -> this.apolloClient.getProjectBacking(slug) } }
val backing = this.projectDataInput
.switchMap { getBackingInfo(it) }
.distinctUntilChanged()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to check for uniqueness here?

Copy link
Contributor Author
@Arkariang Arkariang Jun 4, 2020

Choose a reason for hiding this comment

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

You can hit the view pledge button, then the back arrow and hit again view pledge really quick. that's why I added the check for uniqueness to not repeat the network call uneccessarly. But if you have a better way for avoiding that second call let me know!

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, perhaps I'm misunderstanding the code, what I'm reading is:

  1. .distinctUntilChanged() is placed after the call would have happened so I don't think it would prevent repeating the network call in this case?
  2. getBackingInfo(it:) appears to return the backing immediately if it's passed in so if we already have one it won't make another request - would we already have one in the scenario you're describing?

@justinswart
Copy link
Contributor

Cool! I was able to navigate to the new backing view:

image

.minimum(rewardAmount?: 0.0)
.description(backingGr?.reward()?.description())
.estimatedDeliveryOn(DateTime(backingGr?.reward()?.estimatedDeliveryOn()))
.convertedMinimum(rewardAmount ?: 0.0)
Copy link
Contributor

Choose a reason for hiding this comment

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

The convertedMinimum is based on the projects currency and exchange rate, we might need this to come through from GraphQL too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it!

@Arkariang Arkariang merged commit 8bf3b11 into feature/NT-1141-add-ons Jun 5, 2020
@Arkariang Arkariang deleted the imartin/NT-1231 branch June 5, 2020 21:05
JadeByfield89 pushed a commit that referenced this pull request Jul 22, 2020
* https://kickstarter.atlassian.net/browse/NT-1231
-- Refactored BackingActivity & BackingViewModel to fetch the backing from GraphQL
-- Load BackingFragment in BackingActivity
-- Changed logic for fetching the reward
-- Added toolbar
Arkariang added a commit that referenced this pull request Oct 15, 2020
* NT-1231 Creator Perspective query + View your pledge updated (#895)
* NT-1141: Refactor existing queries (#897)
* NT-1294: RecyclerView structure for reward & Add-ons (#896)
* NT-1222:Retrieve Add-ons data from Graph (#899)
* NT- 1290: Add-ons UI in BackingFragment (#900)
* NT-1171: Manage Pledge View Backing Info updates (#902)
* NT-1290: Add-ons UI(with real data from staging) (#905)
* NT-1326: Pledge header ui just for rewards (#906)
* NT-1327: Header animation (#911)
* NT-1171: (Fixed) Manage Pledge View Backing Info updates (#912)
* NT-1326 : Add total amount back to the header (#914)
* NT-1326: Reward Title going two lines (#918)
* NT-1345: Bonus support validation fixes (#917)
* NT-1345: Bonus support 
8000
validation fixes (#917)
* NT-1383: New add-ons screen (#923)
* NT-1384: Add-ons list (#925)
* NT-1384- AddOns query (#927)
* NT-1411: Creator crash fixed (#929)
* NT-1385: Add Ons Card UI  (#930)
* NT-1386: Stepper UI on Add-On card (#937)
* NT-1422 && NT-1402 && NT-1383 && NT-1385 && NT-1382: Fix rejected (#946)
* NT-1386:Rejected fix (#947)
* NT-1381: Pledge header design polish (#948)
* NT-1426: Android Manage Pledge View Design Polish (#949)
* NT-1380 Bonus support design polish (#950)
* NT-1344: Updated checkout with new mutation  (#951)
* NT-1344: Updated checkout with new mutation 
* NT- 1462&& NT-1463: UpdateBacking Mutation  (#952)
* NT-1462:Update pledge flow (#954)
* NT-1445: Selected Reward Tag  (#955)
* NT-1390: Previously selected reward logic (#956)
* NT-1440:Display Empty State when add-ons unavailable (#961)
* NT-1453:Maximum pledge string updates (#962)
* NT-1460:Update add ons selection (#959)
* NT-1417: Show a native alert during Edit Reward if changes would remove add ons (#965)
* NT-1387: Fix Add-Ons Available tag for Digital Reward (#970)
* NT-1387: Fix - Select AddOns for digital reward (#971)
* [NT-1453][NT-1344][NT-1399][NT-1509]: Fix Pledge with Digital addOns  (#974)
* [NT-1417][NT-1510]:Fix change reward flow (#975)
* NT-1442: Android Display an error state if add-ons fail to load (#980)
* NT-1516: Update the Bonus Support Base Amount (#981)
* NT-1534: Sold-out add-ons (#983)
* [NT-1453] Bonus Support Max Pledge String Fix (#987)
* NT-1442: Hide shipping selector on network error (#986)
* NT-1471 | NT-1539 - Prevent Add-ons Alert & Add Pledge Label (#991)
* NT-1549 : Choose another reward flow (#993)
* NT-1539: Unprompted Edit Rewards Alert (#994)
* NT-1541: Updated Add-ons Quantity Not Updated (#995)
* NT-1534: Android Sold-out add-ons fix (#996)
* NT-1534: Modify previously backed AddOns if unavailable (#1005)
* NT-606: FIX Display a string indicating backing state for creators on View/Manage Pledge screen 
* NT-1585:Reward with starting time restriction not started yet. (#1009)
* https://kickstarter.atlassian.net/browse/NT-1587 (#1011)
* NT- 1591:Blanck screen edit reward flow (#1012)
* NT-1531: Android Refactor RewardUtils Java to Kotlin (#1008)
* NT-1587: Improve performance (#1013)
* NT-1587: Query with filtering for shippingRules (#1015)

Co-authored-by: Jade Byfield <jjbyfield@gmail.com>
Co-authored-by: Jade Byfield <jade@thoughtbot.com>
Co-authored-by: leighdouglas <leighcdouglas1@gmail.com>
Co-authored-by: jgsamudio <jonathan2457@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0