Add payment result view default state. Set up build env (#328)

This commit is contained in:
Ildar Galeev 2024-07-24 20:37:17 +07:00 committed by GitHub
parent 17cb74690a
commit 0bfc635965
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 28 deletions

View File

@ -20,12 +20,10 @@ jobs:
uses: ./.github/actions/init
- name: Build
run: npm run build
- name: Set checkout version
uses: jossef/action-set-json-field@v2
with:
file: ./dist/v1/env.json
field: version
value: ${{ github.sha }}
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: Deploy image
uses: valitydev/action-deploy-docker@v2
with:
@ -61,12 +59,3 @@ jobs:
directory: 'dist'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: main
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: 'production'
sourcemaps: './dist'

View File

@ -35,8 +35,6 @@ creditCardType.addCard({
const initSentry = async (dsn: string) => {
const { init, BrowserTracing } = await import('@sentry/react');
const { CaptureConsole } = await import('@sentry/integrations');
const fetchEnv = withRetry(fetchConfig<{ version: string }>);
const env = await fetchEnv('./env.json');
init({
environment: 'production',
dsn,
@ -47,7 +45,6 @@ const initSentry = async (dsn: string) => {
}),
],
tracesSampleRate: 0.1,
release: env.version,
});
};

View File

@ -80,5 +80,15 @@ export const getResultInfo = (condition: PaymentCondition): ResultInfo => {
label: 'form.header.final.pending.label',
description: 'form.header.final.pending.description',
};
default:
const errDescription = `Unexpected Payment condition: ${condition.name}`;
console.error(errDescription, JSON.stringify(condition));
return {
iconName: 'WarningIcon',
color: 'red.500',
label: 'form.header.final.error.label',
description: errDescription,
hasActions: false,
};
}
};

View File

@ -1,3 +0,0 @@
{
"version": ""
}

View File

@ -27,10 +27,6 @@ export default defineConfig({
src: 'src/appConfig.json',
dest: './',
},
{
src: 'src/env.json',
dest: './',
},
{
src: 'src/assets/*',
dest: './assets',
@ -39,10 +35,10 @@ export default defineConfig({
}),
visualizer(),
sentryVitePlugin({
org: 'empayredev',
project: 'checkout',
telemetry: false,
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
telemetry: false,
}),
],
server: {