@growy/strapi-plugin-encrypted-field 1.2.2 → 1.4.0

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.
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { useIntl } from 'react-intl';
3
- import { Field, Typography } from '@strapi/design-system';
3
+ import { Field } from '@strapi/design-system';
4
4
 
5
5
  const Input = (props) => {
6
6
  const {
@@ -28,8 +28,6 @@ const Input = (props) => {
28
28
  });
29
29
  };
30
30
 
31
- const charCount = value ? value.length : 0;
32
-
33
31
  return (
34
32
  <Field.Root
35
33
  name={name}
@@ -39,10 +37,10 @@ const Input = (props) => {
39
37
  required={required}
40
38
  >
41
39
  <Field.Label action={labelAction}>
42
- {intlLabel?.id ? formatMessage(intlLabel) : intlLabel} 🔒
40
+ {intlLabel?.id ? formatMessage(intlLabel) : intlLabel}
43
41
  </Field.Label>
44
42
  <Field.Input
45
- type="password"
43
+ type="text"
46
44
  placeholder={formatMessage({
47
45
  id: 'encrypted-field.placeholder',
48
46
  defaultMessage: 'Ingresa el texto a cifrar...',
@@ -51,11 +49,6 @@ const Input = (props) => {
51
49
  onChange={handleChange}
52
50
  disabled={disabled}
53
51
  />
54
- {charCount > 0 && (
55
- <Typography variant="pi" textColor="neutral600" marginTop={1}>
56
- {charCount} {charCount === 1 ? 'carácter' : 'caracteres'}
57
- </Typography>
58
- )}
59
52
  <Field.Hint />
60
53
  <Field.Error />
61
54
  </Field.Root>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growy/strapi-plugin-encrypted-field",
3
- "version": "1.2.2",
3
+ "version": "1.4.0",
4
4
  "description": "Campo personalizado de texto cifrado para Strapi",
5
5
  "strapi": {
6
6
  "name": "encrypted-field",
@@ -63,7 +63,7 @@ module.exports = ({ strapi }) => {
63
63
  if (!isEncryptedField(attribute)) continue;
64
64
  if (Object.prototype.hasOwnProperty.call(result, key)) {
65
65
  const value = result[key];
66
- if (typeof value === 'string') {
66
+ if (typeof value === 'string' && value) {
67
67
  result[key] = decrypt(value, strapi);
68
68
  }
69
69
  }
@@ -84,7 +84,7 @@ module.exports = ({ strapi }) => {
84
84
  if (!isEncryptedField(attribute)) continue;
85
85
  if (Object.prototype.hasOwnProperty.call(item, key)) {
86
86
  const value = item[key];
87
- if (typeof value === 'string') {
87
+ if (typeof value === 'string' && value) {
88
88
  item[key] = decrypt(value, strapi);
89
89
  }
90
90
  }