Skip to content

Commit

Permalink
Feat/ime 87 (#62)
Browse files Browse the repository at this point in the history
* Task/ime 261 redo mapping graphql final UI (#60)

* feat: Enhance GraphQL queries with additional fields for transfer details

* Added optional chaining to safely access the uid=1000(harlem) gid=1000(harlem) groups=1000(harlem),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),116(netdev),1001(docker) property of  in the TransferDetails component. This prevents runtime errors when  is null or undefined.

* Added optional chaining to safely access the uid=1000(harlem) gid=1000(harlem) groups=1000(harlem),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),116(netdev),1001(docker) property of  in the TransferDetails component. This prevents runtime errors when  is null or undefined.

* merged the code in preparation for enhancements

* Make fx fields and buttons hidden

* task/ime-242-verify_ui

* updated technical details fields

* task/ime-242-verify_ui

* updated technical details mapping

* updated mapping

* updated mapping

* Fix formatting issue

* task/ime-242-verify_ui

* task/ime-242-verify_ui

* updated the models and removed Transaction model

* feat: Update GraphQL queries to align with mock data structure

* feat: Update GraphQL queries to align with mock data structure

* changes

* feat: Update GraphQL queries to align with mock data structure

* updated types

* updated mapping to types

* updated mocks

* updated dashboard ui

* update: transfer summary dashboard ui and mapping

* UI mapping modal

* mapping done for modals

* fixed lint errors

* updated ui

* update: transfer summary dashboard UI

- Create new GraphQL query

- Map UI to the updated GraphQL schema

- Refine logic to display successful and failed transactions in doughnut charts

- Adjust dashboard UI alignment

* completed mapping

* updated payer information modal

* fix: white screen bug due to mock.ts

* update: transfer query to also add events fields

* fix: payer and payeeDFSP undefined bug in tranfer tables

* updated final ui

* fix: payerModal showing wrong fspId

fix: settlement batch id null

* update: UI mapping to new graphql changes

updated graphl query types

* update: transfer query to fetch FxQuote and FxTransfer events

* add: settlement batch id

- updated transfer query

- updated graphql types

- updated ui mapping to new graphQl

* fix: conversion terms source currency maaping

* fix: lint errors

---------

Co-authored-by: Mayhem <mwangilwa23@gmail.com>
Co-authored-by: Naph <naohtaliphiri@gmail.com>
Co-authored-by: Akhilesh Rawat <akhileshrawat.asr@gmail.com>

* Update config.yml

* Fix: resolved build error (#61)

* feat: Enhance GraphQL queries with additional fields for transfer details

* Added optional chaining to safely access the uid=1000(harlem) gid=1000(harlem) groups=1000(harlem),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),116(netdev),1001(docker) property of  in the TransferDetails component. This prevents runtime errors when  is null or undefined.

* Added optional chaining to safely access the uid=1000(harlem) gid=1000(harlem) groups=1000(harlem),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),116(netdev),1001(docker) property of  in the TransferDetails component. This prevents runtime errors when  is null or undefined.

* merged the code in preparation for enhancements

* Make fx fields and buttons hidden

* task/ime-242-verify_ui

* updated technical details fields

* task/ime-242-verify_ui

* updated technical details mapping

* updated mapping

* updated mapping

* Fix formatting issue

* task/ime-242-verify_ui

* task/ime-242-verify_ui

* updated the models and removed Transaction model

* feat: Update GraphQL queries to align with mock data structure

* feat: Update GraphQL queries to align with mock data structure

* changes

* feat: Update GraphQL queries to align with mock data structure

* updated types

* updated mapping to types

* updated mocks

* updated dashboard ui

* update: transfer summary dashboard ui and mapping

* UI mapping modal

* mapping done for modals

* fixed lint errors

* updated ui

* update: transfer summary dashboard UI

- Create new GraphQL query

- Map UI to the updated GraphQL schema

- Refine logic to display successful and failed transactions in doughnut charts

- Adjust dashboard UI alignment

* completed mapping

* updated payer information modal

* fix: white screen bug due to mock.ts

* update: transfer query to also add events fields

* fix: payer and payeeDFSP undefined bug in tranfer tables

* updated final ui

* fix: payerModal showing wrong fspId

fix: settlement batch id null

* update: UI mapping to new graphql changes

updated graphl query types

* update: transfer query to fetch FxQuote and FxTransfer events

* add: settlement batch id

- updated transfer query

- updated graphql types

- updated ui mapping to new graphQl

* fix: conversion terms source currency maaping

* fix: lint errors

* fix: yarn build bug

- updated mock.ts object types

---------

Co-authored-by: Mayhem <mwangilwa23@gmail.com>
Co-authored-by: Naph <naohtaliphiri@gmail.com>
Co-authored-by: Bupe <ngasebupe@gmail.com>

* Update LICENSE.md

* Update LICENSE.md

* Update CHANGELOG.md

---------

Co-authored-by: Bupe <46236053+NgaseBupe@users.noreply.github.com>
Co-authored-by: Mayhem <mwangilwa23@gmail.com>
Co-authored-by: Naph <naohtaliphiri@gmail.com>
Co-authored-by: Akhilesh Rawat <akhileshrawat.asr@gmail.com>
Co-authored-by: vijayg10 <33152110+vijayg10@users.noreply.github.com>
Co-authored-by: Bupe <ngasebupe@gmail.com>
  • Loading branch information
7 people authored Dec 24, 2024
1 parent 4b07a5c commit 79d60cd
Show file tree
Hide file tree
Showing 67 changed files with 9,499 additions and 1,151 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": [ "@babel/env","@babel/preset-react", "@babel/preset-typescript"],
"presets": ["@babel/env", "@babel/preset-react", "@babel/preset-typescript"],
"plugins": [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread",
Expand Down
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ executors:

default-machine:
machine:
image: ubuntu-1604:201903-01
image: ubuntu-2004:current

##
# Jobs
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:
- checkout
- restore_cache:
keys:
- dependency-cache-{{ checksum "yarn.lock" }}
- dependency-cache-{{ checksum "yarn.lock" }}
- run:
name: Configure git + ssh
command: |
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
description: ${RELEASE_CHANGES}
file-path: CHANGELOG.md
- slack/status:
webhook: "$SLACK_WEBHOOK_ANNOUNCEMENT"
webhook: '$SLACK_WEBHOOK_ANNOUNCEMENT'
success_message: '*"${CIRCLE_PROJECT_REPONAME}"* - Release \`"v${RELEASE_TAG}"\` \nhttps://github.com/mojaloop/"${CIRCLE_PROJECT_REPONAME}"/releases/tag/"v${RELEASE_TAG}"'

publish:
Expand Down Expand Up @@ -244,7 +244,7 @@ jobs:
docker push $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:${CIRCLE_TAG}
- slack/status:
fail_only: true
webhook: "$SLACK_WEBHOOK_ANNOUNCEMENT_CI_CD"
webhook: '$SLACK_WEBHOOK_ANNOUNCEMENT_CI_CD'
failure_message: 'Publishing docker image failed for: \`"${DOCKER_ORG}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_TAG}"\`'

#license-scan:
Expand Down
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = {
{
singleQuote: true,
trailingComma: 'all',
"endOfLine": "auto"
},
],
'react/prop-types': [
Expand All @@ -47,7 +48,7 @@ module.exports = {
'react/no-unescaped-entities': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-wrap-multilines': 'off',
'react/destructuring-assignment': 'off'
'react/destructuring-assignment': 'off',
},
overrides: [
{
Expand Down
100 changes: 47 additions & 53 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,55 @@ on:
types: [published]
push:
branches:
- '**'
- '**'

jobs:
main:
runs-on: ubuntu-latest
steps:
-
name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
with:
# Except for Dockerhub, which is the default, tags need to have the registry name in
# them, e.g. ghcr.io for Github container registry, or gcr.io for Google container
# registry.
# Note that the generated tags will look like:
# ghcr.io/{owner}/{repo}:version
images: ghcr.io/${{ github.repository }}
# For a release v1.2.3, we'll produce the following image tags
# v1.2.3
# 1.2.3
# 1.2
# latest
# For non-releases, we'll produce a long sha
flavor: |
latest=${{ github.event_name == 'release' }}
tags: |
type=match,pattern=v\d+\.\d+\.\d+,enable=${{ github.event_name == 'release' }}
type=match,pattern=v(\d+\.\d+\.\d+),enable=${{ github.event_name == 'release' }},group=1
type=match,pattern=v(\d+\.\d+)\.\d+,enable=${{ github.event_name == 'release' }},group=1
type=match,pattern=v(\d+)\.\d+\.\d+,group=1,enable=${{ !startsWith(github.ref, 'refs/tags/v0.') && github.event_name == 'release' }}
type=sha,event=push,value={{sha}},format=long,enable=${{ github.event_name != 'release' }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/${{ github.sha }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to GitHub Container Registry
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2.2.1
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
with:
# Except for Dockerhub, which is the default, tags need to have the registry name in
# them, e.g. ghcr.io for Github container registry, or gcr.io for Google container
# registry.
# Note that the generated tags will look like:
# ghcr.io/{owner}/{repo}:version
images: ghcr.io/${{ github.repository }}
# For a release v1.2.3, we'll produce the following image tags
# v1.2.3
# 1.2.3
# 1.2
# latest
# For non-releases, we'll produce a long sha
flavor: |
latest=${{ github.event_name == 'release' }}
tags: |
type=match,pattern=v\d+\.\d+\.\d+,enable=${{ github.event_name == 'release' }}
type=match,pattern=v(\d+\.\d+\.\d+),enable=${{ github.event_name == 'release' }},group=1
type=match,pattern=v(\d+\.\d+)\.\d+,enable=${{ github.event_name == 'release' }},group=1
type=match,pattern=v(\d+)\.\d+\.\d+,group=1,enable=${{ !startsWith(github.ref, 'refs/tags/v0.') && github.event_name == 'release' }}
type=sha,event=push,value={{sha}},format=long,enable=${{ github.event_name != 'release' }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/${{ github.sha }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2.2.1
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
182 changes: 91 additions & 91 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,108 +3,108 @@ name: Integration test
on:
push:
branches:
- '**'
- '**'

jobs:
manifest_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17.tar.gz
- name: Install dependencies in environment
run: nix-env -if integration_test/default.nix
- name: Validate integration test manifest
run: kustomize build integration_test | kubeconform -strict -kubernetes-version 1.17.9
- uses: actions/checkout@v2.3.4
- uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17.tar.gz
- name: Install dependencies in environment
run: nix-env -if integration_test/default.nix
- name: Validate integration test manifest
run: kustomize build integration_test | kubeconform -strict -kubernetes-version 1.17.9

integration_test:
timeout-minutes: 45
needs: manifest_check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

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

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

- name: Start cluster
run: minikube start --driver=docker --kubernetes-version=v1.21.5

- name: Install Mojaloop Charts
run: helm repo add mojaloop-charts https://docs.mojaloop.io/charts/repo

- name: Install BizOps Backend
run: helm upgrade --install backend mojaloop-charts/backend --devel -f integration_test/chart_values/backend.yaml

- name: Install BizOps Services
run: helm upgrade --install bof mojaloop-charts/bof --devel -f integration_test/chart_values/bof.yaml --version 1.0.0-557.7cb0c96

- name: Deploy
run: skaffold run -p integration-test

- name: Wait for kube api server to process and create all resources
# This is because the wait step that follows this one does this:
# 1. retrieve list of pods
# 2. wait for list of pods
# Unfortunately, the list of pods might not be complete at step (1), as all pods may not yet
# be created, meaning the list of pods waited on in step (2) is not complete. We therefore
# wait some time here to allow that to finish before we retrieve the list of pods to wait on.
# 30s should be more than enough.
run: sleep 30s

- name: Wait for deployment readiness
# Skaffold is supposed to do this, but for whatever reason, does not. At the time of writing,
# investigating this was not a priority.
run: timeout 900 kubectl wait --for=condition=Ready pod --all --timeout=900s

- name: Port-forward the portal frontend ingress
run: kubectl port-forward -n ingress-nginx --address 0.0.0.0 svc/ingress-nginx-controller 3000:80 &

- name: Port-forward voodoo-doll
run: kubectl port-forward --address 0.0.0.0 voodoo-doll 3030 &

- name: Install test dependencies
working-directory: integration_test/tests
run: |-
npm ci
- name: Run tests
working-directory: integration_test/tests
run: |-
TRANSFERS_MICROFRONTEND_ENDPOINT="http://localhost:3000" npm run test:headless
- name: Archive test report
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-report
path: integration_test/tests/report.html

- name: Print docker containers to check any issues with the cluster
if: ${{ failure() }}
run: docker ps

- name: Print voodoo doll logs
if: ${{ always() }}
run: kubectl logs voodoo-doll

- name: Print resources
if: ${{ always() }}
run: kubectl get svc,deploy,sts,pv,pvc,configmap,job,pod -A

- name: Describe resources
if: ${{ always() }}
run: kubectl describe svc,deploy,sts,pv,pvc,configmap,job,pod -A

- name: Print secret values
if: ${{ always() }}
run: |-
kubectl get secrets -o json | jq -r '.items[] | { name: .metadata.name, data: .data | map_values(@base64d) }'
- uses: actions/checkout@v2

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

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

- name: Start cluster
run: minikube start --driver=docker --kubernetes-version=v1.21.5

- name: Install Mojaloop Charts
run: helm repo add mojaloop-charts https://docs.mojaloop.io/charts/repo

- name: Install BizOps Backend
run: helm upgrade --install backend mojaloop-charts/backend --devel -f integration_test/chart_values/backend.yaml

- name: Install BizOps Services
run: helm upgrade --install bof mojaloop-charts/bof --devel -f integration_test/chart_values/bof.yaml --version 1.0.0-557.7cb0c96

- name: Deploy
run: skaffold run -p integration-test

- name: Wait for kube api server to process and create all resources
# This is because the wait step that follows this one does this:
# 1. retrieve list of pods
# 2. wait for list of pods
# Unfortunately, the list of pods might not be complete at step (1), as all pods may not yet
# be created, meaning the list of pods waited on in step (2) is not complete. We therefore
# wait some time here to allow that to finish before we retrieve the list of pods to wait on.
# 30s should be more than enough.
run: sleep 30s

- name: Wait for deployment readiness
# Skaffold is supposed to do this, but for whatever reason, does not. At the time of writing,
# investigating this was not a priority.
run: timeout 900 kubectl wait --for=condition=Ready pod --all --timeout=900s

- name: Port-forward the portal frontend ingress
run: kubectl port-forward -n ingress-nginx --address 0.0.0.0 svc/ingress-nginx-controller 3000:80 &

- name: Port-forward voodoo-doll
run: kubectl port-forward --address 0.0.0.0 voodoo-doll 3030 &

- name: Install test dependencies
working-directory: integration_test/tests
run: |-
npm ci
- name: Run tests
working-directory: integration_test/tests
run: |-
TRANSFERS_MICROFRONTEND_ENDPOINT="http://localhost:3000" npm run test:headless
- name: Archive test report
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-report
path: integration_test/tests/report.html

- name: Print docker containers to check any issues with the cluster
if: ${{ failure() }}
run: docker ps

- name: Print voodoo doll logs
if: ${{ always() }}
run: kubectl logs voodoo-doll

- name: Print resources
if: ${{ always() }}
run: kubectl get svc,deploy,sts,pv,pvc,configmap,job,pod -A

- name: Describe resources
if: ${{ always() }}
run: kubectl describe svc,deploy,sts,pv,pvc,configmap,job,pod -A

- name: Print secret values
if: ${{ always() }}
run: |-
kubectl get secrets -o json | jq -r '.items[] | { name: .metadata.name, data: .data | map_values(@base64d) }'
# - name: Setup tmate session
# if: ${{ failure() }}
Expand Down
4 changes: 1 addition & 3 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-scss"
],
"plugins": ["stylelint-scss"],
"rules": {
"at-rule-no-unknown": null,
"scss/at-rule-no-unknown": true,
Expand Down
9 changes: 5 additions & 4 deletions .versionrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
header: '# Changelog: [mojaloop/reporting-hub-bop-trx-ui](https://github.com/mojaloop/reporting-hub-bop-trx-ui)',
header:
'# Changelog: [mojaloop/reporting-hub-bop-trx-ui](https://github.com/mojaloop/reporting-hub-bop-trx-ui)',
types: [
{ type: 'feat', section: 'Features' },
{ type: 'fix', section: 'Bug Fixes' },
Expand All @@ -9,6 +10,6 @@ module.exports = {
{ type: 'style', section: 'Style Improvements' },
{ type: 'refactor', section: 'Code Refactor' },
{ type: 'perf', section: 'Performance' },
{ type: 'test', section: 'Tests' }
]
}
{ type: 'test', section: 'Tests' },
],
};
Loading

0 comments on commit 79d60cd

Please sign in to comment.