forked from wwWallet/wallet-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from gunet/gunet-workflows
Gunet workflows
- Loading branch information
Showing
16 changed files
with
255 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
HOST='0.0.0.0' | ||
PORT=3000 | ||
REACT_APP_FIREBASE_VAPIDKEY=<Your_Vapid_Key> | ||
REACT_APP_WS_URL=ws://wallet-backend-server:8002 | ||
REACT_APP_WALLET_BACKEND_URL=http://wallet-backend-server:8002 | ||
REACT_APP_LOGIN_WITH_PASSWORD=false | ||
REACT_APP_FIREBASE_API_KEY=<Your_Firebase_API_Key> | ||
REACT_APP_FIREBASE_AUTH_DOMAIN=<Your_Firebase_Auth_Domain> | ||
REACT_APP_FIREBASE_PROJECT_ID=<Your_Firebase_Project_ID> | ||
REACT_APP_FIREBASE_STORAGE_BUCKET=<Your_Firebase_Storage_Bucket> | ||
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=<Your_Firebase_Messaging_Sender_ID> | ||
REACT_APP_FIREBASE_APP_ID=<Your_Firebase_App_ID> | ||
REACT_APP_FIREBASE_MEASUREMENT_ID=<Your_Firebase_Measurement_ID> | ||
REACT_APP_DID_KEY_VERSION=jwk_jcs-pub | ||
HOST=VAR_HOST | ||
PORT=VAR_PORT | ||
REACT_APP_FIREBASE_VAPIDKEY=VAR_REACT_APP_FIREBASE_VAPIDKEY | ||
REACT_APP_WS_URL=VAR_REACT_APP_WS_URL | ||
REACT_APP_WALLET_BACKEND_URL=VAR_REACT_APP_WALLET_BACKEND_URL | ||
REACT_APP_LOGIN_WITH_PASSWORD=VAR_REACT_APP_LOGIN_WITH_PASSWORD | ||
REACT_APP_FIREBASE_API_KEY=VAR_REACT_APP_FIREBASE_API_KEY | ||
REACT_APP_FIREBASE_AUTH_DOMAIN=VAR_REACT_APP_FIREBASE_AUTH_DOMAIN | ||
REACT_APP_FIREBASE_PROJECT_ID=VAR_REACT_APP_FIREBASE_PROJECT_ID | ||
REACT_APP_FIREBASE_STORAGE_BUCKET=VAR_REACT_APP_FIREBASE_STORAGE_BUCKET | ||
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=VAR_REACT_APP_FIREBASE_MESSAGING_SENDER_ID | ||
REACT_APP_FIREBASE_APP_ID=VAR_REACT_APP_FIREBASE_APP_ID | ||
REACT_APP_FIREBASE_MEASUREMENT_ID=VAR_REACT_APP_FIREBASE_MEASUREMENT_ID | ||
REACT_APP_DID_KEY_VERSION=VAR_REACT_APP_DID_KEY_VERSION | ||
REACT_APP_VERSION=$npm_package_version | ||
REACT_APP_DISPLAY_CONSOLE=true | ||
REACT_APP_DISPLAY_CONSOLE=VAR_REACT_APP_DISPLAY_CONSOLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Build Docker image | ||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
- dc4eu-rome | ||
pull_request: | ||
|
||
jobs: | ||
build-front: | ||
permissions: | ||
contents: read | ||
packages: read | ||
|
||
uses: gunet/wallet-ecosystem/.github/workflows/docker-build-push.yml@dc4eu-rome | ||
secrets: inherit | ||
with: | ||
image-tag: ghcr.io/gunet/wallet-frontend:latest | ||
docker-push: false | ||
dockerfile-path: ./Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Push Docker image | ||
on: | ||
push: | ||
tags: | ||
- v0.* | ||
- v1.* | ||
- v2.* | ||
|
||
jobs: | ||
push-front: | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
uses: gunet/wallet-ecosystem/.github/workflows/docker-build-push.yml@dc4eu-rome | ||
secrets: inherit | ||
with: | ||
image-tag: ghcr.io/gunet/wallet-frontend:${{ github.ref_name }} | ||
docker-push: true | ||
dockerfile-path: ./Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,5 @@ src/config/config.prod.js | |
ssl_keys/* | ||
*.tar.gz | ||
.npmrc | ||
|
||
variables.vars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React, { createContext, useState, useEffect, useCallback } from 'react'; | ||
import { useApi } from '../api'; | ||
import { extractCredentialFriendlyName } from '../functions/extractCredentialFriendlyName'; | ||
|
||
const CredentialsContext = createContext(); | ||
|
||
export const CredentialsProvider = ({ children }) => { | ||
const api = useApi(); | ||
const [vcEntityList, setVcEntityList] = useState([]); | ||
const [latestCredentials, setLatestCredentials] = useState(new Set()); | ||
|
||
const getData = useCallback(async () => { | ||
try { | ||
const response = await api.get('/storage/vc'); | ||
const fetchedVcList = response.data.vc_list; | ||
const vcEntityList = await Promise.all(fetchedVcList.map(async vcEntity => { | ||
const name = await extractCredentialFriendlyName(vcEntity.credential); | ||
return { ...vcEntity, friendlyName: name }; | ||
})); | ||
vcEntityList.sort((vcA, vcB) => new Date(vcB.issuanceDate) - new Date(vcA.issuanceDate)); | ||
|
||
const latestIssuanceDate = vcEntityList[0]?.issuanceDate; | ||
const latestCreds = new Set(vcEntityList.filter(vc => vc.issuanceDate === latestIssuanceDate).map(vc => vc.id)); | ||
|
||
if (window.location.pathname.includes('/cb')) { | ||
setLatestCredentials(latestCreds); | ||
setTimeout(() => { | ||
setLatestCredentials(new Set()); | ||
}, 4000); | ||
} | ||
|
||
setVcEntityList(vcEntityList); | ||
} catch (error) { | ||
console.error('Failed to fetch data', error); | ||
} | ||
}, [api]); | ||
|
||
return ( | ||
<CredentialsContext.Provider value={{ vcEntityList, latestCredentials, getData }}> | ||
{children} | ||
</CredentialsContext.Provider> | ||
); | ||
}; | ||
|
||
export default CredentialsContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.