cedarstalking with keyboard shortcuts
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: fix api shape for self

+31 -40
+7 -7
src/api.ts
··· 67 67 isFaculty: boolean; 68 68 facultyDepts: { code: string; description: string; division: string }[]; 69 69 scheduleItems: ScheduleItem[]; 70 - term: { key: string; description: string }; 70 + term: { key: string | null; description: string | null }; 71 71 }; 72 72 student: { 73 73 isStudent: boolean; 74 74 scheduleItems: ScheduleItem[]; 75 - programs: string[]; 76 - majors: { code: string; description: string }[]; 77 - minors: { code: string; description: string }[]; 78 - concentrations: { code: string; description: string }[]; 79 - advisors: { id: string; name: string }[]; 80 - term: { key: string; description: string }; 75 + programs: { key: string; title: string }[]; 76 + majors: { code: string; desc: string }[]; 77 + minors: { code: string; desc: string }[]; 78 + concentrations: { code: string; desc: string }[]; 79 + advisors: { advisor: { id: string; name: string; email: string }; advisement: { type: string } }[]; 80 + term: { key: string | null; description: string | null }; 81 81 }; 82 82 } 83 83
+24 -33
src/search-directory.tsx
··· 324 324 text={demo ? "City, OH" : [person.AddressCity, person.AddressState].filter(Boolean).join(", ")} 325 325 /> 326 326 )} 327 - {info?.student?.isStudent && info.student.majors.length > 0 && ( 328 - <> 329 - <Detail.Metadata.Separator /> 330 - {info.student.majors.map((m) => ( 331 - <Detail.Metadata.Label 332 - key={m.code} 333 - title="Major" 334 - text={m.description} 335 - /> 336 - ))} 337 - {info.student.minors.map((m) => ( 338 - <Detail.Metadata.Label 339 - key={m.code} 340 - title="Minor" 341 - text={m.description} 342 - /> 343 - ))} 344 - {info.student.concentrations.map((c) => ( 345 - <Detail.Metadata.Label 346 - key={c.code} 347 - title="Concentration" 348 - text={c.description} 349 - /> 350 - ))} 351 - {info.student.advisors.map((a) => ( 352 - <Detail.Metadata.Label 353 - key={a.id} 354 - title="Advisor" 355 - text={demo ? "Advisor Name" : a.name} 356 - /> 357 - ))} 358 - </> 359 - )} 327 + {info?.student?.isStudent && (() => { 328 + const majors = info.student.majors.filter(m => m.desc?.trim()); 329 + const minors = info.student.minors.filter(m => m.desc?.trim()); 330 + const concentrations = info.student.concentrations.filter(c => c.desc?.trim()); 331 + const advisors = info.student.advisors.filter(a => a.advisor.name?.trim()); 332 + if (!majors.length && !minors.length && !concentrations.length && !advisors.length) return null; 333 + return ( 334 + <> 335 + <Detail.Metadata.Separator /> 336 + {majors.map((m) => ( 337 + <Detail.Metadata.Label key={m.code} title="Major" text={m.desc} /> 338 + ))} 339 + {minors.map((m) => ( 340 + <Detail.Metadata.Label key={m.code} title="Minor" text={m.desc} /> 341 + ))} 342 + {concentrations.map((c) => ( 343 + <Detail.Metadata.Label key={c.code} title="Concentration" text={c.desc} /> 344 + ))} 345 + {advisors.map((a) => ( 346 + <Detail.Metadata.Label key={a.advisor.id} title="Advisor" text={demo ? "Advisor Name" : a.advisor.name} /> 347 + ))} 348 + </> 349 + ); 350 + })()} 360 351 {info?.faculty?.isFaculty && info.faculty.facultyDepts.length > 0 && ( 361 352 <> 362 353 <Detail.Metadata.Separator />