Skip to content

Commit 2cd9d6f

Browse files
authored
Merge pull request #68 from Pocket/delete-comments-from-incident
(chore) Remove code that was commented out during the recent incident
2 parents cb053c0 + be678d6 commit 2cd9d6f

File tree

6 files changed

+92
-34
lines changed

6 files changed

+92
-34
lines changed

src/api/desktop/recommendations/response.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ describe('response', () => {
4343
`utm_source=${graphResponse.newTabSlate.utmSource}`
4444
)
4545
).toBeTruthy();
46-
// Even recommendations have timeToRead mocked to [1, 9].
47-
//expect(res.data[0].timeToRead).toBeGreaterThanOrEqual(1);
48-
//expect(res.data[0].timeToRead).toBeLessThanOrEqual(9);
4946
expect(res.data[0].timeToRead).toBeUndefined();
50-
// Odd recommendations have timeToRead mocked to undefined.
5147
expect(res.data[1].timeToRead).toBeUndefined();
5248
} else {
5349
throw validate.errors;

src/api/desktop/recommendations/response.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@ export const mapRecommendation = (
5858
imageUrl: recommendation.corpusItem.imageUrl,
5959
};
6060

61-
// if (recommendation.corpusItem.timeToRead) {
62-
// return {
63-
// ...recommendationToReturn,
64-
// timeToRead: recommendation.corpusItem.timeToRead,
65-
// };
66-
// }
67-
6861
return recommendationToReturn;
6962
};
7063

src/api/v3/response.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ describe('response', () => {
4343
`utm_source=${graphResponse.newTabSlate.utmSource}`
4444
)
4545
).toBeTruthy();
46-
// Even recommendations have timeToRead mocked to [1, 9].
47-
// expect(res.recommendations[0].time_to_read).toBeGreaterThanOrEqual(1);
48-
// expect(res.recommendations[0].time_to_read).toBeLessThanOrEqual(9);
4946
expect(res.recommendations[0].time_to_read).toBeUndefined();
50-
// Odd recommendations have timeToRead mocked to undefined.
5147
expect(res.recommendations[1].time_to_read).toBeUndefined();
5248
} else {
5349
throw validate.errors;

src/api/v3/response.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ export const mapRecommendation = (
3737
image_src: `https://img-getpocket.cdn.mozilla.net/direct?url=${encodedImageUrl}&resize=w450`,
3838
};
3939

40-
// if (recommendation.corpusItem.timeToRead) {
41-
// return {
42-
// ...feedItemToReturn,
43-
// time_to_read: recommendation.corpusItem.timeToRead,
44-
// };
45-
// }
46-
4740
return feedItemToReturn;
4841
};
4942

src/generated/graphql/types.ts

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ export type Scalars = {
2626
Url: any;
2727
};
2828

29+
/**
30+
* Input data for adding multiple items to a list.
31+
* Appends to the end of the list.
32+
*/
33+
export type AddItemInput = {
34+
authors?: InputMaybe<Scalars['String']>;
35+
excerpt?: InputMaybe<Scalars['String']>;
36+
imageUrl?: InputMaybe<Scalars['Url']>;
37+
itemId: Scalars['ID'];
38+
note?: InputMaybe<Scalars['String']>;
39+
publisher?: InputMaybe<Scalars['String']>;
40+
title?: InputMaybe<Scalars['String']>;
41+
url: Scalars['Url'];
42+
};
43+
2944
export type AdvancedSearchFilters = {
3045
contentType?: InputMaybe<SearchItemsContentType>;
3146
domain?: InputMaybe<Scalars['String']>;
@@ -801,6 +816,26 @@ export type ListElement = {
801816
level: Scalars['Int'];
802817
};
803818

819+
/** The Connection type for ListItem */
820+
export type ListItemConnection = {
821+
__typename?: 'ListItemConnection';
822+
/** A list of edges. */
823+
edges?: Maybe<Array<ListItemEdge>>;
824+
/** Information to aid in pagination. */
825+
pageInfo: PageInfo;
826+
/** Identifies the total count of SavedItems in the connection. */
827+
totalCount: Scalars['Int'];
828+
};
829+
830+
/** An Edge in a Connection */
831+
export type ListItemEdge = {
832+
__typename?: 'ListItemEdge';
833+
/** A cursor for use in pagination. */
834+
cursor: Scalars['String'];
835+
/** The ListItem at the end of the edge. */
836+
node: ShareableListItem;
837+
};
838+
804839
export type MarkdownImagePosition = {
805840
__typename?: 'MarkdownImagePosition';
806841
index: Scalars['Int'];
@@ -874,11 +909,15 @@ export type MarticleText = {
874909
/** Default Mutation Type */
875910
export type Mutation = {
876911
__typename?: 'Mutation';
912+
/** Add a batch of items to an existing shareable list. */
913+
addToShareableList: ShareableList;
877914
/**
878915
* Make requests to create and delete highlights in a single batch.
879916
* Mutation is atomic -- if there is a response, all operations were successful.
880917
*/
881918
batchWriteHighlights: BatchWriteHighlightsResult;
919+
/** Add a batch of items to an existing shareable list. */
920+
createAndAddToShareableList?: Maybe<ShareableList>;
882921
/** Create new highlight note. Returns the data for the created Highlight note. */
883922
createSavedItemHighlightNote?: Maybe<HighlightNote>;
884923
/** Create new highlight annotation(s). Returns the data for the created Highlight object(s). */
@@ -1092,12 +1131,26 @@ export type Mutation = {
10921131
};
10931132

10941133

1134+
/** Default Mutation Type */
1135+
export type MutationAddToShareableListArgs = {
1136+
items: Array<AddItemInput>;
1137+
listExternalId: Scalars['ID'];
1138+
};
1139+
1140+
10951141
/** Default Mutation Type */
10961142
export type MutationBatchWriteHighlightsArgs = {
10971143
input?: InputMaybe<BatchWriteHighlightsInput>;
10981144
};
10991145

11001146

1147+
/** Default Mutation Type */
1148+
export type MutationCreateAndAddToShareableListArgs = {
1149+
itemData: Array<AddItemInput>;
1150+
listData: CreateShareableListInput;
1151+
};
1152+
1153+
11011154
/** Default Mutation Type */
11021155
export type MutationCreateSavedItemHighlightNoteArgs = {
11031156
id: Scalars['ID'];
@@ -1440,6 +1493,14 @@ export type NumberedListElement = ListElement & {
14401493
level: Scalars['Int'];
14411494
};
14421495

1496+
/** Input for offset-pagination (internal backend use only). */
1497+
export type OffsetPaginationInput = {
1498+
/** Defaults to 30 */
1499+
limit?: InputMaybe<Scalars['Int']>;
1500+
/** Defaults to 0 */
1501+
offset?: InputMaybe<Scalars['Int']>;
1502+
};
1503+
14431504
/** Information about pagination in a connection. */
14441505
export type PageInfo = {
14451506
__typename?: 'PageInfo';
@@ -2228,6 +2289,15 @@ export type SavedItemsFilter = {
22282289
updatedSince?: InputMaybe<Scalars['Int']>;
22292290
};
22302291

2292+
/** A page of SavedItems, retrieved by offset-based pagination. */
2293+
export type SavedItemsPage = {
2294+
__typename?: 'SavedItemsPage';
2295+
entries: Array<SavedItem>;
2296+
limit: Scalars['Int'];
2297+
offset: Scalars['Int'];
2298+
totalCount: Scalars['Int'];
2299+
};
2300+
22312301
/** Input to sort fetched SavedItems. If unspecified, defaults to CREATED_AT, ASC. */
22322302
export type SavedItemsSort = {
22332303
/** The field by which to sort SavedItems */
@@ -2439,9 +2509,14 @@ export type ShareableList = {
24392509
description?: Maybe<Scalars['String']>;
24402510
/** A unique string identifier in UUID format. */
24412511
externalId: Scalars['ID'];
2512+
/** Pocket Saves that have been added to this list by the Pocket user. */
2513+
items: ListItemConnection;
24422514
/** The visibility of notes added to list items for this list. */
24432515
listItemNoteVisibility: ShareableListVisibility;
2444-
/** Pocket Saves that have been added to this list by the Pocket user. */
2516+
/**
2517+
* Pocket Saves that have been added to this list by the Pocket user.
2518+
* @deprecated use items
2519+
*/
24452520
listItems: Array<ShareableListItem>;
24462521
/** The moderation status of the list. Defaults to VISIBLE. */
24472522
moderationStatus: ShareableListModerationStatus;
@@ -2463,6 +2538,12 @@ export type ShareableList = {
24632538
user: User;
24642539
};
24652540

2541+
2542+
/** A user-created list of Pocket saves that can be shared publicly. */
2543+
export type ShareableListItemsArgs = {
2544+
pagination?: InputMaybe<PaginationInput>;
2545+
};
2546+
24662547
/** A Pocket Save (story) that has been added to a Shareable List. */
24672548
export type ShareableListItem = {
24682549
__typename?: 'ShareableListItem';
@@ -2942,6 +3023,8 @@ export type User = {
29423023
savedItemById?: Maybe<SavedItem>;
29433024
/** Get a general paginated listing of all SavedItems for the user */
29443025
savedItems?: Maybe<SavedItemConnection>;
3026+
/** Fetch SavedItems with offset pagination. Internal backend use only. */
3027+
savedItemsByOffset?: Maybe<SavedItemsPage>;
29453028
/**
29463029
* Premium search query. Name will be updated after client input
29473030
* @deprecated Use searchSavedItems
@@ -2985,6 +3068,14 @@ export type UserSavedItemsArgs = {
29853068
};
29863069

29873070

3071+
/** Resolve by reference the User entity in this graph to provide user data with public lists. */
3072+
export type UserSavedItemsByOffsetArgs = {
3073+
filter?: InputMaybe<SavedItemsFilter>;
3074+
pagination?: InputMaybe<OffsetPaginationInput>;
3075+
sort?: InputMaybe<SavedItemsSort>;
3076+
};
3077+
3078+
29883079
/** Resolve by reference the User entity in this graph to provide user data with public lists. */
29893080
export type UserSearchArgs = {
29903081
params: SearchParams;

src/graphql-proxy/recommendations/__mocks__/recommendations.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@ const fakeRecommendation = (hasTimeToRead = true): GraphRecommendation => {
4747
};
4848

4949
return recommendationWithoutTimeToRead;
50-
// if (!hasTimeToRead) {
51-
// return recommendationWithoutTimeToRead;
52-
// }
53-
54-
// return {
55-
// ...recommendationWithoutTimeToRead,
56-
// corpusItem: {
57-
// ...recommendationWithoutTimeToRead.corpusItem,
58-
// timeToRead: faker.datatype.number({ min: 1, max: 9 }),
59-
// },
60-
// };
6150
};
6251

6352
const fakeRecommendations = (

0 commit comments

Comments
 (0)