@visns-studio/visns-components 2.1.1 → 2.1.3

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.
@@ -652,29 +652,27 @@ const Field = ({
652
652
  break;
653
653
  case 'richeditor':
654
654
  htmlContainer = (
655
- <React.Fragment style={{ height: '1000px' }}>
656
- <ReactQuill
657
- theme="snow"
658
- name={settings.id}
659
- onChange={(value) => {
660
- onChangeRicheditor(value, settings.id);
661
- }}
662
- value={inputValue || ''}
663
- modules={modules}
664
- formats={[
665
- 'header',
666
- 'bold',
667
- 'italic',
668
- 'underline',
669
- 'strike',
670
- 'blockquote',
671
- 'list',
672
- 'bullet',
673
- 'link',
674
- 'image',
675
- ]}
676
- />
677
- </React.Fragment>
655
+ <ReactQuill
656
+ theme="snow"
657
+ name={settings.id}
658
+ onChange={(value) => {
659
+ onChangeRicheditor(value, settings.id);
660
+ }}
661
+ value={inputValue || ''}
662
+ modules={modules}
663
+ formats={[
664
+ 'header',
665
+ 'bold',
666
+ 'italic',
667
+ 'underline',
668
+ 'strike',
669
+ 'blockquote',
670
+ 'list',
671
+ 'bullet',
672
+ 'link',
673
+ 'image',
674
+ ]}
675
+ />
678
676
  );
679
677
  break;
680
678
  case 'image':
@@ -1,33 +1,33 @@
1
- import React, { useState } from "react";
2
- import Reveal from "react-reveal/Reveal";
3
- import { toast } from "react-toastify";
4
- import parse from "html-react-parser";
5
- import { Person } from "akar-icons";
1
+ import React, { useState } from 'react';
2
+ import Reveal from 'react-reveal/Reveal';
3
+ import { toast } from 'react-toastify';
4
+ import parse from 'html-react-parser';
5
+ import { Person } from 'akar-icons';
6
6
 
7
- import CustomFetch from "../Fetch";
7
+ import CustomFetch from '../Fetch';
8
8
 
9
- const Reset = () => {
10
- const [email, setEmail] = useState("");
11
- const [emailClass, setEmailClass] = useState("");
9
+ const Reset = ({ logo }) => {
10
+ const [email, setEmail] = useState('');
11
+ const [emailClass, setEmailClass] = useState('');
12
12
 
13
13
  const handleSubmit = (e) => {
14
14
  e.preventDefault();
15
15
 
16
- if (email === "") {
17
- const error = "Please type in your email address.";
18
- setEmailClass("inputError");
16
+ if (email === '') {
17
+ const error = 'Please type in your email address.';
18
+ setEmailClass('inputError');
19
19
  toast.error(<div>{parse(error)}</div>);
20
20
  return;
21
21
  }
22
22
 
23
23
  CustomFetch(
24
- "/password/forgot",
25
- "POST",
24
+ '/password/forgot',
25
+ 'POST',
26
26
  { email: email },
27
27
  function (result) {
28
- if (result.error === "") {
28
+ if (result.error === '') {
29
29
  setEmail(
30
- "You have successfully requested to reset your password, an email will be sent shortly. Please follow the instruction on the email."
30
+ 'You have successfully requested to reset your password, an email will be sent shortly. Please follow the instruction on the email.'
31
31
  );
32
32
  } else {
33
33
  toast.error(result.error);
@@ -44,6 +44,11 @@ const Reset = () => {
44
44
  <form onSubmit={handleSubmit}>
45
45
  <Reveal effect="fadeInUp">
46
46
  <div className="login">
47
+ <img
48
+ src={logo}
49
+ alt="CRM"
50
+ className="loginlogo"
51
+ />
47
52
  <div className="formItem fwItem">
48
53
  <h1>Forgot your password?</h1>
49
54
  </div>
@@ -55,7 +60,7 @@ const Reset = () => {
55
60
  value={email}
56
61
  onChange={(e) => {
57
62
  setEmail(e.target.value);
58
- setEmailClass("");
63
+ setEmailClass('');
59
64
  }}
60
65
  tabIndex="1"
61
66
  className={emailClass}
@@ -7,7 +7,7 @@ import Reveal from 'react-reveal/Reveal';
7
7
 
8
8
  import CustomFetch from '../Fetch';
9
9
 
10
- const Verify = () => {
10
+ const Verify = ({ logo }) => {
11
11
  const navigate = useNavigate();
12
12
  const { code } = useParams();
13
13
 
@@ -100,6 +100,11 @@ const Verify = () => {
100
100
  <form onSubmit={handleSubmit}>
101
101
  <Reveal effect="fadeInUp">
102
102
  <div className="login">
103
+ <img
104
+ src={logo}
105
+ alt="CRM"
106
+ className="loginlogo"
107
+ />
103
108
  <div className="formItem fwItem">
104
109
  <h1>Reset your password</h1>
105
110
  </div>
@@ -420,15 +420,19 @@ function GenericDetail({ setting, urlParam, userProfile }) {
420
420
 
421
421
  const applyUrlParamsToData = (data) => {
422
422
  return data.map((item) => {
423
- return {
424
- ...item,
425
- value:
426
- item.hasOwnProperty('value') &&
427
- item.urlParam &&
428
- routeParams[item.urlParam]
429
- ? routeParams[item.urlParam]
430
- : item.value,
431
- };
423
+ if (item.hasOwnProperty('value') && item.urlParam) {
424
+ return {
425
+ ...item,
426
+ value:
427
+ item.hasOwnProperty('value') &&
428
+ item.urlParam &&
429
+ routeParams[item.urlParam]
430
+ ? routeParams[item.urlParam]
431
+ : item.value,
432
+ };
433
+ } else {
434
+ return item;
435
+ }
432
436
  });
433
437
  };
434
438
 
@@ -446,12 +450,54 @@ function GenericDetail({ setting, urlParam, userProfile }) {
446
450
  activeTabConfig.ajaxSetting.where
447
451
  ),
448
452
  };
453
+
449
454
  const updatedForm = {
450
455
  ...activeTabConfig.form,
451
- fields: applyUrlParamsToData(
452
- activeTabConfig.form.fields
456
+ fields: activeTabConfig.form.fields.map(
457
+ (field) => {
458
+ if (
459
+ field.hasOwnProperty('value') &&
460
+ field.urlParam &&
461
+ routeParams[field.urlParam]
462
+ ) {
463
+ if (
464
+ field.type &&
465
+ field.relationName &&
466
+ (field.type ===
467
+ 'multi-dropdown-ajax' ||
468
+ field.type ===
469
+ 'multi-dropdown')
470
+ ) {
471
+ field.value = {
472
+ value: routeParams[
473
+ field.urlParam
474
+ ],
475
+ label: data[
476
+ field.relationName
477
+ ],
478
+ };
479
+ } else {
480
+ field.value =
481
+ routeParams[
482
+ field.urlParam
483
+ ];
484
+ }
485
+ }
486
+
487
+ if (field.where) {
488
+ return {
489
+ ...field,
490
+ where: applyUrlParamsToData(
491
+ field.where
492
+ ),
493
+ };
494
+ } else {
495
+ return field;
496
+ }
497
+ }
453
498
  ),
454
499
  };
500
+
455
501
  setConfig({
456
502
  ajaxSetting: updatedAjaxSetting,
457
503
  form: updatedForm,
package/package.json CHANGED
@@ -40,7 +40,7 @@
40
40
  "react-dom": "^17.0.1"
41
41
  },
42
42
  "name": "@visns-studio/visns-components",
43
- "version": "2.1.1",
43
+ "version": "2.1.3",
44
44
  "description": "Various packages to assist in the development of our Custom Applications.",
45
45
  "main": "index.js",
46
46
  "scripts": {