@corva/create-app 0.0.0-73c49372
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +211 -0
- package/bin/cca.js +5 -0
- package/bin/create-corva-app.cjs +30 -0
- package/common/node/.env +15 -0
- package/common/node/.env.sample +26 -0
- package/common/node/gitignore +130 -0
- package/common/package.json +3 -0
- package/common/python/.env +5 -0
- package/common/python/.env.sample +7 -0
- package/common/python/Makefile +15 -0
- package/common/python/gitignore +161 -0
- package/common/python/requirements.txt +2 -0
- package/lib/commands/attach.js +28 -0
- package/lib/commands/create.js +463 -0
- package/lib/commands/release.js +52 -0
- package/lib/commands/rerun.js +34 -0
- package/lib/commands/zip.js +39 -0
- package/lib/constants/cache.js +5 -0
- package/lib/constants/cli.js +24 -0
- package/lib/constants/manifest.js +262 -0
- package/lib/constants/messages.js +15 -0
- package/lib/constants/package.js +269 -0
- package/lib/flow.js +53 -0
- package/lib/flows/attach.js +8 -0
- package/lib/flows/lib/api.js +376 -0
- package/lib/flows/lib/create-zip-archive.js +83 -0
- package/lib/flows/lib/json.js +30 -0
- package/lib/flows/lib/manifest.js +81 -0
- package/lib/flows/lib/notification.js +142 -0
- package/lib/flows/lib/step-error.js +10 -0
- package/lib/flows/lib/waitForMs.js +3 -0
- package/lib/flows/prepare.js +6 -0
- package/lib/flows/release.js +26 -0
- package/lib/flows/rerun.js +8 -0
- package/lib/flows/steps/attach/add-app-to-stream.js +23 -0
- package/lib/flows/steps/attach/get-all-live-assets.js +135 -0
- package/lib/flows/steps/attach/index.js +5 -0
- package/lib/flows/steps/attach/prepare-data.js +19 -0
- package/lib/flows/steps/prepare-load-app-files.js +12 -0
- package/lib/flows/steps/release/add-label.js +10 -0
- package/lib/flows/steps/release/add-notes.js +10 -0
- package/lib/flows/steps/release/get-config.js +41 -0
- package/lib/flows/steps/release/prepare-data.js +12 -0
- package/lib/flows/steps/release/publish.js +11 -0
- package/lib/flows/steps/release/remove-failed-upload.js +21 -0
- package/lib/flows/steps/release/upload-zip-to-corva.js +62 -0
- package/lib/flows/steps/release/wait-for-build.js +36 -0
- package/lib/flows/steps/rerun/create-task.js +77 -0
- package/lib/flows/steps/rerun/ensure-that-app-in-stream.js +68 -0
- package/lib/flows/steps/rerun/get-app-version.js +111 -0
- package/lib/flows/steps/rerun/prepare-data.js +162 -0
- package/lib/flows/steps/rerun/prepare-well-and-stream-data.js +188 -0
- package/lib/flows/steps/rerun/rerun.js +13 -0
- package/lib/flows/steps/zip-cleanup.js +17 -0
- package/lib/flows/steps/zip-create-archive.js +15 -0
- package/lib/flows/steps/zip-file-list-resolve.js +260 -0
- package/lib/flows/steps/zip-prepare.js +20 -0
- package/lib/flows/steps/zip.js +6 -0
- package/lib/flows/zip-simple.js +6 -0
- package/lib/flows/zip.js +7 -0
- package/lib/helpers/cli-version.js +114 -0
- package/lib/helpers/commands.js +13 -0
- package/lib/helpers/logger.js +35 -0
- package/lib/helpers/manifest.js +74 -0
- package/lib/helpers/resolve-app-runtime.js +128 -0
- package/lib/helpers/utils.js +91 -0
- package/lib/helpers/versioning.js +94 -0
- package/lib/main.js +68 -0
- package/lib/options/api-key.js +6 -0
- package/lib/options/app-key.js +6 -0
- package/lib/options/app-version.js +3 -0
- package/lib/options/bump-version.js +19 -0
- package/lib/options/cache.js +11 -0
- package/lib/options/env.js +3 -0
- package/lib/options/original-cwd.js +3 -0
- package/lib/options/silent.js +3 -0
- package/package.json +104 -0
- package/template_extensions/corva/.commitlintrc.json +6 -0
- package/template_extensions/corva/.github/pull_request_template.md +14 -0
- package/template_extensions/corva/.github/workflows/code-checks.yml +15 -0
- package/template_extensions/corva/.github/workflows/develop.yml +17 -0
- package/template_extensions/corva/.github/workflows/feat-fix-delete.yml +14 -0
- package/template_extensions/corva/.github/workflows/feat-fix.yml +23 -0
- package/template_extensions/corva/.github/workflows/release-fix-X.X.X.yml +16 -0
- package/template_extensions/corva/.github/workflows/validate-pr-title.yml +19 -0
- package/template_extensions/corva/.husky/commit-msg +5 -0
- package/template_extensions/corva/.husky/pre-commit +4 -0
- package/templates/scheduler_data-time/javascript/README.md +19 -0
- package/templates/scheduler_data-time/javascript/__tests__/processor.spec.js +15 -0
- package/templates/scheduler_data-time/javascript/index.js +15 -0
- package/templates/scheduler_data-time/python/README.md +31 -0
- package/templates/scheduler_data-time/python/lambda_function.py +7 -0
- package/templates/scheduler_data-time/python/test/__init__.py +0 -0
- package/templates/scheduler_data-time/python/test/app_test.py +10 -0
- package/templates/scheduler_data-time/typescript/README.md +25 -0
- package/templates/scheduler_data-time/typescript/__tests__/processor.spec.ts +15 -0
- package/templates/scheduler_data-time/typescript/index.ts +8 -0
- package/templates/scheduler_depth/javascript/README.md +19 -0
- package/templates/scheduler_depth/javascript/__tests__/processor.spec.js +17 -0
- package/templates/scheduler_depth/javascript/index.js +15 -0
- package/templates/scheduler_depth/python/README.md +31 -0
- package/templates/scheduler_depth/python/lambda_function.py +7 -0
- package/templates/scheduler_depth/python/test/__init__.py +0 -0
- package/templates/scheduler_depth/python/test/app_test.py +10 -0
- package/templates/scheduler_depth/typescript/README.md +25 -0
- package/templates/scheduler_depth/typescript/__tests__/processor.spec.ts +17 -0
- package/templates/scheduler_depth/typescript/index.ts +8 -0
- package/templates/scheduler_natural-time/javascript/README.md +19 -0
- package/templates/scheduler_natural-time/javascript/__tests__/processor.spec.js +15 -0
- package/templates/scheduler_natural-time/javascript/index.js +15 -0
- package/templates/scheduler_natural-time/python/README.md +31 -0
- package/templates/scheduler_natural-time/python/lambda_function.py +7 -0
- package/templates/scheduler_natural-time/python/test/__init__.py +0 -0
- package/templates/scheduler_natural-time/python/test/app_test.py +10 -0
- package/templates/scheduler_natural-time/typescript/README.md +25 -0
- package/templates/scheduler_natural-time/typescript/__tests__/processor.spec.ts +15 -0
- package/templates/scheduler_natural-time/typescript/index.ts +8 -0
- package/templates/stream_depth/javascript/README.md +19 -0
- package/templates/stream_depth/javascript/__tests__/processor.spec.js +20 -0
- package/templates/stream_depth/javascript/index.js +14 -0
- package/templates/stream_depth/python/README.md +31 -0
- package/templates/stream_depth/python/lambda_function.py +7 -0
- package/templates/stream_depth/python/test/__init__.py +0 -0
- package/templates/stream_depth/python/test/app_test.py +16 -0
- package/templates/stream_depth/typescript/README.md +25 -0
- package/templates/stream_depth/typescript/__tests__/processor.spec.ts +20 -0
- package/templates/stream_depth/typescript/index.ts +8 -0
- package/templates/stream_time/javascript/README.md +19 -0
- package/templates/stream_time/javascript/__tests__/processor.spec.js +14 -0
- package/templates/stream_time/javascript/index.js +14 -0
- package/templates/stream_time/python/README.md +31 -0
- package/templates/stream_time/python/lambda_function.py +7 -0
- package/templates/stream_time/python/test/__init__.py +0 -0
- package/templates/stream_time/python/test/app_test.py +16 -0
- package/templates/stream_time/typescript/README.md +25 -0
- package/templates/stream_time/typescript/__tests__/processor.spec.ts +14 -0
- package/templates/stream_time/typescript/index.ts +8 -0
- package/templates/task/javascript/README.md +19 -0
- package/templates/task/javascript/__tests__/processor.spec.js +16 -0
- package/templates/task/javascript/index.js +15 -0
- package/templates/task/python/README.md +31 -0
- package/templates/task/python/lambda_function.py +7 -0
- package/templates/task/python/test/__init__.py +0 -0
- package/templates/task/python/test/app_test.py +8 -0
- package/templates/task/typescript/README.md +25 -0
- package/templates/task/typescript/__tests__/processor.spec.ts +16 -0
- package/templates/task/typescript/index.ts +8 -0
- package/templates/ui/javascript/.eslintrc +11 -0
- package/templates/ui/javascript/.prettierrc +1 -0
- package/templates/ui/javascript/README.md +31 -0
- package/templates/ui/javascript/config/jest/babelTransform.js +16 -0
- package/templates/ui/javascript/config/jest/cssTransform.js +16 -0
- package/templates/ui/javascript/config/jest/fileTransform.js +48 -0
- package/templates/ui/javascript/config/jest/globalSetup.js +5 -0
- package/templates/ui/javascript/config/jest/setupTests.js +11 -0
- package/templates/ui/javascript/config-overrides.js +10 -0
- package/templates/ui/javascript/gitignore +27 -0
- package/templates/ui/javascript/src/App.completion.js +64 -0
- package/templates/ui/javascript/src/App.css +30 -0
- package/templates/ui/javascript/src/App.drilling.js +58 -0
- package/templates/ui/javascript/src/AppSettings.js +42 -0
- package/templates/ui/javascript/src/__mocks__/mockAppProps.js +590 -0
- package/templates/ui/javascript/src/__mocks__/mockAppSettingsProps.js +290 -0
- package/templates/ui/javascript/src/__tests__/App.test.js +21 -0
- package/templates/ui/javascript/src/__tests__/AppSettings.test.js +21 -0
- package/templates/ui/javascript/src/__tests__/TestsExample.test.js +37 -0
- package/templates/ui/javascript/src/assets/logo.svg +7 -0
- package/templates/ui/javascript/src/constants.js +3 -0
- package/templates/ui/javascript/src/index.js +7 -0
- package/templates/ui/typescript/.eslintrc +28 -0
- package/templates/ui/typescript/.prettierrc +1 -0
- package/templates/ui/typescript/README.md +31 -0
- package/templates/ui/typescript/config/jest/babelTransform.js +16 -0
- package/templates/ui/typescript/config/jest/cssTransform.js +16 -0
- package/templates/ui/typescript/config/jest/fileTransform.js +48 -0
- package/templates/ui/typescript/config/jest/globalSetup.js +5 -0
- package/templates/ui/typescript/config/jest/setupTests.js +11 -0
- package/templates/ui/typescript/config-overrides.js +10 -0
- package/templates/ui/typescript/gitignore +27 -0
- package/templates/ui/typescript/src/App.completion.tsx +66 -0
- package/templates/ui/typescript/src/App.css +30 -0
- package/templates/ui/typescript/src/App.drilling.tsx +60 -0
- package/templates/ui/typescript/src/AppSettings.tsx +38 -0
- package/templates/ui/typescript/src/__mocks__/mockAppProps.ts +590 -0
- package/templates/ui/typescript/src/__mocks__/mockAppSettingsProps.ts +290 -0
- package/templates/ui/typescript/src/__tests__/App.test.tsx +21 -0
- package/templates/ui/typescript/src/__tests__/AppSettings.test.tsx +21 -0
- package/templates/ui/typescript/src/__tests__/TestsExample.test.tsx +37 -0
- package/templates/ui/typescript/src/assets/logo.svg +7 -0
- package/templates/ui/typescript/src/constants.ts +3 -0
- package/templates/ui/typescript/src/custom.d.ts +9 -0
- package/templates/ui/typescript/src/index.js +7 -0
- package/templates/ui/typescript/tsconfig.json +8 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a real example of the props that'll come
|
|
3
|
+
* to the AppSettings component. You'll need to manually update it
|
|
4
|
+
* if in the future some new properties are added
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const mockAppSettingsProps = {
|
|
8
|
+
onSettingChange: jest.fn(),
|
|
9
|
+
onSettingsChange: jest.fn(),
|
|
10
|
+
app: {
|
|
11
|
+
id: -1,
|
|
12
|
+
app: {
|
|
13
|
+
app_key: 'company.app_key.ui',
|
|
14
|
+
platform: 'dev_center',
|
|
15
|
+
},
|
|
16
|
+
settings: {
|
|
17
|
+
package: '0.1.0',
|
|
18
|
+
rigId: 1,
|
|
19
|
+
wellId: 2,
|
|
20
|
+
isExampleCheckboxChecked: true,
|
|
21
|
+
},
|
|
22
|
+
package: {
|
|
23
|
+
manifest: {
|
|
24
|
+
format: 1,
|
|
25
|
+
license: {
|
|
26
|
+
type: 'MIT',
|
|
27
|
+
url: 'https://www.oandgexample.com/license/',
|
|
28
|
+
},
|
|
29
|
+
developer: {
|
|
30
|
+
name: 'Company Name',
|
|
31
|
+
identifier: 'companyIdentifier',
|
|
32
|
+
authors: [],
|
|
33
|
+
},
|
|
34
|
+
application: {
|
|
35
|
+
type: 'ui',
|
|
36
|
+
key: 'company.app_key.ui',
|
|
37
|
+
visibility: 'private',
|
|
38
|
+
name: 'dev center app name',
|
|
39
|
+
description: 'This is the description of my app. You can do great things with it!',
|
|
40
|
+
summary: 'More information about this app goes here',
|
|
41
|
+
category: 'analytics',
|
|
42
|
+
website: 'https://www.oandgexample.com/my-app/',
|
|
43
|
+
segments: ['drilling', 'completion'],
|
|
44
|
+
ui: {
|
|
45
|
+
initial_size: {
|
|
46
|
+
w: 4,
|
|
47
|
+
h: 10,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
settings: {
|
|
52
|
+
entrypoint: {
|
|
53
|
+
file: 'src/index.js',
|
|
54
|
+
function: 'handler',
|
|
55
|
+
},
|
|
56
|
+
environment: {},
|
|
57
|
+
runtime: 'ui',
|
|
58
|
+
app: {
|
|
59
|
+
scheduler_type: 1,
|
|
60
|
+
cron_string: '*/5 * * * *',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
datasets: {},
|
|
64
|
+
},
|
|
65
|
+
build: 'company.app_key.ui-0.1.0',
|
|
66
|
+
version: '0.1.0',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
appData: {
|
|
70
|
+
id: -1,
|
|
71
|
+
rig: {
|
|
72
|
+
name: 'Test Rig Name',
|
|
73
|
+
id: '1',
|
|
74
|
+
asset_id: 3,
|
|
75
|
+
},
|
|
76
|
+
well: {
|
|
77
|
+
name: 'Test Well Name',
|
|
78
|
+
settings: {
|
|
79
|
+
basin: 'Test Basin Name',
|
|
80
|
+
county: 'Pecos',
|
|
81
|
+
timezone: 'America/Chicago',
|
|
82
|
+
top_hole: {
|
|
83
|
+
raw: '50.123456,-102.865431',
|
|
84
|
+
coordinates: [50.123456, -102.865431],
|
|
85
|
+
},
|
|
86
|
+
api_number: '12-345-67689',
|
|
87
|
+
bottom_hole: {},
|
|
88
|
+
mud_company: 'Mud Company Name',
|
|
89
|
+
spud_release: [
|
|
90
|
+
{
|
|
91
|
+
id: '1111111111-2222-3a3a-4b4b-afc5c7c8f245',
|
|
92
|
+
spud: '01/08/2023 00:46',
|
|
93
|
+
rig_up: '01/08/2023 00:10',
|
|
94
|
+
release: '',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
string_design: '5',
|
|
98
|
+
contractor_name: 'Test Contractor Name',
|
|
99
|
+
target_formation: 'Test Traget Formation',
|
|
100
|
+
last_mongo_refresh: '2023-02-24T16:16:06.383Z',
|
|
101
|
+
rig_classification: 'land',
|
|
102
|
+
directional_driller: 'Test Directional Driller',
|
|
103
|
+
drilling_afe_number: 'AB12356',
|
|
104
|
+
day_shift_start_time: '06:00',
|
|
105
|
+
off_bottom_tolerance: 1,
|
|
106
|
+
target_formation_standard: 'Test Traget Formation',
|
|
107
|
+
completion_day_shift_start_time: '06:00',
|
|
108
|
+
associations_last_active_at_updated_at: '2023-02-24T16:15:40.000Z',
|
|
109
|
+
},
|
|
110
|
+
asset_id: 4,
|
|
111
|
+
last_active_at: '2023-02-24T16:20:29.000Z',
|
|
112
|
+
id: '2',
|
|
113
|
+
companyId: '6',
|
|
114
|
+
},
|
|
115
|
+
fracFleet: null,
|
|
116
|
+
wells: null,
|
|
117
|
+
isLoading: false,
|
|
118
|
+
appHash: '-1-2-1-NaN-NaN-NaN',
|
|
119
|
+
},
|
|
120
|
+
settings: {
|
|
121
|
+
package: '0.1.0',
|
|
122
|
+
rigId: 1,
|
|
123
|
+
wellId: 2,
|
|
124
|
+
isExampleCheckboxChecked: true,
|
|
125
|
+
},
|
|
126
|
+
layoutEnvironment: {
|
|
127
|
+
type: 'general',
|
|
128
|
+
pdfReportMode: false,
|
|
129
|
+
},
|
|
130
|
+
currentUser: {
|
|
131
|
+
id: 1,
|
|
132
|
+
company_id: 3,
|
|
133
|
+
first_name: 'John',
|
|
134
|
+
last_name: 'Doe',
|
|
135
|
+
email: 'john.doe@company.ai',
|
|
136
|
+
mobile: '',
|
|
137
|
+
created_at: '2020-11-03T08:42:53.161Z',
|
|
138
|
+
terms_acceptance_at: '2021-10-20T13:28:6.385Z',
|
|
139
|
+
profile_photo: null,
|
|
140
|
+
recently_viewed_asset_ids: [64],
|
|
141
|
+
unit_system: null,
|
|
142
|
+
role: 'user',
|
|
143
|
+
title: null,
|
|
144
|
+
group: null,
|
|
145
|
+
favorite_asset_id: null,
|
|
146
|
+
current_segment: null,
|
|
147
|
+
theme: 'dark',
|
|
148
|
+
messaging_id: '1',
|
|
149
|
+
restricted_assets: [],
|
|
150
|
+
restricted_programs: [],
|
|
151
|
+
settings: {
|
|
152
|
+
favorites: {},
|
|
153
|
+
sms_blacklisted: false,
|
|
154
|
+
restricted_assets: [],
|
|
155
|
+
restricted_programs: [],
|
|
156
|
+
participates_in_beta_apps: false,
|
|
157
|
+
last_new_dashboard_shares_check: '2021-11-24T18:57:13.679Z',
|
|
158
|
+
},
|
|
159
|
+
last_sign_in_at: '2023-02-23T10:19:06.349Z',
|
|
160
|
+
locked_access: false,
|
|
161
|
+
unit_ids: [],
|
|
162
|
+
intercom_admin_id: null,
|
|
163
|
+
resource: [],
|
|
164
|
+
intercom_user_hash: 'intercom_user_hash',
|
|
165
|
+
profile_groups: [],
|
|
166
|
+
preference: {
|
|
167
|
+
id: 6,
|
|
168
|
+
user: {
|
|
169
|
+
id: 1,
|
|
170
|
+
company_id: 3,
|
|
171
|
+
first_name: 'John',
|
|
172
|
+
last_name: 'Doe',
|
|
173
|
+
email: 'john.doe@company.ai',
|
|
174
|
+
role: 'user',
|
|
175
|
+
created_at: '2020-11-03T08:42:53.161Z',
|
|
176
|
+
updated_at: '2023-02-23T12:26:46.835Z',
|
|
177
|
+
recently_viewed_asset_ids: [64],
|
|
178
|
+
unit_system: null,
|
|
179
|
+
mobile: '',
|
|
180
|
+
terms_acceptance_at: '2021-10-20T13:28:6.385Z',
|
|
181
|
+
messaging_id: '1',
|
|
182
|
+
settings: {
|
|
183
|
+
favorites: {},
|
|
184
|
+
sms_blacklisted: false,
|
|
185
|
+
restricted_assets: [],
|
|
186
|
+
restricted_programs: [],
|
|
187
|
+
participates_in_beta_apps: false,
|
|
188
|
+
last_new_dashboard_shares_check: '2021-11-24T18:57:13.679Z',
|
|
189
|
+
},
|
|
190
|
+
theme: 'dark',
|
|
191
|
+
title: null,
|
|
192
|
+
group: null,
|
|
193
|
+
profile_photo: null,
|
|
194
|
+
favorite_asset_id: null,
|
|
195
|
+
current_segment: null,
|
|
196
|
+
state: 'active',
|
|
197
|
+
created_by: null,
|
|
198
|
+
provisioner: 'internal',
|
|
199
|
+
intercom_admin_id: null,
|
|
200
|
+
resource: [],
|
|
201
|
+
},
|
|
202
|
+
push_notifications_enabled: true,
|
|
203
|
+
emails_enabled: true,
|
|
204
|
+
sms_enabled: true,
|
|
205
|
+
alert_levels: ['info', 'warning', 'critical'],
|
|
206
|
+
play_alerts_sound: true,
|
|
207
|
+
show_intercom_icon: true,
|
|
208
|
+
segment: ['drilling', 'completion'],
|
|
209
|
+
disable_create_dashboard: false,
|
|
210
|
+
disable_costs: false,
|
|
211
|
+
disable_documents: false,
|
|
212
|
+
realtime_operation_mode: false,
|
|
213
|
+
disable_file_upload: false,
|
|
214
|
+
stay_on_app_store: false,
|
|
215
|
+
},
|
|
216
|
+
company: {
|
|
217
|
+
id: 3,
|
|
218
|
+
name: 'Test Company Name',
|
|
219
|
+
time_zone: 'America/Chicago',
|
|
220
|
+
language: 'en',
|
|
221
|
+
provider: 'company',
|
|
222
|
+
unit_system: {
|
|
223
|
+
yp: 'hsf',
|
|
224
|
+
oil: 'bbl',
|
|
225
|
+
area: 'ft2',
|
|
226
|
+
mass: 'lb',
|
|
227
|
+
time: 'min',
|
|
228
|
+
angle: 'deg',
|
|
229
|
+
force: 'klbf',
|
|
230
|
+
power: 'hp',
|
|
231
|
+
speed: 'ft/min',
|
|
232
|
+
length: 'm',
|
|
233
|
+
system: 'imperial',
|
|
234
|
+
torque: 'ft-klbf',
|
|
235
|
+
volume: 'gal',
|
|
236
|
+
current: 'mA',
|
|
237
|
+
density: 'ppg',
|
|
238
|
+
gravity: 'g',
|
|
239
|
+
voltage: 'mV',
|
|
240
|
+
porosity: 'pu',
|
|
241
|
+
pressure: 'psi',
|
|
242
|
+
velocity: 'ft/min',
|
|
243
|
+
gasVolume: 'Mscf',
|
|
244
|
+
gravityRMS: 'gRMS',
|
|
245
|
+
msePressure: 'ksi',
|
|
246
|
+
oilFlowRate: 'bbl/min',
|
|
247
|
+
resistivity: 'ohmm',
|
|
248
|
+
shortLength: 'in',
|
|
249
|
+
temperature: 'F',
|
|
250
|
+
massFlowRate: 'lb/min',
|
|
251
|
+
permiability: 'md',
|
|
252
|
+
concentration: 'ppm',
|
|
253
|
+
fluidVelocity: 'ft/min',
|
|
254
|
+
massPerLength: 'lb-ft',
|
|
255
|
+
anglePerLength: 'dp100f',
|
|
256
|
+
lengthPerAngle: 'in/rev',
|
|
257
|
+
volumeFlowRate: 'gal/min',
|
|
258
|
+
angularVelocity: 'rpm',
|
|
259
|
+
inversePressure: 'i-psi',
|
|
260
|
+
acousticSlowness: 'us/ft',
|
|
261
|
+
formationDensity: 'g/l',
|
|
262
|
+
gasConcentration: 'Units (0-5000u)',
|
|
263
|
+
pressureGradient: 'psi/ft',
|
|
264
|
+
massConcentration: 'lb/gal',
|
|
265
|
+
revolutionPerVolume: 'rpg',
|
|
266
|
+
spontaneousPotential: 'mV',
|
|
267
|
+
chemMassConcentration: 'lb/Mgal',
|
|
268
|
+
chemVolumeConcentration: 'gal/Mgal',
|
|
269
|
+
},
|
|
270
|
+
dev_center_enabled: true,
|
|
271
|
+
workflows_enabled: true,
|
|
272
|
+
with_subscription: false,
|
|
273
|
+
competitor_analysis_enabled: true,
|
|
274
|
+
},
|
|
275
|
+
groups: [
|
|
276
|
+
{
|
|
277
|
+
id: 5,
|
|
278
|
+
name: 'user',
|
|
279
|
+
company_id: 3,
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
id: 9,
|
|
283
|
+
name: 'customGroup',
|
|
284
|
+
company_id: 3,
|
|
285
|
+
},
|
|
286
|
+
],
|
|
287
|
+
},
|
|
288
|
+
user: {},
|
|
289
|
+
company: {},
|
|
290
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
|
|
3
|
+
import App from '../App';
|
|
4
|
+
import { mockAppProps } from '../__mocks__/mockAppProps';
|
|
5
|
+
|
|
6
|
+
describe('<App />', () => {
|
|
7
|
+
it('should show correct layout', () => {
|
|
8
|
+
render(<App {...mockAppProps} />);
|
|
9
|
+
|
|
10
|
+
screen.getByText(/checked/i);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should show correct layout when settings are not provided', () => {
|
|
14
|
+
const propsWithoutSettings = mockAppProps;
|
|
15
|
+
delete propsWithoutSettings.isExampleCheckboxChecked;
|
|
16
|
+
|
|
17
|
+
render(<App {...propsWithoutSettings} />);
|
|
18
|
+
|
|
19
|
+
screen.getByText(/unchecked/i);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { render, screen, act } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
|
|
4
|
+
import AppSettings from '../AppSettings';
|
|
5
|
+
import { mockAppSettingsProps } from '../__mocks__/mockAppSettingsProps';
|
|
6
|
+
|
|
7
|
+
describe('<AppSettings />', () => {
|
|
8
|
+
it('should call onChange with a changed setting on settings change', async () => {
|
|
9
|
+
const handleSettingsChange = jest.fn();
|
|
10
|
+
|
|
11
|
+
render(<AppSettings {...mockAppSettingsProps} onSettingChange={handleSettingsChange} />);
|
|
12
|
+
|
|
13
|
+
const exampleCheckbox = screen.getByTestId('exampleCheckbox').querySelector('input');
|
|
14
|
+
|
|
15
|
+
await act(async () => {
|
|
16
|
+
await userEvent.click(exampleCheckbox);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
expect(handleSettingsChange).toBeCalledWith('isExampleCheckboxChecked', false);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
|
3
|
+
import { components } from '@corva/ui';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
|
|
6
|
+
const Toggle = () => {
|
|
7
|
+
const [isOn, setIsOn] = useState(false);
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
{isOn ? 'ON' : 'OFF'}
|
|
12
|
+
<components.Button onClick={() => setIsOn(value => !value)}>toggle</components.Button>
|
|
13
|
+
</>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
describe('Tests examples', () => {
|
|
18
|
+
it('should use UTC timezone by default to not depend on the environment timezone', () => {
|
|
19
|
+
expect(Intl.DateTimeFormat().resolvedOptions().timeZone).toBe('UTC');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe('<Toggle />', () => {
|
|
23
|
+
it('should be OFF by default', () => {
|
|
24
|
+
render(<Toggle />);
|
|
25
|
+
|
|
26
|
+
expect(screen.getByText('OFF')).toBeInTheDocument();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should switch to ON after a single press', async () => {
|
|
30
|
+
render(<Toggle />);
|
|
31
|
+
|
|
32
|
+
userEvent.click(screen.getByText('toggle'));
|
|
33
|
+
|
|
34
|
+
await waitFor(() => screen.getByText('ON'));
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
|
|
2
|
+
<g fill="#61DAFB">
|
|
3
|
+
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
|
|
4
|
+
<circle cx="420.9" cy="296.5" r="45.7"/>
|
|
5
|
+
<path d="M520.5 78.1z"/>
|
|
6
|
+
</g>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"parser": "@typescript-eslint/parser",
|
|
4
|
+
"parserOptions": {
|
|
5
|
+
"ecmaVersion": 2020,
|
|
6
|
+
"sourceType": "module",
|
|
7
|
+
"ecmaFeature": {
|
|
8
|
+
"jsx": true
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"extends": ["@corva/eslint-config-browser"],
|
|
12
|
+
"overrides": [
|
|
13
|
+
{
|
|
14
|
+
"files": ["*.ts", "*.tsx"],
|
|
15
|
+
"extends": ["@corva/eslint-config-browser", "plugin:@typescript-eslint/recommended"],
|
|
16
|
+
"rules": {
|
|
17
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
18
|
+
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }],
|
|
19
|
+
/* Turned off until adopted by @corva/eslint-config-browser */
|
|
20
|
+
"react/prop-types": 0,
|
|
21
|
+
"react/default-props-match-prop-types": 0,
|
|
22
|
+
"react/no-unused-prop-types": 0,
|
|
23
|
+
"react/require-default-props": 0
|
|
24
|
+
/* Turned off until adopted by @corva/eslint-config-browser */
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"@corva/eslint-config-browser/prettier"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Getting Started with Create Corva App
|
|
2
|
+
|
|
3
|
+
## Available Scripts
|
|
4
|
+
|
|
5
|
+
In the project directory, you can run:
|
|
6
|
+
|
|
7
|
+
### `yarn start`
|
|
8
|
+
|
|
9
|
+
Runs the app in the development mode.\
|
|
10
|
+
Open [http://app.local.corva.ai:8080](http://app.local.corva.ai:8080/) to view it in the browser.
|
|
11
|
+
|
|
12
|
+
The page will reload if you make edits.\
|
|
13
|
+
You will also see any lint errors in the console.
|
|
14
|
+
|
|
15
|
+
### `yarn build`
|
|
16
|
+
|
|
17
|
+
Bundles the app into static files for production.
|
|
18
|
+
|
|
19
|
+
### `yarn zip`
|
|
20
|
+
|
|
21
|
+
Bundles the app into ZIP file in app root directory
|
|
22
|
+
|
|
23
|
+
### `yarn release`
|
|
24
|
+
|
|
25
|
+
Releases the app into Corva
|
|
26
|
+
|
|
27
|
+
## Documentation
|
|
28
|
+
|
|
29
|
+
- [Dev Center documentation](https://dc-docs.corva.ai/) – information about development process
|
|
30
|
+
- [Component Library](https://dc-docs.corva.ai/docs/Frontend/Data%20visualization/Components%20library)
|
|
31
|
+
- [Datasets documentation](https://dc-docs.corva.ai/docs/Datasets/Link%20App%20to%20Dataset)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
const babelJest = require('babel-jest').default;
|
|
4
|
+
|
|
5
|
+
module.exports = babelJest.createTransformer({
|
|
6
|
+
presets: [
|
|
7
|
+
[
|
|
8
|
+
require.resolve('babel-preset-react-app'),
|
|
9
|
+
{
|
|
10
|
+
runtime: 'automatic',
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
],
|
|
14
|
+
babelrc: false,
|
|
15
|
+
configFile: false,
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// This is a custom Jest transformer turning style imports into empty objects.
|
|
4
|
+
// http://facebook.github.io/jest/docs/en/webpack.html
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
process() {
|
|
8
|
+
return {
|
|
9
|
+
code: 'module.exports = {};',
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
getCacheKey() {
|
|
13
|
+
// The output is always the same.
|
|
14
|
+
return 'cssTransform';
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
// This is a custom Jest transformer turning file imports into filenames.
|
|
6
|
+
// http://facebook.github.io/jest/docs/en/webpack.html
|
|
7
|
+
|
|
8
|
+
const toPascalCase = str => {
|
|
9
|
+
const allWordsIterator = str.matchAll(/\w+/g);
|
|
10
|
+
|
|
11
|
+
return Array.from(allWordsIterator).reduce((acc, matchResult) => {
|
|
12
|
+
const word = matchResult[0];
|
|
13
|
+
return acc + word[0].toUpperCase() + word.slice(1).toLowerCase();
|
|
14
|
+
}, '');
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
module.exports = {
|
|
18
|
+
process(src, filename) {
|
|
19
|
+
const assetFilename = JSON.stringify(path.basename(filename));
|
|
20
|
+
|
|
21
|
+
if (filename.match(/\.svg$/)) {
|
|
22
|
+
// Based on how SVGR generates a component name:
|
|
23
|
+
// https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
|
|
24
|
+
const pascalCaseFilename = toPascalCase(path.parse(filename).name);
|
|
25
|
+
const componentName = `Svg${pascalCaseFilename}`;
|
|
26
|
+
return {
|
|
27
|
+
code: `const React = require('react');
|
|
28
|
+
module.exports = {
|
|
29
|
+
__esModule: true,
|
|
30
|
+
default: ${assetFilename},
|
|
31
|
+
ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
|
|
32
|
+
return {
|
|
33
|
+
$$typeof: Symbol.for('react.element'),
|
|
34
|
+
type: 'svg',
|
|
35
|
+
ref: ref,
|
|
36
|
+
key: null,
|
|
37
|
+
props: Object.assign({}, props, {
|
|
38
|
+
children: ${assetFilename}
|
|
39
|
+
})
|
|
40
|
+
};
|
|
41
|
+
}),
|
|
42
|
+
};`,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return { code: `module.exports = ${assetFilename};` };
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
|
4
|
+
// allows you to do things like:
|
|
5
|
+
// expect(element).toHaveTextContent(/react/i)
|
|
6
|
+
// learn more: https://github.com/testing-library/jest-dom
|
|
7
|
+
// eslint-disable-next-line
|
|
8
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
9
|
+
|
|
10
|
+
// Set UTC timezone for tests to not use the environment timezone
|
|
11
|
+
process.env.TZ = 'UTC';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const { getWebpackConfig } = require('@corva/dc-platform-shared/cjs');
|
|
2
|
+
const { merge } = require('webpack-merge');
|
|
3
|
+
|
|
4
|
+
module.exports = (env, argv) => {
|
|
5
|
+
return merge(
|
|
6
|
+
getWebpackConfig(env, argv),
|
|
7
|
+
// NOTE: Custom webpack 5 plugins and module rules can be provided here
|
|
8
|
+
{}
|
|
9
|
+
);
|
|
10
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# testing
|
|
9
|
+
/coverage
|
|
10
|
+
|
|
11
|
+
# production
|
|
12
|
+
/build
|
|
13
|
+
/dist
|
|
14
|
+
|
|
15
|
+
# misc
|
|
16
|
+
.env
|
|
17
|
+
.DS_Store
|
|
18
|
+
.env.local
|
|
19
|
+
.env.development.local
|
|
20
|
+
.env.test.local
|
|
21
|
+
.env.production.local
|
|
22
|
+
.idea
|
|
23
|
+
|
|
24
|
+
npm-debug.log*
|
|
25
|
+
yarn-debug.log*
|
|
26
|
+
yarn-error.log*
|
|
27
|
+
.eslintcache
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { AppHeader } from '@corva/ui/components';
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_SETTINGS } from './constants';
|
|
4
|
+
import logo from './assets/logo.svg';
|
|
5
|
+
|
|
6
|
+
import styles from './App.css';
|
|
7
|
+
|
|
8
|
+
type AppProps = {
|
|
9
|
+
appHeaderProps: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
app: any;
|
|
12
|
+
};
|
|
13
|
+
isExampleCheckboxChecked?: boolean;
|
|
14
|
+
fracFleet?: { name: string };
|
|
15
|
+
well?: { name: string };
|
|
16
|
+
wells?: { name: string }[];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function App({
|
|
20
|
+
appHeaderProps,
|
|
21
|
+
isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
|
|
22
|
+
fracFleet,
|
|
23
|
+
well,
|
|
24
|
+
wells,
|
|
25
|
+
}: AppProps): JSX.Element {
|
|
26
|
+
// NOTE: On general type dashboard app receives wells array
|
|
27
|
+
// on asset type dashboard app receives well object
|
|
28
|
+
const wellsList = wells || [well];
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div className={styles.container}>
|
|
32
|
+
<AppHeader {...appHeaderProps} />
|
|
33
|
+
<div className={styles.content}>
|
|
34
|
+
<div>
|
|
35
|
+
<img src={logo} alt="logo" className={styles.logo} />
|
|
36
|
+
<p>
|
|
37
|
+
Edit <code>src/App.js</code> and save to reload.
|
|
38
|
+
<br />
|
|
39
|
+
<br />
|
|
40
|
+
</p>
|
|
41
|
+
<p>
|
|
42
|
+
Frac Fleet: {fracFleet?.name || 'No Frac Fleet'}
|
|
43
|
+
<br />
|
|
44
|
+
Wells: {wellsList.map(well => well.name).join(', ')}
|
|
45
|
+
</p>
|
|
46
|
+
<a
|
|
47
|
+
className="App-link"
|
|
48
|
+
href="https://reactjs.org"
|
|
49
|
+
target="_blank"
|
|
50
|
+
rel="noopener noreferrer"
|
|
51
|
+
>
|
|
52
|
+
Learn React
|
|
53
|
+
</a>
|
|
54
|
+
</div>
|
|
55
|
+
<div>
|
|
56
|
+
Settings "Example" checkbox is{' '}
|
|
57
|
+
{isExampleCheckboxChecked ? 'checked' : 'unchecked'}
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Important: Do not change root component default export (App.js). Use it as container
|
|
65
|
+
// for your App. It's required to make build and zip scripts work as expected;
|
|
66
|
+
export default App;
|