From 636a8cc9f53942461d9fbed8ed87cbfdadf35667 Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 19:16:21 +0900 Subject: [PATCH 01/13] =?UTF-8?q?Env:=20QA=20=EB=B9=8C=EB=93=9C=20?= =?UTF-8?q?=EB=8C=80=EC=83=81=EC=9D=84=20develop=20=EB=B8=8C=EB=9E=9C?= =?UTF-8?q?=EC=B9=98=EB=A1=9C=20=EB=B3=80=EA=B2=BD=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main-deploy.yml | 6 ++++++ .github/workflows/qa-deploy.yml | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main-deploy.yml b/.github/workflows/main-deploy.yml index ddc90e5..e45d14e 100644 --- a/.github/workflows/main-deploy.yml +++ b/.github/workflows/main-deploy.yml @@ -34,6 +34,9 @@ jobs: echo "SOURCE_PATH=$SOURCE_PATH" >> .env.local echo "NEXT_PUBLIC_CHANNEL_PLUGIN=$NEXT_PUBLIC_CHANNEL_PLUGIN" >> .env.local echo "NEXT_PUBLIC_GOOGLE_ANALYTICS=$NEXT_PUBLIC_GOOGLE_ANALYTICS" >> .env.local + echo "ADMIN_SOURCE_PATH=$ADMIN_SOURCE_PATH" >> .env.local + echo "ADMIN_DESTINATION_URL=$ADMIN_DESTINATION_URL" >> .env.local + echo "ADMIN_TOKEN=$ADMIN_TOKEN" >> .env.local env: ANALYZE: ${{ secrets.ANALYZE }} BASE_URL: ${{ secrets.DEPLOY_BASE_URL }} @@ -45,6 +48,9 @@ jobs: SOURCE_PATH: ${{ secrets.SOURCE_PATH }} NEXT_PUBLIC_CHANNEL_PLUGIN: ${{ secrets.NEXT_PUBLIC_CHANNEL_PLUGIN }} NEXT_PUBLIC_GOOGLE_ANALYTICS: ${{ secrets.NEXT_PUBLIC_GOOGLE_ANALYTICS }} + ADMIN_SOURCE_PATH: ${{ secrets.ADMIN_SOURCE_PATH }} + ADMIN_DESTINATION_URL: ${{ secrets.DEPLOY_ADMIN_DESTINATION_URL }} + ADMIN_TOKEN: ${{ secrets.DEPLOY_ADMIN_TOKEN }} - name: Install dependencies run: yarn install diff --git a/.github/workflows/qa-deploy.yml b/.github/workflows/qa-deploy.yml index eb04ca5..36aaa20 100644 --- a/.github/workflows/qa-deploy.yml +++ b/.github/workflows/qa-deploy.yml @@ -3,7 +3,7 @@ name: dev-recruit CI/CD on: push: branches: - - qa/* + - develop env: S3_BUCKET_NAME: dev-recruit.mash-up @@ -34,6 +34,9 @@ jobs: echo "SOURCE_PATH=$SOURCE_PATH" >> .env.local echo "NEXT_PUBLIC_CHANNEL_PLUGIN=$NEXT_PUBLIC_CHANNEL_PLUGIN" >> .env.local echo "NEXT_PUBLIC_GOOGLE_ANALYTICS=$NEXT_PUBLIC_GOOGLE_ANALYTICS" >> .env.local + echo "ADMIN_SOURCE_PATH=$ADMIN_SOURCE_PATH" >> .env.local + echo "ADMIN_DESTINATION_URL=$ADMIN_DESTINATION_URL" >> .env.local + echo "ADMIN_TOKEN=$ADMIN_TOKEN" >> .env.local env: ANALYZE: ${{ secrets.ANALYZE }} BASE_URL: ${{ secrets.BASE_URL }} @@ -45,6 +48,9 @@ jobs: SOURCE_PATH: ${{ secrets.SOURCE_PATH }} NEXT_PUBLIC_CHANNEL_PLUGIN: ${{ secrets.NEXT_PUBLIC_CHANNEL_PLUGIN }} NEXT_PUBLIC_GOOGLE_ANALYTICS: ${{ secrets.NEXT_PUBLIC_GOOGLE_ANALYTICS }} + ADMIN_SOURCE_PATH: ${{ secrets.ADMIN_SOURCE_PATH }} + ADMIN_DESTINATION_URL: ${{ secrets.ADMIN_DESTINATION_URL }} + ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }} - name: Install dependencies run: yarn install From 04ef1f39d667350c198b10e45c738887a782c858 Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 19:22:25 +0900 Subject: [PATCH 02/13] =?UTF-8?q?Env:=20editorjs=20->=20HTML=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=ED=99=98=EC=9D=84=20=EC=88=98=ED=96=89=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20=EC=9C=84=ED=95=9C=20=ED=8C=A8=ED=82=A4=EC=A7=80?= =?UTF-8?q?=EB=A5=BC=20=EC=B6=94=EA=B0=80=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + yarn.lock | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/package.json b/package.json index 2a5b6c4..0e8daac 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "@next/bundle-analyzer": "^12.1.0", "aos": "^3.0.0-beta.6", "axios": "^0.26.0", + "editorjs-html": "^3.4.3", "lodash-es": "^4.17.21", "lottie-web": "^5.9.1", "next": "12.3.4", diff --git a/yarn.lock b/yarn.lock index acb77b3..937f6c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5621,6 +5621,11 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== +editorjs-html@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/editorjs-html/-/editorjs-html-3.4.3.tgz#81c089ba69df3a702a7535ec34ee276a6444668e" + integrity sha512-HMqQ3BCE98uhSpJsbfH0c3CoMctUMCHlap2Eq/7/VjaHas+g3IJqyf+ERtMByoQCzvcW22ISYaZEeE7rGkd8Xg== + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" From a29d770523459e7b5579d31db9367fc0bfa5e98f Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 19:25:24 +0900 Subject: [PATCH 03/13] =?UTF-8?q?Refactor:=20=EC=82=AC=EC=9A=A9=EB=90=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=EB=A5=BC=20=EC=A0=9C=EA=B1=B0=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformInformation.component.tsx | 17 ---------- .../PlatformInformation.styled.ts | 32 ------------------- .../PlatformInterviewSchedule.component.tsx | 16 ---------- .../PlatformInterviewSchedule.styled.ts | 16 ---------- .../PlatformStudy/PlatformStudy.component.tsx | 16 ---------- .../PlatformStudy/PlatformStudy.styled.ts | 16 ---------- .../PlatformTalent.component.tsx | 16 ---------- .../PlatformTalent/PlatformTalent.styled.ts | 16 ---------- 8 files changed, 145 deletions(-) delete mode 100644 src/components/recruit/PlatformInformation/PlatformInformation.component.tsx delete mode 100644 src/components/recruit/PlatformInformation/PlatformInformation.styled.ts delete mode 100644 src/components/recruit/PlatformInterviewSchedule/PlatformInterviewSchedule.component.tsx delete mode 100644 src/components/recruit/PlatformInterviewSchedule/PlatformInterviewSchedule.styled.ts delete mode 100644 src/components/recruit/PlatformStudy/PlatformStudy.component.tsx delete mode 100644 src/components/recruit/PlatformStudy/PlatformStudy.styled.ts delete mode 100644 src/components/recruit/PlatformTalent/PlatformTalent.component.tsx delete mode 100644 src/components/recruit/PlatformTalent/PlatformTalent.styled.ts diff --git a/src/components/recruit/PlatformInformation/PlatformInformation.component.tsx b/src/components/recruit/PlatformInformation/PlatformInformation.component.tsx deleted file mode 100644 index f1b44c4..0000000 --- a/src/components/recruit/PlatformInformation/PlatformInformation.component.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { ReactNode } from 'react'; -import * as Styled from './PlatformInformation.styled'; - -interface PlatformInformationProps { - name: string; - children: ReactNode; -} - -const PlatformInformation = ({ name, children }: PlatformInformationProps) => { - return ( - - {name} 팀 소개 - {children} - - ); -}; -export default PlatformInformation; diff --git a/src/components/recruit/PlatformInformation/PlatformInformation.styled.ts b/src/components/recruit/PlatformInformation/PlatformInformation.styled.ts deleted file mode 100644 index 6653915..0000000 --- a/src/components/recruit/PlatformInformation/PlatformInformation.styled.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { css } from '@emotion/react'; -import styled from '@emotion/styled'; - -export const Container = styled.div` - ${({ theme }) => css` - color: ${theme.colors.gray70}; - `} -`; - -export const Heading = styled.h3` - ${({ theme }) => css` - ${theme.fonts.kr.bold18}; - margin: 1.6rem 0; - color: ${theme.colors.gray80}; - `} -`; - -export const Paragraph = styled.p` - ${({ theme }) => css` - ${theme.fonts.kr.medium16}; - - width: 100%; - - @media (max-width: ${theme.breakPoint.media.tabletL}) { - width: 60rem; - } - - @media (max-width: ${theme.breakPoint.media.tabletS}) { - width: 100%; - } - `} -`; diff --git a/src/components/recruit/PlatformInterviewSchedule/PlatformInterviewSchedule.component.tsx b/src/components/recruit/PlatformInterviewSchedule/PlatformInterviewSchedule.component.tsx deleted file mode 100644 index ce333fd..0000000 --- a/src/components/recruit/PlatformInterviewSchedule/PlatformInterviewSchedule.component.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { ReactNode } from 'react'; -import * as Styled from './PlatformInterviewSchedule.styled'; - -interface PlatformInterviewScheduleProps { - children: ReactNode; -} - -const PlatformInterviewSchedule = ({ children }: PlatformInterviewScheduleProps) => { - return ( - - 예상 면접일시 - {children} - - ); -}; -export default PlatformInterviewSchedule; diff --git a/src/components/recruit/PlatformInterviewSchedule/PlatformInterviewSchedule.styled.ts b/src/components/recruit/PlatformInterviewSchedule/PlatformInterviewSchedule.styled.ts deleted file mode 100644 index 229e64e..0000000 --- a/src/components/recruit/PlatformInterviewSchedule/PlatformInterviewSchedule.styled.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { css } from '@emotion/react'; -import styled from '@emotion/styled'; - -export const Container = styled.div` - ${({ theme }) => css` - color: ${theme.colors.gray70}; - `} -`; - -export const Heading = styled.h3` - ${({ theme }) => css` - ${theme.fonts.kr.bold18}; - margin: 1.6rem 0; - color: ${theme.colors.gray80}; - `} -`; diff --git a/src/components/recruit/PlatformStudy/PlatformStudy.component.tsx b/src/components/recruit/PlatformStudy/PlatformStudy.component.tsx deleted file mode 100644 index ba6bbc9..0000000 --- a/src/components/recruit/PlatformStudy/PlatformStudy.component.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { ReactNode } from 'react'; -import * as Styled from './PlatformStudy.styled'; - -interface PlatformStudyProps { - children: ReactNode; -} - -const PlatformStudy = ({ children }: PlatformStudyProps) => { - return ( - - 스터디 - {children} - - ); -}; -export default PlatformStudy; diff --git a/src/components/recruit/PlatformStudy/PlatformStudy.styled.ts b/src/components/recruit/PlatformStudy/PlatformStudy.styled.ts deleted file mode 100644 index 229e64e..0000000 --- a/src/components/recruit/PlatformStudy/PlatformStudy.styled.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { css } from '@emotion/react'; -import styled from '@emotion/styled'; - -export const Container = styled.div` - ${({ theme }) => css` - color: ${theme.colors.gray70}; - `} -`; - -export const Heading = styled.h3` - ${({ theme }) => css` - ${theme.fonts.kr.bold18}; - margin: 1.6rem 0; - color: ${theme.colors.gray80}; - `} -`; diff --git a/src/components/recruit/PlatformTalent/PlatformTalent.component.tsx b/src/components/recruit/PlatformTalent/PlatformTalent.component.tsx deleted file mode 100644 index 7b75de9..0000000 --- a/src/components/recruit/PlatformTalent/PlatformTalent.component.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { ReactNode } from 'react'; -import * as Styled from './PlatformTalent.styled'; - -interface PlatformTalentProps { - children: ReactNode; -} - -const PlatformTalent = ({ children }: PlatformTalentProps) => { - return ( - - 인재상 - {children} - - ); -}; -export default PlatformTalent; diff --git a/src/components/recruit/PlatformTalent/PlatformTalent.styled.ts b/src/components/recruit/PlatformTalent/PlatformTalent.styled.ts deleted file mode 100644 index 229e64e..0000000 --- a/src/components/recruit/PlatformTalent/PlatformTalent.styled.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { css } from '@emotion/react'; -import styled from '@emotion/styled'; - -export const Container = styled.div` - ${({ theme }) => css` - color: ${theme.colors.gray70}; - `} -`; - -export const Heading = styled.h3` - ${({ theme }) => css` - ${theme.fonts.kr.bold18}; - margin: 1.6rem 0; - color: ${theme.colors.gray80}; - `} -`; From 487ac2fed06fac23b72ff328bbfe74040075833b Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 19:26:07 +0900 Subject: [PATCH 04/13] =?UTF-8?q?Env:=20=EC=96=B4=EB=93=9C=EB=AF=BC=20API?= =?UTF-8?q?=20=EC=9A=94=EC=B2=AD=EC=9D=84=20=EC=9C=84=ED=95=B4=20=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20=ED=99=98=EA=B2=BD=EB=B3=80=EC=88=98?= =?UTF-8?q?=EB=A5=BC=20=EC=A0=95=EC=9D=98=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- @types/custom-types/process.d.ts | 3 +++ next.config.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/@types/custom-types/process.d.ts b/@types/custom-types/process.d.ts index 5e51b26..451d58f 100644 --- a/@types/custom-types/process.d.ts +++ b/@types/custom-types/process.d.ts @@ -10,5 +10,8 @@ declare namespace NodeJS { NEXT_PUBLIC_CHANNEL_PLUGIN: string; DESTINATION_URL: string; SOURCE_PATH: string; + ADMIN_SOURCE_PATH: string; + ADMIN_DESTINATION_PATH: string; + ADMIN_TOKEN: string; } } diff --git a/next.config.js b/next.config.js index b96bce1..d67ffda 100644 --- a/next.config.js +++ b/next.config.js @@ -8,13 +8,16 @@ const nextConfig = { env: { BASE_URL: process.env.BASE_URL, }, - // eslint-disable-next-line consistent-return async rewrites() { return [ { source: '/api/auth/:path*', destination: '/api/auth/:path*', }, + { + source: process.env.ADMIN_SOURCE_PATH, + destination: process.env.ADMIN_DESTINATION_URL, + }, { source: process.env.SOURCE_PATH, destination: process.env.DESTINATION_URL, From f14cd5488a6a0228afd85bea27cff2c8b76d3eec Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 19:29:54 +0900 Subject: [PATCH 05/13] =?UTF-8?q?Feat:=20=EC=96=B4=EB=93=9C=EB=AF=BC=20API?= =?UTF-8?q?=20=EC=84=9C=EB=B9=84=EC=8A=A4=20=ED=81=B4=EB=9E=98=EC=8A=A4?= =?UTF-8?q?=EB=A5=BC=20=EC=A0=95=EC=9D=98=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/services/admin.ts | 40 +++++++++++++++++++++++++++++++++++++++ src/api/services/index.ts | 1 + src/types/dto/admin.ts | 18 ++++++++++++++++++ src/types/dto/index.ts | 1 + 4 files changed, 60 insertions(+) create mode 100644 src/api/services/admin.ts create mode 100644 src/types/dto/admin.ts diff --git a/src/api/services/admin.ts b/src/api/services/admin.ts new file mode 100644 index 0000000..709ee9c --- /dev/null +++ b/src/api/services/admin.ts @@ -0,0 +1,40 @@ +import { + StorageKeysResponse, + StorageDataResponse, + StorageDataRequest, + StorageKeysRequest, +} from '@/types/dto'; +import BaseApiService from './base'; + +class AdminApiService extends BaseApiService { + public constructor() { + super('admin'); + } + + public getKeysFromStorage({ accessToken }: StorageKeysRequest): Promise { + return this.http + .get('/storage/keys', { + headers: { + Authorization: `Bearer ${accessToken}`, + }, + }) + .then(BaseApiService.handleResponse) + .catch(BaseApiService.handleError); + } + + public getRecruitDataFromStorage({ + accessToken, + key, + }: StorageDataRequest): Promise { + return this.http + .get(`/storage/key/recruit-${key}`, { + headers: { + Authorization: `Bearer ${accessToken}`, + }, + }) + .then(BaseApiService.handleResponse) + .catch(BaseApiService.handleError); + } +} + +export default new AdminApiService(); diff --git a/src/api/services/index.ts b/src/api/services/index.ts index 7aef809..f2afc09 100644 --- a/src/api/services/index.ts +++ b/src/api/services/index.ts @@ -1,3 +1,4 @@ export { default as applicantApiService } from './applicant'; export { default as applicationApiService } from './application'; export { default as teamApiService } from './team'; +export { default as adminApiService } from './admin'; diff --git a/src/types/dto/admin.ts b/src/types/dto/admin.ts new file mode 100644 index 0000000..4c07774 --- /dev/null +++ b/src/types/dto/admin.ts @@ -0,0 +1,18 @@ +import { BaseRequest, BaseResponse } from '@/types/dto/base'; + +export interface StorageKeysRequest extends BaseRequest {} + +export interface StorageKeysResponseData { + keyStrings: string[]; +} + +export interface StorageKeysResponse extends BaseResponse {} + +export interface StorageDataRequest extends BaseRequest { + key: string; +} + +export interface StorageDataResponseData { + valueMap: Record; +} +export interface StorageDataResponse extends BaseResponse {} diff --git a/src/types/dto/index.ts b/src/types/dto/index.ts index 53cd6f2..e79e4d3 100644 --- a/src/types/dto/index.ts +++ b/src/types/dto/index.ts @@ -1,3 +1,4 @@ export * from './team'; export * from './applicant'; export * from './application'; +export * from './admin'; From 106bb541c71de40967459052ebeb3c8df58c1d42 Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 19:31:43 +0900 Subject: [PATCH 06/13] =?UTF-8?q?Feat:=20CMS=20=EB=8D=B0=EC=9D=B4=ED=84=B0?= =?UTF-8?q?=EB=A5=BC=20=EC=9D=B4=EC=9A=A9=ED=95=B4=20UI=EB=A5=BC=20?= =?UTF-8?q?=EB=A0=8C=EB=8D=94=EB=A7=81=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/recruit/[platformName].tsx | 80 +++++++++++-------- .../RecruitEditorContainer.component.tsx | 10 +++ .../RecruitEditorContainer.styled.ts | 46 +++++++++++ src/components/recruit/index.ts | 5 +- 4 files changed, 105 insertions(+), 36 deletions(-) create mode 100644 src/components/recruit/RecruitEditorContainer/RecruitEditorContainer.component.tsx create mode 100644 src/components/recruit/RecruitEditorContainer/RecruitEditorContainer.styled.ts diff --git a/pages/recruit/[platformName].tsx b/pages/recruit/[platformName].tsx index b2e01c8..700498a 100644 --- a/pages/recruit/[platformName].tsx +++ b/pages/recruit/[platformName].tsx @@ -1,23 +1,22 @@ import { GetStaticPaths, GetStaticProps, NextPage } from 'next'; import { ParsedUrlQuery } from 'querystring'; import { PlatformKey, platformMap, platforms } from '@/constants'; +import editorjsHTML from 'editorjs-html'; +import { unescape, flow, toLower } from 'lodash-es'; import { RecruitHeader, PlatformHero, Divider, BottomNavigation, NavigationHeader, - PlatformInformation, - PlatformTalent, - PlatformInterviewSchedule, - PlatformStudy, - ActionGroup, - RecruitLayout, RecruitContents, + RecruitLayout, ApplyLinkButton, - BulletedList, + ActionGroup, + RecruitEditorContainer, SEO, } from '@/components'; +import { adminApiService } from '@/api/services'; interface Params extends ParsedUrlQuery { platformName: PlatformKey; @@ -25,17 +24,14 @@ interface Params extends ParsedUrlQuery { interface PlatformProps { platformName: PlatformKey; + html: string; } -const Platform: NextPage = ({ platformName }) => { +const Platform: NextPage = ({ platformName, html }) => { const { name: currentPlatformName, role: currentPlatformRole, path: currentPlatformPath, - introduction: currentPlatformIntroduction, - study: currentPlatformStudy, - talent: currentPlatformTalent, - interview: currentPlatformInterview, hero: currentPlatformHero, } = platformMap[platformName]; @@ -50,18 +46,7 @@ const Platform: NextPage = ({ platformName }) => { - - {currentPlatformIntroduction} - - - - - - - - - - + @@ -74,15 +59,32 @@ const Platform: NextPage = ({ platformName }) => { }; export const getStaticPaths: GetStaticPaths = async () => { + const [prefix, separator] = ['recruit', '-']; + + const { data } = await adminApiService.getKeysFromStorage({ + accessToken: process.env.ADMIN_TOKEN, + }); + + const paths = data.keyStrings + .map(toLower) + .filter((key: string) => key.includes(`${prefix}${separator}`)) + .filter((key: string) => + [ + `${prefix}${separator}ios`, + `${prefix}${separator}web`, + `${prefix}${separator}android`, + `${prefix}${separator}spring`, + `${prefix}${separator}design`, + `${prefix}${separator}node`, + ].includes(key), + ) + .map((key: string) => { + const [, platformName] = key.split(separator); + return { params: { platformName: platformName as PlatformKey } }; + }); + return { - paths: [ - { params: { platformName: 'ios' } }, - { params: { platformName: 'web' } }, - { params: { platformName: 'android' } }, - { params: { platformName: 'spring' } }, - { params: { platformName: 'design' } }, - { params: { platformName: 'node' } }, - ], + paths, fallback: false, }; }; @@ -90,10 +92,24 @@ export const getStaticPaths: GetStaticPaths = async () => { export const getStaticProps: GetStaticProps = async (context) => { const { platformName } = context.params!; + const removeWrongAmpString = (value: string) => value.replace(/&/g, '&'); + + const { data } = await adminApiService.getRecruitDataFromStorage({ + accessToken: process.env.ADMIN_TOKEN, + key: platformName, + }); + + const html = editorjsHTML() + .parse(data.valueMap.editorData) + .map(flow(removeWrongAmpString, unescape)) + .join(''); + return { props: { platformName, + html, }, + revalidate: 60 * 60 * 24, }; }; diff --git a/src/components/recruit/RecruitEditorContainer/RecruitEditorContainer.component.tsx b/src/components/recruit/RecruitEditorContainer/RecruitEditorContainer.component.tsx new file mode 100644 index 0000000..72ce42b --- /dev/null +++ b/src/components/recruit/RecruitEditorContainer/RecruitEditorContainer.component.tsx @@ -0,0 +1,10 @@ +import type { ComponentProps } from 'react'; +import * as Styled from './RecruitEditorContainer.styled'; + +interface RecruitEditorContainerProps extends ComponentProps<'div'> {} + +const RecruitEditorContainer = (props: RecruitEditorContainerProps) => { + return ; +}; + +export default RecruitEditorContainer; diff --git a/src/components/recruit/RecruitEditorContainer/RecruitEditorContainer.styled.ts b/src/components/recruit/RecruitEditorContainer/RecruitEditorContainer.styled.ts new file mode 100644 index 0000000..ebd75b6 --- /dev/null +++ b/src/components/recruit/RecruitEditorContainer/RecruitEditorContainer.styled.ts @@ -0,0 +1,46 @@ +import { css } from '@emotion/react'; +import styled from '@emotion/styled'; + +export const Container = styled.div` + ${({ theme }) => css` + h3 { + ${theme.fonts.kr.bold18}; + margin: 1.6rem 0; + color: ${theme.colors.gray80}; + } + + p { + ${theme.fonts.kr.medium16}; + width: 100%; + + @media (max-width: ${theme.breakPoint.media.tabletL}) { + width: 60rem; + } + + @media (max-width: ${theme.breakPoint.media.tabletS}) { + width: 100%; + } + } + + ul { + ${theme.fonts.kr.medium16}; + margin-left: 2.4rem; + color: ${theme.colors.gray70}; + list-style-type: disc; + + & > * { + margin: 0.6rem 0; + } + } + + li { + &:first-of-type { + margin: 0; + } + + & > ul { + margin: 0.6rem 0 0 2.4rem; + } + } + `} +`; diff --git a/src/components/recruit/index.ts b/src/components/recruit/index.ts index 2fd2bf9..f5a11db 100644 --- a/src/components/recruit/index.ts +++ b/src/components/recruit/index.ts @@ -3,12 +3,9 @@ export { default as RecruitHeader } from './RecruitHeader/RecruitHeader.componen export { default as Divider } from './Divider/Divider.component'; export { default as BottomNavigation } from './BottomNavigation/BottomNavigation.component'; export { default as NavigationHeader } from './NavigationHeader/NavigationHeader.component'; -export { default as PlatformTalent } from './PlatformTalent/PlatformTalent.component'; -export { default as PlatformInformation } from './PlatformInformation/PlatformInformation.component'; -export { default as PlatformInterviewSchedule } from './PlatformInterviewSchedule/PlatformInterviewSchedule.component'; export { default as ActionGroup } from './ActionGroup/ActionGroup.component'; export { default as ApplyLinkButton } from './ApplyLinkButton/ApplyLinkButton.component'; export { default as RecruitLayout } from './RecruitLayout/RecruitLayout.component'; export { default as RecruitDate } from './RecruitDate/RecruitDate.component'; -export { default as PlatformStudy } from './PlatformStudy/PlatformStudy.component'; export { default as RecruitContents } from './RecruitContents/RecruitContents.component'; +export { default as RecruitEditorContainer } from './RecruitEditorContainer/RecruitEditorContainer.component'; From c7532ba64316ecd26e978d4ba911a0d1c58f88b2 Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 19:58:01 +0900 Subject: [PATCH 07/13] =?UTF-8?q?Refactor:=20path=20=EC=B6=94=EB=A1=A0=20?= =?UTF-8?q?=EC=8B=9C=20=EC=A0=81=EC=9A=A9=ED=95=98=EB=8A=94=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=EC=9D=84=20=EA=B0=84=EC=86=8C=ED=99=94=ED=95=9C?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/recruit/[platformName].tsx | 29 +++++------------------------ src/api/services/admin.ts | 18 +----------------- src/types/dto/admin.ts | 8 -------- 3 files changed, 6 insertions(+), 49 deletions(-) diff --git a/pages/recruit/[platformName].tsx b/pages/recruit/[platformName].tsx index 700498a..cd6809f 100644 --- a/pages/recruit/[platformName].tsx +++ b/pages/recruit/[platformName].tsx @@ -1,8 +1,8 @@ import { GetStaticPaths, GetStaticProps, NextPage } from 'next'; import { ParsedUrlQuery } from 'querystring'; -import { PlatformKey, platformMap, platforms } from '@/constants'; +import { PlatformKey, platformKeys, platformMap, platforms } from '@/constants'; import editorjsHTML from 'editorjs-html'; -import { unescape, flow, toLower } from 'lodash-es'; +import { unescape, flow } from 'lodash-es'; import { RecruitHeader, PlatformHero, @@ -17,6 +17,7 @@ import { SEO, } from '@/components'; import { adminApiService } from '@/api/services'; +import { objectKeys } from '@/utils/object'; interface Params extends ParsedUrlQuery { platformName: PlatformKey; @@ -59,30 +60,10 @@ const Platform: NextPage = ({ platformName, html }) => { }; export const getStaticPaths: GetStaticPaths = async () => { - const [prefix, separator] = ['recruit', '-']; - - const { data } = await adminApiService.getKeysFromStorage({ - accessToken: process.env.ADMIN_TOKEN, + const paths = objectKeys(platformKeys).map((platformKey) => { + return { params: { platformName: platformKey } }; }); - const paths = data.keyStrings - .map(toLower) - .filter((key: string) => key.includes(`${prefix}${separator}`)) - .filter((key: string) => - [ - `${prefix}${separator}ios`, - `${prefix}${separator}web`, - `${prefix}${separator}android`, - `${prefix}${separator}spring`, - `${prefix}${separator}design`, - `${prefix}${separator}node`, - ].includes(key), - ) - .map((key: string) => { - const [, platformName] = key.split(separator); - return { params: { platformName: platformName as PlatformKey } }; - }); - return { paths, fallback: false, diff --git a/src/api/services/admin.ts b/src/api/services/admin.ts index 709ee9c..44b864c 100644 --- a/src/api/services/admin.ts +++ b/src/api/services/admin.ts @@ -1,9 +1,4 @@ -import { - StorageKeysResponse, - StorageDataResponse, - StorageDataRequest, - StorageKeysRequest, -} from '@/types/dto'; +import { StorageDataResponse, StorageDataRequest } from '@/types/dto'; import BaseApiService from './base'; class AdminApiService extends BaseApiService { @@ -11,17 +6,6 @@ class AdminApiService extends BaseApiService { super('admin'); } - public getKeysFromStorage({ accessToken }: StorageKeysRequest): Promise { - return this.http - .get('/storage/keys', { - headers: { - Authorization: `Bearer ${accessToken}`, - }, - }) - .then(BaseApiService.handleResponse) - .catch(BaseApiService.handleError); - } - public getRecruitDataFromStorage({ accessToken, key, diff --git a/src/types/dto/admin.ts b/src/types/dto/admin.ts index 4c07774..b601b3e 100644 --- a/src/types/dto/admin.ts +++ b/src/types/dto/admin.ts @@ -1,13 +1,5 @@ import { BaseRequest, BaseResponse } from '@/types/dto/base'; -export interface StorageKeysRequest extends BaseRequest {} - -export interface StorageKeysResponseData { - keyStrings: string[]; -} - -export interface StorageKeysResponse extends BaseResponse {} - export interface StorageDataRequest extends BaseRequest { key: string; } From 2fc8c6f3889353caba1778b6a45b043861b96037 Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 20:33:38 +0900 Subject: [PATCH 08/13] =?UTF-8?q?Env:=20=EC=96=B4=EB=93=9C=EB=AF=BC=20API?= =?UTF-8?q?=20=EA=B2=BD=EB=A1=9C=EB=A5=BC=20=ED=99=98=EA=B2=BD=EB=B3=80?= =?UTF-8?q?=EC=88=98=EB=A1=9C=20=EC=A0=95=EC=9D=98=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main-deploy.yml | 6 ++---- .github/workflows/qa-deploy.yml | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main-deploy.yml b/.github/workflows/main-deploy.yml index e45d14e..a6ddb58 100644 --- a/.github/workflows/main-deploy.yml +++ b/.github/workflows/main-deploy.yml @@ -34,8 +34,7 @@ jobs: echo "SOURCE_PATH=$SOURCE_PATH" >> .env.local echo "NEXT_PUBLIC_CHANNEL_PLUGIN=$NEXT_PUBLIC_CHANNEL_PLUGIN" >> .env.local echo "NEXT_PUBLIC_GOOGLE_ANALYTICS=$NEXT_PUBLIC_GOOGLE_ANALYTICS" >> .env.local - echo "ADMIN_SOURCE_PATH=$ADMIN_SOURCE_PATH" >> .env.local - echo "ADMIN_DESTINATION_URL=$ADMIN_DESTINATION_URL" >> .env.local + echo "ADMIN_DESTINATION_PATH=$ADMIN_DESTINATION_PATH" >> .env.local echo "ADMIN_TOKEN=$ADMIN_TOKEN" >> .env.local env: ANALYZE: ${{ secrets.ANALYZE }} @@ -48,8 +47,7 @@ jobs: SOURCE_PATH: ${{ secrets.SOURCE_PATH }} NEXT_PUBLIC_CHANNEL_PLUGIN: ${{ secrets.NEXT_PUBLIC_CHANNEL_PLUGIN }} NEXT_PUBLIC_GOOGLE_ANALYTICS: ${{ secrets.NEXT_PUBLIC_GOOGLE_ANALYTICS }} - ADMIN_SOURCE_PATH: ${{ secrets.ADMIN_SOURCE_PATH }} - ADMIN_DESTINATION_URL: ${{ secrets.DEPLOY_ADMIN_DESTINATION_URL }} + ADMIN_DESTINATION_PATH: ${{ secrets.DEPLOY_ADMIN_DESTINATION_PATH }} ADMIN_TOKEN: ${{ secrets.DEPLOY_ADMIN_TOKEN }} - name: Install dependencies diff --git a/.github/workflows/qa-deploy.yml b/.github/workflows/qa-deploy.yml index 36aaa20..f7f9149 100644 --- a/.github/workflows/qa-deploy.yml +++ b/.github/workflows/qa-deploy.yml @@ -34,8 +34,7 @@ jobs: echo "SOURCE_PATH=$SOURCE_PATH" >> .env.local echo "NEXT_PUBLIC_CHANNEL_PLUGIN=$NEXT_PUBLIC_CHANNEL_PLUGIN" >> .env.local echo "NEXT_PUBLIC_GOOGLE_ANALYTICS=$NEXT_PUBLIC_GOOGLE_ANALYTICS" >> .env.local - echo "ADMIN_SOURCE_PATH=$ADMIN_SOURCE_PATH" >> .env.local - echo "ADMIN_DESTINATION_URL=$ADMIN_DESTINATION_URL" >> .env.local + echo "ADMIN_DESTINATION_PATH=$ADMIN_DESTINATION_PATH" >> .env.local echo "ADMIN_TOKEN=$ADMIN_TOKEN" >> .env.local env: ANALYZE: ${{ secrets.ANALYZE }} @@ -48,8 +47,7 @@ jobs: SOURCE_PATH: ${{ secrets.SOURCE_PATH }} NEXT_PUBLIC_CHANNEL_PLUGIN: ${{ secrets.NEXT_PUBLIC_CHANNEL_PLUGIN }} NEXT_PUBLIC_GOOGLE_ANALYTICS: ${{ secrets.NEXT_PUBLIC_GOOGLE_ANALYTICS }} - ADMIN_SOURCE_PATH: ${{ secrets.ADMIN_SOURCE_PATH }} - ADMIN_DESTINATION_URL: ${{ secrets.ADMIN_DESTINATION_URL }} + ADMIN_DESTINATION_PATH: ${{ secrets.ADMIN_DESTINATION_PATH }} ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }} - name: Install dependencies From 1d4d0a947fb4bc519f0b71542735de5db9c093bc Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 20:34:10 +0900 Subject: [PATCH 09/13] =?UTF-8?q?Refactor:=20=EC=84=9C=EB=B2=84=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=82=AC=EC=9A=A9=EB=90=A0=20axios=20=EC=9D=B8?= =?UTF-8?q?=EC=8A=A4=ED=84=B4=EC=8A=A4=EB=A5=BC=20=EB=8C=80=EC=9D=91?= =?UTF-8?q?=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- @types/custom-types/process.d.ts | 1 - next.config.js | 4 ---- src/api/services/admin.ts | 2 +- src/api/services/base.ts | 4 ++-- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/@types/custom-types/process.d.ts b/@types/custom-types/process.d.ts index 451d58f..8aff512 100644 --- a/@types/custom-types/process.d.ts +++ b/@types/custom-types/process.d.ts @@ -10,7 +10,6 @@ declare namespace NodeJS { NEXT_PUBLIC_CHANNEL_PLUGIN: string; DESTINATION_URL: string; SOURCE_PATH: string; - ADMIN_SOURCE_PATH: string; ADMIN_DESTINATION_PATH: string; ADMIN_TOKEN: string; } diff --git a/next.config.js b/next.config.js index d67ffda..dff45e9 100644 --- a/next.config.js +++ b/next.config.js @@ -14,10 +14,6 @@ const nextConfig = { source: '/api/auth/:path*', destination: '/api/auth/:path*', }, - { - source: process.env.ADMIN_SOURCE_PATH, - destination: process.env.ADMIN_DESTINATION_URL, - }, { source: process.env.SOURCE_PATH, destination: process.env.DESTINATION_URL, diff --git a/src/api/services/admin.ts b/src/api/services/admin.ts index 44b864c..b1f0255 100644 --- a/src/api/services/admin.ts +++ b/src/api/services/admin.ts @@ -3,7 +3,7 @@ import BaseApiService from './base'; class AdminApiService extends BaseApiService { public constructor() { - super('admin'); + super(undefined, process.env.ADMIN_DESTINATION_PATH); } public getRecruitDataFromStorage({ diff --git a/src/api/services/base.ts b/src/api/services/base.ts index ef230ec..f6bfde6 100644 --- a/src/api/services/base.ts +++ b/src/api/services/base.ts @@ -3,9 +3,9 @@ import axios, { AxiosInstance, AxiosResponse } from 'axios'; abstract class BaseApiService { protected readonly http: AxiosInstance; - protected constructor(protected readonly path?: string) { + protected constructor(protected readonly path?: string, protected readonly baseURL?: string) { this.http = axios.create({ - baseURL: `${process.env.BASE_URL ?? ''}/api/${path ?? ''}`, + baseURL: baseURL ?? `${process.env.BASE_URL ?? ''}/api/${path ?? ''}`, headers: { 'Content-Type': 'application/json', }, From 9c5d002dda0590d3aef1558b7f69f884a6aa4c4e Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 20:51:28 +0900 Subject: [PATCH 10/13] =?UTF-8?q?Env:=20DEV=20=ED=99=98=EA=B2=BD=20S3=20Bu?= =?UTF-8?q?cket=20=EC=9D=B4=EB=A6=84=EC=9D=84=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/qa-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qa-deploy.yml b/.github/workflows/qa-deploy.yml index f7f9149..0ba832e 100644 --- a/.github/workflows/qa-deploy.yml +++ b/.github/workflows/qa-deploy.yml @@ -6,7 +6,7 @@ on: - develop env: - S3_BUCKET_NAME: dev-recruit.mash-up + S3_BUCKET_NAME: dev-recruit.mash-up.kr CODE_DEPLOY_APPLICATION_NAME: dev-recruit-cd CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: dev-recruit From cde05821ad38394d97ac246d98b79beff8e2ee9b Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 20:52:39 +0900 Subject: [PATCH 11/13] =?UTF-8?q?Env:=20CODE=20DEPLOY=20=EC=95=A0=ED=94=8C?= =?UTF-8?q?=EB=A6=AC=EC=BC=80=EC=9D=B4=EC=85=98=20=EC=9D=B4=EB=A6=84?= =?UTF-8?q?=EC=9D=84=20=EC=88=98=EC=A0=95=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/qa-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qa-deploy.yml b/.github/workflows/qa-deploy.yml index 0ba832e..e5ad1bc 100644 --- a/.github/workflows/qa-deploy.yml +++ b/.github/workflows/qa-deploy.yml @@ -7,7 +7,7 @@ on: env: S3_BUCKET_NAME: dev-recruit.mash-up.kr - CODE_DEPLOY_APPLICATION_NAME: dev-recruit-cd + CODE_DEPLOY_APPLICATION_NAME: dev-recruit-code-deploy CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: dev-recruit jobs: From efe39ad8681bf3690377b188a4516c82ff179c3d Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 22:17:14 +0900 Subject: [PATCH 12/13] =?UTF-8?q?Env:=20AWS=20Access=20Key,=20Secret?= =?UTF-8?q?=EC=9D=84=20DEPLOY=EB=A1=9C=20=EB=B3=80=EA=B2=BD=ED=95=9C?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/qa-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/qa-deploy.yml b/.github/workflows/qa-deploy.yml index e5ad1bc..10e1bd8 100644 --- a/.github/workflows/qa-deploy.yml +++ b/.github/workflows/qa-deploy.yml @@ -63,8 +63,8 @@ jobs: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-access-key-id: ${{ secrets.DEPLOY_AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.DEPLOY_AWS_SECRET_ACCESS_KEY }} aws-region: ap-northeast-2 - name: Upload to S3 From 6b64af5b89e79442ef9a5d22140d240dfdf6883a Mon Sep 17 00:00:00 2001 From: Baek2back Date: Sat, 29 Jul 2023 23:53:28 +0900 Subject: [PATCH 13/13] =?UTF-8?q?Feat:=20=EA=B0=9C=ED=96=89=EC=9D=84=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=ED=95=98=EA=B8=B0=20=EC=9C=84=ED=95=B4=20p?= =?UTF-8?q?=20=ED=83=9C=EA=B7=B8=EC=9D=98=20=EC=B5=9C=EC=86=8C=20=EB=86=92?= =?UTF-8?q?=EC=9D=B4=EB=A5=BC=20=EC=A7=80=EC=A0=95=ED=95=B4=EC=A4=80?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RecruitEditorContainer/RecruitEditorContainer.styled.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/recruit/RecruitEditorContainer/RecruitEditorContainer.styled.ts b/src/components/recruit/RecruitEditorContainer/RecruitEditorContainer.styled.ts index ebd75b6..b8f6463 100644 --- a/src/components/recruit/RecruitEditorContainer/RecruitEditorContainer.styled.ts +++ b/src/components/recruit/RecruitEditorContainer/RecruitEditorContainer.styled.ts @@ -12,6 +12,7 @@ export const Container = styled.div` p { ${theme.fonts.kr.medium16}; width: 100%; + min-height: 2.4rem; @media (max-width: ${theme.breakPoint.media.tabletL}) { width: 60rem;