Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion __tests__/integrations/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,18 @@ describe('FeedPreferencesConfigGenerator', () => {
defaultEnabledState: true,
options: { type: 'news' },
},
{
title: 'Social',
group: 'content_types',
description: '',
defaultEnabledState: true,
options: { type: PostType.SocialTwitter },
},
]);
await con.getRepository(FeedAdvancedSettings).save([
{ feedId: '1', advancedSettingsId: 1, enabled: false },
{ feedId: '1', advancedSettingsId: 2, enabled: true },
{ feedId: '1', advancedSettingsId: 4, enabled: false },
]);
});

Expand Down Expand Up @@ -432,7 +440,7 @@ describe('FeedPreferencesConfigGenerator', () => {
followed_sources: expect.arrayContaining(['c', 'p']),
followed_user_ids: expect.arrayContaining(['2', '3']),
allowed_post_types: postTypes.filter(
(x) => x !== PostType.VideoYouTube,
(x) => x !== PostType.VideoYouTube && x !== PostType.SocialTwitter,
),
feed_config_name: FeedConfigName.Personalise,
fresh_page_size: '1',
Expand Down
25 changes: 25 additions & 0 deletions src/migration/1770400000000-SocialContentTypeAdvancedSetting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class SocialContentTypeAdvancedSetting1770400000000
implements MigrationInterface
{
name = 'SocialContentTypeAdvancedSetting1770400000000';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`INSERT INTO advanced_settings
("title", "description", "group", "options")
VALUES
('Social', 'Posts from social platforms, including tweets and threads shared on daily.dev.', 'content_types', '{"type": "social:twitter"}')`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`DELETE FROM advanced_settings
WHERE "title" = 'Social'
AND "group" = 'content_types'
AND options->>'type' = 'social:twitter'`,
);
}
}
Loading