Skip to content

Commit

Permalink
Merge pull request #209 from stellar/release/3.1.0
Browse files Browse the repository at this point in the history
Release `3.1.0` to `main`
  • Loading branch information
marcelosalloum authored Jan 16, 2025
2 parents 9d84ec9 + 7df5c4a commit f70fb1d
Show file tree
Hide file tree
Showing 16 changed files with 629 additions and 309 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker_image_public_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push to DockerHub (release prd)
uses: docker/build-push-action@v6.9.0
uses: docker/build-push-action@v6.11.0
with:
push: true
build-args: |
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
$GITHUB_OUTPUT

- name: Build and push to DockerHub (develop branch)
uses: docker/build-push-action@v6.9.0
uses: docker/build-push-action@v6.11.0
with:
push: true
build-args: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- run: yarn install
- run: yarn build

Expand Down
49 changes: 46 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,46 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

> Place unreleased changes here.
## [3.1.0](https://github.com/stellar/stellar-disbursement-platform-frontend/releases/tag/3.1.0) ([diff](https://github.com/stellar/stellar-disbursement-platform-frontend/compare/3.0.0...3.1.0))

Release of the Stellar Disbursement Platform `v3.1.0`. This release introduces
key updates, including the migration to Circle's Payouts API, aligning with
Circle's latest recommendations. It also enhances platform functionality by
enabling data export through dedicated endpoints, allowing users to export
disbursements, payments, and receivers with filters. Additionally, users now
have the ability to delete disbursements in `DRAFT` or `READY` status,
streamlining data management workflows.

> [!WARNING]
> This version is only compatible with the
> [stellar/stellar-disbursement-platform-backend] version `3.1.0`.
### Added

- Export functionality, allowing users to export:
- Disbursements with filters.
[#202](https://github.com/stellar/stellar-disbursement-platform-frontend/pull/202)
- Payments and Receivers with filters.
[#203](https://github.com/stellar/stellar-disbursement-platform-frontend/pull/203)
- Option to delete a disbursement in `DRAFT` or `READY` status.
[#205](https://github.com/stellar/stellar-disbursement-platform-frontend/pull/205)

### Changed

- Update the Disbursements table by adding the status column.
[#194](https://github.com/stellar/stellar-disbursement-platform-frontend/pull/194)

### Security and Dependencies

- Bump `react-router-dom` from 6.28.0 to 7.0.1.
[#197](https://github.com/stellar/stellar-disbursement-platform-frontend/pull/197)
- Bump the minor-and-patch.
[#198](https://github.com/stellar/stellar-disbursement-platform-frontend/pull/198),
[#200](https://github.com/stellar/stellar-disbursement-platform-frontend/pull/200)
- Bump docker/build-push-action from 6.9.0 to 6.11.0 in the all-actions group.
[#195](https://github.com/stellar/stellar-disbursement-platform-frontend/pull/195),
[#207](https://github.com/stellar/stellar-disbursement-platform-frontend/pull/207)

## [3.0.0](https://github.com/stellar/stellar-disbursement-platform-frontend/releases/tag/3.0.0) ([diff](https://github.com/stellar/stellar-disbursement-platform-frontend/compare/2.1.0...3.0.0))

Release of the Stellar Disbursement Platform `v3.0.0`. In this release, receiver
Expand All @@ -17,7 +57,8 @@ and `PHONE_NUMBER_AND_WALLET_ADDRESS`. If a receiver is registered with a wallet
address, they can receive the payment right away without having to go through
the SEP-24 registration flow.

> [!Warning] This version is only compatible with the
> [!WARNING]
> This version is only compatible with the
> [stellar/stellar-disbursement-platform-backend] version `3.0.0`.
### Added
Expand Down Expand Up @@ -90,7 +131,8 @@ option to set different distribution account signers per tenant, as well as
Circle support, so the tenant can choose to run their payments through the
Circle API rather than directly on the Stellar network.

> [!Warning] This version is only compatible with the
> [!WARNING]
> This version is only compatible with the
> [stellar/stellar-disbursement-platform-backend] version `2.1.0`.
### Added
Expand Down Expand Up @@ -131,7 +173,8 @@ platform simultaneously.

Each organization has its own set of users, receivers, disbursements, etc.

> [!Warning] This version is only compatible with the
> [!WARNING]
> This version is only compatible with the
> [stellar/stellar-disbursement-platform-backend] version 2.x.x. In order to
> migrate from 1.x.x to 2.x.x, please consult the
> [SDP Migration Guide](https://developers.stellar.org/network/stellar-disbursement-platform/admin-guide/single-tenant-to-multi-tenant-migration).
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /app
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --no-install-recommends -y gpg curl git make g++ ca-certificates apt-transport-https && \
curl -sSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key|gpg --dearmor >/etc/apt/trusted.gpg.d/nodesource-key.gpg && \
echo "deb https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
echo "deb https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg |gpg --dearmor >/etc/apt/trusted.gpg.d/yarnpkg.gpg && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y nodejs yarn && apt-get clean
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "stellar-disbursement-platform-frontend",
"version": "3.0.0",
"version": "3.1.0",
"license": "Apache-2.0",
"engines": {
"node": ">=18.x"
"node": ">=20.x"
},
"lint-staged": {
"src/**/*.ts?(x)": [
Expand All @@ -12,42 +12,42 @@
},
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^2.3.0",
"@reduxjs/toolkit": "^2.4.0",
"@stellar/design-system": "^1.1.3",
"@stellar/tsconfig": "^1.0.2",
"@svgr/webpack": "8.1.0",
"@tanstack/react-query": "^5.60.5",
"@tanstack/react-query-devtools": "^5.60.5",
"@tanstack/react-query": "^5.62.3",
"@tanstack/react-query-devtools": "^5.62.3",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@testing-library/react": "^16.1.0",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.17.13",
"@types/node": "^22.9.0",
"@types/node": "^22.10.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-google-recaptcha": "^2.1.9",
"@types/react-redux": "^7.1.34",
"@types/react-router-dom": "^5.3.3",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.15.0",
"@typescript-eslint/parser": "^8.15.0",
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"assert": "^2.1.0",
"bignumber.js": "^9.1.2",
"buffer": "^6.0.3",
"concurrently": "^9.1.0",
"crypto-browserify": "^3.12.1",
"date-fns": "^4.1.0",
"dotenv": "^16.4.5",
"eslint": "^9.15.0",
"dotenv": "^16.4.7",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-react": "^1.1.7",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-hooks": "^5.1.0",
"https-browserify": "^1.0.0",
"husky": "^9.1.7",
"lint-staged": "^15.2.10",
Expand All @@ -56,20 +56,20 @@
"os-browserify": "^0.3.0",
"papaparse": "^5.4.1",
"path-browserify": "^1.0.1",
"prettier": "^3.3.3",
"prettier": "^3.4.2",
"pretty-quick": "^4.0.0",
"process": "^0.11.10",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-google-recaptcha": "^3.1.0",
"react-redux": "^9.1.2",
"react-router-dom": "^6.28.0",
"react-router-dom": "^7.0.2",
"redux": "^5.0.1",
"sass": "^1.81.0",
"sass-loader": "^16.0.3",
"sass": "^1.82.0",
"sass-loader": "^16.0.4",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"url": "^0.11.4"
},
"resolutions": {
Expand Down Expand Up @@ -107,23 +107,23 @@
]
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.60.1",
"@tanstack/eslint-plugin-query": "^5.62.1",
"@types/papaparse": "^5.3.15",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
"eslint-webpack-plugin": "^4.2.0",
"file-loader": "^6.2.0",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"globals": "^15.12.0",
"globals": "^15.13.0",
"html-webpack-plugin": "^5.6.3",
"mini-css-extract-plugin": "^2.9.2",
"react-hot-loader": "^4.13.1",
"style-loader": "^4.0.0",
"ts-loader": "^9.5.1",
"tsconfig-paths-webpack-plugin": "^4.2.0",
"typescript-eslint": "^8.15.0",
"webpack": "^5.96.1",
"typescript-eslint": "^8.17.0",
"webpack": "^5.97.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0"
}
Expand Down
20 changes: 20 additions & 0 deletions src/api/deleteDisbursementDraft.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { handleApiResponse } from "api/handleApiResponse";
import { API_URL } from "constants/envVariables";
import { getSdpTenantName } from "helpers/getSdpTenantName";
import { ApiDisbursement } from "types";

export const deleteDisbursementDraft = async (
token: string,
draftId: string,
): Promise<ApiDisbursement> => {
const response = await fetch(`${API_URL}/disbursements/${draftId}`, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
"SDP-Tenant-Name": getSdpTenantName(),
},
});

return handleApiResponse(response);
};
40 changes: 40 additions & 0 deletions src/api/getExport.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { API_URL } from "constants/envVariables";
import { getSdpTenantName } from "helpers/getSdpTenantName";
import { handleSearchParams } from "api/handleSearchParams";
import { Export } from "types";

export const getExport = async <T>(
token: string,
type: Export,
searchParams?: T,
): Promise<void> => {
const params = handleSearchParams(searchParams);

const response = await fetch(`${API_URL}/exports/${type}${params}`, {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
"SDP-Tenant-Name": getSdpTenantName(),
},
});

if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}

const contentDisposition = response.headers.get("content-disposition");
const filename = contentDisposition
? contentDisposition.split("filename=")[1]
: `${type}_${new Date().toISOString().split("T")[0]}.csv`;

// Create a download from the response
const blob = await response.blob();
const url = window.URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.setAttribute("download", filename);
document.body.appendChild(link);
link.click();
link.remove();
window.URL.revokeObjectURL(url);
};
26 changes: 15 additions & 11 deletions src/components/DisbursementsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ export const DisbursementsTable: React.FC<DisbursementsTableProps> = ({
<Checkbox id="disbursements-select-all" fieldSize="xs" />
</Table.HeaderCell> */}
<Table.HeaderCell
width="9rem"
sortDirection={sortBy === "name" ? sortDir : defaultSortDirection}
onSort={() => handleSort("name")}
>
Disbursement name
</Table.HeaderCell>
<Table.HeaderCell>Total payments</Table.HeaderCell>
<Table.HeaderCell width="5.7rem">Total payments</Table.HeaderCell>
<Table.HeaderCell>Successful</Table.HeaderCell>
<Table.HeaderCell>Failed</Table.HeaderCell>
<Table.HeaderCell>Canceled</Table.HeaderCell>
Expand All @@ -124,10 +125,11 @@ export const DisbursementsTable: React.FC<DisbursementsTableProps> = ({
>
Created at
</Table.HeaderCell>
<Table.HeaderCell textAlign="right" width="7.9rem">
<Table.HeaderCell>Status</Table.HeaderCell>
<Table.HeaderCell textAlign="right" width="4.8rem">
Total amount
</Table.HeaderCell>
<Table.HeaderCell textAlign="right" width="7.9rem">
<Table.HeaderCell textAlign="right" width="8.1rem">
Amount disbursed
</Table.HeaderCell>
</Table.Header>
Expand All @@ -146,35 +148,37 @@ export const DisbursementsTable: React.FC<DisbursementsTableProps> = ({
{d.name}
</Link>
</Table.BodyCell>
<Table.BodyCell width="5.5rem" textAlign="right">
<Table.BodyCell textAlign="right">
{renderNumberOrDash(d.stats?.paymentsTotalCount)}
</Table.BodyCell>
<Table.BodyCell width="4rem" textAlign="right">
<Table.BodyCell textAlign="right">
{renderNumberOrDash(d.stats?.paymentsSuccessfulCount)}
</Table.BodyCell>
<Table.BodyCell width="2.25rem" textAlign="right">
<Table.BodyCell textAlign="right">
{renderNumberOrDash(d.stats?.paymentsFailedCount)}
</Table.BodyCell>
<Table.BodyCell width="3.4rem" textAlign="right">
<Table.BodyCell textAlign="right">
{renderNumberOrDash(d.stats?.paymentsCanceledCount)}
</Table.BodyCell>
<Table.BodyCell width="3.75rem" textAlign="right">
<Table.BodyCell textAlign="right">
{renderNumberOrDash(d.stats?.paymentsRemainingCount)}
</Table.BodyCell>
<Table.BodyCell width="9.375rem">
<Table.BodyCell width="9.5rem">
<span className="Table-v2__cell--secondary">
{formatDateTime(d.createdAt)}
</span>
</Table.BodyCell>

<Table.BodyCell textAlign="right" width="7.9rem">
<Table.BodyCell textAlign="right">{d.status}</Table.BodyCell>

<Table.BodyCell textAlign="right">
<AssetAmount
amount={d.stats?.totalAmount}
assetCode={d.asset.code}
fallback="-"
/>
</Table.BodyCell>
<Table.BodyCell textAlign="right" width="7.9rem">
<Table.BodyCell textAlign="right">
<AssetAmount
amount={d.stats?.disbursedAmount}
assetCode={d.asset.code}
Expand Down
Loading

0 comments on commit f70fb1d

Please sign in to comment.