@visns-studio/visns-components 4.3.9 → 4.3.11

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.
@@ -543,8 +543,9 @@ function GenericDetail({ extraUrlParam, setting, urlParam, userProfile }) {
543
543
  <GenericDynamic
544
544
  data={data}
545
545
  fetchData={handleReload}
546
- label={activeTabConfig.setting.label}
546
+ label={data.task_template.label}
547
547
  multiple={false}
548
+ originalData={data}
548
549
  primaryKey={activeTabConfig.setting.key}
549
550
  setData={setData}
550
551
  setting={activeTabConfig.setting.url}
@@ -41,10 +41,14 @@ const renderValue = (field, data) => {
41
41
  if (field.dynamicfield && typeof field.dynamicfield === 'string') {
42
42
  const [table, key] = field.dynamicfield.split('::');
43
43
 
44
+ console.info(data, table, key);
45
+
44
46
  if (table && key) {
45
47
  switch (table) {
46
48
  case 'opportunities':
47
49
  return data[table][key];
50
+ case 'clients':
51
+ return data['client'][key];
48
52
  default:
49
53
  if (key === 'surname' && !data[key]) {
50
54
  return data['lastname'] || '';
@@ -550,12 +554,17 @@ const GenericDynamic = ({
550
554
  }
551
555
  }
552
556
  } else {
553
- if (
554
- Object.keys(activeForm).length === 0 &&
555
- templateStatus &&
556
- data[type][0]
557
- ) {
558
- setActiveForm(data[type][0]);
557
+ if (data[type].hasOwnProperty('id')) {
558
+ if (
559
+ Object.keys(activeForm).length === 0 &&
560
+ templateStatus &&
561
+ data[type][0]
562
+ ) {
563
+ setActiveForm(data[type][0]);
564
+ setActiveFormKey(0);
565
+ }
566
+ } else {
567
+ setActiveForm(data[type]);
559
568
  setActiveFormKey(0);
560
569
  }
561
570
  }
@@ -707,7 +716,7 @@ const GenericDynamic = ({
707
716
  <>
708
717
  <div className={styles.gridtxt__header}>
709
718
  <span>
710
- {label}{' '}
719
+ {label}
711
720
  {multiple && ` - Form #${activeForm?.id ?? ''}`}
712
721
  </span>
713
722
  </div>
@@ -830,7 +839,7 @@ const GenericDynamic = ({
830
839
  </button>
831
840
  )}
832
841
 
833
- {activeForm.id && (
842
+ {activeForm.id ? (
834
843
  <>
835
844
  {multiple && activeForm.form_status === 0 ? (
836
845
  <button className="btn" onClick={handleSaveForm}>
@@ -842,6 +851,10 @@ const GenericDynamic = ({
842
851
  </button>
843
852
  )}
844
853
  </>
854
+ ) : (
855
+ <button className="btn" onClick={handleSaveForm}>
856
+ Save
857
+ </button>
845
858
  )}
846
859
  </div>
847
860
  </>
@@ -180,7 +180,7 @@ input[type='file']:hover {
180
180
  .contentTable td {
181
181
  font-size: 0.95em;
182
182
  padding: 8px 15px;
183
- color: var(--paragraph-color);
183
+ color: var(--table-text-color, var(--paragraph-color));
184
184
  border-right: 1px solid var(--table-border);
185
185
  line-height: 1;
186
186
  border-spacing: 0;
package/package.json CHANGED
@@ -57,7 +57,7 @@
57
57
  "react-dom": "^17.0.1"
58
58
  },
59
59
  "name": "@visns-studio/visns-components",
60
- "version": "4.3.9",
60
+ "version": "4.3.11",
61
61
  "description": "Various packages to assist in the development of our Custom Applications.",
62
62
  "main": "index.js",
63
63
  "scripts": {