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
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:
# be deployed to ECS.
docker build \
--build-arg NPM_TOKEN=${{ secrets.NPM_TOKEN }} \
--build-arg SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ jobs:
run: |
DOCKER_BUILDKIT=1 docker build \
--build-arg NPM_TOKEN=$NPM_TOKEN \
--build-arg SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG

Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ generate-devel-token.json
.idea/

generate-devel-token-*
# Sentry Config File
.sentryclirc
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ FROM node:18-alpine3.17 as base

COPY package.json ./
COPY yarn.lock ./
ARG SENTRY_AUTH_TOKEN
ARG NPM_TOKEN
ARG NPM_TOKEN
RUN echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
RUN ["yarn", "install", "--frozen-lockfile", "--ignore-scripts"]
RUN rm -f .npmrc

COPY . .

RUN ["yarn", "build"]
RUN ["yarn", "sentry:sourcemaps"]


FROM alpine:3.14 as web
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"@craco/craco": "^6.4.3",
"@craftjs/core": "^0.2.0-beta.5",
"@reduxjs/toolkit": "^1.8.3",
"@sentry/cli": "^2.23.0",
"@sentry/react": "^7.84.0",
"@silevis/reactgrid": "^4.0.4",
"@zendeskgarden/react-dropdowns": "^8.75.0",
"@zendeskgarden/react-theming": "^8.75.0",
Expand Down Expand Up @@ -78,8 +76,7 @@
"prettier": "npx prettier --write 'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}'",
"translate": "i18next-scanner",
"generate-api": ". ./.env.development; API_URL=$REACT_APP_API_URL/reference/ npx @rtk-query/codegen-openapi src/services/tryberApi/config.ts",
"generate-fixtures": ". ./.env.development; API_URL=$REACT_APP_API_URL/reference/; npx @appquality/fixture-generator -u $API_URL && npx prettier --write 'tests/api/**/*.json'",
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org appquality-srl --project tryber-backoffice ./build && sentry-cli sourcemaps upload --org appquality-srl --project tryber-backoffice ./build"
"generate-fixtures": ". ./.env.development; API_URL=$REACT_APP_API_URL/reference/; npx @appquality/fixture-generator -u $API_URL && npx prettier --write 'tests/api/**/*.json'"
},
"browserslist": {
"production": [
Expand Down
152 changes: 69 additions & 83 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "./App.css";

import * as Sentry from "@sentry/react";
import { createBrowserHistory } from "history";
import { Provider } from "react-redux";
import { BrowserRouter, Route, Router, Switch } from "react-router-dom";
Expand All @@ -13,7 +12,6 @@ import EditPreselectionForm from "src/pages/preselectionForms/edit";
import NewPreselectionForm from "src/pages/preselectionForms/new";
import { setupStore } from "src/store";
import { PageTemplate } from "./features/PageTemplate";
import SentryWrapper from "./features/SentryWrapper";
import AgreementsList from "./pages/agreements/list";
import SingleAgreementNew from "./pages/agreements/new";
import SingleAgreementEdit from "./pages/agreements/view-edit";
Expand All @@ -27,91 +25,79 @@ import CampaignPreselectionList from "./pages/preselectionForms";
import Prospect from "./pages/Prospect";
import UxDashboard from "./pages/UxDashboard";

const SentryRoute = Sentry.withSentryRouting(Route);
const history = createBrowserHistory();

function App() {
return (
<SentryWrapper history={history}>
<Provider store={setupStore()}>
<BrowserRouter>
<Router history={history}>
<Switch>
<SentryRoute
path={`/backoffice/campaigns/:id/bugs`}
component={BugsList}
/>
<SentryRoute
path={`/backoffice/campaigns/:id/prospect`}
component={Prospect}
/>
<SentryRoute path={`/backoffice/new`} component={Create} />
<SentryRoute
path="/backoffice/payments"
component={AdminPayments}
/>
<SentryRoute
path="/backoffice/preselection-forms/new"
component={NewPreselectionForm}
/>
<SentryRoute
path="/backoffice/preselection-forms/:id"
component={EditPreselectionForm}
/>
<SentryRoute
path="/backoffice/preselection-forms"
component={CampaignPreselectionList}
/>
<SentryRoute
path="/backoffice/campaigns/new/success"
component={NewCampaignSuccess}
/>
<SentryRoute
path="/backoffice/campaigns/new"
component={NewCampaign}
/>
<SentryRoute
path="/backoffice/campaigns/:id/edit"
component={EditCampaign}
/>
<SentryRoute
path="/backoffice/campaigns/:id/quotes"
component={QuotesPage}
/>
<SentryRoute
path="/backoffice/campaigns/:id/selection"
component={SelectionPage}
/>
<SentryRoute
path="/backoffice/campaigns/:id/ux-dashboard"
component={UxDashboard}
/>
<SentryRoute path="/backoffice/campaigns" component={Campaigns} />
<SentryRoute
path="/backoffice/agreements/new"
component={SingleAgreementNew}
/>
<SentryRoute
path="/backoffice/agreements/:id"
component={SingleAgreementEdit}
/>
<SentryRoute
path="/backoffice/agreements"
component={AgreementsList}
/>
<SentryRoute
path={`/backoffice/testUnguess`}
component={() => (
<PageTemplate type="unguess">TestUnguess</PageTemplate>
)}
/>
<SentryRoute path={`/backoffice/:id`} component={Update} />
<SentryRoute path={`/backoffice`} component={List} />
</Switch>
</Router>
</BrowserRouter>
</Provider>
</SentryWrapper>
<Provider store={setupStore()}>
<BrowserRouter>
<Router history={history}>
<Switch>
<Route
path={`/backoffice/campaigns/:id/bugs`}
component={BugsList}
/>
<Route
path={`/backoffice/campaigns/:id/prospect`}
component={Prospect}
/>
<Route path={`/backoffice/new`} component={Create} />
<Route path="/backoffice/payments" component={AdminPayments} />
<Route
path="/backoffice/preselection-forms/new"
component={NewPreselectionForm}
/>
<Route
path="/backoffice/preselection-forms/:id"
component={EditPreselectionForm}
/>
<Route
path="/backoffice/preselection-forms"
component={CampaignPreselectionList}
/>
<Route
path="/backoffice/campaigns/new/success"
component={NewCampaignSuccess}
/>
<Route path="/backoffice/campaigns/new" component={NewCampaign} />
<Route
path="/backoffice/campaigns/:id/edit"
component={EditCampaign}
/>
<Route
path="/backoffice/campaigns/:id/quotes"
component={QuotesPage}
/>
<Route
path="/backoffice/campaigns/:id/selection"
component={SelectionPage}
/>
<Route
path="/backoffice/campaigns/:id/ux-dashboard"
component={UxDashboard}
/>
<Route path="/backoffice/campaigns" component={Campaigns} />
<Route
path="/backoffice/agreements/new"
component={SingleAgreementNew}
/>
<Route
path="/backoffice/agreements/:id"
component={SingleAgreementEdit}
/>
<Route path="/backoffice/agreements" component={AgreementsList} />
<Route
path={`/backoffice/testUnguess`}
component={() => (
<PageTemplate type="unguess">TestUnguess</PageTemplate>
)}
/>
<Route path={`/backoffice/:id`} component={Update} />
<Route path={`/backoffice`} component={List} />
</Switch>
</Router>
</BrowserRouter>
</Provider>
);
}

Expand Down
8 changes: 0 additions & 8 deletions src/features/PageTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
ToastProvider,
GlobalStyle as UnguessGlobalStyle,
} from "@appquality/unguess-design-system";
import * as Sentry from "@sentry/react";
import { ThemeProvider as UnguessThemeProvider } from "@zendeskgarden/react-theming";
import React from "react";
import TagManager from "react-gtm-module";
Expand Down Expand Up @@ -37,13 +36,6 @@ export const PageTemplate = ({
event: "ApiLoaded",
},
});
Sentry.setUser({
id: user?.id ?? 0,
email: user?.email ?? "unknown",
username: user?.username ?? "unknown",
wp_user_id: user?.wp_user_id ?? 0,
role: user?.role ?? "unknown",
});
if (error) {
if ("status" in error && error.status === 403) {
return (
Expand Down
41 changes: 0 additions & 41 deletions src/features/SentryWrapper.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions src/features/isStagingEnvironment.tsx

This file was deleted.

Loading
Loading