Skip to content

Commit

Permalink
[FE] 팀 피드/팀 링크에서의 최상위 도메인명 조건 완화 (#954)
Browse files Browse the repository at this point in the history
* refactor: URL 판정 정규표현식의 최상위 도메인 제한 길이를 2~12자로 수정

* test: 최상위 도메인의 길이가 긴 케이스를 스토리로 추가
  • Loading branch information
wzrabbit authored Mar 10, 2024
1 parent 210a8e9 commit 6df9beb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions frontend/src/components/feed/Thread/Thread.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,19 @@ export const ThreadWithLinkAndSentByMe: Story = {
},
},
};

export const ThreadWithLinkAndLongDomain: Story = {
args: {
authorName: '엣지케이스를 제공하는 필립',
isMe: false,
profileImageUrl:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQYZjvO1QuvfgCfQxBwwzmJcHIT5pTXIBGOLeyBDIbZknn6Dhkd40WrU0ZCdjt-IoXLzI0&usqp=CAU',
createdAt: '2024-03-08 15:48',
content: '지금 바로 접속: https://whatever.community/mock-resume',
images: [],
isContinue: false,
onClickImage: (images, selectedImage) => {
alert(JSON.stringify({ images, selectedImage }));
},
},
};
2 changes: 1 addition & 1 deletion frontend/src/constants/link.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const linkTableHeaderValues = ['링크명', '이름', '날짜', ''];

export const URL_REGEX =
/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/i;
/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,12}(:[0-9]{1,5})?(\/.*)?$/i;

0 comments on commit 6df9beb

Please sign in to comment.