Skip to content
Open
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
90 changes: 51 additions & 39 deletions .github/workflows/deploy_branch_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ name: Deploy Branch Preview
on: [pull_request]

jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
test:
name: Lint & Test
runs-on: ubuntu-latest
Expand Down Expand Up @@ -47,12 +59,12 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: expo/expo-github-action@v5
with:
expo-packager: npm
expo-username: ${{ secrets.EXPO_CLI_TEST_USERNAME }}
expo-password: ${{ secrets.EXPO_CLI_TEST_PASSWORD }}
expo-cache: true
# - uses: expo/expo-github-action@v5
# with:
# expo-packager: npm
# expo-username: ${{ secrets.EXPO_CLI_TEST_USERNAME }}
# expo-password: ${{ secrets.EXPO_CLI_TEST_PASSWORD }}
# expo-cache: true
- name: Cache Node Modules
uses: actions/cache@v2
env:
Expand All @@ -78,36 +90,36 @@ jobs:
run: |
echo Build number is $GITHUB_RUN_NUMBER
echo Latest release is ${{ steps.latestBinaryVersion.outputs.version }}
- name: Expo Publish Channel
env:
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
APP_BUILD_VERSION: ${{ github.run_number }}
APP_BINARY_VERSION: ${{ steps.latestBinaryVersion.outputs.version }}
DOMAIN_FORMAT: ${{ secrets.TEST_DOMAIN_FORMAT }}
run: expo publish --non-interactive --release-channel pr${{ github.event.number }}
- name: Expo Publish Storybook Channel
env:
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
APP_BUILD_VERSION: ${{ github.run_number }}
APP_BINARY_VERSION: ${{ steps.latestBinaryVersion.outputs.version }}
DOMAIN_FORMAT: ${{ secrets.TEST_DOMAIN_FORMAT }}
run: expo publish --non-interactive --release-channel storybook-pr${{ github.event.number }}
- name: Add Comment To PR
uses: mshick/add-pr-comment@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EXPO_PROJECT: "@supplyallytest/rationally"
with:
message: |
## Application
![Expo QR](https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=exp://exp.host/${{ env.EXPO_PROJECT }}?release-channel=pr${{ github.event.number }})
Published to https://exp.host/${{ env.EXPO_PROJECT }}?release-channel=pr${{ github.event.number }}
## Storybook
![Expo QR](https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=exp://exp.host/${{ env.EXPO_PROJECT }}?release-channel=storybook-pr${{ github.event.number }})
Published to https://exp.host/${{ env.EXPO_PROJECT }}?release-channel=storybook-pr${{ github.event.number }}
# - name: Expo Publish Channel
# env:
# SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
# SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
# APP_BUILD_VERSION: ${{ github.run_number }}
# APP_BINARY_VERSION: ${{ steps.latestBinaryVersion.outputs.version }}
# DOMAIN_FORMAT: ${{ secrets.TEST_DOMAIN_FORMAT }}
# run: expo publish --non-interactive --release-channel pr${{ github.event.number }}
# - name: Expo Publish Storybook Channel
# env:
# SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
# SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
# APP_BUILD_VERSION: ${{ github.run_number }}
# APP_BINARY_VERSION: ${{ steps.latestBinaryVersion.outputs.version }}
# DOMAIN_FORMAT: ${{ secrets.TEST_DOMAIN_FORMAT }}
# run: expo publish --non-interactive --release-channel storybook-pr${{ github.event.number }}
# - name: Add Comment To PR
# uses: mshick/add-pr-comment@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# EXPO_PROJECT: "@supplyallytest/rationally"
# with:
# message: |
# ## Application
# ![Expo QR](https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=exp://exp.host/${{ env.EXPO_PROJECT }}?release-channel=pr${{ github.event.number }})
# Published to https://exp.host/${{ env.EXPO_PROJECT }}?release-channel=pr${{ github.event.number }}
# ## Storybook
# ![Expo QR](https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=exp://exp.host/${{ env.EXPO_PROJECT }}?release-channel=storybook-pr${{ github.event.number }})
# Published to https://exp.host/${{ env.EXPO_PROJECT }}?release-channel=storybook-pr${{ github.event.number }}
27 changes: 20 additions & 7 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
sonar.projectKey=Open-Attestation_identity-wallet
sonar.organization=open-attestation
sonar.projectName=identity-wallet
sonar.projectVersion=1.0
sonar.test.inclusions=src/**/*.test.ts,src/**/*.test.tsx
sonar.inclusions=src/**
sonar.typescript.lcov.reportPaths=coverage/lcov.info
# sonar.projectKey=Open-Attestation_identity-wallet
# sonar.organization=open-attestation
# sonar.projectName=identity-wallet
# sonar.projectVersion=1.0
# sonar.test.inclusions=src/**/*.test.ts,src/**/*.test.tsx
# sonar.inclusions=src/**
# sonar.typescript.lcov.reportPaths=coverage/lcov.info

sonar.projectKey=ddwsd_mobile-application
sonar.organization=ddwsd-sonarcloud

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=mobile-application
#sonar.projectVersion=1.0

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
#sonar.sources=.

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
3 changes: 3 additions & 0 deletions src/context/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ const messageToTranslationKeyMappings: Record<string, string> = {
};

const getTranslationKeyFromErrorMessage = (message: string): string => {
const c = 2;
if (c > 0) {
}
return messageToTranslationKeyMappings[message] ?? message;
};

Expand Down