@corva/create-app 0.50.0-0 → 0.50.0-1
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/lib/constants/package.js
CHANGED
|
@@ -12,13 +12,13 @@ const uiDependencies = {
|
|
|
12
12
|
'mapbox.js': '3.2.1',
|
|
13
13
|
'moment': '2.29.4',
|
|
14
14
|
'moment-timezone': '0.5.23',
|
|
15
|
-
'prop-types': '^15.6.1',
|
|
16
15
|
'react': '17.0.1',
|
|
17
16
|
'react-dom': '17.0.1',
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
const jsUiDevDependencies = {
|
|
21
20
|
'@corva/dc-platform-shared': 'latest',
|
|
21
|
+
'@corva/eslint-config-browser': 'latest',
|
|
22
22
|
'@testing-library/jest-dom': '^5.16.4',
|
|
23
23
|
'@testing-library/react': '12.1.5',
|
|
24
24
|
'@testing-library/react-hooks': '^8.0.1',
|
package/package.json
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { AppHeader } from '@corva/ui/components';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { DEFAULT_SETTINGS } from './constants';
|
|
4
2
|
|
|
3
|
+
import { DEFAULT_SETTINGS } from './constants';
|
|
5
4
|
import logo from './assets/logo.svg';
|
|
5
|
+
|
|
6
6
|
import styles from './App.css';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @param {Object} props
|
|
10
|
+
* @param {boolean} props.isExampleCheckboxChecked
|
|
11
|
+
* @param {Object} props.appHeaderProps
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
function App({
|
|
15
|
+
isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
|
|
16
|
+
appHeaderProps,
|
|
17
|
+
}) {
|
|
10
18
|
return (
|
|
11
19
|
<div className={styles.container}>
|
|
12
20
|
<AppHeader {...appHeaderProps} />
|
|
@@ -36,15 +44,6 @@ function App(props) {
|
|
|
36
44
|
);
|
|
37
45
|
}
|
|
38
46
|
|
|
39
|
-
App.propTypes = {
|
|
40
|
-
isExampleCheckboxChecked: PropTypes.bool,
|
|
41
|
-
appHeaderProps: PropTypes.shape({}).isRequired,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
App.defaultProps = {
|
|
45
|
-
...DEFAULT_SETTINGS,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
47
|
// Important: Do not change root component default export (App.js). Use it as container
|
|
49
48
|
// for your App. It's required to make build and zip scripts work as expected;
|
|
50
49
|
export default App;
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { Checkbox, FormControlLabel } from '@material-ui/core';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
|
|
4
3
|
import { DEFAULT_SETTINGS } from './constants';
|
|
5
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} props
|
|
7
|
+
* @param {Object} props.app
|
|
8
|
+
* @param {Object} props.appData
|
|
9
|
+
* @param {Object} props.company
|
|
10
|
+
* @param {(key: string, value: any) => void} props.onSettingChange
|
|
11
|
+
* @param {{isExampleCheckboxChecked: boolean}} props.settings
|
|
12
|
+
* @param {Object} props.user
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
6
15
|
function AppSettings({
|
|
7
16
|
settings: apiSettings,
|
|
8
17
|
onSettingChange,
|
|
9
18
|
// appData,
|
|
10
19
|
// app,
|
|
11
|
-
// user,
|
|
12
|
-
// company,
|
|
20
|
+
// user = {},
|
|
21
|
+
// company = {},
|
|
13
22
|
}) {
|
|
14
23
|
const settings = { ...DEFAULT_SETTINGS, ...apiSettings };
|
|
15
24
|
return (
|
|
@@ -27,22 +36,6 @@ function AppSettings({
|
|
|
27
36
|
);
|
|
28
37
|
}
|
|
29
38
|
|
|
30
|
-
AppSettings.propTypes = {
|
|
31
|
-
app: PropTypes.shape({}).isRequired,
|
|
32
|
-
appData: PropTypes.shape({}).isRequired,
|
|
33
|
-
company: PropTypes.shape({}),
|
|
34
|
-
onSettingChange: PropTypes.func.isRequired,
|
|
35
|
-
settings: PropTypes.shape({
|
|
36
|
-
isExampleCheckboxChecked: PropTypes.bool,
|
|
37
|
-
}).isRequired,
|
|
38
|
-
user: PropTypes.shape({}),
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
AppSettings.defaultProps = {
|
|
42
|
-
user: {},
|
|
43
|
-
company: {},
|
|
44
|
-
};
|
|
45
|
-
|
|
46
39
|
// Important: Do not change root component default export (AppSettings.js). Use it as container
|
|
47
40
|
// for your App Settings. It's required to make build and zip scripts work as expected;
|
|
48
41
|
export default AppSettings;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { AppHeader } from '@corva/ui/components';
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { DEFAULT_SETTINGS } from './constants';
|
|
4
4
|
|
|
5
5
|
import logo from './assets/logo.svg';
|
|
6
6
|
import styles from './App.css';
|
|
7
7
|
|
|
8
|
-
type
|
|
9
|
-
isExampleCheckboxChecked
|
|
8
|
+
type AppProps = {
|
|
9
|
+
isExampleCheckboxChecked?: boolean;
|
|
10
10
|
appHeaderProps: {
|
|
11
11
|
[key: string]: any;
|
|
12
12
|
app: any;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
function App({
|
|
16
|
+
function App({
|
|
17
|
+
isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
|
|
18
|
+
appHeaderProps,
|
|
19
|
+
}: AppProps): JSX.Element {
|
|
17
20
|
return (
|
|
18
21
|
<div className={styles.container}>
|
|
19
22
|
<AppHeader {...appHeaderProps} />
|
|
@@ -43,15 +46,6 @@ function App({ isExampleCheckboxChecked, appHeaderProps }: Props): JSX.Element {
|
|
|
43
46
|
);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
|
-
App.propTypes = {
|
|
47
|
-
isExampleCheckboxChecked: PropTypes.bool,
|
|
48
|
-
appHeaderProps: PropTypes.shape({}).isRequired,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
App.defaultProps = {
|
|
52
|
-
...DEFAULT_SETTINGS,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
49
|
// Important: Do not change root component default export (App.js). Use it as container
|
|
56
50
|
// for your App. It's required to make build and zip scripts work as expected;
|
|
57
51
|
export default App;
|
|
@@ -2,8 +2,7 @@ import { Checkbox, FormControlLabel } from '@material-ui/core';
|
|
|
2
2
|
|
|
3
3
|
import { DEFAULT_SETTINGS } from './constants';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
interface AppSettingsProps {
|
|
5
|
+
type AppSettingsProps = {
|
|
7
6
|
app: { [key: string]: any };
|
|
8
7
|
appData: { [key: string]: any };
|
|
9
8
|
company: { [key: string]: any };
|
|
@@ -12,7 +11,7 @@ interface AppSettingsProps {
|
|
|
12
11
|
isExampleCheckboxChecked: boolean;
|
|
13
12
|
};
|
|
14
13
|
user: { [key: string]: any };
|
|
15
|
-
}
|
|
14
|
+
};
|
|
16
15
|
|
|
17
16
|
const AppSettings = (props: AppSettingsProps): JSX.Element => {
|
|
18
17
|
const { settings: apiSettings, onSettingChange } = props;
|
|
@@ -32,10 +31,6 @@ const AppSettings = (props: AppSettingsProps): JSX.Element => {
|
|
|
32
31
|
</div>
|
|
33
32
|
);
|
|
34
33
|
};
|
|
35
|
-
AppSettings.defaultProps = {
|
|
36
|
-
user: {},
|
|
37
|
-
company: {},
|
|
38
|
-
};
|
|
39
34
|
|
|
40
35
|
// Important: Do not change root component default export (AppSettings.js). Use it as container
|
|
41
36
|
// for your App Settings. It's required to make build and zip scripts work as expected;
|