Skip to content
Open
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
1 change: 1 addition & 0 deletions kraken-app/kraken-app-portal/src/hooks/product/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ export const useGetComponentDetailMapping = (
PRODUCT_CACHE_KEYS.get_component_detail_mapping,
productId,
componentId,
productType,
],
queryFn: () =>
getComponentDetailMapping(productId, componentId, productType),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import buildInitListMapping from "@/utils/helpers/buildInitListMapping";
import groupByPath from "@/utils/helpers/groupByPath";
import { IMappers } from "@/utils/types/component.type";
import { IMapperDetails } from "@/utils/types/env.type";
import { parseProductName } from "@/utils/helpers/name";
import { Flex, Spin, Button, Tooltip, notification, Drawer } from "antd";
import dayjs from "dayjs";
import { delay, get, isEmpty, chain, cloneDeep, flatMap, reduce } from "lodash";
Expand All @@ -35,14 +36,25 @@ import {getData} from "@/utils/helpers/token.ts";

const StandardAPIMapping = () => {
const { currentProduct } = useAppStore();
const { componentId } = useParams();
const { componentId, targetKey } = useParams();
const location = JSON.parse(getData("currentLocation")??'{}');
const [mainTitle, setMainTitle] = useState(() => location?.productType ?? "unknown main title");
const [filteredComponentList, setFilteredComponentList] = useState(() => location?.filteredComponentList ?? []);
const [productType, setProductType] = useState(() => location?.productType ?? "");
useEffect(() => {
if (!targetKey) {
return;
}
if (targetKey.includes("address")) {
setProductType("SHARE");
} else if (targetKey.includes("uni")) {
setProductType("UNI");
} else if (targetKey.includes("eline")) {
setProductType("ACCESS_E_LINE");
}
}, [targetKey]);

const { activePath, setActivePath, selectedKey, setSelectedKey } =
useMappingUiStore();

const {
setQuery,
reset,
Expand All @@ -64,10 +76,11 @@ const StandardAPIMapping = () => {
currentProduct,
componentId ?? ""
);

const { data: detailDataMapping, refetch } = useGetComponentDetailMapping(
currentProduct,
componentId ?? "",
productType
productType,
);

const { value: isChangeMappingKey, setValue: setIsChangeMappingKey } =
Expand Down Expand Up @@ -104,8 +117,6 @@ const StandardAPIMapping = () => {
};

useEffect(() => {
// Silence unused setter warnings without changing state
setMainTitle((prev: string) => prev);
setFilteredComponentList((prev: any[]) => prev);
setProductType((prev: string) => prev);
}, []);
Expand Down Expand Up @@ -364,7 +375,7 @@ const StandardAPIMapping = () => {
style={{ padding: "5px 0" }}
>
<BreadCrumb
mainTitle= {mainTitle}
mainTitle= {parseProductName(productType)}
mainUrl="/components"
optionalParam={productType}
items={[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ const StandardAPIMappingTable = () => {
),
},
];

return (
<PageLayout
title={
Expand Down
2 changes: 1 addition & 1 deletion kraken-app/kraken-app-portal/src/utils/helpers/name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ export const parseProductName = (product?: string) => {

export const parseProductValue = (product: string) => {
return product.split(':').shift();
};
};
Loading