diff --git a/.github/workflows/flutter-ci.yml b/.github/workflows/flutter-ci.yml index 2b62318f1..33805c699 100644 --- a/.github/workflows/flutter-ci.yml +++ b/.github/workflows/flutter-ci.yml @@ -82,8 +82,7 @@ jobs: - name: Create .env file run: | - echo "NEWSURL=https://www.freecodecamp.org/news/ghost/api/v3/content/" > .env - echo "NEWSKEY=$GHOST_NEWSKEY" >> .env + echo "HASHNODE_PUBLICATION_ID=$HASHNODE_PUBLICATION_ID" > .env echo "ALGOLIAAPPID=$ALGOLIA_APP_ID" >> .env echo "ALGOLIAKEY=$ALGOLIA_KEY" >> .env echo "AUTH0_DOMAIN=$AUTH0_DOMAIN" >> .env diff --git a/.github/workflows/flutter-deploy.yml b/.github/workflows/flutter-deploy.yml index 566715ef8..a90dabbd8 100644 --- a/.github/workflows/flutter-deploy.yml +++ b/.github/workflows/flutter-deploy.yml @@ -77,8 +77,7 @@ jobs: - name: Create .env file run: | - echo "NEWSURL=https://www.freecodecamp.org/news/ghost/api/v3/content/" > .env - echo "NEWSKEY=$GHOST_NEWSKEY" >> .env + echo "HASHNODE_PUBLICATION_ID=$HASHNODE_PUBLICATION_ID" > .env echo "ALGOLIAAPPID=$ALGOLIA_APP_ID" >> .env echo "ALGOLIAKEY=$ALGOLIA_KEY" >> .env echo "AUTH0_DOMAIN=$AUTH0_DOMAIN" >> .env diff --git a/.github/workflows/mobile-curriculum-e2e.yml b/.github/workflows/mobile-curriculum-e2e.yml index 76f9c0c64..c047605bd 100644 --- a/.github/workflows/mobile-curriculum-e2e.yml +++ b/.github/workflows/mobile-curriculum-e2e.yml @@ -65,7 +65,7 @@ jobs: run: | cd mobile/mobile-app echo "DEVELOPMENTMODE=true" > .env - echo "NEWSURL=https://www.freecodecamp.org/news/ghost/api/v3/content/" >> .env + echo "HASHNODE_PUBLICATION_ID=$HASHNODE_PUBLICATION_ID" > .env flutter pub get flutter test test/widget_test.dart diff --git a/codemagic.yaml b/codemagic.yaml index 824b3e888..203743e07 100644 --- a/codemagic.yaml +++ b/codemagic.yaml @@ -31,8 +31,7 @@ workflows: scripts: - name: Create .env file script: | - echo "NEWSURL=$NEWSURL" > .env - echo "NEWSKEY=$NEWSKEY" >> .env + echo "HASHNODE_PUBLICATION_ID=$HASHNODE_PUBLICATION_ID" > .env echo "ALGOLIAAPPID=$ALGOLIAAPPID" >> .env echo "ALGOLIAKEY=$ALGOLIAKEY" >> .env echo "AUTH0_DOMAIN=$AUTH0_DOMAIN" >> .env @@ -109,8 +108,7 @@ workflows: scripts: - name: Create .env file script: | - echo "NEWSURL=$NEWSURL" > .env - echo "NEWSKEY=$NEWSKEY" >> .env + echo "HASHNODE_PUBLICATION_ID=$HASHNODE_PUBLICATION_ID" > .env echo "ALGOLIAAPPID=$ALGOLIAAPPID" >> .env echo "ALGOLIAKEY=$ALGOLIAKEY" >> .env echo "AUTH0_DOMAIN=$AUTH0_DOMAIN" >> .env diff --git a/mobile-app/integration_test/news/bookmark_test.dart b/mobile-app/integration_test/news/bookmark_test.dart index cb761b33e..238022a10 100644 --- a/mobile-app/integration_test/news/bookmark_test.dart +++ b/mobile-app/integration_test/news/bookmark_test.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:freecodecamp/main.dart' as app; -import 'package:freecodecamp/ui/views/news/news-feed/news_feed_viewmodel.dart'; import 'package:freecodecamp/ui/views/news/news-tutorial/news_tutorial_view.dart'; import 'package:integration_test/integration_test.dart'; import 'package:path/path.dart' as path; @@ -29,7 +28,12 @@ void main() { await binding.takeScreenshot('news/news-feed'); // Tap on the first tutorial - final Finder firstTutorial = find.byType(NewsFeedLazyLoading).first; + final Finder firstTutorial = find + .descendant( + of: find.byKey(const Key('news-tutorial-0')), + matching: find.byType(InkWell), + ) + .first; final Finder firstTutorialImage = find .descendant( of: firstTutorial, @@ -37,7 +41,7 @@ void main() { ) .first; final ValueKey firstTutorialKey = - tester.firstWidget(firstTutorial).key! as ValueKey; + tester.firstWidget(firstTutorial).key! as ValueKey; expect(firstTutorial, findsOneWidget); expect(firstTutorialImage, findsOneWidget); diff --git a/mobile-app/lib/ui/views/news/news-feed/news_feed_view.dart b/mobile-app/lib/ui/views/news/news-feed/news_feed_view.dart index 944554914..aca560cd9 100644 --- a/mobile-app/lib/ui/views/news/news-feed/news_feed_view.dart +++ b/mobile-app/lib/ui/views/news/news-feed/news_feed_view.dart @@ -83,8 +83,10 @@ class NewsFeedView extends StatelessWidget { height: 3, ), builderDelegate: PagedChildBuilderDelegate( - itemBuilder: (context, tutorial, index) => - tutorialThumbnailBuilder(tutorial, model), + itemBuilder: (context, tutorial, index) => Container( + key: Key('news-tutorial-$index'), + child: tutorialThumbnailBuilder(tutorial, model), + ), ), ), ), @@ -122,6 +124,7 @@ class NewsFeedView extends StatelessWidget { InkWell tutorialThumbnailBuilder(Tutorial tutorial, NewsFeedViewModel model) { return InkWell( + key: Key(tutorial.id), splashColor: Colors.transparent, onTap: () { model.navigateTo(tutorial.id, tutorial.title); diff --git a/mobile-app/sample.env b/mobile-app/sample.env index 716ccf946..e2f4dd1af 100644 --- a/mobile-app/sample.env +++ b/mobile-app/sample.env @@ -1,8 +1,8 @@ ###NEWS### -NEWSKEY= -NEWSURL=https://www.freecodecamp.org/news/ghost/api/v3/content/ +HASHNODE_PUBLICATION_ID= + ALGOLIAAPPID= ALGOLIAKEY= diff --git a/mobile-app/test/services/news/bookmark_service_test.dart b/mobile-app/test/services/news/bookmark_service_test.dart index 5daf5917c..abcc2d25e 100644 --- a/mobile-app/test/services/news/bookmark_service_test.dart +++ b/mobile-app/test/services/news/bookmark_service_test.dart @@ -18,6 +18,7 @@ final Tutorial testTutorial = Tutorial( 'Python Game Development - How to Make a Turtle Racing Game with PyCharm', profileImage: 'https://www.freecodecamp.org/news/content/images/2022/02/profile.jpg', + authorId: '', authorName: 'Shahan Chowdhury', authorSlug: 'shahan', text: