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 Redux DevTools, Migrate to arbitraryPlannerItem.tsx #36

Merged
merged 4 commits into from
Mar 11, 2024
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
3 changes: 3 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ const store = createStore(
writeReviews: writeReviewsReducer,
planner: plannerReducer,
}),
process.env.NODE_ENV === 'development'
? window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
: null,
);

class App extends Component {
Expand Down
14 changes: 14 additions & 0 deletions src/shapes/model/planner/arbitraryPlannerItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import department from '../subject/department';

export default interface arbitraryPlannerItem {
id: number;
item_type: 'ARBITRARY';
is_excluded: boolean;
year: number;
semester: 1 | 2 | 3 | 4;
department?: department;
type: string;
type_en: string;
credit: number;
credit_au: number;
}
10 changes: 10 additions & 0 deletions src/shapes/model/planner/futurePlannerItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import course from '../subject/course';

export default interface futurePlannerItem {
id: number;
item_type: 'FUTURE';
is_excluded: boolean;
year: number;
semester: 1 | 2 | 3 | 4;
course: course;
}
19 changes: 19 additions & 0 deletions src/shapes/model/planner/planner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import takenPlannerItem from './takenPlannerItem';
import futurePlannerItem from './futurePlannerItem';
import arbitraryPlannerItem from './arbitraryPlannerItem';
import generalTrack from '../graduation/generalTrack';
import majorTrack from '../graduation/majorTrack';
import additionalTrack from '../graduation/additionalTrack';

export default interface planner {
id: number;
start_year: number;
end_year: number;
general_track: generalTrack;
major_track: majorTrack;
additional_tracks: additionalTrack[];
taken_items: takenPlannerItem[];
future_items: futurePlannerItem[];
arbitrary_items: arbitraryPlannerItem[];
arrange_order: number;
}
10 changes: 10 additions & 0 deletions src/shapes/model/planner/takenPlannerItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import course from '../subject/course';
import lecture from '../subject/lecture';

export default interface takenPlannerItem {
id: number;
item_type: 'TAKEN';
is_excluded: boolean;
lecture: lecture;
course: course;
}
Loading