Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
schedules
Commits
2f6f110a
Commit
2f6f110a
authored
Jun 19, 2018
by
David Haynes
🙆
Browse files
Initial abstraction of ScheduleBadge
parent
0cf2318a
Changes
11
Hide whitespace changes
Inline
Side-by-side
schedules_web/src/actions/schedule/schedule.actions.ts
View file @
2f6f110a
import
{
CourseSection
}
from
'
../../util/CourseSection
'
;
import
CourseSection
from
'
../../util/CourseSection
'
;
import
{
ADD_COURSE_SECTION
,
REMOVE_COURSE_SECTION
}
from
'
./schedule.action-types
'
;
import
{
ADD_COURSE_SECTION
,
REMOVE_COURSE_SECTION
}
from
'
./schedule.action-types
'
;
export
interface
ScheduleAction
{
export
interface
ScheduleAction
{
...
...
schedules_web/src/actions/search/search.actions.ts
View file @
2f6f110a
import
{
CourseSection
}
from
'
../../util/CourseSection
'
;
import
CourseSection
from
'
../../util/CourseSection
'
;
import
{
SET_SEARCH_RESULTS
}
from
'
./search.action-types
'
;
import
{
SET_SEARCH_RESULTS
}
from
'
./search.action-types
'
;
export
interface
SearchAction
{
export
interface
SearchAction
{
...
...
schedules_web/src/components/App.tsx
View file @
2f6f110a
import
*
as
React
from
'
react
'
;
import
*
as
React
from
'
react
'
;
import
{
Container
}
from
'
reactstrap
'
;
import
{
Container
}
from
'
reactstrap
'
;
import
Schedule
from
'
../containers/Schedule
'
;
import
Search
from
'
../containers/Search
'
;
import
Search
from
'
../containers/Search
'
;
import
CourseSectionCard
from
'
./CourseSectionCard
'
;
import
CourseSectionCard
from
'
./CourseSectionCard
'
;
import
Header
from
'
./Header
'
;
import
Header
from
'
./Header
'
;
...
@@ -9,10 +10,10 @@ require('../css/core.css');
...
@@ -9,10 +10,10 @@ require('../css/core.css');
const
App
=
()
=>
(
const
App
=
()
=>
(
<
div
>
<
div
>
<
Container
>
<
Container
>
<
Schedule
/>
<
Header
/>
<
Header
/>
<
Search
/>
<
Search
/>
<
CourseSectionCard
/>
<
CourseSectionCard
/>
{
/* <Schedule /> */
}
</
Container
>
</
Container
>
</
div
>
</
div
>
);
);
...
...
schedules_web/src/components/Header.tsx
View file @
2f6f110a
...
@@ -5,12 +5,6 @@ require('../css/icon-badge.css');
...
@@ -5,12 +5,6 @@ require('../css/icon-badge.css');
const
Header
=
()
=>
(
const
Header
=
()
=>
(
<
div
>
<
div
>
{
/* TODO Extract into its own components with state management. */
}
<
Row
className
=
"justify-content-end my-5 px-3"
>
<
span
className
=
"fa-stack fa-3x has-badge"
data
-
count
=
"0"
>
<
i
className
=
"fa fas fa-shopping-bag fa-stack-1x"
/>
</
span
>
</
Row
>
<
Row
className
=
"justify-content-center my-5"
>
<
Row
className
=
"justify-content-center my-5"
>
<
h1
>
<
h1
>
<
i
className
=
"far fa-calendar-alt"
/>
Schedules
<
i
className
=
"far fa-calendar-alt"
/>
Schedules
...
...
schedules_web/src/components/ScheduleBadge.tsx
0 → 100644
View file @
2f6f110a
import
*
as
React
from
'
react
'
;
import
{
Row
}
from
'
reactstrap
'
;
import
CourseSection
from
'
../util/CourseSection
'
;
interface
ScheduleBadgeProps
{
schedule
:
CourseSection
[];
}
const
ScheduleBadge
=
({
schedule
}:
ScheduleBadgeProps
)
=>
(
<
Row
className
=
"justify-content-end my-5 px-3"
>
<
span
className
=
"fa-stack fa-3x has-badge"
data
-
count
=
{
schedule
.
length
}
>
<
i
className
=
"fa fas fa-shopping-bag fa-stack-1x"
/>
</
span
>
</
Row
>
);
export
default
ScheduleBadge
;
schedules_web/src/components/ScheduleList.tsx
View file @
2f6f110a
import
*
as
React
from
'
react
'
;
import
*
as
React
from
'
react
'
;
import
{
CourseSection
}
from
'
../util/CourseSection
'
;
import
CourseSection
from
'
../util/CourseSection
'
;
interface
Props
{
interface
Props
{
courses
:
CourseSection
[];
courses
:
CourseSection
[];
...
...
schedules_web/src/components/ScheduleRoot.tsx
View file @
2f6f110a
import
*
as
React
from
'
react
'
;
import
*
as
React
from
'
react
'
;
import
{
CourseSection
}
from
'
../util/CourseSection
'
;
import
CourseSection
from
'
../util/CourseSection
'
;
import
Schedule
List
from
'
./Schedule
List
'
;
import
Schedule
Badge
from
'
./Schedule
Badge
'
;
interface
SearchRootProps
{
interface
SearchRootProps
{
schedule
:
CourseSection
[];
schedule
:
CourseSection
[];
...
@@ -17,7 +17,8 @@ interface SearchRootProps {
...
@@ -17,7 +17,8 @@ interface SearchRootProps {
const
ScheduleRoot
=
({
schedule
,
removeCourseSection
}:
SearchRootProps
)
=>
(
const
ScheduleRoot
=
({
schedule
,
removeCourseSection
}:
SearchRootProps
)
=>
(
<
div
>
<
div
>
<
ScheduleList
courses
=
{
schedule
}
selectCourseCallback
=
{
removeCourseSection
}
/>
<
ScheduleBadge
schedule
=
{
schedule
}
/>
{
/* <ScheduleList courses={schedule} selectCourseCallback={removeCourseSection} /> */
}
{
/* <button onClick={generateSchedule}>Generate Schedule</button> */
}
{
/* <button onClick={generateSchedule}>Generate Schedule</button> */
}
</
div
>
</
div
>
);
);
...
...
schedules_web/src/components/SearchRoot.tsx
View file @
2f6f110a
import
*
as
React
from
'
react
'
;
import
*
as
React
from
'
react
'
;
import
SearchBar
from
'
../components/SearchBar
'
;
import
SearchBar
from
'
../components/SearchBar
'
;
import
{
CourseSection
}
from
'
../util/CourseSection
'
;
import
CourseSection
from
'
../util/CourseSection
'
;
interface
SearchRootProps
{
interface
SearchRootProps
{
searchResults
:
CourseSection
[];
searchResults
:
CourseSection
[];
...
...
schedules_web/src/reducers/schedule.reducer.ts
View file @
2f6f110a
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*/
*/
import
{
ADD_COURSE_SECTION
,
REMOVE_COURSE_SECTION
}
from
'
../actions/schedule/schedule.action-types
'
;
import
{
ADD_COURSE_SECTION
,
REMOVE_COURSE_SECTION
}
from
'
../actions/schedule/schedule.action-types
'
;
import
{
ScheduleAction
}
from
'
../actions/schedule/schedule.actions
'
;
import
{
ScheduleAction
}
from
'
../actions/schedule/schedule.actions
'
;
import
{
CourseSection
}
from
'
../util/CourseSection
'
;
import
CourseSection
from
'
../util/CourseSection
'
;
export
type
ScheduleState
=
CourseSection
[];
export
type
ScheduleState
=
CourseSection
[];
...
...
schedules_web/src/reducers/search.reducer.ts
View file @
2f6f110a
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*/
*/
import
{
SET_SEARCH_RESULTS
}
from
'
../actions/search/search.action-types
'
;
import
{
SET_SEARCH_RESULTS
}
from
'
../actions/search/search.action-types
'
;
import
{
SearchAction
}
from
'
../actions/search/search.actions
'
;
import
{
SearchAction
}
from
'
../actions/search/search.actions
'
;
import
{
CourseSection
}
from
'
../util/CourseSection
'
;
import
CourseSection
from
'
../util/CourseSection
'
;
export
type
SearchState
=
CourseSection
[];
export
type
SearchState
=
CourseSection
[];
...
...
schedules_web/src/util/CourseSection.ts
View file @
2f6f110a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Common object interface for all "Section"s.
* Common object interface for all "Section"s.
*/
*/
export
interface
CourseSection
{
interface
CourseSection
{
id
:
number
;
id
:
number
;
name
:
string
;
name
:
string
;
title
:
string
;
title
:
string
;
...
@@ -14,3 +14,5 @@ export interface CourseSection {
...
@@ -14,3 +14,5 @@ export interface CourseSection {
startTime
:
string
;
startTime
:
string
;
endTime
:
string
;
endTime
:
string
;
}
}
export
default
CourseSection
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment