@adminforth/clone-row 1.1.1 → 1.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.
package/build.log CHANGED
@@ -7,5 +7,5 @@ custom/
7
7
  custom/CloneRowButton.vue
8
8
  custom/tsconfig.json
9
9
 
10
- sent 2,103 bytes received 58 bytes 4,322.00 bytes/sec
11
- total size is 1,888 speedup is 0.87
10
+ sent 2,087 bytes received 58 bytes 4,290.00 bytes/sec
11
+ total size is 1,869 speedup is 0.87
@@ -35,12 +35,17 @@ function redirectToCreatePage() {
35
35
  const fieldsToFill = { ...props.resource.columns.filter((col: any) => col.showIn.create === true) }
36
36
  let dataToFill = {};
37
37
  for (const field of Object.values(fieldsToFill)) {
38
+ if (field.foreignResource) {
39
+ dataToFill[field.name] = props.record[field.name]?.pk
40
+ continue;
41
+ }
38
42
  dataToFill[field.name] = props.record[field.name];
39
43
  }
40
44
  return dataToFill;
41
45
  }
42
46
 
43
47
  function save_btoa(str) {
44
- return btoa(str);
48
+ const cleaned = str.replace(/\uFEFF/g, '');
49
+ return btoa(cleaned);
45
50
  }
46
51
  </script>
@@ -1,17 +1,14 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "baseUrl": ".", // This should point to your project root
3
+ "baseUrl": ".",
4
4
  "paths": {
5
5
  "@/*": [
6
- // "node_modules/adminforth/dist/spa/src/*"
7
6
  "../../../adminforth/spa/src/*"
8
7
  ],
9
8
  "*": [
10
- // "node_modules/adminforth/dist/spa/node_modules/*"
11
9
  "../../../adminforth/spa/node_modules/*"
12
10
  ],
13
11
  "@@/*": [
14
- // "node_modules/adminforth/dist/spa/src/*"
15
12
  "."
16
13
  ]
17
14
  }
@@ -35,12 +35,17 @@ function redirectToCreatePage() {
35
35
  const fieldsToFill = { ...props.resource.columns.filter((col: any) => col.showIn.create === true) }
36
36
  let dataToFill = {};
37
37
  for (const field of Object.values(fieldsToFill)) {
38
+ if (field.foreignResource) {
39
+ dataToFill[field.name] = props.record[field.name]?.pk
40
+ continue;
41
+ }
38
42
  dataToFill[field.name] = props.record[field.name];
39
43
  }
40
44
  return dataToFill;
41
45
  }
42
46
 
43
47
  function save_btoa(str) {
44
- return btoa(str);
48
+ const cleaned = str.replace(/\uFEFF/g, '');
49
+ return btoa(cleaned);
45
50
  }
46
51
  </script>
@@ -1,17 +1,14 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "baseUrl": ".", // This should point to your project root
3
+ "baseUrl": ".",
4
4
  "paths": {
5
5
  "@/*": [
6
- // "node_modules/adminforth/dist/spa/src/*"
7
6
  "../../../adminforth/spa/src/*"
8
7
  ],
9
8
  "*": [
10
- // "node_modules/adminforth/dist/spa/node_modules/*"
11
9
  "../../../adminforth/spa/node_modules/*"
12
10
  ],
13
11
  "@@/*": [
14
- // "node_modules/adminforth/dist/spa/src/*"
15
12
  "."
16
13
  ]
17
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/clone-row",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",