Skip to content

Commit c3d43fe

Browse files
howardwkimHoward Kim
andauthored
Release/1.21.6.clean (#58)
* Increase map render threshold (#32) * format on save * Increase MAP_RENDER_POINT_THRESHOLD * format on save * increase SAMPLE_VIS_MAX_QUERY_SIZE to match * format on save * GRUMP Visualization hide logic' * additional hide logic' * simplify logic * refactor section header * format on save * pause data fetching on recommended datasets --------- Co-authored-by: Howard Kim <hwk@uw.edu> * Feature/dataset download improvements (#35) * format on save * open download link directly --------- Co-authored-by: Howard Kim <hwk@uw.edu> * Merge release/1.21.4 * Format Entire Codebase and Ignore in Git Blame (#40) * Format entire codebase * git blame ignore these revisions --------- Co-authored-by: Howard Kim <hwk@uw.edu> * add howard (#44) Co-authored-by: Howard Kim <hwk@uw.edu> * add ignore revs * Feature/chore cleanup logs (#45) * nit * rm logs * unused * rm logs --------- Co-authored-by: Howard Kim <hwk@uw.edu> * bump * Release/1.21.4 EBS: 06-04-21-340 redo (#38) * Increase map render threshold (#32) * format on save * Increase MAP_RENDER_POINT_THRESHOLD * format on save * increase SAMPLE_VIS_MAX_QUERY_SIZE to match * format on save * GRUMP Visualization hide logic' * additional hide logic' * simplify logic * refactor section header * format on save * pause data fetching on recommended datasets --------- Co-authored-by: Howard Kim <hwk@uw.edu> * Feature/dataset download improvements (#35) * format on save * open download link directly --------- Co-authored-by: Howard Kim <hwk@uw.edu> * bump * nit * Revert Data Thresholds * Fix alignment * note on duplicate constant * rm unused * nit * nit * button loading state * Add direct download suggestion threshold constant * Add large dataset warning dialog to DownloadDialog component * Refactor DownloadDialog to include conditional rendering for download steps based on dataset size, integrating a new DownloadStepWithWarning component for large datasets. * Remove unused Grid component and refactor DownloadStepWithWarning integration in DownloadDialog. * Remove debug console logs from DownloadDialog component for cleaner code. * Enhance LargeDatasetWarningDialog to display the number of rows in the dataset for better user awareness during downloads. * Add Direct Download button to LargeDatasetWarningDialog for improved user experience * Refactor DownloadDialog to ensure main dialog closes upon direct download and download confirmation, enhancing user flow. * Update button text in LargeDatasetWarningDialog to clarify direct download action * oops! --------- Co-authored-by: Howard Kim <hwk@uw.edu> * Sentry (#52) * revert docs * Fix Decision Tree * ignore * Disable deprecated API warnings * add Sentry packages * downgrade sentry version * add sentry to root * add tracing package * fix * snetry cli * ignore env * add sentry script * Sentry initialization logic per environment * wip * add environments * rm x-sentry-token * default to dev * no staging on front * mv * pii false * rm unused --------- Co-authored-by: Howard Kim <hwk@uw.edu> * bump --------- Co-authored-by: Howard Kim <hwk@uw.edu>
1 parent 2ab3b50 commit c3d43fe

File tree

5 files changed

+225
-48
lines changed

5 files changed

+225
-48
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ src/buildInfo.json
1818
# misc
1919
**/.DS_Store
2020
.DS_Store
21+
.env
2122
.env.local
2223
.env.development.local
2324
.env.test.local
@@ -27,3 +28,5 @@ src/buildInfo.json
2728
npm-debug.log*
2829
yarn-debug.log*
2930
yarn-error.log*
31+
32+
notes

docs/logging.md

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,40 +45,24 @@ Until logs are forwarded to persistence, there is no need to alter formatting fo
4545
| 1 | Error | errors which prevent the application from running as intended |
4646
| 0 | Fatal | errers which prevent the service from operating; data loss |
4747

48-
## Decision Tree
49-
50-
┌──────────┐
51-
│Who is the│
52-
Developer ◄──── │ log for? ├────► Admin
53-
│ └──────────┘ │
54-
│ │
55-
▼ ▼
56-
▼ ▼
57-
┌──────────────┐ ┌───────────────┐
58-
│Do you need to│ │Are you logging│
59-
60-
NOPE ─────┤ log state ? ├──── YES NOPE ────┤unwanted state?├─── YES
61-
└──────────────┘ └───────────────┘
62-
│ │ │ │
63-
│ │ │ │
64-
▼ ▼ ▼ │
65-
▼ ▼ ▼ │
66-
┌───────┴───────┐
67-
TRACE DEBUG INFO │Can the process│
68-
YES ────┤ continue │
69-
│ with the ├──── NO!
70-
│ │unwanted state?│
71-
│ └───────────────┘ │
72-
▼ │
73-
▼ ▼
74-
75-
WARN ┌───────────────┐
76-
│Can the service│
77-
YES ────┤ continue ├──── NO!
78-
│ with the │
79-
│ │unwanted state?│ │
80-
│ └───────────────┘ │
81-
▼ ▼
82-
▼ ▼
83-
84-
ERROR FATAL
48+
## Logging Decision Tree
49+
50+
```mermaid
51+
flowchart TD
52+
A[Who is the log for?] --> B[Developer]
53+
A --> C[Admin]
54+
55+
B --> D{Do you need to log state?}
56+
D -->|No| E[TRACE]
57+
D -->|Yes| F[DEBUG]
58+
59+
C --> G{Are you logging unwanted state?}
60+
G -->|No| H[INFO]
61+
G -->|Yes| I{Can the process continue with the unwanted state?}
62+
63+
I -->|Yes| J[WARN]
64+
I -->|No| K{Can the service continue with the unwanted state?}
65+
66+
K -->|Yes| L[ERROR]
67+
K -->|No| M[FATAL]
68+
```

package-lock.json

Lines changed: 162 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "cmap_react",
3-
"version": "1.21.5",
3+
"version": "1.21.6",
44
"private": true,
55
"scripts": {
6-
"start": "npm run pre-build && react-scripts --max_old_space_size=4096 start",
6+
"start": "export REACT_APP_ENABLE_SENTRY=false && npm run pre-build && react-scripts --max_old_space_size=4096 start",
7+
"start:sentry": "export REACT_APP_ENABLE_SENTRY=true && npm run pre-build && react-scripts --max_old_space_size=4096 start",
78
"pre-build": "node generateBuildInfo.js > src/buildInfo.json",
89
"build": "npm run pre-build && react-scripts --max_old_space_size=4096 build && npm run tagv && mv ./build/index.html ./build/app.html",
910
"tagv": "./scripts/create-tag-file.js",
@@ -23,6 +24,8 @@
2324
"@material-ui/lab": "^4.0.0-alpha.56",
2425
"@material-ui/pickers": "^3.2.10",
2526
"@react-oauth/google": "^0.12.1",
27+
"@sentry/react": "^6.19.7",
28+
"@sentry/tracing": "^6.19.7",
2629
"ag-grid-community": "^22.0.0",
2730
"ag-grid-enterprise": "^22.0.0",
2831
"ag-grid-react": "^22.0.0",

src/index.js

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,49 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import './Stylesheets/index.css';
4-
import 'ag-grid-enterprise';
5-
6-
import * as serviceWorker from './serviceWorker';
7-
83
import { Provider } from 'react-redux';
4+
import { LicenseManager } from 'ag-grid-enterprise';
5+
import * as Sentry from '@sentry/react';
6+
import { Integrations } from '@sentry/tracing';
7+
import * as serviceWorker from './serviceWorker';
98
import store from './Redux/store';
10-
119
import App from './App';
12-
13-
import { LicenseManager } from 'ag-grid-enterprise';
10+
import './Stylesheets/index.css';
11+
import 'ag-grid-enterprise';
1412

1513
LicenseManager.setLicenseKey(
1614
'School_of_Oceanography_Simons_CMAP_1Devs_1Deployment_19_June_2020__MTU5MjUyMTIwMDAwMA==aec33f954c06d90afed06467402921bd',
1715
);
1816

17+
// `npm run start:sentry` will set process.env.REACT_APP_ENABLE_SENTRY to true
18+
// for enabling Sentry locally
19+
if (
20+
process.env.NODE_ENV === 'production' ||
21+
process.env.REACT_APP_ENABLE_SENTRY === 'true'
22+
) {
23+
Sentry.init({
24+
dsn: process.env.REACT_APP_SENTRY_DSN,
25+
release: process.env.REACT_APP_SENTRY_RELEASE || 'development',
26+
environment: process.env.NODE_ENV,
27+
28+
// Setting this option to true will send default PII data to Sentry.
29+
// For example, automatic IP address collection on events
30+
sendDefaultPii: false,
31+
integrations: [new Integrations.BrowserTracing()],
32+
// Tracing
33+
tracesSampleRate: 1.0, // Capture 100% of the transactions
34+
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
35+
tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/],
36+
// Session Replay
37+
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
38+
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
39+
});
40+
}
41+
1942
const rootElement = document.getElementById('root');
2043

44+
// We're using React 16.13.1 where ReactDOM.render is the standard API.
45+
// The createRoot API is not available in React 16, so this warning can be safely ignored.
46+
/* eslint-disable react/no-deprecated */
2147
ReactDOM.render(
2248
<Provider store={store}>
2349
<App />

0 commit comments

Comments
 (0)