Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

fix: display protocol data #3107

Merged
merged 5 commits into from
Mar 6, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export const UpdatedValue = styled(Box)(() => ({
export const Wrapper = styled(Box)(({ theme }) => ({
border: `1px solid ${theme.isDark ? theme.palette.secondary[700] : theme.palette.primary[200]}`,
borderRadius: theme.spacing(2),
overflow: "hidden"
overflow: "hidden",
"& .table-wrapper": {
[theme.breakpoints.down("sm")]: {
paddingBottom: "8px"
}
}
}));

export const LimitCell = styled(Box)`
Expand Down
22 changes: 16 additions & 6 deletions src/pages/ProtocolParameter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import InfoSolidIcon from "src/components/commons/InfoSolidIcon";
import { details, lists } from "src/commons/routers";
import { API } from "src/commons/utils/api";
import { PROTOCOL_TYPE } from "src/commons/utils/constants";
import { formatDateTimeLocal } from "src/commons/utils/helper";
import { formatDateTimeLocal, getShortValue } from "src/commons/utils/helper";
import ParseScriptModal from "src/components/ParseScriptModal";
import Card from "src/components/commons/Card";
import DateRangeModal from "src/components/commons/CustomFilter/DateRangeModal";
Expand Down Expand Up @@ -100,7 +100,7 @@ const ProtocolParameter: React.FC = () => {
>;
return {
name,
value: name === "costModel" ? JSON.stringify(valueObject) : convertedObj?.value,
value: name === "costModel" ? getShortValue(JSON.stringify(valueObject)) : convertedObj?.value,
epochNo: convertedObj?.epochNo,
time: convertedObj?.time
};
Expand Down Expand Up @@ -171,7 +171,7 @@ const ProtocolParameter: React.FC = () => {
textOverflow={"ellipsis"}
color={({ palette }) => (isModalType ? palette.primary.main : "unset")}
>
{r.value}
{getShortValue(r.value?.toString())}
</Box>
</Box>
);
Expand Down Expand Up @@ -233,7 +233,7 @@ const ProtocolParameter: React.FC = () => {
textOverflow={"ellipsis"}
color={({ palette }) => (isModalType ? palette.primary.main : "unset")}
>
{r.value}
{getShortValue(r.value?.toString())}
</Box>
</Box>
);
Expand Down Expand Up @@ -499,9 +499,19 @@ export const ProtocolParameterHistory = () => {
}
}, [JSON.stringify(dataHistory)]);

const newCostModel = dataHistory?.costModel.map((item): TProtocolItem => {
return {
...item,
value: getShortValue(item.value?.toString() || "")
};
}) as TProtocolItem[];

useUpdateEffect(() => {
if (columnTitle) {
getDataColumn(dataHistory);
if (columnTitle && dataHistory) {
getDataColumn({
...dataHistory,
costModel: newCostModel
});
setColumnsTable([...columnsFull]);
}
}, [JSON.stringify(columnTitle), JSON.stringify(dataHistory)]);
Expand Down
Loading