Merged PR 812: 「oderLicense」や「CardLicense」を開いて閉じるとパンくずリストがおかしくなる

## 概要
[Task3771: 対応](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3771)

ポップアップを×で閉じた際に、パンくずリストを保持したまま、`dispatch(getMyAccountAsync()`しており画面を初期化していた。
画面を更新するのかしないのかあいまいな挙動になっていた。

対応としては、他のポップアップと同様、×で閉じた場合は画面は更新しないように修正。
追加でパンくずリストを初期化する処理を作成し、ポップアップ側でAPIを呼び出した場合のみそれを実行する。

## レビューポイント
- 特筆する点はなし

## UIの変更
- スクショ置き場
https://ndstokyo.sharepoint.com/:f:/r/sites/Piranha/Shared%20Documents/General/OMDS/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88/Task3771?csf=1&web=1&e=USf40m

## 動作確認状況
- ローカルで確認

## 補足
- 相談、参考資料などがあれば
This commit is contained in:
maruyama.t 2024-03-07 10:41:30 +00:00
parent e448e8d249
commit f265d0ff45
4 changed files with 16 additions and 3 deletions

View File

@ -61,6 +61,9 @@ export const partnerLicenseSlice = createSlice({
const { deleteCount } = action.payload;
state.apps.hierarchicalElements.splice(-deleteCount);
},
clearHierarchicalElement: (state) => {
state.apps.hierarchicalElements = [];
},
changeSelectedRow: (
state,
action: PayloadAction<{ value?: PartnerLicenseInfo }>
@ -110,6 +113,7 @@ export const {
pushHierarchicalElement,
popHierarchicalElement,
spliceHierarchicalElement,
clearHierarchicalElement,
changeSelectedRow,
savePageInfo,
} = partnerLicenseSlice.actions;

View File

@ -2,6 +2,10 @@ import React, { useState, useCallback, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { AppDispatch } from "app/store";
import { useDispatch, useSelector } from "react-redux";
import {
clearHierarchicalElement,
getMyAccountAsync,
} from "features/license/partnerLicense";
import styles from "../../styles/app.module.scss";
import { getTranslationID } from "../../translation";
import close from "../../assets/images/close.svg";
@ -92,6 +96,8 @@ export const CardLicenseIssuePopup: React.FC<CardLicenseIssuePopupProps> = (
setIsPushCreateButton(false);
if (meta.requestStatus === "fulfilled") {
dispatch(getMyAccountAsync());
dispatch(clearHierarchicalElement());
closePopup();
}
}, [

View File

@ -14,6 +14,10 @@ import {
cleanupApps,
selectIsLoading,
} from "features/license/licenseOrder";
import {
clearHierarchicalElement,
getMyAccountAsync,
} from "features/license/partnerLicense";
import close from "../../assets/images/close.svg";
import progress_activit from "../../assets/images/progress_activit.svg";
@ -90,6 +94,8 @@ export const LicenseOrderPopup: React.FC<LicenseOrderPopupProps> = (props) => {
setIsPushOrderButton(false);
if (meta.requestStatus === "fulfilled") {
dispatch(getMyAccountAsync());
dispatch(clearHierarchicalElement());
closePopup();
}
}, [

View File

@ -216,13 +216,11 @@ const PartnerLicense: React.FC = (): JSX.Element => {
return (
<>
{/* 表示確認用の仮画面 */}
{/* isPopupOpenがfalseの場合はポップアップのhtmlを生成しないように対応。これによりポップアップは都度生成されて初期化の考慮が減る */}
{isCardLicenseIssuePopupOpen && (
<CardLicenseIssuePopup
onClose={() => {
setIsCardLicenseIssuePopupOpen(false);
dispatch(getMyAccountAsync());
}}
/>
)}
@ -230,7 +228,6 @@ const PartnerLicense: React.FC = (): JSX.Element => {
<LicenseOrderPopup
onClose={() => {
setIslicenseOrderPopupOpen(false);
dispatch(getMyAccountAsync());
}}
/>
)}