@corva/create-app 0.0.0-73c49372-test → 0.0.0-ae3a727
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 +7 -0
- package/bin/create-corva-app.cjs +4 -9
- package/lib/commands/release.js +6 -0
- package/lib/constants/cli.js +13 -3
- package/lib/constants/manifest.js +3 -2
- package/lib/constants/package.js +18 -6
- package/lib/flows/lib/api.js +3 -9
- package/lib/flows/lib/manifest.js +1 -1
- package/lib/flows/steps/release/upload-zip-to-corva.js +74 -0
- package/lib/flows/steps/zip-file-list-resolve.js +1 -0
- package/lib/helpers/cli-version.js +39 -3
- package/lib/helpers/manifest.js +9 -1
- package/lib/helpers/resolve-app-runtime.js +6 -6
- package/lib/helpers/utils.js +7 -1
- package/package.json +1 -104
- package/template_extensions/corva/.eslintrc +32 -0
- package/template_extensions/corva/.github/workflows/develop.yml +2 -0
- package/template_extensions/corva/.release-please-manifest.json +3 -0
- package/template_extensions/corva/release-please-config.json +10 -0
- package/templates/scheduler_data-time/javascript/__tests__/processor.spec.js +1 -1
- package/templates/scheduler_data-time/typescript/__tests__/processor.spec.ts +1 -1
- package/templates/scheduler_depth/javascript/__tests__/processor.spec.js +1 -1
- package/templates/scheduler_depth/typescript/__tests__/processor.spec.ts +1 -1
- package/templates/scheduler_natural-time/javascript/__tests__/processor.spec.js +1 -1
- package/templates/scheduler_natural-time/typescript/__tests__/processor.spec.ts +1 -1
- package/templates/stream_depth/javascript/__tests__/processor.spec.js +1 -1
- package/templates/stream_depth/typescript/__tests__/processor.spec.ts +1 -1
- package/templates/stream_time/javascript/__tests__/processor.spec.js +1 -1
- package/templates/stream_time/typescript/__tests__/processor.spec.ts +1 -1
- package/templates/task/javascript/__tests__/processor.spec.js +1 -1
- package/templates/task/typescript/__tests__/processor.spec.ts +1 -1
- package/templates/ui/javascript/config/jest/setupTests.js +19 -0
- package/templates/ui/javascript/src/App.completion.js +30 -31
- package/templates/ui/javascript/src/App.css +0 -13
- package/templates/ui/javascript/src/App.drilling.js +31 -36
- package/templates/ui/javascript/src/__tests__/App.test.js +27 -2
- package/templates/ui/typescript/config/jest/setupTests.js +19 -0
- package/templates/ui/typescript/src/App.completion.tsx +32 -42
- package/templates/ui/typescript/src/App.css +0 -13
- package/templates/ui/typescript/src/App.drilling.tsx +32 -41
- package/templates/ui/typescript/src/AppSettings.tsx +2 -12
- package/templates/ui/typescript/src/__mocks__/mockData.ts +194 -0
- package/templates/ui/typescript/src/__tests__/App.test.tsx +80 -6
- package/templates/ui/typescript/src/__tests__/AppSettings.test.tsx +14 -3
- package/templates/ui/typescript/src/types.ts +618 -0
- package/templates/ui/typescript/tsconfig.json +0 -1
- package/templates/ui/typescript/src/__mocks__/mockAppProps.ts +0 -590
- package/templates/ui/typescript/src/__mocks__/mockAppSettingsProps.ts +0 -290
|
@@ -9,3 +9,22 @@ import '@testing-library/jest-dom/extend-expect';
|
|
|
9
9
|
|
|
10
10
|
// Set UTC timezone for tests to not use the environment timezone
|
|
11
11
|
process.env.TZ = 'UTC';
|
|
12
|
+
|
|
13
|
+
// Mock ResizeObserver & MutationObserver
|
|
14
|
+
class FakeObserver {
|
|
15
|
+
observe() {}
|
|
16
|
+
unobserve() {}
|
|
17
|
+
disconnect() {}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
global.ResizeObserver = FakeObserver;
|
|
21
|
+
global.MutationObserver = FakeObserver;
|
|
22
|
+
|
|
23
|
+
// Suppressing "Could not parse CSS stylesheet" from JSDOM
|
|
24
|
+
const originalConsoleError = global.console.error;
|
|
25
|
+
global.console.error = (message, ...optionalParams) => {
|
|
26
|
+
if (message.includes('Could not parse CSS stylesheet')) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
originalConsoleError(message, ...optionalParams);
|
|
30
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AppHeader } from '@corva/ui/
|
|
1
|
+
import { AppContainer, AppHeader } from '@corva/ui/componentsV2';
|
|
2
|
+
import { useAppCommons } from '@corva/ui/effects';
|
|
2
3
|
|
|
3
4
|
import { DEFAULT_SETTINGS } from './constants';
|
|
4
5
|
import logo from './assets/logo.svg';
|
|
@@ -8,54 +9,52 @@ import styles from './App.css';
|
|
|
8
9
|
/**
|
|
9
10
|
* @param {Object} props
|
|
10
11
|
* @param {boolean} props.isExampleCheckboxChecked
|
|
11
|
-
* @param {Object} props.appHeaderProps
|
|
12
12
|
* @param {Object} props.fracFleet
|
|
13
13
|
* @param {Object} props.well
|
|
14
14
|
* @param {Object[]} props.wells
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
17
|
function App({
|
|
18
|
-
appHeaderProps,
|
|
19
18
|
isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
|
|
20
19
|
fracFleet,
|
|
21
20
|
well,
|
|
22
21
|
wells,
|
|
23
22
|
}) {
|
|
23
|
+
const { appKey } = useAppCommons();
|
|
24
24
|
// NOTE: On general type dashboard app receives wells array
|
|
25
25
|
// on asset type dashboard app receives well object
|
|
26
26
|
const wellsList = wells || [well];
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
Settings "Example" checkbox is{' '}
|
|
29
|
+
<AppContainer header={<AppHeader />} testId={appKey}>
|
|
30
|
+
<div className={styles.container}>
|
|
31
|
+
<img src={logo} alt="logo" className={styles.logo} />
|
|
32
|
+
<p>
|
|
33
|
+
Edit <code>src/App.js</code> and save to reload.
|
|
34
|
+
<br />
|
|
35
|
+
<br />
|
|
36
|
+
</p>
|
|
37
|
+
<p>
|
|
38
|
+
Frac Fleet: <span data-testid="fracFleet">{fracFleet?.name || 'No Frac Fleet'}</span>
|
|
39
|
+
<br />
|
|
40
|
+
Wells: <span data-testid="wellsList">{wellsList.map(well => well?.name).join(', ')}</span>
|
|
41
|
+
</p>
|
|
42
|
+
<a
|
|
43
|
+
className="App-link"
|
|
44
|
+
href="https://reactjs.org"
|
|
45
|
+
target="_blank"
|
|
46
|
+
rel="noopener noreferrer"
|
|
47
|
+
>
|
|
48
|
+
Learn React
|
|
49
|
+
</a>
|
|
50
|
+
</div>
|
|
51
|
+
<div>
|
|
52
|
+
Settings "Example" checkbox is{' '}
|
|
53
|
+
<span data-testid="exampleCheckboxChecked">
|
|
55
54
|
{isExampleCheckboxChecked ? 'checked' : 'unchecked'}
|
|
56
|
-
</
|
|
55
|
+
</span>
|
|
57
56
|
</div>
|
|
58
|
-
</
|
|
57
|
+
</AppContainer>
|
|
59
58
|
);
|
|
60
59
|
}
|
|
61
60
|
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
.container {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
height: 100%;
|
|
5
|
-
padding: 12px 12px 30px 12px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.content {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
2
|
text-align: center;
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
flex-grow: 1;
|
|
15
|
-
overflow: auto;
|
|
16
3
|
}
|
|
17
4
|
|
|
18
5
|
@keyframes App-logo-spin {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AppHeader } from '@corva/ui/
|
|
1
|
+
import { AppContainer, AppHeader } from '@corva/ui/componentsV2';
|
|
2
|
+
import { useAppCommons } from '@corva/ui/effects';
|
|
2
3
|
|
|
3
4
|
import { DEFAULT_SETTINGS } from './constants';
|
|
4
5
|
import logo from './assets/logo.svg';
|
|
@@ -7,49 +8,43 @@ import styles from './App.css';
|
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @param {Object} props
|
|
10
|
-
* @param {Object} props.appHeaderProps
|
|
11
11
|
* @param {boolean} props.isExampleCheckboxChecked
|
|
12
12
|
* @param {Object} props.rig
|
|
13
13
|
* @param {Object} props.well
|
|
14
14
|
* @returns
|
|
15
15
|
*/
|
|
16
|
-
function App({
|
|
17
|
-
|
|
18
|
-
isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
|
|
19
|
-
rig,
|
|
20
|
-
well,
|
|
21
|
-
}) {
|
|
16
|
+
function App({ isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked, rig, well }) {
|
|
17
|
+
const { appKey } = useAppCommons();
|
|
22
18
|
return (
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<
|
|
48
|
-
Settings "Example" checkbox is{' '}
|
|
19
|
+
<AppContainer header={<AppHeader />} testId={appKey}>
|
|
20
|
+
<div className={styles.container}>
|
|
21
|
+
<img src={logo} alt="logo" className={styles.logo} />
|
|
22
|
+
<p>
|
|
23
|
+
Edit <code>src/App.js</code> and save to reload.
|
|
24
|
+
<br />
|
|
25
|
+
<br />
|
|
26
|
+
</p>
|
|
27
|
+
<p>
|
|
28
|
+
Rig: <span data-testid="rig">{rig?.name}</span>
|
|
29
|
+
<br />
|
|
30
|
+
Well: <span data-testid="well">{well?.name}</span>
|
|
31
|
+
</p>
|
|
32
|
+
<a
|
|
33
|
+
className="App-link"
|
|
34
|
+
href="https://reactjs.org"
|
|
35
|
+
target="_blank"
|
|
36
|
+
rel="noopener noreferrer"
|
|
37
|
+
>
|
|
38
|
+
Learn React
|
|
39
|
+
</a>
|
|
40
|
+
</div>
|
|
41
|
+
<div>
|
|
42
|
+
Settings "Example" checkbox is{' '}
|
|
43
|
+
<span data-testid="exampleCheckboxState">
|
|
49
44
|
{isExampleCheckboxChecked ? 'checked' : 'unchecked'}
|
|
50
|
-
</
|
|
45
|
+
</span>
|
|
51
46
|
</div>
|
|
52
|
-
</
|
|
47
|
+
</AppContainer>
|
|
53
48
|
);
|
|
54
49
|
}
|
|
55
50
|
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { AppTestWrapper } from '@corva/ui/testing';
|
|
2
3
|
|
|
3
4
|
import App from '../App';
|
|
4
5
|
import { mockAppProps } from '../__mocks__/mockAppProps';
|
|
5
6
|
|
|
6
7
|
describe('<App />', () => {
|
|
7
8
|
it('should show correct layout', () => {
|
|
8
|
-
render(
|
|
9
|
+
render(
|
|
10
|
+
<AppTestWrapper
|
|
11
|
+
app={mockAppProps.app}
|
|
12
|
+
appId={123}
|
|
13
|
+
maximized={false}
|
|
14
|
+
appSettings={mockAppProps.app.settings}
|
|
15
|
+
onSettingChange={() => {
|
|
16
|
+
/* noop */
|
|
17
|
+
}}
|
|
18
|
+
>
|
|
19
|
+
<App {...mockAppProps} />
|
|
20
|
+
</AppTestWrapper>
|
|
21
|
+
);
|
|
9
22
|
|
|
10
23
|
screen.getByText(/checked/i);
|
|
11
24
|
});
|
|
@@ -14,7 +27,19 @@ describe('<App />', () => {
|
|
|
14
27
|
const propsWithoutSettings = mockAppProps;
|
|
15
28
|
delete propsWithoutSettings.isExampleCheckboxChecked;
|
|
16
29
|
|
|
17
|
-
render(
|
|
30
|
+
render(
|
|
31
|
+
<AppTestWrapper
|
|
32
|
+
app={mockAppProps.app}
|
|
33
|
+
appId={123}
|
|
34
|
+
maximized={false}
|
|
35
|
+
appSettings={mockAppProps.app.settings}
|
|
36
|
+
onSettingChange={() => {
|
|
37
|
+
/* noop */
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<App {...propsWithoutSettings} />
|
|
41
|
+
</AppTestWrapper>
|
|
42
|
+
);
|
|
18
43
|
|
|
19
44
|
screen.getByText(/unchecked/i);
|
|
20
45
|
});
|
|
@@ -9,3 +9,22 @@ import '@testing-library/jest-dom/extend-expect';
|
|
|
9
9
|
|
|
10
10
|
// Set UTC timezone for tests to not use the environment timezone
|
|
11
11
|
process.env.TZ = 'UTC';
|
|
12
|
+
|
|
13
|
+
// Mock ResizeObserver & MutationObserver
|
|
14
|
+
class FakeObserver {
|
|
15
|
+
observe() {}
|
|
16
|
+
unobserve() {}
|
|
17
|
+
disconnect() {}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
global.ResizeObserver = FakeObserver;
|
|
21
|
+
global.MutationObserver = FakeObserver;
|
|
22
|
+
|
|
23
|
+
// Suppressing "Could not parse CSS stylesheet" from JSDOM
|
|
24
|
+
const originalConsoleError = global.console.error;
|
|
25
|
+
global.console.error = (message, ...optionalParams) => {
|
|
26
|
+
if (message.includes('Could not parse CSS stylesheet')) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
originalConsoleError(message, ...optionalParams);
|
|
30
|
+
};
|
|
@@ -1,63 +1,53 @@
|
|
|
1
|
-
import { AppHeader } from '@corva/ui/
|
|
1
|
+
import { AppContainer, AppHeader } from '@corva/ui/componentsV2';
|
|
2
|
+
import { useAppCommons } from '@corva/ui/effects';
|
|
2
3
|
|
|
3
4
|
import { DEFAULT_SETTINGS } from './constants';
|
|
5
|
+
import { AppProps, CustomAppSettings } from './types';
|
|
4
6
|
import logo from './assets/logo.svg';
|
|
5
7
|
|
|
6
8
|
import styles from './App.css';
|
|
7
9
|
|
|
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
10
|
function App({
|
|
20
|
-
appHeaderProps,
|
|
21
11
|
isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
|
|
22
12
|
fracFleet,
|
|
23
13
|
well,
|
|
24
14
|
wells,
|
|
25
|
-
}: AppProps): JSX.Element {
|
|
15
|
+
}: AppProps & CustomAppSettings): JSX.Element {
|
|
16
|
+
const { appKey } = useAppCommons();
|
|
26
17
|
// NOTE: On general type dashboard app receives wells array
|
|
27
18
|
// on asset type dashboard app receives well object
|
|
28
19
|
const wellsList = wells || [well];
|
|
29
20
|
|
|
30
21
|
return (
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
</
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
Settings "Example" checkbox is{' '}
|
|
22
|
+
<AppContainer header={<AppHeader />} testId={appKey}>
|
|
23
|
+
<div className={styles.container}>
|
|
24
|
+
<img src={logo} alt="logo" className={styles.logo} />
|
|
25
|
+
<p>
|
|
26
|
+
Edit <code>src/App.js</code> and save to reload.
|
|
27
|
+
<br />
|
|
28
|
+
<br />
|
|
29
|
+
</p>
|
|
30
|
+
<p>
|
|
31
|
+
Frac Fleet: <span data-testid="fracFleet">{fracFleet?.name || 'No Frac Fleet'}</span>
|
|
32
|
+
<br />
|
|
33
|
+
Wells: <span data-testid="wellsList">{wellsList.map(well => well?.name).join(', ')}</span>
|
|
34
|
+
</p>
|
|
35
|
+
<a
|
|
36
|
+
className="App-link"
|
|
37
|
+
href="https://reactjs.org"
|
|
38
|
+
target="_blank"
|
|
39
|
+
rel="noopener noreferrer"
|
|
40
|
+
>
|
|
41
|
+
Learn React
|
|
42
|
+
</a>
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
Settings "Example" checkbox is{' '}
|
|
46
|
+
<span data-testid="exampleCheckboxState">
|
|
57
47
|
{isExampleCheckboxChecked ? 'checked' : 'unchecked'}
|
|
58
|
-
</
|
|
48
|
+
</span>
|
|
59
49
|
</div>
|
|
60
|
-
</
|
|
50
|
+
</AppContainer>
|
|
61
51
|
);
|
|
62
52
|
}
|
|
63
53
|
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
.container {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
height: 100%;
|
|
5
|
-
padding: 12px 12px 30px 12px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.content {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
2
|
text-align: center;
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
flex-grow: 1;
|
|
15
|
-
overflow: auto;
|
|
16
3
|
}
|
|
17
4
|
|
|
18
5
|
@keyframes App-logo-spin {
|
|
@@ -1,57 +1,48 @@
|
|
|
1
|
-
import { AppHeader } from '@corva/ui/
|
|
1
|
+
import { AppContainer, AppHeader } from '@corva/ui/componentsV2';
|
|
2
|
+
import { useAppCommons } from '@corva/ui/effects';
|
|
2
3
|
|
|
3
4
|
import { DEFAULT_SETTINGS } from './constants';
|
|
5
|
+
import { AppProps, CustomAppSettings } from './types';
|
|
4
6
|
import logo from './assets/logo.svg';
|
|
5
7
|
|
|
6
8
|
import styles from './App.css';
|
|
7
9
|
|
|
8
|
-
type AppProps = {
|
|
9
|
-
appHeaderProps: {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
app: any;
|
|
12
|
-
};
|
|
13
|
-
isExampleCheckboxChecked?: boolean;
|
|
14
|
-
rig: { name: string };
|
|
15
|
-
well: { name: string };
|
|
16
|
-
};
|
|
17
|
-
|
|
18
10
|
function App({
|
|
19
|
-
appHeaderProps,
|
|
20
11
|
isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
|
|
21
12
|
rig,
|
|
22
13
|
well,
|
|
23
|
-
}: AppProps): JSX.Element {
|
|
14
|
+
}: AppProps & CustomAppSettings): JSX.Element {
|
|
15
|
+
const { appKey } = useAppCommons();
|
|
24
16
|
return (
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<
|
|
50
|
-
Settings "Example" checkbox is{' '}
|
|
17
|
+
<AppContainer header={<AppHeader />} testId={appKey}>
|
|
18
|
+
<div className={styles.container}>
|
|
19
|
+
<img src={logo} alt="logo" className={styles.logo} />
|
|
20
|
+
<p>
|
|
21
|
+
Edit <code>src/App.js</code> and save to reload.
|
|
22
|
+
<br />
|
|
23
|
+
<br />
|
|
24
|
+
</p>
|
|
25
|
+
<p>
|
|
26
|
+
Rig: <span data-testid="rig">{rig?.name}</span>
|
|
27
|
+
<br />
|
|
28
|
+
Well: <span data-testid="well">{well?.name}</span>
|
|
29
|
+
</p>
|
|
30
|
+
<a
|
|
31
|
+
className="App-link"
|
|
32
|
+
href="https://reactjs.org"
|
|
33
|
+
target="_blank"
|
|
34
|
+
rel="noopener noreferrer"
|
|
35
|
+
>
|
|
36
|
+
Learn React
|
|
37
|
+
</a>
|
|
38
|
+
</div>
|
|
39
|
+
<div>
|
|
40
|
+
Settings "Example" checkbox is{' '}
|
|
41
|
+
<span data-testid="exampleCheckboxState">
|
|
51
42
|
{isExampleCheckboxChecked ? 'checked' : 'unchecked'}
|
|
52
|
-
</
|
|
43
|
+
</span>
|
|
53
44
|
</div>
|
|
54
|
-
</
|
|
45
|
+
</AppContainer>
|
|
55
46
|
);
|
|
56
47
|
}
|
|
57
48
|
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import { Checkbox, FormControlLabel } from '@material-ui/core';
|
|
2
2
|
|
|
3
3
|
import { DEFAULT_SETTINGS } from './constants';
|
|
4
|
+
import { AppSettingsProps, CustomAppSettings } from './types';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
app: { [key: string]: any };
|
|
7
|
-
appData: { [key: string]: any };
|
|
8
|
-
company: { [key: string]: any };
|
|
9
|
-
onSettingChange: (key: string, value: any) => void;
|
|
10
|
-
settings: {
|
|
11
|
-
isExampleCheckboxChecked: boolean;
|
|
12
|
-
};
|
|
13
|
-
user: { [key: string]: any };
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const AppSettings = (props: AppSettingsProps): JSX.Element => {
|
|
6
|
+
const AppSettings = (props: AppSettingsProps & CustomAppSettings): JSX.Element => {
|
|
17
7
|
const { settings: apiSettings, onSettingChange } = props;
|
|
18
8
|
const settings = { ...DEFAULT_SETTINGS, ...apiSettings };
|
|
19
9
|
|