Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add planner #178

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e10949b
feat: add planner tab
RGLie May 1, 2024
e8f3663
feat: add planner block colors
RGLie May 1, 2024
d227acb
feat: add planner block colors
RGLie May 1, 2024
03be72d
feat: add planner page
RGLie May 1, 2024
1627e9e
feat: add planner table
RGLie May 1, 2024
c8c0fd0
feat: add planner statistic layout
RGLie May 1, 2024
ad3caf3
chore: add planner color
RGLie May 24, 2024
be2503c
chore: add planner api url
RGLie May 24, 2024
fd0d027
add: planner model change notifier
RGLie May 24, 2024
1c56860
feat: change planner design
RGLie May 24, 2024
cde9cbf
remove unused file
RGLie May 24, 2024
7710481
chore: delete unused import
RGLie May 24, 2024
9c30dfa
feat: add tabs to select planner
RGLie May 24, 2024
72a312b
feat: add planner model
RGLie May 24, 2024
6895ef0
feat: add planner course model
RGLie May 24, 2024
38aae85
feat: add planner provider model
RGLie May 24, 2024
361d38c
feat: add planner preview block
RGLie May 24, 2024
7ba7ef1
feat: add planner semester select tab
RGLie May 24, 2024
d41cbca
feat: add planner lecture view
RGLie May 24, 2024
1322b57
bug: fix format
RGLie May 24, 2024
eb9814f
g11n: add translations for planner dialog
RGLie May 24, 2024
1c10a06
feat: add planner delete dialog
RGLie May 24, 2024
cf48ba4
feat: add planner delete
RGLie May 24, 2024
df94a4d
feat: add planner course detail page
RGLie May 25, 2024
ea7cb5f
feat: add course detail page navigator
RGLie May 25, 2024
94718e7
feat: change planner model lecture structure
RGLie May 25, 2024
a0787c6
feat: add planner track url
RGLie May 25, 2024
61bb6be
feat: add track provider model
RGLie May 25, 2024
ce7d4da
chore: change max height
RGLie May 25, 2024
4dbed9a
feat: add planner update url
RGLie May 25, 2024
22bc997
feat: change track model provider
RGLie May 25, 2024
d6f04ab
feat: add lecture exclude button
RGLie May 25, 2024
83d37de
chore: remove unused model
RGLie May 25, 2024
82b7bec
feat: add planner update and add
RGLie May 25, 2024
b580703
feat: add planner track model
RGLie May 25, 2024
d4a0eb4
feat: change lecture calculation
RGLie May 25, 2024
496e9ec
bug: fix release mode widget error
RGLie May 26, 2024
2c1a39f
bug: fix format
RGLie May 26, 2024
36237af
chore: remove unused import
RGLie May 26, 2024
dc70fb3
bug: fix format
RGLie May 26, 2024
bbceaee
feat: hide planner select tab when loading
RGLie May 26, 2024
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
22 changes: 21 additions & 1 deletion assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"latest_reviews": "Latest Reviews",
"hall_of_fame": "Hall of Fame",
"my_information": "My Information",
"settings": "Settings"
"settings": "Settings",
"planner": "Planner"
},
"home": {
"schedule": {
Expand Down Expand Up @@ -111,6 +112,25 @@
"sun": "Sun"
}
},
"planner": {
"my_tab": "My Planner",
"tab": "플래너 {}",
"dialog": {
"add_lecture": "Add Lecture",
"add_overlapping_lecture": "Add Overlapping Lecture",
"delete_lecture": "Delete Lecture",
"delete_planner_tab": "Delete Planner",
"delete_last_planner_tab": "Can't Delete Planner",
"ask_add_lecture": "Do you want to add lecture '{lecture}'?",
"ask_add_lecture_with_tab": "Do you want to add lecture '{lecture}' to {planner}?",
"ask_add_overlapping_lecture": "Time overlaps with {lectures}. If you add '{lecture}', the lecture(s) will be deleted. Do you want to add it to the planner?",
"ask_add_overlapping_lecture_with_tab": "Time overlaps with {lectures} in {planner}. If you add '{lecture}', the lecture(s) will be deleted. Do you want to add it to the planner?",
"ask_delete_lecture": "Do you want to delete lecture '{lecture}'?",
"ask_delete_lecture_with_tab": "Do you want to delete lecture '{lecture}' from {planner}?",
"ask_delete_planner_tab": "Do you really want to delete {planner}?",
"disabled_delete_last_planner_tab": "You can't delete the last planner."
}
},
"dictionary": {
"reviews": "Reviews",
"dictionary": "Dictionary",
Expand Down
22 changes: 21 additions & 1 deletion assets/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"latest_reviews": "따끈따끈 과목후기",
"hall_of_fame": "명예의 전당",
"my_information": "내 정보",
"settings": "설정"
"settings": "설정",
"planner": "졸업플래너"
},
"home": {
"schedule": {
Expand Down Expand Up @@ -111,6 +112,25 @@
"sun": "일요일"
}
},
"planner": {
"my_tab": "내 플래너",
"tab": "플래너 {}",
"dialog": {
"add_lecture": "수업 추가",
"add_overlapping_lecture": "겹치는 수업 추가",
"delete_lecture": "수업 삭제",
"delete_planner_tab": "플래너 삭제",
"delete_last_planner_tab": "플래너 삭제 불가",
"ask_add_lecture": "'{lecture}' 수업을 추가하시겠습니까?",
"ask_add_lecture_with_tab": "'{lecture}' 수업을 {planner}에 추가하시겠습니까?",
"ask_add_overlapping_lecture": "{lectures}와(과) 시간이 겹칩니다. '{lecture}'을(를) 추가하시면 해당 수업은 삭제됩니다. 플래너에 추가하시겠습니까?",
"ask_add_overlapping_lecture_with_tab": "{planner}의 {lectures}와(과) 시간이 겹칩니다. '{lecture}'을(를) 추가하시면 해당 수업은 삭제됩니다. 플래너에 추가하시겠습니까?",
"ask_delete_lecture": "'{lecture}' 수업을 삭제하시겠습니까?",
"ask_delete_lecture_with_tab": "'{lecture}' 수업을 {planner}에서 삭제하시겠습니까?",
"ask_delete_planner_tab": "{planner}을(를) 정말 삭제하시겠습니까?",
"disabled_delete_last_planner_tab": "마지막 플래너는 삭제할 수 없습니다."
}
},
"dictionary": {
"reviews": "과목 후기",
"dictionary": "과목사전",
Expand Down
19 changes: 19 additions & 0 deletions lib/constants/color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,23 @@ class OTLColor {
Color(0xFFEBCAEF),
Color(0xFFF4BADB),
];
static const plannerBlockColors = [
Color(0xFFEAC6C6),
Color(0xFFEAC6C6),
Color(0xFFEABEA4),
Color(0xFFEABEA4),
Color(0xFFD4C2ED),
Color(0xFFEBD4B0),
Color(0xFFDDDDDD)
];

static const plannerStatisticColors = [
Color(0xFFDDDDDD),
Color(0xFFEAC6C6),
Color(0xFFEABEA4),
Color(0xFFEABEA4),
Color(0xFFD4C2ED),
Color(0xFFEBD4B0),
Color(0xFFDDDDDD)
];
}
7 changes: 7 additions & 0 deletions lib/constants/url.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ const API_TIMETABLE_REMOVE_LECTURE_URL =
const API_LIKED_REVIEW_URL = API_URL + "/users/{user_id}/liked-reviews";
const API_SHARE_URL = API_URL + "share/timetable/{share_type}";

const API_PLANNER_URL = API_URL + "users/{user_id}/planners";
const API_PLANNER_UPDATE_URL =
API_URL + "users/{user_id}/planners/{planner_id}/update-item";
const API_TRACK_URL = API_URL + "tracks";
const API_PLANNER_ADD_FUTURE_URL =
API_PLANNER_URL + "/{planner_id}/add-future-item";

enum ShareType { image, ical }

const CONTACT = "[email protected]";
6 changes: 6 additions & 0 deletions lib/home.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:otlplus/pages/planner_page.dart';
import 'package:otlplus/widgets/otl_scaffold.dart';
import 'package:otlplus/pages/dictionary_page.dart';
import 'package:otlplus/pages/main_page.dart';
Expand Down Expand Up @@ -84,6 +85,7 @@
TimetablePage(),
DictionaryPage(),
ReviewPage(),
PlannerPage(),

Check warning on line 88 in lib/home.dart

View check run for this annotation

Codecov / codecov/patch

lib/home.dart#L88

Added line #L88 was not covered by tests
],
),
curve: Curves.easeInOut,
Expand Down Expand Up @@ -126,6 +128,10 @@
icon: Icon(Icons.rate_review_outlined),
label: tr("title.review"),
),
BottomNavigationBarItem(
icon: Icon(Icons.edit_calendar_outlined),
label: tr("title.planner"),

Check warning on line 133 in lib/home.dart

View check run for this annotation

Codecov / codecov/patch

lib/home.dart#L131-L133

Added lines #L131 - L133 were not covered by tests
),
],
);
}
Expand Down
22 changes: 22 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import 'package:otlplus/providers/course_search_model.dart';
import 'package:otlplus/providers/hall_of_fame_model.dart';
import 'package:otlplus/providers/liked_review_model.dart';
import 'package:otlplus/providers/planner_model.dart';
import 'package:otlplus/providers/settings_model.dart';
import 'package:otlplus/providers/track_model.dart';
import 'package:provider/provider.dart';
import 'package:otlplus/constants/color.dart';
import 'package:otlplus/home.dart';
Expand Down Expand Up @@ -63,6 +65,26 @@
: TimetableModel();
},
),
ChangeNotifierProxyProvider<InfoModel, PlannerModel>(
create: (context) => PlannerModel(),
update: (context, infoModel, plannerModel) {
if (infoModel.hasData) {
plannerModel?.loadPlanner(user: infoModel.user);

Check warning on line 72 in lib/main.dart

View check run for this annotation

Codecov / codecov/patch

lib/main.dart#L68-L72

Added lines #L68 - L72 were not covered by tests
}
return (plannerModel is PlannerModel)

Check warning on line 74 in lib/main.dart

View check run for this annotation

Codecov / codecov/patch

lib/main.dart#L74

Added line #L74 was not covered by tests
? plannerModel
: PlannerModel();

Check warning on line 76 in lib/main.dart

View check run for this annotation

Codecov / codecov/patch

lib/main.dart#L76

Added line #L76 was not covered by tests
},
),
ChangeNotifierProxyProvider<InfoModel, TrackModel>(
create: (context) => TrackModel(),
update: (context, infoModel, trackModel) {
if (infoModel.hasData) {
trackModel?.loadTracks();

Check warning on line 83 in lib/main.dart

View check run for this annotation

Codecov / codecov/patch

lib/main.dart#L79-L83

Added lines #L79 - L83 were not covered by tests
}
return (trackModel is TrackModel) ? trackModel : TrackModel();

Check warning on line 85 in lib/main.dart

View check run for this annotation

Codecov / codecov/patch

lib/main.dart#L85

Added line #L85 was not covered by tests
},
),
ChangeNotifierProvider(create: (_) => LectureSearchModel()),
ChangeNotifierProvider(create: (_) => CourseSearchModel()),
ChangeNotifierProvider(create: (_) => LatestReviewsModel()),
Expand Down
Loading
Loading