@visns-studio/visns-components 3.7.2 → 3.7.4

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.
@@ -668,7 +668,8 @@ const Field = ({
668
668
  case 'richeditor':
669
669
  htmlContainer = (
670
670
  <Editor
671
- apiKey="51mqcxkrrco6unmr6h8exc5mkhtjwi6fpyedy3r493px8cbq"
671
+ tinymceScriptSrc="https://d16lktya8ojp5z.cloudfront.net/generic/packages/tinymce_v701/tinymce.min.js"
672
+ licenseKey="gpl"
672
673
  onEditorChange={(value, e) => {
673
674
  onChangeRicheditor(e, value, settings.id);
674
675
  }}
@@ -993,13 +993,8 @@ function Field({
993
993
  case 'richeditor':
994
994
  return (
995
995
  <Editor
996
- apiKey={
997
- userProfile?.settings?.api?.tinymce
998
- ? userProfile.settings.api.tinymce
999
- : api.tinymce
1000
- ? api.tinymce
1001
- : ''
1002
- }
996
+ tinymceScriptSrc="https://d16lktya8ojp5z.cloudfront.net/generic/packages/tinymce_v701/tinymce.min.js"
997
+ licenseKey="gpl"
1003
998
  onEditorChange={(value, e) => {
1004
999
  onChangeRicheditor(e, value, settings.id);
1005
1000
  }}
@@ -630,15 +630,19 @@ function Form({
630
630
  }, {});
631
631
 
632
632
  let payload = { ...formData };
633
-
634
633
  Object.keys(formData).forEach((key) => {
635
634
  const value = formData[key];
636
635
  const field = fieldMap[key];
637
636
 
638
637
  // Check if the field exists and is of type 'multi-dropdown-ajax'
639
638
  if (field && field.type === 'multi-dropdown-ajax') {
640
- // Check if 'value' and 'label' exist
641
- if (value && 'value' in value && 'label' in value) {
639
+ // First check if 'value' is an object and then check if 'value' and 'label' exist in it
640
+ if (
641
+ typeof value === 'object' &&
642
+ value !== null &&
643
+ 'value' in value &&
644
+ 'label' in value
645
+ ) {
642
646
  console.info(
643
647
  `Updating payload for key ${key}:`,
644
648
  value
@@ -1055,6 +1059,13 @@ function Form({
1055
1059
  ) {
1056
1060
  return null;
1057
1061
  }
1062
+ if (
1063
+ item.hasOwnProperty('updateOnly') &&
1064
+ item.updateOnly === true &&
1065
+ formType === 'create'
1066
+ ) {
1067
+ return null;
1068
+ }
1058
1069
 
1059
1070
  switch (item.type) {
1060
1071
  case 'table':
@@ -1195,6 +1206,14 @@ function Form({
1195
1206
  ) {
1196
1207
  return null;
1197
1208
  }
1209
+ if (
1210
+ item.hasOwnProperty('updateOnly') &&
1211
+ item.updateOnly === true &&
1212
+ formType === 'create'
1213
+ ) {
1214
+ return null;
1215
+ }
1216
+
1198
1217
  return (
1199
1218
  <Field
1200
1219
  api={api}
@@ -848,14 +848,8 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
848
848
  <div className="formItem fwItem">
849
849
  <label className="fi__label">
850
850
  <Editor
851
- apiKey={
852
- userProfile?.settings
853
- ?.api?.tinymce
854
- ? userProfile
855
- .settings.api
856
- .tinymce
857
- : ''
858
- }
851
+ tinymceScriptSrc="https://d16lktya8ojp5z.cloudfront.net/generic/packages/tinymce_v701/tinymce.min.js"
852
+ licenseKey="gpl"
859
853
  onEditorChange={(
860
854
  value,
861
855
  e
package/package.json CHANGED
@@ -50,7 +50,7 @@
50
50
  "react-dom": "^17.0.1"
51
51
  },
52
52
  "name": "@visns-studio/visns-components",
53
- "version": "3.7.2",
53
+ "version": "3.7.4",
54
54
  "description": "Various packages to assist in the development of our Custom Applications.",
55
55
  "main": "index.js",
56
56
  "scripts": {