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

Course card update #283

Merged
merged 7 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ docker.env
startBackend.sh

/.env
backend/web-bff/App/.env
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public void testAddGroupScore() throws Exception {
when(groupFeedbackUtil.checkGroupFeedbackUpdate(groupFeedbackEntity.getGroupId(), groupFeedbackEntity.getProjectId(), getMockUser(), HttpMethod.POST))
.thenReturn(new CheckResult<>(HttpStatus.OK, "", null));
when(groupFeedbackUtil.checkGroupFeedbackUpdateJson(argThat(
json -> json.getScore() == groupFeedbackEntity.getScore() && json.getFeedback().equals(groupFeedbackEntity.getFeedback())), eq(groupFeedbackEntity.getProjectId())))
json -> Objects.equals(json.getScore(), groupFeedbackEntity.getScore()) && json.getFeedback().equals(groupFeedbackEntity.getFeedback())), eq(groupFeedbackEntity.getProjectId())))
.thenReturn(new CheckResult<>(HttpStatus.OK, "", null));
when(groupFeedbackRepository.save(any())).thenReturn(groupFeedbackEntity);
when(entityToJsonConverter.groupFeedbackEntityToJson(groupFeedbackEntity)).thenReturn(groupFeedbackJson);
Expand All @@ -292,7 +292,7 @@ public void testAddGroupScore() throws Exception {
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
.andExpect(content().json(objectMapper.writeValueAsString(groupFeedbackJson)));
verify(groupFeedbackRepository, times(1)).save(argThat(
groupFeedback -> groupFeedback.getScore() == groupFeedbackEntity.getScore() &&
groupFeedback -> Objects.equals(groupFeedback.getScore(), groupFeedbackEntity.getScore()) &&
groupFeedback.getFeedback().equals(groupFeedbackEntity.getFeedback()) &&
groupFeedback.getGroupId() == groupFeedbackEntity.getGroupId() &&
groupFeedback.getProjectId() == groupFeedbackEntity.getProjectId()));
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/pages/index/components/CourseCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useNavigate } from "react-router-dom"
import { AppRoutes } from "../../../@types/routes"
import GroupProgress from "./GroupProgress"
import { CourseProjectsType } from "./CourseSection"
import { Link } from "react-router-dom"

const CourseCard: FC<{ courseProjects: CourseProjectsType[string], adminView?:boolean }> = ({ courseProjects,adminView }) => {
const { t } = useTranslation()
Expand Down Expand Up @@ -74,10 +75,16 @@ const CourseCard: FC<{ courseProjects: CourseProjectsType[string], adminView?:bo
/>,
]}
>
<List.Item.Meta title={<Typography.Text ellipsis>{project.name}</Typography.Text>} />
<List.Item.Meta title={
<Link to={AppRoutes.PROJECT.replace(":courseId", courseProjects.course.courseId.toString()).replace(":projectId", project.projectId.toString())} style={{ color: token.colorPrimary }}
onClick={(event) => event.stopPropagation()}>
<Typography.Text ellipsis>{project.name}</Typography.Text>
</Link>}/>
</List.Item>
)}
></List>
>
{courseProjects.projects.length > 3 && <Typography.Text style={{ textAlign: 'left', display: 'block' }}>...</Typography.Text>}
</List>
</Card>
)
}
Expand Down
Loading