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

[FE] 코드잽 프로덕션 v1.1.3 배포 #766

Merged
merged 84 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
c04425a
feat(hooks): useNoSpaceInput
Hain-tain Sep 15, 2024
873e9ad
refactor(authentication): useAuth useCustomContext 사용하도록 변경
Hain-tain Sep 19, 2024
de7f1a6
feat(hooks): useToast 생성
Hain-tain Sep 19, 2024
3684d05
feat(components): SourceCode, SourceCodeEditor, SourceCodeViewer 로 컴포…
Hain-tain Sep 19, 2024
971db90
refactor(src): fileName => filename 으로 통일
Hain-tain Sep 19, 2024
6a4954a
refactor(pages): SourceCodeEditor 적용
Hain-tain Sep 19, 2024
274837e
refactor(src): SourceCodeViewer 적용
Hain-tain Sep 19, 2024
8fd7254
design(TemplateCard): TemplateCardContainer에 gap 1rem 추가
Hain-tain Sep 19, 2024
e8cc42c
design(SourceCodeEditor): 상위 컨테이너에 position: relative 추가
Hain-tain Sep 23, 2024
bf1a5ec
feat(components): TemplateEdit 에서 CategoryDropdown, CategoryGuide, Ne…
Hain-tain Sep 25, 2024
ad7e815
refactor(category): 카테고리 생성하는 함수(createNewCategory) useCategory 훅으로 이동
Hain-tain Sep 25, 2024
3323899
feat(template): useSourceCode, useTag
Hain-tain Sep 25, 2024
1678a06
refactor(src): useSelectList => useSourceCodeSelectList 로 변경 및 파일 위치 …
Hain-tain Sep 25, 2024
3280963
refactor(TemplateUploadPage): TemplateEdit 및 useTemplateUpload 삭제
Hain-tain Sep 25, 2024
594284a
refactor(TemplateEditPage): TemplateEdit 및 useTemplateEdit 삭제
Hain-tain Sep 25, 2024
788f3a0
refactor(SourceCodeViewer): SVGElement 에 isOpen 전달 불가로 인해 ChevronIcon…
Hain-tain Sep 25, 2024
c97ada2
refactor(src): useSourceCodeSelectList => useSelectList 로 변경 및 매개변수 제거
Hain-tain Sep 25, 2024
bb6f63b
refactor(src): 소스코드 유효성 검증 로직 useSourceCode 내부에서 하도록 변경
Hain-tain Sep 25, 2024
79e2ac6
fix(tests): 파일명 placeholder '파일명.[확장자]'로 변경된 점 playwright에 반영
Hain-tain Sep 25, 2024
0ea946b
fix(page): 파일명, 소스코드 내용 공백으로만 채우는 경우 유효성 검사 통과하지 않도록 수정
Hain-tain Sep 25, 2024
c43a5b0
fix(tests): api 변경으로 인해 e2e 테스트 시 waitForSuccess apiUrl 변경
Hain-tain Sep 26, 2024
d400bdf
refactor(TagFilterMenu): height의 기본값 LINE_HEIGHT_REM 으로 설정
Hain-tain Sep 26, 2024
d9609d8
feat(templates): useTemplateCategoryTagQueries
Hain-tain Sep 26, 2024
cedc2ba
refactor(api): getTemplateList 에서 keyword 가 있는 경우에만 queryParams 에 포함되…
Hain-tain Sep 26, 2024
0d83344
refactor(src): useTemplateCategoryTagQueries 적용 및 Suspense 설정
Hain-tain Sep 26, 2024
cfb88bc
refactor(Footer): isChecking 아닐때 랜더링되도록 수정
Hain-tain Sep 26, 2024
0be7178
refactor(MyTemplatePage): templates, categories, tags => templateList…
Hain-tain Sep 26, 2024
5074e61
refactor(routes): Suspense fallback 내부 Flex css props 삭제
Hain-tain Sep 26, 2024
88b6c3f
feat(src): LoadingFallback 컴포넌트 생성 및 적용
Hain-tain Sep 26, 2024
c3282c7
refactor(Toast): 불필요한 import 제거
vi-wolhwa Sep 26, 2024
ab981be
chore: 최적화를 위한 패키지 설치
vi-wolhwa Sep 26, 2024
b35abf0
chore: sideEffects false 설정
vi-wolhwa Sep 26, 2024
b79e3dc
refactor(routes): 라우터 Code Splitting 적용
vi-wolhwa Sep 26, 2024
469dae9
chore: 번들 brotli 압축
vi-wolhwa Sep 26, 2024
349d51a
chore: 번들 청크 분리 설정
vi-wolhwa Sep 26, 2024
dd8835e
chore: BundleAnalyzerPlugin 적용
vi-wolhwa Sep 26, 2024
3aa7495
chore: 빌드 파일명에 content hash 적용
vi-wolhwa Sep 26, 2024
e6e19ad
chore: production 모드에서 source-map 비활성화
vi-wolhwa Sep 26, 2024
3d0238b
Merge branch 'dev/fe' of https://github.com/woowacourse-teams/2024-co…
vi-wolhwa Sep 26, 2024
cae272d
feat(public): index.html - API서버, GA서버 preconnect
Jaymyong66 Sep 27, 2024
6ad064a
feat(TemplateCard): 썸네일 코드에서 Gutter 제거
Jaymyong66 Sep 27, 2024
b5215c6
Merge branch 'dev/fe' into refactor/695-perf-optimization
Hain-tain Sep 27, 2024
d62ccac
refactor(MyTemplatesPage): 사용하지 않는 import 제거
Hain-tain Sep 27, 2024
a21210a
Merge pull request #706 from woowacourse-teams/refactor/695-perf-opti…
vi-wolhwa Sep 27, 2024
aeb51cc
Merge pull request #717 from woowacourse-teams/feat/695-rendering-opt…
Hain-tain Sep 27, 2024
5456e6c
chore: webpack compression plugin 삭제
vi-wolhwa Sep 27, 2024
fa2e4d9
Merge branch 'dev/fe' of https://github.com/woowacourse-teams/2024-co…
vi-wolhwa Sep 27, 2024
bae39af
chore: webpack dev 모드 "devtool: source-map" 제거
vi-wolhwa Oct 2, 2024
b1539f9
design(SourceCodeViewer): 글자색 theme 적용
Hain-tain Oct 2, 2024
4ea93e2
refactor(src): useNoSpaceInput 에서 모든 공백 막도록 변경 및 사용하지 않는 removeAllWhi…
Hain-tain Oct 2, 2024
f7066d0
Merge branch 'dev/fe' of https://github.com/woowacourse-teams/2024-co…
Hain-tain Oct 2, 2024
3a971d5
refactor(TemplatePage): hooks index에 useLike 추가 및 import 변경
Hain-tain Oct 2, 2024
0e65205
refactor(hooks): useNoSpaceInput 에서 공백처럼 보이는 유니코드 막도록 추가
Hain-tain Oct 2, 2024
dfa2cf0
chore: side effect 범위를 router.tsx로 한정
vi-wolhwa Oct 2, 2024
8908aa1
chore: BundleAnalyzerPlugin 비활성화
vi-wolhwa Oct 2, 2024
99f8f38
Merge pull request #694 from woowacourse-teams/refactor/649-template-…
Jaymyong66 Oct 2, 2024
a9e8408
chore: BundleAnalyzerPlugin import 제거
vi-wolhwa Oct 2, 2024
bb91b6a
feat(ScreenReaderScript): 스크린 리더 스크립트 컴포넌트 생성
vi-wolhwa Oct 2, 2024
fcd4aa7
refactor(TagInput): 스크린리더가 태그 등록 메시지를 읽도록 개선
vi-wolhwa Oct 2, 2024
91870d5
feat(CategoryGuide): 카테고리 가이드 숨김 상태일 때 aria-hidden 설정
vi-wolhwa Oct 4, 2024
c295b61
Merge pull request #736 from woowacourse-teams/refactor/722-category-…
Hain-tain Oct 4, 2024
18dc932
Merge pull request #716 from woowacourse-teams/refactor/715-bundle-op…
Jaymyong66 Oct 4, 2024
276cf09
refactor(SourceCodeViewer): 스크린 리더기가 소스코드 접기 및 파일명 읽도록 aria-label 추가
Hain-tain Oct 5, 2024
efbc994
refactor(LoginPage): input에 투명한 placeholder 추가 및 비밀번호 버튼에 버튼 태그 추가
Hain-tain Oct 5, 2024
c36ca80
feat(Header): 햄버거 메뉴 태그 button으로 변경 및 aria-label 추가
Jaymyong66 Oct 5, 2024
6040145
feat(Header): 스크린 리더용 새 템플릿 버튼 안내 메시지 추가
Jaymyong66 Oct 5, 2024
16c44ec
feat(LoginPage): 아이디, 비밀번호 input에 요구 사항을 aria-label에 추가
Jaymyong66 Oct 5, 2024
40318e7
refactor(LoginPage): placeholderColor 사용하도록 변경
Hain-tain Oct 5, 2024
6dee26e
refactor(src): Adornment가 as 로 button 받을 수 있도록 변경 및 적용
Hain-tain Oct 5, 2024
32cc70a
refactor(Input): Adornment가 button일 경우 type=button 추가
Hain-tain Oct 5, 2024
df0f3e6
refactor(src): ScreenReader 기능을 컴포넌트에서 훅으로 변경
vi-wolhwa Oct 7, 2024
bbf8693
refactor(src): 스크린리더 요소를 RouterProvider 밖으로 이동
vi-wolhwa Oct 7, 2024
27f8f1d
feat(hooks): useCustomNavigate
Hain-tain Oct 7, 2024
520ef3b
feat(src): useCustomNavigate 적용
Hain-tain Oct 7, 2024
b770476
Merge pull request #742 from woowacourse-teams/refactor/722-improve-a…
vi-wolhwa Oct 7, 2024
0bcc07b
refactor(ScreenReaderOnly): ScreenReader 컴포넌트명 변경
vi-wolhwa Oct 8, 2024
30a5b0d
Merge branch 'dev/fe' into feat/722-accessibility-improve
Jaymyong66 Oct 8, 2024
010413d
Merge pull request #727 from woowacourse-teams/refactor/722-tag-regis…
Jaymyong66 Oct 8, 2024
f0983ab
feat(hooks): useCustomNavigate JSDoc 추가
Hain-tain Oct 8, 2024
f7eb3dc
Merge pull request #750 from woowacourse-teams/refactor/575-router-hi…
Jaymyong66 Oct 10, 2024
ace4548
feat(frontend): package.json - version 1.1.3으로 변경
Jaymyong66 Oct 10, 2024
034ee66
Merge pull request #743 from woowacourse-teams/feat/722-accessibility…
vi-wolhwa Oct 10, 2024
6c7487e
refactor: 프론트엔드 cd 파일 삭제
Hain-tain Oct 11, 2024
cd1c482
Merge pull request #773 from woowacourse-teams/delete-front-cd-yml
vi-wolhwa Oct 11, 2024
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
155 changes: 155 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "code-zap",
"version": "1.1.2",
"version": "1.1.3",
"description": "",
"main": "index.js",
"scripts": {
Expand All @@ -10,12 +10,16 @@
"dev": "webpack-dev-server --config webpack.dev.js --open",
"tsc": "tsc --noEmit",
"build": "webpack --mode production --config webpack.prod.js",
"build:report": "webpack-bundle-analyzer --port 8888 dist/bundle-stats.json",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"lint:style": "stylelint '**/style.ts' --fix"
},
"keywords": [],
"author": "",
"sideEffects": [
"./src/routes/router.tsx"
],
"license": "ISC",
"dependencies": {
"@emotion/react": "^11.11.4",
Expand Down Expand Up @@ -80,6 +84,7 @@
"undici": "^6.19.2",
"util": "^0.12.5",
"webpack": "^5.92.1",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4"
},
Expand Down
4 changes: 2 additions & 2 deletions frontend/playwright/tests/search.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test('검색창에 `검색테스트`를 입력하면 `검색테스트`가 내용

await searchTemplates({ page, keyword });

await waitForSuccess({ page, apiUrl: '/templates?keyword' });
await waitForSuccess({ page, apiUrl: '/templates/login?keyword' });
await expect(page.getByRole('link', { name: /검색테스트/ })).toBeVisible();
});

Expand All @@ -23,6 +23,6 @@ test('검색창에 `ㅁㅅㅌㅇ`를 입력할 경우 `검색 결과가 없습

await searchTemplates({ page, keyword });

await waitForSuccess({ page, apiUrl: '/templates?keyword' });
await waitForSuccess({ page, apiUrl: '/templates/login?keyword' });
await expect(page.locator('div').filter({ hasText: /^검색 결과가 없습니다\.$/ })).toBeVisible();
});
2 changes: 1 addition & 1 deletion frontend/playwright/tests/templates.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const uploadTemplateToCodezap = async ({
}

// 파일명 입력
await page.getByPlaceholder('파일명.js').fill(fileName);
await page.getByPlaceholder('파일명.[확장자]').fill(fileName);

// 코드 입력
await page
Expand Down
4 changes: 2 additions & 2 deletions frontend/playwright/tests/templates.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test('템플릿 제목, 설명, 파일명, 소스코드, 태그를 입력하고
tag: testTitle,
});

const templateCard = page.getByRole('link', { name: `testTitle` }).first();
const templateCard = page.getByRole('link', { name: testTitle }).first();

await expect(templateCard).toBeVisible();
} catch (error) {
Expand All @@ -50,7 +50,7 @@ test('템플릿 카드를 누르면 템플릿 제목, 설명, 작성자, 생성
}) => {
await page.goto('/my-templates');
// 템플릿 목록
await waitForSuccess({ page, apiUrl: '/templates' });
await waitForSuccess({ page, apiUrl: '/templates/login?keyword' });

const templateCard = page.getByRole('link', { name: '상세조회테스트' });

Expand Down
2 changes: 2 additions & 0 deletions frontend/public/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!doctype html>
<html lang="ko">
<head>
<link rel="preconnect" href="https://api.code-zap.com" />
<link rel="preconnect" href="https://www.googletagmanager.com" />
<link
rel="stylesheet"
type="text/css"
Expand Down
79 changes: 79 additions & 0 deletions frontend/src/components/CategoryDropdown/CategoryDropdown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { Dropdown, CategoryGuide, NewCategoryInput } from '@/components';
import { useInputWithValidate } from '@/hooks';
import { validateCategoryName } from '@/service/validates';
import { Category } from '@/types';

interface Props {
options: Category[];
isOpen: boolean;
toggleDropdown: () => void;
currentValue: Category;
handleCurrentValue: (newValue: Category) => void;
getOptionLabel: (category: Category) => string;
createNewCategory: (categoryName: string) => Promise<void>;
dropdownRef: React.MutableRefObject<HTMLDivElement | null>;
isPending: boolean;
}

const CategoryDropdown = ({
options,
isOpen,
toggleDropdown,
currentValue,
handleCurrentValue,
getOptionLabel,
createNewCategory,
dropdownRef,
isPending,
}: Props) => {
const {
value: categoryInputValue,
errorMessage: categoryInputErrorMessage,
handleChange: handleCategoryInputChange,
} = useInputWithValidate('', validateCategoryName);

const handleNewCategory = async (e: React.KeyboardEvent<HTMLInputElement>) => {
if (!(e.target instanceof HTMLInputElement) || e.key !== 'Enter' || e.nativeEvent.isComposing === true) {
return;
}

if (categoryInputErrorMessage !== '') {
return;
}

const inputValue = e.target.value;

if (inputValue === '') {
return;
}

await createNewCategory(inputValue);

e.target.value = '';
};

return (
<>
<CategoryGuide isOpen={isOpen} categoryErrorMessage={categoryInputErrorMessage} />
<Dropdown
options={options}
isOpen={isOpen}
toggleDropdown={toggleDropdown}
currentValue={currentValue}
handleCurrentValue={handleCurrentValue}
getOptionLabel={getOptionLabel}
dropdownRef={dropdownRef}
replaceChildrenWhenIsOpen={
<NewCategoryInput
value={categoryInputValue}
onChange={handleCategoryInputChange}
onEnterDown={handleNewCategory}
isPending={isPending}
/>
}
/>
</>
);
};

export default CategoryDropdown;
Loading