Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added public/images/org/ImgSchedule.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const ExecInfo = ({
<MyDropzone
method={method}
label={`member.${selectedExec}.profileImageFileName`}
required
width="168px"
height="168px"
shape="circle"
Expand Down
27 changes: 14 additions & 13 deletions src/components/org/OrgAdmin/AboutSection/Schedule/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { IconInfoCircle } from '@sopt-makers/icons';
import { Button, DialogOptionType, useDialog } from '@sopt-makers/ui';
import { useFormContext, useWatch } from 'react-hook-form';

import Modal from '@/components/org/OrgAdmin/common/Modal';

import RequiredIcon from '../../assets/RequiredIcon';
// import Modal from '../../common/Modal';
import useModal from '../../common/Modal/useModal';
import { StWrapper } from '../style';
import {
Expand All @@ -13,7 +14,7 @@ import {
StScheduleHeader,
StScheduleIndex,
StScheduleInfoButton,
// StScheduleModalWrapper,
StScheduleModalWrapper,
StScheduleRow,
StScheduleRowWrapper,
StScheduleSessionField,
Expand Down Expand Up @@ -127,18 +128,18 @@ const Schedule = ({ isEditable = true }: ScheduleProps) => {
))}
</StScheduleRowWrapper>
</StScheduleBody>
</StScheduleWrapper>

{/* <StScheduleModalWrapper>
<Modal
title="전체 일정"
description="전체 일정 및 진행 세션을 순서대로 작성하는 영역이에요."
subDescription="왼쪽부터 번호, 날짜, 세션명 순서로 정리해주세요."
imgSrc="/images/org/imgAboutHeaderInfo.png"
isInfoVisible={isInfoVisible}
onInfoToggle={onInfoToggle}
/>
</StScheduleModalWrapper> */}
<StScheduleModalWrapper>
<Modal
title="전체 일정"
description="전체 일정 및 진행 세션을 순서대로 작성하는 영역이에요."
subDescription="왼쪽부터 번호, 날짜, 세션명 순서로 정리해주세요."
imgSrc="/images/org/imgSchedule.png"
isInfoVisible={isInfoVisible}
onInfoToggle={onInfoToggle}
/>
</StScheduleModalWrapper>
</StScheduleWrapper>
</StWrapper>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/org/OrgAdmin/AboutSection/Schedule/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ export const StScheduleSessionField = styled(TextField)`

export const StScheduleModalWrapper = styled.div`
position: absolute;
top: 0;
top: 56px;
left: calc(100% + 20px);
`;
6 changes: 5 additions & 1 deletion src/components/org/OrgAdmin/HomeSection/HomeSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,15 @@ const HomeSectionContent = ({ onEditModeChange }: HomeSectionProps) => {
const isDeployModalOpen = editStep === EDIT_STEP.DEPLOY;

useEffect(() => {
if (isEditMode) {
return;
}

setDraft({
reviews: initialReviews,
news: latestNews,
});
}, [initialReviews, latestNews]);
}, [initialReviews, isEditMode, latestNews]);

const resetDraft = () => {
setDraft({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ type EditReviewModalProps = {
isOpen: boolean;
reviewId?: number;
onCancel?: () => void;
onSuccess?: (review: ReviewForm) => void;
};

export const EditReviewModal = ({
isOpen,
reviewId,
onCancel,
onSuccess,
}: EditReviewModalProps) => {
const [editedReview, setEditedReview] = useState<ReviewForm | null>(null);
const contentTextAreaRef = useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -99,7 +101,15 @@ export const EditReviewModal = ({
formData.append('content', review.content);
formData.append('authorInfo', review.authorInfo);

mutate({ id: reviewId, formData }, { onSuccess: () => handleCloseModal() });
mutate(
{ id: reviewId, formData },
{
onSuccess: () => {
onSuccess?.(review);
handleCloseModal();
},
},
);
};

const isSubmitDisabled =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ const ReviewSection = ({ reviews, onChangeReviews, isEditable }: Props) => {
isOpen={editReviewId != null}
reviewId={editReviewId}
onCancel={() => setEditReviewId(undefined)}
onSuccess={(updatedReview) => {
onChangeReviews(
reviews.map((review) =>
review.id === editReviewId
? { ...review, ...updatedReview }
: review,
),
);
}}
/>
</StSectionWrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
ERROR_MESSAGES,
ONE_LINE_MAX_LENGTH,
PREFERENCE_DEFAULT_COUNT,
PREFERENCE_MAX_COUNT,
} from '@/components/org/OrgAdmin/RecruitSection/_constants/constants';
import {
StSectionWrapper,
Expand Down Expand Up @@ -98,7 +97,7 @@ const PartIntroSection = ({
.split('\n')
.filter((item) => item.trim());
const count = items.length
? Math.min(items.length, PREFERENCE_MAX_COUNT)
? Math.min(items.length, PREFERENCE_DEFAULT_COUNT)
: PREFERENCE_DEFAULT_COUNT;
next[part as PART_KO] = Math.max(count, PREFERENCE_DEFAULT_COUNT);
});
Expand Down
13 changes: 8 additions & 5 deletions src/components/org/OrgAdmin/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,30 +139,33 @@ export const validationAboutInputs = (

if (!isAllFilled) return false;

// 이름을 채운 임원진만 실존 인물로 보고, 소속/소개/사진(새 파일 or 기존 이미지)을 요구한다.
// 모든 임원진 역할은 이름/소속/소개/사진이 필수다.
const { member } = getValues();

for (const execType of EXEC_ROLE_LIST) {
const memberValue = member?.[execType];
if (!memberValue?.name) continue;

const apiRole = toMemberRole(execType);
const existingImage = existingMembers?.find(
(m) => m.role === apiRole,
)?.profileImage;

const memberFieldsToValidate = [
{
name: `member.${execType}.name`,
value: memberValue?.name,
},
{
name: `member.${execType}.affiliation`,
value: memberValue.affiliation,
value: memberValue?.affiliation,
},
{
name: `member.${execType}.introduction`,
value: memberValue.introduction,
value: memberValue?.introduction,
},
{
name: `member.${execType}.profileImageFileName`,
value: memberValue.profileImageFileName?.fileName ?? existingImage,
value: memberValue?.profileImageFileName?.fileName ?? existingImage,
},
];

Expand Down