Skip to content

Commit

Permalink
Merge branch 'develop' into release/3.0.0-rc.2
Browse files Browse the repository at this point in the history
  • Loading branch information
marwen-abid authored Oct 30, 2024
2 parents 4c31b5e + 0d5cfbc commit 2039244
Show file tree
Hide file tree
Showing 45 changed files with 2,181 additions and 3,203 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.7.0
uses: docker/build-push-action@v6.9.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.7.0
uses: docker/build-push-action@v6.9.0
with:
push: true
build-args: |
Expand Down
109 changes: 54 additions & 55 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,65 @@
},
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^1.9.7",
"@stellar/design-system": "^1.1.1",
"@reduxjs/toolkit": "^2.3.0",
"@stellar/design-system": "^1.1.3",
"@stellar/tsconfig": "^1.0.2",
"@svgr/webpack": "8.1.0",
"@tanstack/react-query": "^4.29.25",
"@tanstack/react-query-devtools": "^4.35.3",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.5.1",
"@types/jest": "^29.5.6",
"@types/lodash": "^4.14.200",
"@types/node": "^20.8.8",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@types/react-google-recaptcha": "^2.1.5",
"@types/react-redux": "^7.1.28",
"@tanstack/react-query": "^5.59.16",
"@tanstack/react-query-devtools": "^5.59.16",
"@testing-library/jest-dom": "^6.6.2",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.17.12",
"@types/node": "^22.8.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": "^9.0.6",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@typescript-eslint/parser": "^8.11.0",
"assert": "^2.1.0",
"bignumber.js": "^9.1.2",
"buffer": "^6.0.3",
"concurrently": "^8.2.2",
"crypto-browserify": "^3.12.0",
"date-fns": "^2.30.0",
"dotenv": "^16.4.1",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"concurrently": "^9.0.1",
"crypto-browserify": "^3.12.1",
"date-fns": "^4.1.0",
"dotenv": "^16.4.5",
"eslint": "^9.13.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-react": "^1.1.7",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsx-a11y": "^6.7.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.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"https-browserify": "^1.0.0",
"husky": "^8.0.3",
"lint-staged": "^15.0.2",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"lodash": "^4.17.21",
"node-sass": "^9.0.0",
"oidc-client-ts": "^2.4.0",
"oidc-client-ts": "^3.1.0",
"os-browserify": "^0.3.0",
"papaparse": "^5.4.1",
"path-browserify": "^1.0.1",
"prettier": "^2.8.7",
"pretty-quick": "^3.1.3",
"prettier": "^3.3.3",
"pretty-quick": "^4.0.0",
"process": "^0.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-google-recaptcha": "^3.1.0",
"react-redux": "^8.1.3",
"react-router-dom": "^6.17.0",
"redux": "^4.2.1",
"sass": "^1.69.4",
"sass-loader": "^13.3.2",
"react-redux": "^9.1.2",
"react-router-dom": "^6.27.0",
"redux": "^5.0.1",
"sass": "^1.80.4",
"sass-loader": "^16.0.2",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"typescript": "^5.2.2",
"url": "^0.11.3"
"typescript": "^5.6.3",
"url": "^0.11.4"
},
"resolutions": {
"asn1.js": "5.4.0",
Expand All @@ -85,7 +84,7 @@
"prod:build": "docker image build -t disbursement-platform-frontend:localbuild .",
"prod:serve": "docker run -p 8000:80 disbursement-platform-frontend:localbuild",
"production": "yarn prod:build && yarn prod:serve",
"prepare": "husky install",
"prepare": "husky",
"pre-commit": "concurrently 'pretty-quick --staged' 'lint-staged' 'tsc --noEmit'",
"git-info": "rm -rf src/generated/ && mkdir src/generated/ && echo export default \"{\\\"commitHash\\\": \\\"$(git rev-parse --short HEAD)\\\", \\\"version\\\": \\\"$(git describe --tags --always)\\\"};\" > src/generated/gitInfo.ts"
},
Expand All @@ -108,22 +107,22 @@
]
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^4.29.25",
"@types/papaparse": "^5.3.10",
"@tanstack/eslint-plugin-query": "^5.59.7",
"@types/papaparse": "^5.3.15",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.8.1",
"eslint-webpack-plugin": "^4.0.1",
"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.0",
"html-webpack-plugin": "^5.5.3",
"mini-css-extract-plugin": "^2.7.6",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"html-webpack-plugin": "^5.6.3",
"mini-css-extract-plugin": "^2.9.1",
"react-hot-loader": "^4.13.1",
"style-loader": "^3.3.3",
"ts-loader": "^9.5.0",
"style-loader": "^4.0.0",
"ts-loader": "^9.5.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"webpack": "^5.89.0",
"webpack": "^5.95.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.2"
"webpack-dev-server": "^5.1.0"
}
}
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { PrivateRoute } from "components/PrivateRoute";
import { InnerPage } from "components/InnerPage";
import { UserSession } from "components/UserSession";
import { GlobalBanner } from "components/GlobalBanner";
import { SessionTokenRefresher } from "components/SessionTokenRefresher";

import { SignIn } from "pages/SignIn";
import { MFAuth } from "pages/MFAuth";
Expand Down Expand Up @@ -58,6 +59,7 @@ export const App = () => {

return (
<Provider store={store}>
<SessionTokenRefresher />
<QueryClientProvider client={queryClient}>
<UserSession />
<BrowserRouter>
Expand Down
4 changes: 3 additions & 1 deletion src/api/refreshToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import { SESSION_EXPIRED } from "constants/settings";
import { parseJwt } from "helpers/parseJwt";
import { getSdpTenantName } from "helpers/getSdpTenantName";

const MIN_MINUTES_FOR_REFRESH = 5;

export const refreshToken = async (token: string): Promise<string> => {
const jwt = parseJwt(token);
// JWT session is 15 min
const minRemaining = differenceInMinutes(fromUnixTime(jwt.exp), Date.now());

if (minRemaining <= 0) {
throw SESSION_EXPIRED;
} else if (minRemaining < 5) {
} else if (minRemaining < MIN_MINUTES_FOR_REFRESH) {
const response = await fetch(`${API_URL}/refresh-token`, {
method: "POST",
headers: {
Expand Down
3 changes: 1 addition & 2 deletions src/apiQueries/useAssetsAdd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const useAssetsAdd = ({
}),
});
},
cacheTime: 0,
onSuccess,
});

Expand All @@ -34,7 +33,7 @@ export const useAssetsAdd = ({
mutateAsync: async ({ assetCode, assetIssuer }: Asset) => {
try {
await mutation.mutateAsync({ assetCode, assetIssuer });
} catch (e) {
} catch {
// do nothing
}
},
Expand Down
3 changes: 1 addition & 2 deletions src/apiQueries/useAssetsDelete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const useAssetsDelete = ({
method: "DELETE",
});
},
cacheTime: 0,
onSuccess,
});

Expand All @@ -25,7 +24,7 @@ export const useAssetsDelete = ({
mutateAsync: async (assetId: string) => {
try {
await mutation.mutateAsync(assetId);
} catch (e) {
} catch {
// do nothing
}
},
Expand Down
3 changes: 1 addition & 2 deletions src/apiQueries/useCancelPayment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const useCancelPayment = () => {
}),
});
},
cacheTime: 0,
});

return {
Expand All @@ -24,7 +23,7 @@ export const useCancelPayment = () => {
mutateAsync: async ({ paymentId }: { paymentId: string }) => {
try {
await mutation.mutateAsync({ paymentId });
} catch (e) {
} catch {
// do nothing
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/apiQueries/useCircleBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const useCircleBalances = (
queryFn: async () => {
return await fetchApi(`${API_URL}/balances`);
},
keepPreviousData: true,
placeholderData: (prev) => prev,
enabled: Boolean(isActive && walletId),
});

Expand Down
3 changes: 1 addition & 2 deletions src/apiQueries/useCreateNewUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const useCreateNewUser = () => {
}),
});
},
cacheTime: 0,
});

return {
Expand All @@ -26,7 +25,7 @@ export const useCreateNewUser = () => {
mutateAsync: async (newUser: NewUser) => {
try {
await mutation.mutateAsync(newUser);
} catch (e) {
} catch {
// do nothing
}
},
Expand Down
3 changes: 1 addition & 2 deletions src/apiQueries/useForgotPasswordLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export const useForgotPasswordLink = () => {
},
);
},
cacheTime: 0,
});

return {
Expand All @@ -48,7 +47,7 @@ export const useForgotPasswordLink = () => {
}: ForgotPasswordLinkProps) => {
try {
await mutation.mutateAsync({ organizationName, email, recaptchaToken });
} catch (e) {
} catch {
// do nothing
}
},
Expand Down
3 changes: 1 addition & 2 deletions src/apiQueries/useNewPassword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export const useNewPassword = () => {
body: JSON.stringify(fieldsToSubmit),
});
},
cacheTime: 0,
});

return {
Expand All @@ -41,7 +40,7 @@ export const useNewPassword = () => {
}: NewPasswordFields) => {
try {
await mutation.mutateAsync({ currentPassword, newPassword });
} catch (e) {
} catch {
// do nothing
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/apiQueries/usePayments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const usePayments = (searchParams?: PaymentsSearchParams) => {
queryFn: async () => {
return await fetchApi(`${API_URL}/payments/${params}`);
},
keepPreviousData: true,
placeholderData: (prev) => prev,
});

return query;
Expand Down
2 changes: 1 addition & 1 deletion src/apiQueries/useReceivers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const useReceivers = (searchParams?: ReceiversSearchParams) => {
queryFn: async () => {
return await fetchApi(`${API_URL}/receivers/${params}`);
},
keepPreviousData: true,
placeholderData: (prev) => prev,
});

return {
Expand Down
3 changes: 1 addition & 2 deletions src/apiQueries/useResetPassword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const useResetPassword = () => {
},
);
},
cacheTime: 0,
});

return {
Expand All @@ -62,7 +61,7 @@ export const useResetPassword = () => {
}: ResetPasswordProps) => {
try {
await mutation.mutateAsync({ organizationName, password, resetToken });
} catch (e) {
} catch {
// do nothing
}
},
Expand Down
3 changes: 1 addition & 2 deletions src/apiQueries/useUpdateOrgInvitationRetryInterval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const useUpdateOrgInvitationRetryInterval = () => {
{ omitContentType: true },
);
},
cacheTime: 0,
});

return {
Expand All @@ -32,7 +31,7 @@ export const useUpdateOrgInvitationRetryInterval = () => {
mutateAsync: async (retryInterval: number) => {
try {
await mutation.mutateAsync(retryInterval);
} catch (e) {
} catch {
// do nothing
}
},
Expand Down
3 changes: 1 addition & 2 deletions src/apiQueries/useUpdateOrgPaymentCancellationPeriodDays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const useUpdateOrgPaymentCancellationPeriodDays = () => {
{ omitContentType: true },
);
},
cacheTime: 0,
});

return {
Expand All @@ -32,7 +31,7 @@ export const useUpdateOrgPaymentCancellationPeriodDays = () => {
mutateAsync: async (cancellationPeriod: number) => {
try {
await mutation.mutateAsync(cancellationPeriod);
} catch (e) {
} catch {
// do nothing
}
},
Expand Down
1 change: 0 additions & 1 deletion src/apiQueries/useUpdateOrgSmsTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const useUpdateSmsTemplate = () => {
{ omitContentType: true },
);
},
cacheTime: 0,
});

return {
Expand Down
Loading

0 comments on commit 2039244

Please sign in to comment.