260722_01_ENH: 버그 수정 및 개선 사항 수정
This commit is contained in:
@@ -141,9 +141,7 @@ const ProjectAssignPage = () => {
|
||||
};
|
||||
|
||||
const {
|
||||
assignBase,
|
||||
assignView,
|
||||
ableBase,
|
||||
ableView,
|
||||
} = useMemo(() => {
|
||||
const roleVal = roleFilter?.value;
|
||||
@@ -168,9 +166,7 @@ const ProjectAssignPage = () => {
|
||||
const _ableView = kAble ? _ableBase0.filter((u) => kwFilter(u, kAble)) : _ableBase0;
|
||||
|
||||
return {
|
||||
assignBase: _assignBase,
|
||||
assignView: _assignView,
|
||||
ableBase: _ableBase0,
|
||||
ableView: _ableView,
|
||||
};
|
||||
}, [
|
||||
@@ -218,18 +214,21 @@ const ProjectAssignPage = () => {
|
||||
alert("저장되었습니다.");
|
||||
};
|
||||
|
||||
// 로그인 계정의 소속 회사를 기본 선택하되, 매치되는 게 없으면 자사(ownCmpn) 중 가장 상단 1개로 대체한다.
|
||||
useEffect(() => {
|
||||
const cmpn = auth.user?.userCmpn ?? "";
|
||||
const hasAuthCmpn = companyArray.some((company) => company.cmpnId === cmpn);
|
||||
|
||||
if (cmpn && hasAuthCmpn) {
|
||||
if (cmpn && companyArray.some((company) => company.cmpnId === cmpn)) {
|
||||
setCompanyFilter(cmpn);
|
||||
return;
|
||||
}
|
||||
|
||||
if (companyFilter && !companyArray.some((company) => company.cmpnId === companyFilter)) {
|
||||
setCompanyFilter("");
|
||||
// 이미 유효한 값이 선택돼 있으면(사용자가 직접 고른 값 포함) 그대로 둔다.
|
||||
if (companyFilter && companyArray.some((company) => company.cmpnId === companyFilter)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const ownCmpn = companyArray.find((company) => company.ownCmpn);
|
||||
setCompanyFilter(ownCmpn?.cmpnId ?? "");
|
||||
}, [auth.user?.userCmpn, companyArray, companyFilter]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -331,7 +330,7 @@ const ProjectAssignPage = () => {
|
||||
/>
|
||||
</th>
|
||||
<th className="p-2 text-left text-base font-medium">
|
||||
배정된 {roleFilter?.label} ( {assignBase.length}명 )
|
||||
배정된 {roleFilter?.label} ( {assignView.length}명 )
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -424,7 +423,7 @@ const ProjectAssignPage = () => {
|
||||
/>
|
||||
</th>
|
||||
<th className="p-2 text-left text-base font-medium">
|
||||
배정 가능 {roleFilter?.label} ({ableBase.length}명 )
|
||||
배정 가능 {roleFilter?.label} ({ableView.length}명 )
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
Reference in New Issue
Block a user