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

minor/branding : Add ui customisations #58

Merged
merged 46 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1c565e7
migrating from modusbox ui to pm4ml ui component
mwan9ilwa Dec 10, 2024
bfbe01c
Merge branch 'master' of https://github.com/pm4ml/mojaloop-payment-ma…
mwan9ilwa Dec 18, 2024
8157270
created environment variables for branding options, added default fal…
mwan9ilwa Dec 18, 2024
bf96bdd
chore: add ui config variables to redux store
v3-Panwar-Ujjwal Jan 17, 2025
d7c2f7a
ime-521: update ui to env variables
v3-Panwar-Ujjwal Jan 20, 2025
37c7f82
fix: lint
v3-Panwar-Ujjwal Jan 20, 2025
3abe7fa
chore: update setupStyle function
v3-Panwar-Ujjwal Jan 20, 2025
add01d9
Merge branch 'feat/ime-347/pm4ml-branding' into task/refractor-env-va…
Ujjwal-Izyane Jan 21, 2025
f26295c
Merge pull request #54 from pm4ml/task/refractor-env-variables
Ujjwal-Izyane Jan 21, 2025
1d8a580
refactor: navbar
Akku-Rawat Jan 21, 2025
4548359
fix: lint errors
Akku-Rawat Jan 21, 2025
7efeed7
Merge pull request #55 from pm4ml/task/IME-534-update-navbar-css-and-…
Ujjwal-Izyane Jan 21, 2025
416b4a5
chore: create sanitize function for custom ui variables
v3-Panwar-Ujjwal Jan 22, 2025
a33d52a
Merge branch 'feat/ime-347/pm4ml-branding' into task/ime-523
v3-Panwar-Ujjwal Jan 22, 2025
209a0ec
chore: add eslint ignore for regex going over 110 characters
v3-Panwar-Ujjwal Jan 22, 2025
02b6916
chore: replace 4010 with 3000
v3-Panwar-Ujjwal Jan 22, 2025
cbe5771
Merge pull request #56 from pm4ml/task/ime-523
Ujjwal-Izyane Jan 22, 2025
d1b2b4a
update: transfer dashboard charts css
Akku-Rawat Jan 22, 2025
92e66d6
update: fxp conversion dashboard charts css
Akku-Rawat Jan 22, 2025
8e17688
refactor: centralize dashboard charts color
Akku-Rawat Jan 22, 2025
42c0f39
refactor: centralize navbar variable
Akku-Rawat Jan 22, 2025
4214b28
update: apex charts toolbar color
Akku-Rawat Jan 22, 2025
86cdef2
fix: lint errors
Akku-Rawat Jan 22, 2025
56c78b0
Merge pull request #57 from pm4ml/task/IME-539-update-css-for-transfe…
Ujjwal-Izyane Jan 22, 2025
d4a0ae3
update: default theme and fix css issues
Akku-Rawat Jan 29, 2025
87477f8
fix: lint errors
Akku-Rawat Jan 29, 2025
1955283
chore: add sanitization function for image
v3-Panwar-Ujjwal Jan 31, 2025
373f37f
chore: move sanitization util to a new file
v3-Panwar-Ujjwal Jan 31, 2025
075e100
chore: clean up
v3-Panwar-Ujjwal Jan 31, 2025
23334a0
chore: clean up
v3-Panwar-Ujjwal Jan 31, 2025
56d4710
chore: add ui-configuration instructions
v3-Panwar-Ujjwal Jan 31, 2025
8fc9af9
chore: update image sanitization function to remove trailing quotes
v3-Panwar-Ujjwal Jan 31, 2025
cac8cdb
chore: update sanitization of images ,remove trailing whitespaces
v3-Panwar-Ujjwal Jan 31, 2025
aeccf2d
chore: update sanitzation function for urls
v3-Panwar-Ujjwal Jan 31, 2025
2011b89
fix: issue when no value for env app crashing
v3-Panwar-Ujjwal Jan 31, 2025
529e9d6
chore: lint
kalinkrustev Jan 31, 2025
5875403
chore: update ui-test to skip tests
v3-Panwar-Ujjwal Feb 3, 2025
c8439c6
Merge branch 'feat/ime-347/pm4ml-branding' of https://github.com/pm4m…
v3-Panwar-Ujjwal Feb 3, 2025
39146fe
chore: remove the ui-test , comment out at the moment
v3-Panwar-Ujjwal Feb 3, 2025
2d17541
chore: rename env variables - remove prefix
v3-Panwar-Ujjwal Feb 4, 2025
650f72b
chore: clean up, remove REACT_APP prefix
v3-Panwar-Ujjwal Feb 4, 2025
f1342a7
chore: update config.yml , circle ci linux image
Ujjwal-Izyane Feb 4, 2025
a81c528
chore: fix ui bug
v3-Panwar-Ujjwal Feb 5, 2025
fab0414
Merge branch 'minor/branding' of https://github.com/pm4ml/mojaloop-pa…
v3-Panwar-Ujjwal Feb 5, 2025
8828a96
chore: trim color code values before sanitization
v3-Panwar-Ujjwal Feb 5, 2025
11f4b3a
chore: update .env.example
v3-Panwar-Ujjwal Feb 5, 2025
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ executors:

default-machine:
machine:
image: ubuntu-2004:202201-02
image: ubuntu-2204:2023.04.2

##
# Jobs
Expand Down
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# RED THEME
PRIMARY_COLOR=#e80002
SECONDARY_COLOR=#e80002
ACCENT_COLOR=#9b0214
TITLE='Airtel'
COUNTRY_LOGO="https://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Flag_of_Zambia.svg/125px-Flag_of_Zambia.svg.png"
LOGO="https://upload.wikimedia.org/wikipedia/commons/thumb/f/fb/Bharti_Airtel_Logo.svg/150px-Bharti_Airtel_Logo.svg.png"

# YELLOW THEME
PRIMARY_COLOR=#f9d342
SECONDARY_COLOR=#f1b92a
ACCENT_COLOR=#a77e07'
83 changes: 42 additions & 41 deletions .github/workflows/ui-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,45 @@ on:
- '**'

jobs:
ui_test:
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17.tar.gz

- name: Install dependencies
run: nix-env -if ui-tests/default.nix

- name: Start Docker Compose
working-directory: on-premise-deploy/docker-compose/
run: docker-compose up -d

- name: Wait for Docker Compose and Vault
# TODO: Use a script to ascertain docker health instead of flat wait time
run: sleep 120s

- name: Populate payer transfer data with TTK
run: docker exec mojaloop-testing-toolkit npm run cli -- outbound -i collections/payer-tests/ -e environments/environment.json

- name: Populate payee transfer data with TTK
run: docker exec mojaloop-testing-toolkit npm run cli -- outbound -i collections/payee-tests/ -e environments/environment.json

- name: Install test dependencies
working-directory: ui-tests/tests
run: |-
npm ci

- name: Upgrade browserlist
working-directory: ui-tests/tests
run: |-
npx browserslist@latest --update-db

- name: Run tests
working-directory: ui-tests/tests
run: |-
ENV="local" PM4ML_ENDPOINT="http://localhost:8081" SIM_CORE_CONNECTOR_ENDPOINT="http://localhost:3003" npm run test:headless
# ui_test:
# timeout-minutes: 45
# if: "!contains(github.event.head_commit.message, '[skip tests]')"
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
#
# - uses: cachix/install-nix-action@v22
# with:
# nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17.tar.gz
#
# - name: Install dependencies
# run: nix-env -if ui-tests/default.nix
#
# - name: Start Docker Compose
# working-directory: on-premise-deploy/docker-compose/
# run: docker-compose up -d
#
# - name: Wait for Docker Compose and Vault
# # TODO: Use a script to ascertain docker health instead of flat wait time
# run: sleep 120s
#
# - name: Populate payer transfer data with TTK
# run: docker exec mojaloop-testing-toolkit npm run cli -- outbound -i collections/payer-tests/ -e environments/environment.json
#
# - name: Populate payee transfer data with TTK
# run: docker exec mojaloop-testing-toolkit npm run cli -- outbound -i collections/payee-tests/ -e environments/environment.json
#
# - name: Install test dependencies
# working-directory: ui-tests/tests
# run: |-
# npm ci
#
# - name: Upgrade browserlist
# working-directory: ui-tests/tests
# run: |-
# npx browserslist@latest --update-db
#
# - name: Run tests
# working-directory: ui-tests/tests
# run: |-
# ENV="local" PM4ML_ENDPOINT="http://localhost:8081" SIM_CORE_CONNECTOR_ENDPOINT="http://localhost:3003" npm run test:headless
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"serve": "^11.3.2",
"svg-sprite-loader": "^5.0.0",
"typescript": "~3.7.2",
"validator": "^13.12.0",
"xlsx": "^0.17.5"
},
"scripts": {
Expand Down Expand Up @@ -104,6 +105,7 @@
]
},
"devDependencies": {
"@types/validator": "^13.12.2",
"redux-mock-store": "^1.5.4",
"standard-version": "^9.5.0"
},
Expand Down
17 changes: 14 additions & 3 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const app = express();

app.use(express.static(path.join(__dirname, 'build')));

app.get('/config', function (req, res) {
app.get('/config', function(req, res) {
res.send({
API_BASE_URL: process.env.API_BASE_URL,
CHECK_SESSION_URL: process.env.CHECK_SESSION_URL,
Expand All @@ -14,8 +14,19 @@ app.get('/config', function (req, res) {
});
});

app.get('/*', function (req, res) {
app.get('/uiConfig', function(req, res) {
res.send({
PRIMARY_COLOR: process.env.PRIMARY_COLOR,
SECONDARY_COLOR: process.env.SECONDARY_COLOR,
ACCENT_COLOR: process.env.ACCENT_COLOR,
LOGO: process.env.LOGO,
TITLE: process.env.TITLE,
COUNTRY_LOGO: process.env.COUNTRY_LOGO,
});
});

app.get('/*', function(req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});

app.listen(8080);
app.listen(8080);
14 changes: 12 additions & 2 deletions src/App/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Switch, Route, Redirect } from 'react-router-dom';
import React, { FC } from 'react';
import './App.css';
import { useSelector } from 'react-redux';
import Layout from './Layout';
import TechnicalDashboard from './TechnicalDashboard';
import Transfers from './Transfers';
Expand All @@ -12,6 +13,8 @@ import FxpTechnicalDashboard from './FxpTechnicalDashboard';
// import FxpTransfers from './FxpConversions';
import FxpConversions from './FxpConversions';

import { getUiConfig } from './selectors';

interface AppProps {
isSuccessToastVisible: boolean;
isErrorModalVisible: boolean;
Expand All @@ -28,6 +31,10 @@ const App: FC<AppProps> = ({
onCloseErrorModal,
userInfo,
}) => {
const uiConfig = useSelector(getUiConfig);
const { appTitle, countryLogo, appLogo } = uiConfig;
const activeConnectionName = 'Modusbox & Mojaloop Labs';
const activeConnectionStatusColor = '#12d670';
return (
<div className="App">
<Layout.Container>
Expand All @@ -37,8 +44,11 @@ const App: FC<AppProps> = ({
}
logoutUrl={userInfo ? userInfo.logoutUrl : undefined}
kratos={userInfo?.kratos}
activeConnectionName="Modusbox & Mojaloop Labs"
activeConnectionStatusColor="#12d670"
activeConnectionName={activeConnectionName}
activeConnectionStatusColor={activeConnectionStatusColor}
appTitle={appTitle}
appLogo={appLogo}
countryLogo={countryLogo}
/>
<Layout.Content>
<Layout.SideMenu />
Expand Down
8 changes: 8 additions & 0 deletions src/App/FxpConversions/FxpConversions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import FxpConversionsAvgTime from './components/FxpConversionAvgTime';
import FxpConversionsStatuses from './components/FxpConversionStatuses';
import './FxpConversions.css';

import { getUiConfig } from '../selectors';

const stateProps = (state: State) => ({
fxpConversionsErrors: selectors.getFxpConversionsErrors(state),
fxpConversionsErrorsError: selectors.getFxpConversionsErrorsError(state),
Expand All @@ -32,6 +34,7 @@ const stateProps = (state: State) => ({
fxpConversionsAvgTimeError: selectors.getFxpConversionsAvgTimeError(state),
isFxpConversionsAvgTimePending: selectors.getIsFxpConversionsAvgTimePending(state),
isFxpConversionDetailsModalVisible: selectors.getIsFxpConversionDetailsModalVisible(state),
uiConfig: getUiConfig(state),
});

const dispatchProps = (dispatch: Dispatch) => ({
Expand Down Expand Up @@ -65,6 +68,7 @@ type FxpFxpConversionsProps = {
onViewAllReconcilationErrorsButtonClick: () => void;
onFxpConversionFinderButtonClick: () => void;
onFxpConversionRowClick: (fxpConversionError: FxpConversionError) => void;
uiConfig: { primaryColor: string };
};

const FxpFxpConversions: FC<FxpFxpConversionsProps> = ({
Expand All @@ -86,7 +90,9 @@ const FxpFxpConversions: FC<FxpFxpConversionsProps> = ({
onViewAllReconcilationErrorsButtonClick,
onFxpConversionFinderButtonClick,
onFxpConversionRowClick,
uiConfig,
}) => {
const { primaryColor } = uiConfig;
return (
<div className="fxpfxpConversions">
<Heading size="3">FXP Conversions Overview</Heading>
Expand All @@ -101,11 +107,13 @@ const FxpFxpConversions: FC<FxpFxpConversionsProps> = ({
data={fxpConversionsSuccessPerc}
error={fxpConversionsSuccessPercError}
isPending={isFxpConversionsSuccessPercPending}
legendColor={primaryColor}
/>
<FxpConversionsAvgTime
data={fxpConversionsAvgTime}
error={fxpConversionsAvgTimeError}
isPending={isFxpConversionsAvgTimePending}
legendColor={primaryColor}
/>
<FxpConversionsStatuses
isPending={isFxpConversionsStatusesPending}
Expand Down
20 changes: 15 additions & 5 deletions src/App/FxpConversions/components/FxpConversionAvgTime/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ interface FxpConversionsChartsProps {
isPending: boolean | undefined;
data?: XYCoordinate[];
error: ErrorMessage;
legendColor: string;
}

const FxpConversionsCharts: FC<FxpConversionsChartsProps> = ({ isPending, data, error }) => {
const FxpConversionsCharts: FC<FxpConversionsChartsProps> = ({
isPending,
data,
error,
legendColor,
}) => {
let content = null;
if (isPending || !data) {
content = (
Expand All @@ -23,8 +29,8 @@ const FxpConversionsCharts: FC<FxpConversionsChartsProps> = ({ isPending, data,
content = (
<ChartLayout
title="Average FxpConversion Time (E2E)"
legend={[{ label: 'Avg. FxpConversion Time in ms / Min', color: '#4fc7e7' }]}
Graph={() => <AverageFxpConversionTimeGraph data={data} />}
legend={[{ label: 'Avg. FxpConversion Time in ms / Min', color: legendColor }]}
Graph={() => <AverageFxpConversionTimeGraph data={data} chartColor={legendColor} />}
/>
);
}
Expand All @@ -33,9 +39,13 @@ const FxpConversionsCharts: FC<FxpConversionsChartsProps> = ({ isPending, data,

interface AverageFxpConversionTimeGraphProps {
data: XYCoordinate[];
chartColor: string;
}

const AverageFxpConversionTimeGraph: FC<AverageFxpConversionTimeGraphProps> = ({ data }) => {
const AverageFxpConversionTimeGraph: FC<AverageFxpConversionTimeGraphProps> = ({
data,
chartColor,
}) => {
const series = {
name: 'Average Response Time',
data,
Expand Down Expand Up @@ -66,7 +76,7 @@ const AverageFxpConversionTimeGraph: FC<AverageFxpConversionTimeGraphProps> = ({
width: [2],
curve: 'smooth',
},
colors: ['#4fc7e7'],
colors: [chartColor],
tooltip: {
x: {
formatter: (val: string | number) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ interface FxpConversionsSuccessPercProps {
isPending: boolean | undefined;
data?: XYCoordinate[];
error: ErrorMessage;
legendColor: string;
}

const FxpConversionsSuccessPerc: FC<FxpConversionsSuccessPercProps> = ({
isPending,
data,
error,
legendColor,
}) => {
let content = null;
if (isPending || !data) {
Expand All @@ -27,8 +29,8 @@ const FxpConversionsSuccessPerc: FC<FxpConversionsSuccessPercProps> = ({
content = (
<ChartLayout
title="Successful FxpConversions"
legend={[{ label: 'Percent / Min', color: '#4fc7e7' }]}
Graph={() => <SuccessfulFxpConversionGraph data={data} />}
legend={[{ label: 'Percent / Min', color: legendColor }]}
Graph={() => <SuccessfulFxpConversionGraph data={data} chartColor={legendColor} />}
/>
);
}
Expand All @@ -37,9 +39,13 @@ const FxpConversionsSuccessPerc: FC<FxpConversionsSuccessPercProps> = ({

interface SuccessfulFxpConversionGraphProps {
data: XYCoordinate[];
chartColor: string;
}

const SuccessfulFxpConversionGraph: FC<SuccessfulFxpConversionGraphProps> = ({ data }) => {
const SuccessfulFxpConversionGraph: FC<SuccessfulFxpConversionGraphProps> = ({
data,
chartColor,
}) => {
const series = {
name: 'Success Percentage',
data,
Expand Down Expand Up @@ -70,7 +76,7 @@ const SuccessfulFxpConversionGraph: FC<SuccessfulFxpConversionGraphProps> = ({ d
width: [2],
curve: 'smooth',
},
colors: ['#4fc7e7'],
colors: [chartColor],
tooltip: {
x: {
formatter: (val: string | number) => {
Expand Down
17 changes: 12 additions & 5 deletions src/App/Layout/Navbar/Navbar.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#navbar {
flex: 0 0 55px;
width: 100%;
background: #987;
webkit-user-select: none;
user-select: none;
height: 55px;
width: 100%;
background: linear-gradient(269.81deg, #043865 0.01%, #02182b 100%);
border-bottom: 5px solid #4fc7e7;
background: linear-gradient(269.81deg, var(--secondary-color) 0.01%, var(--accent-color) 100%);
border-bottom: 5px solid var(--primary-color);
display: flex;
align-items: center;
}
Expand Down Expand Up @@ -63,3 +60,13 @@
border-radius: 50%;
margin-left: 10px;
}
.navbar__dfsp-logo {
height: 30px;
margin-left: 15px;
object-fit: contain;
}
.navbar__country-logo {
height: 30px;
object-fit: cover;
margin-left: 15px;
}
Loading