@firedesktop/react-base 1.15.9 → 1.16.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/.eslintrc +19 -0
- package/dist/components/AppIcon.d.ts +1 -1
- package/dist/components/AppIcon.js +46 -46
- package/dist/components/Spin.js.map +1 -1
- package/dist/utils/configuration/ConfigurationLoader.js +3 -3
- package/dist/utils/configuration/ConfigurationManager.js +3 -3
- package/dist/utils/fetch/Types.d.ts +1 -0
- package/dist/utils/fetch/fetchWrapper.d.ts +8 -7
- package/dist/utils/fetch/fetchWrapper.js +31 -17
- package/dist/utils/fetch/fetchWrapper.js.map +1 -1
- package/dist/utils/fetch/index.js.map +1 -1
- package/dist/utils/labels/LanguageLoader.js +3 -3
- package/dist/utils/labels/LanguageManager.js +4 -4
- package/package.json +16 -16
- package/src/App.tsx +50 -13
- package/src/TestLabelFunction.tsx +1 -1
- package/src/lib/components/AppIcon.tsx +88 -88
- package/src/lib/components/Spin.tsx +1 -1
- package/src/lib/utils/configuration/ConfigurationLoader.tsx +3 -3
- package/src/lib/utils/configuration/ConfigurationManager.ts +3 -3
- package/src/lib/utils/fetch/Types.ts +1 -0
- package/src/lib/utils/fetch/fetchWrapper.ts +32 -19
- package/src/lib/utils/fetch/index.ts +1 -1
- package/src/lib/utils/labels/LanguageLoader.tsx +3 -3
- package/src/lib/utils/labels/LanguageManager.ts +4 -4
- package/src/reportWebVitals.ts +1 -1
|
@@ -42,14 +42,14 @@ function LanguageManager() {
|
|
|
42
42
|
switch (_a.label) {
|
|
43
43
|
case 0:
|
|
44
44
|
_a.trys.push([0, 3, , 4]);
|
|
45
|
-
return [4, fetch(fullPath, { headers: {
|
|
45
|
+
return [4, fetch(fullPath, { headers: { 'Content-Type': 'application/json; charset=utf-8' } })];
|
|
46
46
|
case 1:
|
|
47
47
|
res = _a.sent();
|
|
48
48
|
return [4, res.json()];
|
|
49
49
|
case 2: return [2, _a.sent()];
|
|
50
50
|
case 3:
|
|
51
51
|
err_1 = _a.sent();
|
|
52
|
-
console.log(
|
|
52
|
+
console.log('Problem loading the Site Labels');
|
|
53
53
|
return [3, 4];
|
|
54
54
|
case 4: return [2];
|
|
55
55
|
}
|
|
@@ -66,9 +66,9 @@ function LanguageManager() {
|
|
|
66
66
|
console.log("Loading Labels for this Language " + language + ", from this path: " + fullPath);
|
|
67
67
|
loadLabels(fullPath).then(function (response) {
|
|
68
68
|
console.log("Loaded Labels for this Language " + language, response);
|
|
69
|
-
dispatch(updateAppState(
|
|
69
|
+
dispatch(updateAppState('labels', response));
|
|
70
70
|
}).catch(function (err) {
|
|
71
|
-
console.log(
|
|
71
|
+
console.log('Problem loading the Site Labels');
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
return [2];
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firedesktop/react-base",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"description": "This is the FireDesktop base package used to support every React Project in this Company.",
|
|
7
7
|
"author": "alessandro.gambaro",
|
|
8
8
|
"repository": "https://firedesktopDevOps@dev.azure.com/firedesktopDevOps/baseFEComponents/_git/baseFEComponents",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@syncfusion/ej2-popups": "^18.3.
|
|
10
|
+
"@syncfusion/ej2-popups": "^18.3.50",
|
|
11
11
|
"react": "^16.14.0",
|
|
12
12
|
"react-dom": "^16.14.0",
|
|
13
13
|
"react-redux": "^7.2.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@babel/cli": "^7.
|
|
17
|
-
"@babel/core": "^7.
|
|
18
|
-
"@babel/plugin-proposal-class-properties": "7.
|
|
16
|
+
"@babel/cli": "^7.12.1",
|
|
17
|
+
"@babel/core": "^7.12.3",
|
|
18
|
+
"@babel/plugin-proposal-class-properties": "7.12.1",
|
|
19
19
|
"@babel/plugin-transform-arrow-functions": "^7.12.1",
|
|
20
20
|
"@babel/preset-typescript": "^7.12.1",
|
|
21
|
-
"@testing-library/jest-dom": "^5.11.
|
|
22
|
-
"@testing-library/react": "^11.1.
|
|
23
|
-
"@testing-library/user-event": "^12.
|
|
21
|
+
"@testing-library/jest-dom": "^5.11.6",
|
|
22
|
+
"@testing-library/react": "^11.1.2",
|
|
23
|
+
"@testing-library/user-event": "^12.2.2",
|
|
24
24
|
"@types/jest": "^26.0.15",
|
|
25
|
-
"@types/node": "^
|
|
26
|
-
"@types/react": "^16.9.
|
|
27
|
-
"@types/react-dom": "^16.9.
|
|
28
|
-
"@types/react-redux": "^7.1.
|
|
25
|
+
"@types/node": "^14.14.8",
|
|
26
|
+
"@types/react": "^16.9.56",
|
|
27
|
+
"@types/react-dom": "^16.9.9",
|
|
28
|
+
"@types/react-redux": "^7.1.11",
|
|
29
29
|
"babel-plugin-minify-builtins": "^0.5.0",
|
|
30
30
|
"babel-preset-minify": "0.5.1",
|
|
31
31
|
"copyfiles": "^2.4.0",
|
|
32
|
-
"react-scripts": "^
|
|
33
|
-
"typescript": "^4.0.
|
|
34
|
-
"web-vitals": "^0.
|
|
32
|
+
"react-scripts": "^4.0.0",
|
|
33
|
+
"typescript": "^4.0.5",
|
|
34
|
+
"web-vitals": "^1.0.1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"distribute_not_working": "rmdir /s /q dist & mkdir dist && npx babel src/lib --out-dir dist --extensions \".js,.ts,.tsx\" --source-maps inline",
|
|
39
|
-
"start": "react-scripts start
|
|
39
|
+
"start": "react-scripts start",
|
|
40
40
|
"distribute": "rmdir /s /q dist & mkdir dist\\styles && tsc && copyfiles -f src/lib/styles/* dist/styles"
|
|
41
41
|
},
|
|
42
42
|
"eslintConfig": {
|
package/src/App.tsx
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { Provider } from
|
|
2
|
+
import { Provider } from 'react-redux';
|
|
3
3
|
import { createStore } from 'redux';
|
|
4
4
|
|
|
5
5
|
import { Components, ConfigurationLoader, Utils, LanguageLoader } from './lib';
|
|
6
6
|
|
|
7
7
|
import TestLabelFunction from './TestLabelFunction';
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
9
|
+
import '../node_modules/@syncfusion/ej2-base/styles/bootstrap4.css';
|
|
10
|
+
import '../node_modules/@syncfusion/ej2-buttons/styles/bootstrap4.css';
|
|
11
|
+
import '../node_modules/@syncfusion/ej2-icons/styles/bootstrap4.css';
|
|
12
|
+
import '../node_modules/@syncfusion/ej2-popups/styles/bootstrap4.css';
|
|
13
13
|
|
|
14
14
|
import './lib/styles/base.css';
|
|
15
15
|
import './lib/styles/syncfusion_bootstrap4.css';
|
|
@@ -25,20 +25,30 @@ const appReducer = (state = {}, action: any) => {
|
|
|
25
25
|
default:
|
|
26
26
|
return state;
|
|
27
27
|
}
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
|
|
30
30
|
function App() {
|
|
31
31
|
const [options, setOptions] = useState<{ value: string }[]>([]);
|
|
32
32
|
const [spinning, setSpinning] = useState(false);
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
|
|
35
|
+
function onGenericServerError(status: number) {
|
|
36
|
+
alert(`Error, Status: ${status}`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function status_401() {
|
|
40
|
+
alert('Log Out 401');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function status_403() {
|
|
44
|
+
alert('Log Out 403');
|
|
36
45
|
}
|
|
37
46
|
|
|
38
47
|
const textFetch = () => {
|
|
39
48
|
const labels = { errorGeneric: 'Errore generiro', errorServerNotAvailable: 'No serviziooo', errorSessionExpired: 'Sessione scadurta' } as Utils.Fetch.Types.ILabels;
|
|
40
49
|
|
|
41
|
-
const runner = new Utils.Fetch.FetchWrapper(null, labels,
|
|
50
|
+
const runner = new Utils.Fetch.FetchWrapper(null, labels, status_401, status_403);
|
|
51
|
+
|
|
42
52
|
setSpinning(true);
|
|
43
53
|
runner.get('https://my-json-server.typicode.com/typicode/demo/posts', null, null, false, false).then(response => {
|
|
44
54
|
// @ts-ignore
|
|
@@ -53,7 +63,34 @@ function App() {
|
|
|
53
63
|
console.log(errorMessage);
|
|
54
64
|
});
|
|
55
65
|
|
|
56
|
-
|
|
66
|
+
|
|
67
|
+
// setSpinning(true);
|
|
68
|
+
|
|
69
|
+
// 401
|
|
70
|
+
// runner.get('https://gammafd1.northeurope.cloudapp.azure.com:9136/flowbot/CustomCode', null, null, false, false).then(response => {
|
|
71
|
+
// setSpinning(false);
|
|
72
|
+
// debugger;
|
|
73
|
+
// alert('OK');
|
|
74
|
+
// }).catch(errorMessage => {
|
|
75
|
+
// debugger;
|
|
76
|
+
// if (errorMessage && errorMessage.message)
|
|
77
|
+
// alert(errorMessage.message);
|
|
78
|
+
// setSpinning(false);
|
|
79
|
+
// });
|
|
80
|
+
|
|
81
|
+
// 400
|
|
82
|
+
// runner.delete('https://gammafd1.northeurope.cloudapp.azure.com:9126/flowbot/Dossier/24/Procedure/78', null, onGenericServerError, null, false, false).then(response => {
|
|
83
|
+
// setSpinning(false);
|
|
84
|
+
// debugger;
|
|
85
|
+
// alert('Ok');
|
|
86
|
+
// }).catch(errorMessage => {
|
|
87
|
+
// debugger;
|
|
88
|
+
// if (errorMessage && errorMessage.message)
|
|
89
|
+
// alert(errorMessage.message);
|
|
90
|
+
// setSpinning(false);
|
|
91
|
+
// });
|
|
92
|
+
|
|
93
|
+
};
|
|
57
94
|
|
|
58
95
|
const updateAppState = (name: string, value: object) => {
|
|
59
96
|
console.log(`updateState name: ${name}, configuration: ${value}`);
|
|
@@ -64,7 +101,7 @@ function App() {
|
|
|
64
101
|
value,
|
|
65
102
|
},
|
|
66
103
|
};
|
|
67
|
-
}
|
|
104
|
+
};
|
|
68
105
|
|
|
69
106
|
// @ts-ignore
|
|
70
107
|
const store = createStore(appReducer);
|
|
@@ -73,14 +110,14 @@ function App() {
|
|
|
73
110
|
|
|
74
111
|
<Provider store={store}>
|
|
75
112
|
<Components.Spin spinning={spinning} />
|
|
76
|
-
<Components.AppIcon name={
|
|
113
|
+
<Components.AppIcon name={'Pin'} className='dark-pink-svg' />
|
|
77
114
|
<TestLabelFunction />
|
|
78
115
|
<ConfigurationLoader updateAppState={updateAppState} path={null} />
|
|
79
116
|
<LanguageLoader updateAppState={updateAppState} language='it-IT' path={null} />
|
|
80
117
|
|
|
81
118
|
<button onClick={textFetch}>Fetch Demo</button>
|
|
82
119
|
{options ? options.map((x: any) => {
|
|
83
|
-
return (<li key={x.value}>ID: {x.value} Post: {x.label}</li>)
|
|
120
|
+
return (<li key={x.value}>ID: {x.value} Post: {x.label}</li>);
|
|
84
121
|
}) : ''}
|
|
85
122
|
</Provider >
|
|
86
123
|
);
|