Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simon open source customisation #1048

Closed
Closed
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
28 changes: 28 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Env
NODE_ENV="development"
LOG_LEVEL="trace"

# APIs
PARTNER_ADMIN_API_URL="https://api.swan.io/sandbox-partner-admin/graphql"
PARTNER_API_URL="https://api.swan.io/sandbox-partner/graphql"
UNAUTHENTICATED_API_URL="https://api.swan.io/sandbox-unauthenticated/graphql"

OAUTH_SERVER_URL="https://oauth.swan.io"
OAUTH_CLIENT_ID="" # Your client ID
OAUTH_CLIENT_SECRET="" # Your client secret

# Key to encrypt cookies
COOKIE_KEY="" # Your cookie key

# URLs to expose your interfaces on
BANKING_URL="https://compte-pro.assoconnect-dev.com"
ONBOARDING_URL="https://onboarding-swan.assoconnect-dev.com"
PAYMENT_URL="https://payment-swan.assoconnect-dev.com"

# Extra keys for the client
CLIENT_PLACEKIT_API_KEY="" # Your placekit API key
CLIENT_ONBOARDING_MATOMO_SITE_ID=""

# API key for automated translations
OPENAI_API_KEY=""
TGGL_API_KEY=""
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
.DS_Store?
.pnpm-store/*
node_modules/

clients/*/src/graphql/*.ts
Expand All @@ -20,6 +21,7 @@ tests/graphql/*.ts
.env
.env.e2e
.env.swan
.env.development.local

localazy.keys.*.json

Expand Down
16 changes: 8 additions & 8 deletions clients/banking/src/components/AccountArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,6 @@ export const AccountArea = ({
to: Router.AccountTransactionsListRoot({ accountMembershipId }),
visible: permissions.canReadTransaction,
},
{
matchRoutes: ["AccountDetailsArea"],
iconActive: "building-bank-filled",
icon: "building-bank-regular",
name: t("navigation.account"),
to: Router.AccountDetailsIban({ accountMembershipId }),
visible: permissions.canReadAccountDetails,
},
{
matchRoutes: ["AccountPaymentsArea"],
iconActive: "arrow-swap-filled",
Expand All @@ -263,6 +255,14 @@ export const AccountArea = ({
to: Router.AccountCardsList({ accountMembershipId }),
visible: permissions.canReadCard,
},
{
matchRoutes: ["AccountDetailsArea"],
iconActive: "building-bank-filled",
icon: "building-bank-regular",
name: t("navigation.account"),
to: Router.AccountDetailsBilling({ accountMembershipId }),
visible: permissions.canReadAccountDetails,
},
{
matchRoutes: ["AccountMembersArea"],
iconActive: "people-filled",
Expand Down
12 changes: 6 additions & 6 deletions clients/banking/src/components/AccountDetailsArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { P, match } from "ts-pattern";
import { AccountLanguage } from "../graphql/partner";
import { usePermissions } from "../hooks/usePermissions";
import { AccountDetailsBillingPage } from "../pages/AccountDetailsBillingPage";
import { AccountDetailsIbanPage } from "../pages/AccountDetailsIbanPage";
// import { AccountDetailsIbanPage } from "../pages/AccountDetailsIbanPage";
import { AccountDetailsSettingsPage } from "../pages/AccountDetailsSettingsPage";
import { AccountDetailsVirtualIbansPage } from "../pages/AccountDetailsVirtualIbansPage";
import { t } from "../utils/i18n";
Expand Down Expand Up @@ -45,10 +45,10 @@ export const AccountDetailsArea = ({

const tabs = useMemo(
() => [
{
label: t("accountDetails.iban.tab"),
url: Router.AccountDetailsIban({ accountMembershipId }),
},
// {
// label: t("accountDetails.iban.tab"),
// url: Router.AccountDetailsIban({ accountMembershipId }),
// },
...(canReadVirtualIBAN
? [
{
Expand Down Expand Up @@ -87,7 +87,7 @@ export const AccountDetailsArea = ({

{match(route)
.with({ name: "AccountDetailsIban" }, () => (
<AccountDetailsIbanPage accountId={accountId} largeBreakpoint={large} />
<></>
))
.with({ name: "AccountDetailsVirtualIbans" }, () => (
<>
Expand Down
6 changes: 3 additions & 3 deletions clients/banking/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -687,14 +687,14 @@
"merchantProfile.status.suspended.description": "This merchant profile was suspended and can't be reactivated. Please contact Swan Support with any questions.",
"merchantProfile.tab.paymentLinks": "Payments links",
"merchantProfile.tab.settings": "Settings",
"navigation.account": "Account",
"navigation.account": "Account details",
"navigation.accounts": "Accounts",
"navigation.cards": "Cards",
"navigation.history": "History",
"navigation.history": "Transactions",
"navigation.members": "Members",
"navigation.menu": "Menu",
"navigation.merchant": "Merchant",
"navigation.transfer": "Transfer",
"navigation.transfer": "Transfers",
"needHelpButton.text": "Need help",
"newStatement.closingIsBeforeOpening": "End date can't be before start date.",
"newStatement.dateInTheFuture": "End date can't be in the future.",
Expand Down
6 changes: 3 additions & 3 deletions clients/banking/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -687,14 +687,14 @@
"merchantProfile.status.suspended.description": "Ce profil marchand a été suspendu et ne peut pas être réactivé. Veuillez contacter le support de Swan pour toute question.",
"merchantProfile.tab.paymentLinks": "Liens de paiement",
"merchantProfile.tab.settings": "Paramètres",
"navigation.account": "Compte",
"navigation.account": "Détails du compte",
"navigation.accounts": "Comptes",
"navigation.cards": "Cartes",
"navigation.history": "Historique",
"navigation.history": "Transactions",
"navigation.members": "Membres",
"navigation.menu": "Navigation",
"navigation.merchant": "Marchand",
"navigation.transfer": "Virement",
"navigation.transfer": "Virements",
"needHelpButton.text": "Besoin d'aide ?",
"newStatement.closingIsBeforeOpening": "La date de fin ne doit pas être antérieure à la date de début.",
"newStatement.dateInTheFuture": "La date de fin ne doit pas être future.",
Expand Down
4 changes: 2 additions & 2 deletions clients/banking/src/pages/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ export const ProfilePage = ({ additionalInfo, email, accentColor }: Props) => {
additionalInfo={additionalInfo}
accentColor={accentColor}
>
{({ onPressShow }) => (
{() => (
<LakeButton
onPress={onPressShow}
onPress={()=> window.open("https://support.swan.io/hc/fr/requests/new", "_blank")}
mode="secondary"
color="gray"
icon="send-regular"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"format": "prettier '**/*' --ignore-unknown --write",
"link-local-lake": "sh scripts/lake/link-local-lake.sh",
"unlink-local-lake": "sh scripts/lake/unlink-local-lake.sh",
"dev": "tsx -r dotenv/config server/src/index.ts --dev",
"dev": "tsx -r dotenv/config --env-file=.env.development --env-file=.env.development.local server/src/index.ts --dev",
"dev-swan": "tsx -r dotenv/config server/src/index.swan.ts --dev dotenv_config_path=.env.swan",
"build": "tsx -r dotenv/config scripts/build/index.ts",
"typecheck": "tsc --noEmit",
Expand Down
1 change: 1 addition & 0 deletions server/src/client/devServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ async function createViteDevServer(appName: string, httpsConfig?: HttpsConfig) {
const server = await createServer({
configFile: path.resolve(process.cwd(), "clients", appName, "vite.config.js"),
server: {
host: "0.0.0.0",
port: mainServerPort,
hmr: {
server: liveReloadServer,
Expand Down
11 changes: 3 additions & 8 deletions server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,14 @@ const onboardingCountries = accountCountries

start({
mode: env.NODE_ENV,
httpsConfig:
env.NODE_ENV === "development"
? {
key: path.join(keysPath, "_wildcard.swan.local-key.pem"),
cert: path.join(keysPath, "_wildcard.swan.local.pem"),
}
: undefined,
httpsConfig: undefined,
}).then(
({ app, ports }) => {
const listenPort = async (port: string) => {
// Expose 8080 so that we don't need `sudo` to listen to the port
// That's the port we expose when dockerized
const finalPort = port === "80" || port === "443" ? "8080" : port;
//const finalPort = port === "80" || port === "443" ? "8080" : port;
const finalPort = "8080";

try {
await app.listen({ port: Number(finalPort), host: "0.0.0.0" });
Expand Down