Skip to content

Commit

Permalink
Merge branch 'v1' into fix/change_completionData
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyaoPCCW authored Nov 22, 2024
2 parents f375cd8 + e160ea9 commit 718e8ce
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
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 @@ -575,6 +575,7 @@ export const useGetBuyerList = (
queryFn: () => getBuyerList(productId, params),
enabled: Boolean(productId) && Boolean(params.envId),
select: (data) => data?.data,
staleTime: STALE_TIME,
});
};

Expand Down
25 changes: 11 additions & 14 deletions kraken-app/kraken-app-portal/src/pages/Buyer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useAppStore } from "@/stores/app.store";
import { useBuyerStore } from "@/stores/buyer.store";
import { IBuyer } from "@/utils/types/component.type";
import { Button, Flex, Popconfirm, Table, notification } from "antd";
import { get, isEmpty, omitBy } from "lodash";
import { get } from "lodash";
import { useEffect, useMemo, useRef } from "react";
import { useBoolean } from "usehooks-ts";
import { ContentTime } from "../NewAPIMapping/components/DeployHistory/ContentTime";
Expand All @@ -26,7 +26,7 @@ const Buyer = () => {
const { params, setParams, resetParams } = useBuyerStore();
const { data: dataList, isLoading } = useGetBuyerList(
currentProduct,
omitBy(params, isEmpty)
params
);
const {
value: isModalVisible,
Expand Down Expand Up @@ -180,18 +180,15 @@ const Buyer = () => {
<div style={{ flex: 1, overflowY: "auto" }} ref={ref}>
<Table
loading={isLoading}
pagination={
dataList?.total < 50
? false
: {
current: dataList?.page + 1,
total: dataList?.total,
size: dataList?.size,
onChange: (page, pageSize) => {
setParams({ page: page - 1, size: pageSize });
},
}
}
pagination={{
current: dataList?.page + 1,
total: dataList?.total,
size: dataList?.size,
showSizeChanger: true,
onChange: (page, pageSize) => {
setParams({ page: page - 1, size: pageSize });
},
}}
dataSource={dataList?.data}
columns={columns}
scroll={{ y: get(size, "height", 0) - 60, x: "auto" }}
Expand Down
2 changes: 1 addition & 1 deletion kraken-app/kraken-app-portal/src/stores/buyer.store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type BuyerStore = {

const DEFAULT_PARAMS = {
page: 0,
size: 50,
size: 20,
orderBy: "createdAt",
direction: "DESC",
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
kind: kraken.product.template-upgrade
apiVersion: v1
metadata:
key: kraken.product.template-upgrade.1.5.22
name: V1.5.22
labels:
productSpec: grace
productVersion: V1.5.22
publishDate: 2024-11-22
description: |
Remove completionDate when state != completed.
version: 2

0 comments on commit 718e8ce

Please sign in to comment.