From df4386107becd720c97f14149237340582482fd8 Mon Sep 17 00:00:00 2001 From: seung365 Date: Sat, 3 Aug 2024 01:34:29 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20build=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/git-push.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/git-push.yml b/.github/workflows/git-push.yml index 4b6bab3..a54e90b 100644 --- a/.github/workflows/git-push.yml +++ b/.github/workflows/git-push.yml @@ -14,17 +14,24 @@ jobs: run: apk add ruby && gem install mustache - name: creates output run: sh ./build.sh + + - name: Get commit message + id: get_commit_message + run: echo "::set-output name=commit_message::$(git log --format=%B -n 1 ${{ github.sha }})" + - name: Pushes to another repository id: push_directory uses: cpina/github-action-push-to-another-repository@main env: API_TOKEN_GITHUB: ${{ secrets.AUTO_KEY }} + COMMIT_MESSAGE: ${{ steps.get_commit_message.outputs.commit_message }} with: source-directory: 'output' destination-github-username: 'seung365' destination-repository-name: 'alphamail-frontend' user-email: ${{ secrets.OFFICIAL_ACCOUNT_EMAIL}} - commit-message: ${{ github.event.commits[0].message }} + commit-message: ${{ env.COMMIT_MESSAGE }} target-branch: main + - name: Test get variable exported by push-to-another-repository run: echo $DESTINATION_CLONED_DIRECTORY From 0396e4af87f52a246e8000e288a22bf5913e071f Mon Sep 17 00:00:00 2001 From: seung365 Date: Sat, 3 Aug 2024 04:04:13 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=EB=AA=A8=EB=8B=AC=EC=97=90=20?= =?UTF-8?q?=EC=8A=A4=ED=82=B5=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?+=20=EB=B2=84=ED=8A=BC=20=EC=A1=B0=EA=B1=B4=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Mail/MailModal.tsx | 40 ++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/src/components/Mail/MailModal.tsx b/src/components/Mail/MailModal.tsx index 5fad899..e7e28e9 100644 --- a/src/components/Mail/MailModal.tsx +++ b/src/components/Mail/MailModal.tsx @@ -89,6 +89,7 @@ export const MailModal = ({ isOpen, onClose }: MailModalProps) => { const handleOptionClick = (value: string) => { setFirstInput(value); + console.log(firstInput); }; const { mutate } = usePostUniv(); @@ -130,8 +131,14 @@ export const MailModal = ({ isOpen, onClose }: MailModalProps) => { setIsHide(!isHide); }; - const handleNextClick = async () => { + const handleNextClick = async (inputValue: string) => { const isValid = await trigger(inputNames[currentIndex]); + console.log('fuck'); + + if (currentIndex === 0 && firstInput && !inputValue) { + setValue(inputNames[currentIndex], firstInput, { shouldValidate: true }); + } + if (isValid) { if (currentIndex < inputNames.length - 1) { setCurrentIndex(currentIndex + 1); @@ -148,13 +155,19 @@ export const MailModal = ({ isOpen, onClose }: MailModalProps) => { }; const handleKeyDown = async (event: React.KeyboardEvent) => { - if (event.key === 'Enter' && content) { - event.preventDefault(); + if (event.key === 'Enter' && event.nativeEvent.isComposing === false) { const inputValue = (event.target as HTMLInputElement).value; - const combinedValue = `${firstInput} ${inputValue}`.trim(); - await setValue(inputNames[currentIndex], combinedValue, { shouldValidate: true }); - console.log(combinedValue); - await handleNextClick(); + if (currentIndex === 0 && firstInput) { + event.preventDefault(); + const combinedValue = `${firstInput} : ${inputValue}`.trim(); + await setValue(inputNames[currentIndex], combinedValue, { shouldValidate: true }); + console.log(combinedValue); + } else { + await setValue(inputNames[currentIndex], inputValue, { shouldValidate: true }); + console.log(inputValue); + } + await handleNextClick(inputValue); + return; } }; @@ -216,11 +229,16 @@ export const MailModal = ({ isOpen, onClose }: MailModalProps) => { name={inputNames[currentIndex]} control={control} rules={{ - required: currentIndex === 0 ? '필수 입력 항목입니다.' : false, validate: (value) => { - if (currentIndex === 0 && (value.length < 5 || value.length > 300)) { - return warningTexts.content[1]; + if (currentIndex === 0) { + if (!value && !firstInput) { + return warningTexts.content[0]; + } + if (value.length < 5 || value.length > 300) { + return warningTexts.content[1]; + } } + if (currentIndex === 3 && (!/^\d+$/.test(value) || '')) { return warningTexts.studentId; } @@ -256,7 +274,7 @@ export const MailModal = ({ isOpen, onClose }: MailModalProps) => { {!isHide && ( {currentIndex < inputNames.length - 1 ? ( - + handleNextClick('')} /> ) : (