From 2a2c3f01e6a08d5739431fd18395d476909a3ef8 Mon Sep 17 00:00:00 2001 From: Minji <121149171+chosim-dvlpr@users.noreply.github.com> Date: Fri, 11 Oct 2024 15:00:04 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=ED=92=80=EC=9D=B4=20=ED=83=9C=EA=B7=B8=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=ED=95=B4=EA=B2=B0=20(issue=20#661)=20(#66?= =?UTF-8?q?3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 미션 태그 버그 해결 * refactor: 사용하지 않는 코드 제거 --- frontend/src/apis/solutions.ts | 1 - frontend/src/pages/SolutionListPage/index.tsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/apis/solutions.ts b/frontend/src/apis/solutions.ts index bd525c30..c440a06d 100644 --- a/frontend/src/apis/solutions.ts +++ b/frontend/src/apis/solutions.ts @@ -1,6 +1,5 @@ import { develupAPIClient } from '@/apis/clients/develupClient'; import { PATH } from '@/apis/paths'; -import { HASHTAGS } from '@/constants/hashTags'; import type { HashTag } from '@/types'; import type { Solution, SubmittedSolution } from '@/types/solution'; diff --git a/frontend/src/pages/SolutionListPage/index.tsx b/frontend/src/pages/SolutionListPage/index.tsx index afb5a9f2..5dc6c77e 100644 --- a/frontend/src/pages/SolutionListPage/index.tsx +++ b/frontend/src/pages/SolutionListPage/index.tsx @@ -12,7 +12,7 @@ export default function SolutionListPage() { const [selectedHashTag, setSelectedHashTag] = useState<{ id: number; name: string } | null>(null); const { data: allHashTags } = useHashTags(); - const { data: allMissions } = useMissions(selectedHashTag?.name); + const { data: allMissions } = useMissions(); return ( From 1eaa291b71f751fb9761492f8f2c07b4fb796d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=ED=95=9C=EC=98=81=28Ryan=29?= Date: Fri, 11 Oct 2024 15:16:46 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=EB=9F=B0=EC=B9=AD=20=EC=A7=81=EC=A0=84=20Q?= =?UTF-8?q?A=20=EC=9D=B4=ED=9B=84=20=EC=88=98=EC=A0=95=EC=82=AC=ED=95=AD?= =?UTF-8?q?=20=EB=B0=98=EC=98=81=20(#664)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 풀이 본문 마크다운 설정 및 카드 overflow ellipsis 적용 * fix: 미션 시작하기 클릭 시 모달이 뜨지 않도록 수정 --------- Co-authored-by: JEON TAEHEON --- .../MissionDetail/MissionDetailButtons.tsx | 1 - .../SolutionDetail/SolutionSection.styled.ts | 4 ++-- frontend/src/components/SolutionDetail/index.tsx | 2 +- .../components/common/InfoCard/InfoCard.styled.ts | 12 +++++++++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/MissionDetail/MissionDetailButtons.tsx b/frontend/src/components/MissionDetail/MissionDetailButtons.tsx index 84c42c52..2330600c 100644 --- a/frontend/src/components/MissionDetail/MissionDetailButtons.tsx +++ b/frontend/src/components/MissionDetail/MissionDetailButtons.tsx @@ -31,7 +31,6 @@ export default function MissionDetailButtons({ const [isMissionStarted, setIsMissionStarted] = useState(isStarted); const handleStartMission = () => { - handleModalOpen(); setIsMissionStarted(true); }; diff --git a/frontend/src/components/SolutionDetail/SolutionSection.styled.ts b/frontend/src/components/SolutionDetail/SolutionSection.styled.ts index 872963b6..f8bb88af 100644 --- a/frontend/src/components/SolutionDetail/SolutionSection.styled.ts +++ b/frontend/src/components/SolutionDetail/SolutionSection.styled.ts @@ -2,6 +2,7 @@ import styled from 'styled-components'; import javaIcon from '@/assets/images/java.svg'; import GithubLogo from '@/assets/images/githubLogo.svg'; import { Link } from 'react-router-dom'; +import SanitizedMDPreview from '../common/SanitizedMDPreview'; export const SolutionDetailTitle = styled.h2` margin: 4rem 0 2rem 0; @@ -103,7 +104,7 @@ export const CodeViewButtonWrapper = styled.div` margin: 3rem 0; `; -export const SolutionDescription = styled.div` +export const SolutionDescription = styled(SanitizedMDPreview)` margin-top: 3rem; ${({ theme }) => theme.font.body} `; @@ -120,4 +121,3 @@ export const SolutionDescriptionBottom = styled.div` export const CodeViewButtonLink = styled(Link)` display: contents; `; - diff --git a/frontend/src/components/SolutionDetail/index.tsx b/frontend/src/components/SolutionDetail/index.tsx index 58512e70..8d9c31fa 100644 --- a/frontend/src/components/SolutionDetail/index.tsx +++ b/frontend/src/components/SolutionDetail/index.tsx @@ -27,7 +27,7 @@ export default function SolutionSection({ solution }: SolutionDetailProps) { - {description} + {userInfo?.id === solution.member.id && ( )} diff --git a/frontend/src/components/common/InfoCard/InfoCard.styled.ts b/frontend/src/components/common/InfoCard/InfoCard.styled.ts index 76076ee2..6a622bb7 100644 --- a/frontend/src/components/common/InfoCard/InfoCard.styled.ts +++ b/frontend/src/components/common/InfoCard/InfoCard.styled.ts @@ -14,13 +14,23 @@ export const TitleWrapper = styled.div` `; export const Title = styled.div` + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + ${(props) => props.theme.font.bodyBold} `; export const Description = styled.div` - ${(props) => props.theme.font.body} + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + text-overflow: ellipsis; + color: ${(props) => props.theme.colors.grey500}; margin-top: 0.5rem; + ${(props) => props.theme.font.body} `; export const TagWrapper = styled.ul` From ebd5a4c0c73d02beeb6f5fb17747c53cf8cde6ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Minjoo=28=EA=B9=80=EB=AF=BC=EC=A3=BC/=EB=A6=AC?= =?UTF-8?q?=EB=B8=8C=29?= <131349867+Minjoo522@users.noreply.github.com> Date: Sat, 12 Oct 2024 00:53:43 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=EC=86=94=EB=A3=A8=EC=85=98=20?= =?UTF-8?q?=EC=A0=84=EC=B2=B4=20=EC=A1=B0=ED=9A=8C=EB=A5=BC=20=EC=A0=9C?= =?UTF-8?q?=EC=B6=9C=20=EC=9D=BC=EC=9E=90=20=EC=97=AD=EC=88=9C=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?(#667)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../solution/SolutionRepositoryCustom.java | 2 +- .../SolutionRepositoryCustomTest.java | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/develup/domain/solution/SolutionRepositoryCustom.java b/backend/src/main/java/develup/domain/solution/SolutionRepositoryCustom.java index 62bc1306..5de994bd 100644 --- a/backend/src/main/java/develup/domain/solution/SolutionRepositoryCustom.java +++ b/backend/src/main/java/develup/domain/solution/SolutionRepositoryCustom.java @@ -29,7 +29,7 @@ public List findAllCompletedSolutionByHashTagName(String missionTitle, .join(mission.missionHashTags.hashTags, missionHashTag).fetchJoin() .join(missionHashTag.hashTag).fetchJoin() .where(eqCompleted(), eqMissionTitle(missionTitle), eqHashTagName(hashTagName)) - .orderBy(solution.id.desc()) + .orderBy(solution.submittedAt.desc()) .fetch(); } diff --git a/backend/src/test/java/develup/domain/solution/SolutionRepositoryCustomTest.java b/backend/src/test/java/develup/domain/solution/SolutionRepositoryCustomTest.java index 7b7b8fce..406145b4 100644 --- a/backend/src/test/java/develup/domain/solution/SolutionRepositoryCustomTest.java +++ b/backend/src/test/java/develup/domain/solution/SolutionRepositoryCustomTest.java @@ -2,6 +2,7 @@ import static org.assertj.core.api.Assertions.assertThat; +import java.time.LocalDateTime; import java.util.List; import java.util.Optional; import java.util.function.Function; @@ -46,6 +47,35 @@ public class SolutionRepositoryCustomTest extends IntegrationTestSupport { @Autowired private HashTagRepository hashTagRepository; + @Test + @DisplayName("솔루션을 제출일자 역순으로 조회할 수 있다.") + void findAllCompletedSolutionByHashTagOrderBySubmittedAtDesc() { + Member member = memberRepository.save(MemberTestData.defaultMember().build()); + HashTag hashTag = hashTagRepository.save(HashTagTestData.defaultHashTag().withName("JAVA").build()); + Mission mission1 = missionRepository.save(MissionTestData.defaultMission().withHashTags(List.of(hashTag)).build()); + Mission mission2 = missionRepository.save(MissionTestData.defaultMission().withHashTags(List.of(hashTag)).build()); + Solution solution1 = SolutionTestData.defaultSolution() + .withMember(member) + .withMission(mission1) + .withStatus(SolutionStatus.COMPLETED) + .withSubmittedAt(LocalDateTime.of(2024, 1, 1, 0, 0)) + .build(); + Solution solution2 = SolutionTestData.defaultSolution() + .withMember(member) + .withMission(mission2) + .withStatus(SolutionStatus.COMPLETED) + .withSubmittedAt(LocalDateTime.of(2024, 1, 2, 0, 0)) + .build(); + + solutionRepository.saveAll(List.of(solution1, solution2)); + + List solutions = solutionRepositoryCustom.findAllCompletedSolutionByHashTagName("all", "all"); + + assertThat(solutions) + .map(Solution::getId) + .containsExactly(solution2.getId(), solution1.getId()); + } + @Test @DisplayName("주어진 해시태그가 포함된 완료된 솔루션을 조회할 수 있다.") void findAllCompletedSolutionByHashTag() { From 582d30c589f95b17f738e709f387a51445f1b809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Minjoo=28=EA=B9=80=EB=AF=BC=EC=A3=BC/=EB=A6=AC?= =?UTF-8?q?=EB=B8=8C=29?= <131349867+Minjoo522@users.noreply.github.com> Date: Sat, 12 Oct 2024 14:59:02 +0900 Subject: [PATCH 4/4] =?UTF-8?q?refactor:=20=ED=86=A0=ED=81=B0=20=EB=A7=8C?= =?UTF-8?q?=EB=A3=8C=20=EC=9D=BC=EC=9E=90=20=EC=97=B0=EC=9E=A5=20(#669)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/secrets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/secrets b/backend/secrets index e6afd457..63636f7d 160000 --- a/backend/secrets +++ b/backend/secrets @@ -1 +1 @@ -Subproject commit e6afd45785951ebbf90e3c275e14ed97e09fc2e4 +Subproject commit 63636f7dedc2a1dacc3233ee3376f94453c85f80