Skip to content

Commit e426beb

Browse files
huyenltnguyenSembaukeNirajn2311
authored
feat: daily coding challenges (#1635)
* feat: daily coding challenges (#1597) * feat: daily coding challenges * cfeat: block view * feat: add notification indicator [skip ci] * Revert "feat: add notification indicator [skip ci]" This reverts commit 7fbf03a. * feat: archive page for daily challenges * fix: import order * feat: add Daily Challenge Card widget to Learn Landing View (#1598) * feat: daily challenges service (#1601) * feat: daily challenges service * feat: register DailyChallengesService in the locator * feat: refactor DailyChallengeCard to StatefulWidget and implement countdown timer * chore: remove unused endpoint --------- Co-authored-by: sembauke <semboot699@gmail.com> * chore: rename file (#1602) * feat(service): add /daily-challenge/today route (#1605) * refactor: move daily challenges models to a separate file (#1608) * refactor: move daily challenges models to a separate file * fix: parse date string to datetime * refactor: update Daily Challenge Card styling and text content * feat: implement daily challenge fetching and UI updates * chore: bring `main` changes to `feat/daily-challenges` (#1614) * refactor: separate daily challenges and standard challenges (#1606) * refactor: separate daily challenges and standard challenges * feat: handle daily challenge in ChallengeTemplateView * fix: use completedDailyCodingChallenges array * feat: switch to list view * refactor: move block widget into daily_challenges_view * refactor: daily challenge models and navigation logic * fix: color usage * feat: handle onPressed logic of daily challenge card CTA (#1619) * refactor: map DailyChallengeBlock to Block * feat: handle onPressed logic of daily challenge card CTA * fix: use /today route * refactor: make format utils sharable * test: add unit tests for the utils * feat(service, model): handle daily challenge completed (#1623) * feat(service, model): add /daily-coding-challenge-completed * feat(service): handle daily challenge completion * feat(daily challenges): allow selecting and storing selected language (#1626) * refactor: use DailyChallengeLanguage enum * feat: allow selecting and storing selected language * fix: reinitialize challenge file when language is switched * refactor: move formatChallengeDate to challenge_utils * fix: use the correct challenge object for daily challenge when rebuild * fix: cache daily challenge data to avoid refetch when switching lang * refactor: parse lang from string * refactor: simplify _dailyChallengeLanguageSelector * fix: daily challenge card label (#1629) * fix: display daily challenge card content based on completion status (#1631) * chore: update daily challenge API endpoints (#1630) * chore: update daily challenge API endpoints * fix: change _id to id * fix: update test runner to handle challengeType 28 and 29 (#1634) * fix: update test runner to handle challengeType 28 and 29 * fix: properly support challengeType 29 * fix: hide preview from challengeType 28 and 29 * fix: populate challenges and challengeTiles in DailyChallengeBlock * fix: add CSRF token and JWT access token to challenge completion request * fix: update assets/test_runner to match main * chore: clean up challengeCompleted computation from daily challenges widgets * chore: pin timezone package version * fix: hide progress indicator for daily challenges * fix: call fetchUser after submitting the completed challenge * fix: import order * refactor: update comments for setSelectedDailyChallengeLanguage method * refactor: rename service for consistency * refactor: move getDailyChallenge to daily challenge service * refactor: change daily_challenges to daily_challenge for consistency * refactor: move /today call from daily challenge card to landing viewmodel * chore: log errors and flatten getDailyChallenge function * fix: daily challenges icon in drawer * refactor: rename timer to countdownTimer * fix: correct language selector color when test panel is displayed * fix: font size of daily challenge card title * fix: sync test list with selected language * fix: handle reset code for daily and standard challenge separately * fix: update daily challenge completion status based on isLoggedIn * fix: reflect completion status on daily_challenge_view correctly * feat: curriculum tests for daily challenges * refactor: simplify challenge type check using array * fix: reset tests panel visibility when setting daily challenge language * fix: semantic label for completion state * fix: use injected DailyChallengeService for fetching challenges * test: daily_challenge_view tests --------- Co-authored-by: Sem Bauke <semboot699@gmail.com> Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
1 parent af93125 commit e426beb

29 files changed

Lines changed: 2561 additions & 194 deletions

.github/workflows/mobile-curriculum-e2e.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ jobs:
103103

104104
- name: Set freeCodeCamp Environment Variables
105105
working-directory: freeCodeCamp
106-
run: cp sample.env .env
106+
run: |
107+
cp sample.env .env
108+
echo "SHOW_UPCOMING_CHANGES=true" >> .env
107109
108110
- name: Create dummy mobile app .env file
109111
working-directory: mobile/mobile-app

mobile-app/integration_test/test_runner/curriculum_tests.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ void main() {
2929
// 'javascript-algorithms-and-data-structures',
3030
'the-odin-project',
3131
'full-stack-developer',
32+
'dev-playground',
3233

3334
// Python SBs
3435
// 'scientific-computing-with-python',
@@ -216,7 +217,7 @@ void main() {
216217
editorChallengeTypes.add(currChallenge['challengeType']);
217218

218219
// Skip non-editor challenges
219-
if (![0, 1, 5, 6, 14, 25, 26, 20, 23, 27, 29]
220+
if (![0, 1, 5, 6, 14, 20, 23, 25, 26, 27, 28, 29]
220221
.contains(currChallenge['challengeType'])) {
221222
continue;
222223
}

mobile-app/lib/app/app.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:freecodecamp/service/firebase/remote_config_service.dart';
66
import 'package:freecodecamp/service/learn/learn_file_service.dart';
77
import 'package:freecodecamp/service/learn/learn_offline_service.dart';
88
import 'package:freecodecamp/service/learn/learn_service.dart';
9+
import 'package:freecodecamp/service/learn/daily_challenge_service.dart';
910
import 'package:freecodecamp/service/locale_service.dart';
1011
import 'package:freecodecamp/service/navigation/quick_actions_service.dart';
1112
import 'package:freecodecamp/service/news/bookmark_service.dart';
@@ -21,6 +22,7 @@ import 'package:freecodecamp/ui/views/learn/landing/landing_view.dart';
2122
import 'package:freecodecamp/ui/views/learn/superblock/superblock_view.dart';
2223
import 'package:freecodecamp/ui/views/learn/chapter/chapter_view.dart';
2324
import 'package:freecodecamp/ui/views/learn/chapter/chapter_block_view.dart';
25+
import 'package:freecodecamp/ui/views/learn/daily_challenge/daily_challenge_view.dart';
2426
import 'package:freecodecamp/ui/views/login/native_login_view.dart';
2527
import 'package:freecodecamp/ui/views/news/news-author/news_author_view.dart';
2628
import 'package:freecodecamp/ui/views/news/news-bookmark/news_bookmark_view.dart';
@@ -59,6 +61,7 @@ import 'package:stacked_services/stacked_services.dart';
5961
MaterialRoute(page: SuperBlockView),
6062
MaterialRoute(page: SettingsView),
6163
MaterialRoute(page: DeleteAccountView),
64+
MaterialRoute(page: DailyChallengeView),
6265
],
6366
dependencies: [
6467
LazySingleton(classType: NavigationService),
@@ -70,6 +73,7 @@ import 'package:stacked_services/stacked_services.dart';
7073
LazySingleton(classType: DeveloperService),
7174
LazySingleton(classType: AuthenticationService),
7275
LazySingleton(classType: AppAudioService),
76+
LazySingleton(classType: DailyChallengeService),
7377
LazySingleton(classType: DownloadService),
7478
LazySingleton(classType: LearnService),
7579
LazySingleton(classType: LearnFileService),

mobile-app/lib/app/app.locator.dart

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)