-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[NT-930] Add Project Creator Details Query and VM outputs #1086
[NT-930] Add Project Creator Details Query and VM outputs #1086
Conversation
@@ -39,7 +39,7 @@ internal final class ProjectPamphletContentDataSource: ValueCellDataSource { | |||
} | |||
|
|||
self.set( | |||
values: [projectAndRefTag], | |||
values: [(project, refTag)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will update ProjectPamphletMainCell
to be configured with all three values (or just ProjectPamphletContentData
).
fileprivate let fetchProjectsResponse: [Project]? | ||
fileprivate let fetchProjectsError: ErrorEnvelope? | ||
|
||
fileprivate let fetchProjectCreatorDetailsResult: Result<ProjectCreatorDetailsEnvelope, GraphError>? | ||
|
||
fileprivate let fetchProjectNotificationsResponse: [ProjectNotification] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alphabetized this so it moved around in a few places. But I now realize a bunch of things are still out of place so I might revert this change and rather fix the ordering separately.
.ksr_delay(AppEnvironment.current.apiDelayInterval, on: AppEnvironment.current.scheduler) | ||
.map { result in (result, false) } | ||
.prefix(value: (nil, true)) | ||
.demoteErrors(replaceErrorWith: (nil, false)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this errors out we just return nil
and tell the cell to stop loading. We will do additional work to not even activate the experiment if we don't have this data.
KsApi/Service.swift
Outdated
@@ -306,6 +302,14 @@ public struct Service: ServiceType { | |||
return requestPagination(paginationUrl) | |||
} | |||
|
|||
public func fetchProjectCreatorDetails(query: NonEmptySet<Query>) -> SignalProducer<ProjectCreatorDetailsEnvelope, GraphError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 | Line should be 110 characters or less: currently 130 charactersline_length Service.swift:305 |
Generated by 🚫 Danger |
self.loadProjectIntoDataSourceProject | ||
.assertValues([project], "Load the full project into the data source.") | ||
self.loadProjectIntoDataSourceRefTag.assertValues([.discovery], "Load the refTag into the data source.") | ||
self.loadMinimalProjectIntoDataSource.assertValues([], "Do not load the minimal version of the project.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 | Line should be 110 characters or less: currently 111 charactersline_length ProjectPamphletContentViewModelTests.swift:501 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I just have a couple questions. Also it seems that there are some Line Length violations.
@@ -192,17 +193,18 @@ public enum Query { | |||
} | |||
} | |||
|
|||
public enum User { | |||
public indirect enum User { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we are enabling indirection for all cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -6,30 +6,39 @@ import ReactiveSwift | |||
import XCTest | |||
|
|||
final class ProjectPamphletContentViewModelTests: TestCase { | |||
fileprivate let vm: ProjectPamphletContentViewModelType = ProjectPamphletContentViewModel() | |||
fileprivate var vm: ProjectPamphletContentViewModelType! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change necessary? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope! Sometimes it is for the scheduler to work correctly but in this case it wasn't. Thanks 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* [NT-878, NT-873] Add Experiment and Read More is a full-width button (#1073) * [NT-876] Add Pledge CTA to ProjectDescriptionViewController (#1072) * [NT-876] Pop ProjectPamphlet to root after project is backed (#1075) * [NT-876] Add Project Campaign Experiment Tests (#1076) * Hide the back this project button to creators of their own projects (#1078) * [NT-877] Project page Optimizely Events (#1079) * Add loader to read more button in second variant (#1077) * [NT-930] Add Project Creator Details Query and VM outputs (#1086) * [NT-940] Activate Creator Details Experiment (#1088) * [NT-931] Add creator byline view (#1089) Co-authored-by: Justin Swart <justinswart@users.noreply.github.com> * [NT- 956] CreatorByline View Model and Tests (#1095) * [NT-937] Creator Details Shimmer Loading View (#1097) * [NT- 939] Creator details tracking events (#1098) * translated copy (#1111) Co-authored-by: Christella <cdolm92@gmail.com>
📲 What
Adds a query for us to fetch some additional project creator details from GraphQL when a project page loads.
Note: This emits what we expect to need to configure the cell that will display this data, that is the
ProjectCreatorDetailsEnvelope
result and anisLoading
boolean to indicate whether we are still fetching the results.🤔 Why
As part of an experiment that we are running we would like to display some additional data to surface trust indicators to users. These values are not available from the v1 API so we are fetching them from GraphQL.
🛠 How
ProjectCreatorDetailsEnvelope
.fetchProjectCreatorDetails
toServiceType
.ProjectPamphletContentViewModel
to improve the frequently changing interface of its datasource loading output.GraphSchema
.✅ Acceptance criteria
(nil, true)
is emitted to put the cell in an initial loading state.(result, false)
is emitted.(nil, false)
is emitted.