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

MBL-1974 Project notice #2214

Merged
merged 26 commits into from
Feb 3, 2025
Merged

MBL-1974 Project notice #2214

merged 26 commits into from
Feb 3, 2025

Conversation

ycheng-kickstarter
Copy link
Contributor

@ycheng-kickstarter ycheng-kickstarter commented Jan 28, 2025

📲 What

For projects that Trust & Safety have flagged as problematic, display a "Kickstarter has restricted this creator" alert on the project overview. When the user clicks on the Learn More button, open up a bottom sheet with more information.

🤔 Why

Let users know we are doing something about sus creators.

🛠 How

  • Add new projectNotice field to GraphQL project fetch and Project data model
  • Create new reusable KSOutlinedButton
  • Create new reusable KSImageTextCtaBanner
  • Create new reusable KSBottomSheetDialogFragment and KSBottomSheetContent
  • Add banner ComposeView to ProjectOverviewFragment and add logic to open bottom sheet
  • Translations
  • Tests

👀 See

Light Dark
projectnotice1 projectnotice_darkmode1
projectnotice2 projectnotice_darkmode2

projectnotice_bounds

📋 QA

Use this project on staging: https://staging.kickstarter.com/projects/clayospice/clayo-gourmet-peruvian-goods

Story 📖

https://kickstarter.atlassian.net/browse/MBL-1974

@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 42.85714% with 80 lines in your changes missing coverage. Please review.

Project coverage is 68.21%. Comparing base (b6ab5da) to head (87ad553).

Files with missing lines Patch % Lines
...kstarter/ui/views/compose/KSColorAccentedBanner.kt 0.00% 58 Missing ⚠️
.../views/compose/projectpage/KSBottomSheetContent.kt 74.62% 12 Missing and 5 partials ⚠️
...arter/services/transformers/GraphQLTransformers.kt 0.00% 4 Missing ⚠️
...pp/src/main/java/com/kickstarter/models/Project.kt 85.71% 0 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2214      +/-   ##
============================================
- Coverage     68.35%   68.21%   -0.15%     
- Complexity     2198     2200       +2     
============================================
  Files           352      354       +2     
  Lines         23726    23866     +140     
  Branches       3482     3501      +19     
============================================
+ Hits          16218    16279      +61     
- Misses         5672     5746      +74     
- Partials       1836     1841       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

text: String,
textColor: Color = colors.textAccentGrey
) {
OutlinedButton(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Material OutlinedButton adds margins on the top and bottom by default, which made things more complicated to match with spec.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jlplks fyi, this button I think belongs to the new Design System, move it along if needed when tackling MBL-2043

private fun close() = this.dismiss()

@Composable
fun KSBottomSheetDragHandle() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ended up drawing the drag handle myself because I don't think it was included in material 1 for bottom sheets?

android:right="@dimen/grid_2" />
<corners android:topRightRadius="@dimen/grid_2" android:topLeftRadius="@dimen/grid_2"/>

<corners android:topRightRadius="@dimen/grid_9_half" android:topLeftRadius="@dimen/grid_9_half"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file wasn't being used (bc there are no other bottom sheets currently in the app) so I went ahead and increased the corner radius on it.

@@ -0,0 +1,36 @@
package com.kickstarter.ui.views.compose.projectpage
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wanted to write a test for onclick events but didn't have a way for the stubbed viewmodel to communicate with the views inside the composeView. Let me know if you know of a way!

Copy link
Contributor

Choose a reason for hiding this comment

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

Take a look here might be helpful ->

on the test when passwords valid and matching, accept button enabled and no warning text visible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Just added a similar test.

Timber.w(e, "Undeliverable Exception");
if (e.getMessage() != null) {
FirebaseCrashlytics.getInstance().setCustomKey("Undeliverable Exception", e.getMessage());
RxJavaPlugins.setErrorHandler(t -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

This es already in master, why are we seeing it this Pr 🤔 ?

@ycheng-kickstarter ycheng-kickstarter changed the base branch from master to leigh/mbl-810 January 30, 2025 17:59
@ycheng-kickstarter ycheng-kickstarter changed the base branch from leigh/mbl-810 to master January 30, 2025 18:00
@ycheng-kickstarter ycheng-kickstarter changed the base branch from master to leigh/mbl-810 January 30, 2025 18:54
@ycheng-kickstarter ycheng-kickstarter changed the base branch from leigh/mbl-810 to master January 30, 2025 18:54
@ycheng-kickstarter ycheng-kickstarter marked this pull request as ready for review January 30, 2025 18:57
@ycheng-kickstarter ycheng-kickstarter merged commit 0ae04da into master Feb 3, 2025
3 checks passed
@ycheng-kickstarter ycheng-kickstarter deleted the MBL-1974-project-notice branch February 3, 2025 19:58
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.

5 participants