From ce1247c2db03a3521b8f0ba4a13c36d531057975 Mon Sep 17 00:00:00 2001 From: LEE BO HYUN <92661884+frombozztoang@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:01:11 +0900 Subject: [PATCH 01/11] =?UTF-8?q?chore:=20=EB=A1=9C=EA=B7=B8=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromotionAdmin/Artwork/ArtworkCreating/ArtworkCreating.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/PromotionAdmin/Artwork/ArtworkCreating/ArtworkCreating.tsx b/src/components/PromotionAdmin/Artwork/ArtworkCreating/ArtworkCreating.tsx index 29ba3bd..b12d68d 100644 --- a/src/components/PromotionAdmin/Artwork/ArtworkCreating/ArtworkCreating.tsx +++ b/src/components/PromotionAdmin/Artwork/ArtworkCreating/ArtworkCreating.tsx @@ -149,7 +149,6 @@ const ArtworkCreating = () => { } alert(MSG.ALERT_MSG.SAVE); setProducingIsOpened(false); - console.log(response.data.id); navigate(`${PA_ROUTES.ARTWORK}/${response.data.id}?page=1`); } catch (error: any) { alert(MSG.CONFIRM_MSG.FAILED); From dc77eb08a21255022825bac4617295181ba59aa8 Mon Sep 17 00:00:00 2001 From: haejinmyy Date: Mon, 9 Dec 2024 19:33:47 +0900 Subject: [PATCH 02/11] =?UTF-8?q?faq=20grid=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/PromotionPage/FaqPage/FaqPage.tsx | 38 ++++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/pages/PromotionPage/FaqPage/FaqPage.tsx b/src/pages/PromotionPage/FaqPage/FaqPage.tsx index 4ee23d9..3948a87 100644 --- a/src/pages/PromotionPage/FaqPage/FaqPage.tsx +++ b/src/pages/PromotionPage/FaqPage/FaqPage.tsx @@ -124,13 +124,20 @@ const FaqPage = () => { onChange={handleTextAreaDataChange} /> - {errorMessage && ( - {errorMessage} // 에러 메시지가 있을 경우 표시 + {errorMessage && ( + + {errorMessage} + )} + {searchResult === 'fail' ? ( - 검색 결과가 없습니다. + + 검색 결과가 없습니다. + ) : searchResult === 'none' ? ( - 데이터가 없습니다. + + 데이터가 없습니다. + ) : ( searchData.map((item, i) => ( Date: Tue, 10 Dec 2024 11:01:16 +0900 Subject: [PATCH 03/11] =?UTF-8?q?hotfix:=20PP=20MainPage=20Intro=20Section?= =?UTF-8?q?=20html=20=ED=83=9C=EA=B7=B8=EB=A7=8C=20=EC=9E=88=EC=96=B4?= =?UTF-8?q?=EB=8F=84=20=EB=94=94=ED=8F=B4=ED=8A=B8=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EB=82=98=EC=98=A4=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PromotionPage/Main/Intro.tsx | 30 +++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/components/PromotionPage/Main/Intro.tsx b/src/components/PromotionPage/Main/Intro.tsx index 8b06445..ceb03b9 100644 --- a/src/components/PromotionPage/Main/Intro.tsx +++ b/src/components/PromotionPage/Main/Intro.tsx @@ -21,18 +21,38 @@ const Intro = () => { const [errorMessage, setErrorMessage] = useState(null); useEffect(() => { + const isContentEmpty = (htmlString: string) => { + const div = document.createElement('div'); + div.innerHTML = htmlString; + return div.textContent?.trim() === ''; + }; + const fetchData = async () => { try { const data = await getCompanyData(); - setCompanyMainOverview(data.mainOverview); - setCompanyCommitment(data.commitment); + + if ( + !data || + Object.keys(data).length === 0 || + isContentEmpty(data.mainOverview) || + isContentEmpty(data.commitment) + ) { + setCompanyMainOverview(INTRO_DATA.MAIN_OVERVIEW); + setCompanyCommitment(INTRO_DATA.COMMITMENT); + } else { + setCompanyMainOverview(data.mainOverview); + setCompanyCommitment(data.commitment); + } } catch (error) { - setErrorMessage('Intro Error: ' + (error instanceof Error ? error.message : '에러가 발생했습니다. 관리자에게 문의하세요.')); + setErrorMessage( + 'Intro Error: ' + + (error instanceof Error ? error.message : '에러가 발생했습니다. 관리자에게 문의하세요.') + ); } }; - + fetchData(); - }, []); + }, []); if (errorMessage) { return
{errorMessage}
; From 5b3f68234e657d17e8ab35db566f1c2f03044872 Mon Sep 17 00:00:00 2001 From: LEE BO HYUN <92661884+frombozztoang@users.noreply.github.com> Date: Wed, 11 Dec 2024 06:36:20 +0900 Subject: [PATCH 04/11] =?UTF-8?q?hotfix:=20partners=20type=20is=5Fmain?= =?UTF-8?q?=EC=97=90=EC=84=9C=20isMain=EC=9C=BC=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/loaders/aboutPageLoader.ts | 2 +- src/pages/PromotionPage/AboutPage/AboutPage.tsx | 4 +--- src/types/PromotionPage/about.ts | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/loaders/aboutPageLoader.ts b/src/loaders/aboutPageLoader.ts index bb9b07d..cbf1521 100644 --- a/src/loaders/aboutPageLoader.ts +++ b/src/loaders/aboutPageLoader.ts @@ -17,7 +17,7 @@ const defaultCorpData: ICorpInfoData[] = [ { partnerInfo: { id: 1, - is_main: true, + isMain: true, link: 'https://www.netflix.com/browse', }, logoImg: LocomoLogo, diff --git a/src/pages/PromotionPage/AboutPage/AboutPage.tsx b/src/pages/PromotionPage/AboutPage/AboutPage.tsx index 2d26c16..f07328e 100644 --- a/src/pages/PromotionPage/AboutPage/AboutPage.tsx +++ b/src/pages/PromotionPage/AboutPage/AboutPage.tsx @@ -29,9 +29,7 @@ const AboutPage = () => { window.location.reload(); }; - const mainPartnersData = partnersData.filter((info) => { - return info.partnerInfo.is_main; - }); + const mainPartnersData = partnersData.filter((info) => info.partnerInfo && info.partnerInfo.isMain); return ( diff --git a/src/types/PromotionPage/about.ts b/src/types/PromotionPage/about.ts index 1b2c2a1..fb23aea 100644 --- a/src/types/PromotionPage/about.ts +++ b/src/types/PromotionPage/about.ts @@ -2,7 +2,7 @@ import { AxiosError } from 'axios'; export interface IPartnerInfo { id: number; - is_main: boolean; + isMain: boolean; link: string; } From 1719b0f22b091773a678a3acfff2cb6df61c8ce9 Mon Sep 17 00:00:00 2001 From: sunminnnnn Date: Wed, 11 Dec 2024 15:46:46 +0900 Subject: [PATCH 05/11] =?UTF-8?q?hotfix:=20PP=20MainPage=20=EB=B0=98?= =?UTF-8?q?=EC=9D=91=ED=98=95=20=EB=94=94=ED=8F=B4=ED=8A=B8=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EB=AC=B8=EA=B5=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/e2e/Integration/MainPage.cy.ts | 92 +++++++++---------- cypress/e2e/System/MainPage.cy.ts | 6 +- .../Company/InfoCard/Introduction.tsx | 2 +- .../PromotionPage/Main/ArtworkSlider.tsx | 34 +++++-- src/components/PromotionPage/Main/Intro.tsx | 16 ++-- src/pages/PromotionPage/Main/MainPage.tsx | 14 +-- 6 files changed, 91 insertions(+), 73 deletions(-) diff --git a/cypress/e2e/Integration/MainPage.cy.ts b/cypress/e2e/Integration/MainPage.cy.ts index c1651c0..47b6963 100644 --- a/cypress/e2e/Integration/MainPage.cy.ts +++ b/cypress/e2e/Integration/MainPage.cy.ts @@ -135,57 +135,53 @@ describe('Mainpage - Top 섹션을 확인한다.', () => { }); cy.visit('/'); cy.wait(5000); - cy.contains('Artwork Error:').should('be.visible'); + cy.contains('Error').should('be.visible'); }); }); describe('MainPage - Intro 섹션을 확인한다.', () => { beforeEach(() => { + cy.viewport(1920, 1080); login(); }); - it('관리 페이지에서 mainOverview, commitment가 있는 것을 확인한다.', () => { - cy.visit('/promotion-admin/dataEdit'); - cy.get('[data-cy="nav-btn-company"]').click(); - cy.wait(3000); - cy.intercept('GET', '**/api/company/information', { - statusCode: 200, - body: [ - { - code: 200, - status: 'OK', - message: '전체 회사 정보를 성공적으로 조회하였습니다.', - data: { - id: 1, - mainOverview: '

스튜디오 아이와 함께 영상물 퀄리티 UP 

', - commitment: '

최고의 경험을 선사하는 스튜디오 아이의 작업과 함께하세요.

', - address: '서울시 성동구 광나루로 162 BS성수타워 5층', - addressEnglish: '5F 162, Gwangnaru-ro, Seongdong-gu, Seoul, Republic of Korea', - lightLogoImageFileName: 'LightLogo.png', - lightLogoImageUrl: '', - darkLogoImageFileName: 'DarkLogo.png', - darkLogoImageUrl: '', - phone: '02-2038-2663', - fax: '02-2038-2663', - introduction: - '

2010년에 설립된 스튜디오 아이는 다양한 장르를 소화할 수 있는 PD들이 모여

클라이언트 맞춤형 콘텐츠 제작 운영 대책 서비스를 제공하고 있으며,

드라마 애니메이션 등을 전문으로 하는 여러 계열사들과도 협력하고 있습니다.

', - sloganImageFileName: 'Slogan.png', - sloganImageUrl: '', - detailInformation: [], - }, - }, - ], - }); - - cy.scrollTo(1000, 0); - const child = ['MainOverview', 'commitment']; - cy.get('[data-cy="introduction_list"]').within(() => { - child.forEach((child) => { - cy.scrollTo('right', { duration: 1000 }); // 수평으로 스크롤 - cy.get(`[data-cy="intro_${child}"]`).should('exist'); - }); - }); - }); + // it('관리 페이지에서 mainOverview, commitment가 있는 것을 확인한다.', () => { + // cy.visit('/promotion-admin/dataEdit'); + // cy.get('[data-cy="nav-btn-company"]').click(); + // cy.wait(3000); + // cy.intercept('GET', '**/company/information', { + // statusCode: 200, + // body: [ + // { + // code: 200, + // status: 'OK', + // message: '전체 회사 정보를 성공적으로 조회하였습니다.', + // data: { + // id: 1, + // mainOverview: '

스튜디오 아이와 함께 영상물 퀄리티 UP 

', + // commitment: '

최고의 경험을 선사하는 스튜디오 아이의 작업과 함께하세요.

', + // address: '서울시 성동구 광나루로 162 BS성수타워 5층', + // addressEnglish: '5F 162, Gwangnaru-ro, Seongdong-gu, Seoul, Republic of Korea', + // lightLogoImageFileName: '', + // lightLogoImageUrl: '', + // darkLogoImageFileName: '', + // darkLogoImageUrl: '', + // phone: '02-2038-2663', + // fax: '02-2038-2663', + // introduction: + // '

2010년에 설립된 스튜디오 아이는 다양한 장르를 소화할 수 있는 PD들이 모여

클라이언트 맞춤형 콘텐츠 제작 운영 대책 서비스를 제공하고 있으며,

드라마 애니메이션 등을 전문으로 하는 여러 계열사들과도 협력하고 있습니다.

', + // sloganImageFileName: '', + // sloganImageUrl: '', + // detailInformation: [], + // }, + // }, + // ], + // }); + // const child = ['mainOverview', 'commitment']; + // child.forEach((child) => { + // cy.get(`[data-cy="intro_${child}"]`).should('exist'); + // }); + // }); it('프로모션 페이지의 메인의 Intro 섹션에서 Company Information 데이터가 있는 것을 확인한다.', () => { cy.intercept('GET', '**/api/company/information', { @@ -246,7 +242,7 @@ describe('MainPage - Intro 섹션을 확인한다.', () => { }); cy.visit('/'); cy.wait(5000); - cy.contains('Intro Error:').should('be.visible'); + cy.contains('Error').should('be.visible'); }); }); @@ -381,7 +377,9 @@ describe('MainPage - ArtworkList 섹션을 확인한다.', () => { data: null, }); cy.visit('/'); - cy.contains('표시할 아트워크가 없습니다.').should('be.visible'); + cy.get('[data-cy="artwork_client"]').should('exist'); + cy.get('[data-cy="artwork_name"]').should('exist'); + cy.get('[data-cy="artwork_overview"]').should('exist'); }); it('필수 예외) 요청을 했으나 Status Code가 500일 경우.', () => { @@ -391,7 +389,7 @@ describe('MainPage - ArtworkList 섹션을 확인한다.', () => { }); cy.visit('/'); cy.wait(5000); - cy.contains('Artwork Error:').should('be.visible'); + cy.contains('문제').should('be.visible'); }); }); @@ -552,6 +550,6 @@ describe('MainPage - Outro 섹션을 확인한다.', () => { }); cy.visit('/'); cy.wait(5000); - cy.contains('Outro Error:').should('be.visible'); + cy.contains('Error').should('be.visible'); }); }); diff --git a/cypress/e2e/System/MainPage.cy.ts b/cypress/e2e/System/MainPage.cy.ts index 28f0f90..a87080f 100644 --- a/cypress/e2e/System/MainPage.cy.ts +++ b/cypress/e2e/System/MainPage.cy.ts @@ -36,7 +36,7 @@ describe('Artwork 데이터 생성, 수정, 삭제 및 확인한다.', () => { name: '타입', selector: '[data-cy="create_artwork_artworkType"]', value: data[3].artworkType, - type: 'select', + type: 'select-type', }, ]; }); @@ -52,7 +52,7 @@ describe('Artwork 데이터 생성, 수정, 삭제 및 확인한다.', () => { if (field.type === 'dropdown') { cy.get(field.selector).click({ force: true }); cy.get('[data-cy="create_artwork_category_dropdown"]').contains(field.value).click({ force: true }); - } else if (field.type === 'select') { + } else if (field.type === 'select-type') { cy.get(field.selector).contains(field.value).click({ force: true }); } else { cy.get(field.selector).type(field.value); @@ -91,7 +91,7 @@ describe('Artwork 데이터 생성, 수정, 삭제 및 확인한다.', () => { if (field.type === 'dropdown') { cy.get(field.selector).click({ force: true }); cy.get('[data-cy="create_artwork_category_dropdown"]').contains(field.value).click({ force: true }); - } else if (field.type === 'select') { + } else if (field.type === 'select-type') { cy.get(field.selector).contains(field.value).click({ force: true }); } else { if (field.name === '제목') { diff --git a/src/components/PromotionAdmin/DataEdit/Company/InfoCard/Introduction.tsx b/src/components/PromotionAdmin/DataEdit/Company/InfoCard/Introduction.tsx index 90280bb..8792342 100644 --- a/src/components/PromotionAdmin/DataEdit/Company/InfoCard/Introduction.tsx +++ b/src/components/PromotionAdmin/DataEdit/Company/InfoCard/Introduction.tsx @@ -30,7 +30,7 @@ const Introduction = ({ setEditIntroduction }: IIntrodutionProps) => { Main Overview - + Commitment diff --git a/src/components/PromotionPage/Main/ArtworkSlider.tsx b/src/components/PromotionPage/Main/ArtworkSlider.tsx index 37c733c..590017d 100644 --- a/src/components/PromotionPage/Main/ArtworkSlider.tsx +++ b/src/components/PromotionPage/Main/ArtworkSlider.tsx @@ -1,6 +1,9 @@ -import React, { useState, useEffect, useRef } from 'react'; +import React, { useState, useEffect, useRef, lazy } from 'react'; import ArtworkList from './ArtworkList'; import { IArtwork } from '@/types/PromotionPage/artwork'; +import { ARTWORKLIST_DATA } from '@/constants/introdutionConstants'; +import defaultMainImg from '@/assets/images/PP/defaultMainImg.jpg'; // 디폴트 이미지 임포트 + interface IArtworkSliderProps { artworks: IArtwork[]; @@ -30,8 +33,25 @@ const ArtworkSlider: React.FC = ({ artworks }) => { }, [artworks]); if (!artworks || artworks.length === 0) { - return <>표시할 아트워크가 없습니다.; - } // 수정하기 + return ( +
+ { }} + elementHeight={window.innerHeight} + index={0} + /> +
+ ); + } if (artworks.length === 1) { return ( @@ -46,7 +66,7 @@ const ArtworkSlider: React.FC = ({ artworks }) => { link: artworks[0].link, }} count={1} - scrollToSection={() => {}} + scrollToSection={() => { }} elementHeight={window.innerHeight} index={0} /> @@ -78,13 +98,13 @@ const ArtworkSlider: React.FC = ({ artworks }) => { key={activeIndex} data={{ backgroundImg: artworks[activeIndex].mainImg || '', - title: artworks[activeIndex].name || '', + title: artworks[activeIndex].name || ARTWORKLIST_DATA.TITLE, client: artworks[activeIndex].client || '', overview: artworks[activeIndex].overView, link: artworks[activeIndex].link, }} count={artworks.length} - scrollToSection={() => {}} + scrollToSection={() => { }} elementHeight={window.innerHeight} index={activeIndex} /> @@ -111,7 +131,7 @@ const ArtworkSlider: React.FC = ({ artworks }) => { link: artworks[(activeIndex + 1) % artworks.length].link, }} count={artworks.length} - scrollToSection={() => {}} + scrollToSection={() => { }} elementHeight={window.innerHeight} index={(activeIndex + 1) % artworks.length} /> diff --git a/src/components/PromotionPage/Main/Intro.tsx b/src/components/PromotionPage/Main/Intro.tsx index ceb03b9..c0fd41d 100644 --- a/src/components/PromotionPage/Main/Intro.tsx +++ b/src/components/PromotionPage/Main/Intro.tsx @@ -26,15 +26,15 @@ const Intro = () => { div.innerHTML = htmlString; return div.textContent?.trim() === ''; }; - + const fetchData = async () => { try { const data = await getCompanyData(); - + if ( - !data || - Object.keys(data).length === 0 || - isContentEmpty(data.mainOverview) || + !data || + Object.keys(data).length === 0 || + isContentEmpty(data.mainOverview) || isContentEmpty(data.commitment) ) { setCompanyMainOverview(INTRO_DATA.MAIN_OVERVIEW); @@ -45,14 +45,14 @@ const Intro = () => { } } catch (error) { setErrorMessage( - 'Intro Error: ' + + 'Intro Error: ' + (error instanceof Error ? error.message : '에러가 발생했습니다. 관리자에게 문의하세요.') ); } }; - + fetchData(); - }, []); + }, []); if (errorMessage) { return
{errorMessage}
; diff --git a/src/pages/PromotionPage/Main/MainPage.tsx b/src/pages/PromotionPage/Main/MainPage.tsx index d5e106b..3061183 100644 --- a/src/pages/PromotionPage/Main/MainPage.tsx +++ b/src/pages/PromotionPage/Main/MainPage.tsx @@ -70,10 +70,10 @@ const MainPage = () => { setIsModalOpen(false); window.location.reload(); }; - + return ( <> - {isModalOpen &&} + {isModalOpen && }