Skip to content

Commit

Permalink
Merge pull request #18 from swawa-yu/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
swawa-yu authored Apr 3, 2024
2 parents 7c66ce7 + c610be4 commit 569af66
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 16 deletions.
11 changes: 11 additions & 0 deletions src/components/SearchComponent/SearchComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,17 @@ const SearchComponent: React.FC<SearchComponentProps> = ({ searchOptions, setSea
placeholder="担当教員名"
/>
</div>
<div className='search-group'>
<br></br>
<label htmlFor="subject-code">講義コード(前方一致): </label>
<input
id='subject-code'
type="text"
value={searchOptions.subjectCode}
onChange={(e) => setSearchOptions({ ...searchOptions, subjectCode: e.target.value })}
placeholder="例: CC2(教育学部第二類)"
/>
</div>

<div className='search-group'>
<label htmlFor="bookmark-filter">ブックマーク:</label>
Expand Down
2 changes: 1 addition & 1 deletion src/components/TableView/TableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function TableView({ searchOptions }: TableViewProps) {

const [isTableRaw, setIsTableRaw] = useState(false);

const defaultMaxNumberOfSubjectsToShow = 100;
const defaultMaxNumberOfSubjectsToShow = 1000;
const [maxNumberOfSubjectsToShow, setMaxNumberOfSubjectsToShow] = useState(defaultMaxNumberOfSubjectsToShow);
const handleMaxSubjectsChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const value = parseInt(event.target.value, 10);
Expand Down
11 changes: 7 additions & 4 deletions src/components/Timetable/Timetable.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
/* より具体的なセレクタを使用 */
/* TODO: !importantの使用をやめる */
.term-selected {
background-color: #4CAF50 !important;
/* background-color: #4CAF50 !important; */
background-color: var(--momiji-color) !important;
color: white !important;
}

.class-objects>div {
position: absolute;
font-size: 0.5em;
border-color: #ccc;
border-style: solid;
border-radius: 5px;
border: 1px solid rgba(220, 220, 220, 0.4);
box-sizing: border-box;
}


Expand Down Expand Up @@ -55,7 +57,8 @@
bottom: 10px;
right: 10px;
border: 1px solid #ccc;
opacity: 0.85;
opacity: 0.95;
background-color: #ccc;
}

.timetable-window .toggle-button {
Expand Down
18 changes: 9 additions & 9 deletions src/components/Timetable/Timetable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ const Timetable = () => {
<div
style={{
position: 'absolute',
top: position.top + 'px',
left: position.left + 'px',
width: position.width + 'px',
height: position.height * (schedule.jigen.komaRange.last - schedule.jigen.komaRange.begin + 1) + 'px',
top: position.top + 2 + 'px',
left: position.left + 2 + 'px',
width: position.width - 4 + 'px',
height: position.height * (schedule.jigen.komaRange.last - schedule.jigen.komaRange.begin + 1) - 4 + 'px',
backgroundColor: 'rgba(20, 200, 20, 0.5)', // TODO: 適当な色の設定
}}
>
Expand All @@ -136,11 +136,11 @@ const Timetable = () => {
<div
style={{
position: 'absolute',
top: position.top + 'px',
left: position.left + 'px',
width: position.width + 'px',
height: position.height * (schedule.jigen.komaRange.last - schedule.jigen.komaRange.begin + 1) + 'px',
backgroundColor: 'rgba(20, 200, 20, 0.5)', // TODO: 適当な色の設定
top: position.top + 2 + 'px',
left: position.left + 2 + 'px',
width: position.width - 4 + 'px',
height: position.height * (schedule.jigen.komaRange.last - schedule.jigen.komaRange.begin + 1) - 4 + 'px',
backgroundColor: 'rgba(40, 60, 200, 0.5)' // TODO: 適当な色の設定
}}
>
{subject2Map[subjectCode]["授業科目名"]}
Expand Down
10 changes: 8 additions & 2 deletions src/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export const initialSearchOptions: SearchOptions = {
courseType: "学部",
language: "指定なし",
rishuNenji: "指定なし",
rishuNenjiFilter: "以下"
rishuNenjiFilter: "以下",
subjectCode: "",
};

// 検索条件で絞り込んだ科目のリスト(講義コードのリスト)を返す
Expand All @@ -69,7 +70,8 @@ function matchesSearchOptions(subject: Subject2, searchOptions: SearchOptions, b
matchesBookmark(subject, searchOptions, bookmarkedSubjects) &&
matchesCourseType(subject, searchOptions) &&
matchesLanguage(subject, searchOptions) &&
matchesRishuNenji(subject, searchOptions);
matchesRishuNenji(subject, searchOptions) &&
matchesSubjectCode(subject, searchOptions);
}


Expand Down Expand Up @@ -169,3 +171,7 @@ function matchesRishuNenji(subject: Subject2, searchOptions: SearchOptions): boo
searchOptions.rishuNenjiFilter === "以下" && subject["履修年次"] <= searchOptions.rishuNenji ||
searchOptions.rishuNenjiFilter === "のみ" && subject["履修年次"] == searchOptions.rishuNenji;
}

function matchesSubjectCode(subject: Subject2, searchOptions: SearchOptions): boolean {
return subject["講義コード"].startsWith(searchOptions.subjectCode);
}
1 change: 1 addition & 0 deletions src/types/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ export interface SearchOptions {
language: Language | "指定なし"
rishuNenji: number | "指定なし"
rishuNenjiFilter: "以下" | "のみ"
subjectCode: string
}

0 comments on commit 569af66

Please sign in to comment.