@visns-studio/visns-components 5.2.12 → 5.2.13
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/package.json
CHANGED
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
79
79
|
},
|
|
80
80
|
"name": "@visns-studio/visns-components",
|
|
81
|
-
"version": "5.2.
|
|
81
|
+
"version": "5.2.13",
|
|
82
82
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
83
83
|
"main": "src/index.js",
|
|
84
84
|
"files": [
|
|
@@ -19,7 +19,7 @@ import styles from './styles/GenericDashboard.module.scss';
|
|
|
19
19
|
|
|
20
20
|
const toSnakeCase = (str) => str.replace(/[\s-]+/g, '_').toLowerCase();
|
|
21
21
|
|
|
22
|
-
function GenericDashboard({ setting, userProfile }) {
|
|
22
|
+
function GenericDashboard({ setting, userProfile, dynamicDashboard = false }) {
|
|
23
23
|
const swapy = useRef(null);
|
|
24
24
|
const container = useRef(null);
|
|
25
25
|
const navigate = useNavigate();
|
|
@@ -1038,25 +1038,27 @@ function GenericDashboard({ setting, userProfile }) {
|
|
|
1038
1038
|
|
|
1039
1039
|
return (
|
|
1040
1040
|
<>
|
|
1041
|
-
|
|
1042
|
-
{
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1041
|
+
{dynamicDashboard && (
|
|
1042
|
+
<div className={styles.editButtonContainer}>
|
|
1043
|
+
{editMode && (
|
|
1044
|
+
<>
|
|
1045
|
+
<button
|
|
1046
|
+
className={styles.btn}
|
|
1047
|
+
style={{ marginRight: '10px' }}
|
|
1048
|
+
onClick={() => setShowAddWidgetModal(true)}
|
|
1049
|
+
>
|
|
1050
|
+
Add Widget
|
|
1051
|
+
</button>
|
|
1052
|
+
</>
|
|
1053
|
+
)}
|
|
1054
|
+
<button
|
|
1055
|
+
className={styles.btn}
|
|
1056
|
+
onClick={() => setEditMode((prev) => !prev)}
|
|
1057
|
+
>
|
|
1058
|
+
{editMode ? 'Done' : 'Edit Dashboard'}
|
|
1059
|
+
</button>
|
|
1060
|
+
</div>
|
|
1061
|
+
)}
|
|
1060
1062
|
<div className={styles.grid} ref={container}>
|
|
1061
1063
|
{renderWidgets()}
|
|
1062
1064
|
<Popup open={modalShow} onClose={closeModal}>
|