Skip to content

Commit

Permalink
r0b08x [chore] 3/29/2024, 3:17:53 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
p3x-robot committed Mar 29, 2024
1 parent 324c888 commit fe54e5f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ https://corifeus.com/redis-ui


---
# 💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io v2024.4.176
# 💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io v2024.4.177



Expand Down Expand Up @@ -77,7 +77,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://

---

[**P3X-REDIS-UI-MATERIAL**](https://corifeus.com/redis-ui-material) Build v2024.4.176
[**P3X-REDIS-UI-MATERIAL**](https://corifeus.com/redis-ui-material) Build v2024.4.177

[![NPM](https://img.shields.io/npm/v/p3x-redis-ui-material.svg)](https://www.npmjs.com/package/p3x-redis-ui-material) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "p3x-redis-ui-material",
"version": "2024.4.176",
"version": "2024.4.177",
"description": "💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io",
"corifeus": {
"icon": "fas fa-database",
Expand Down
4 changes: 3 additions & 1 deletion src/angular/dialog/p3xr-dialog-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,12 @@ p3xr.ng.factory('p3xrDialogConnection', function (p3xrCommon, $mdDialog, p3xrSoc

try {

const saveModel = p3xr.clone($scope.model)
//console.log('saveModel', saveModel)
const response = await p3xrSocket.request({
action: 'connection-save',
payload: {
model: global.p3xr.clone($scope.model)
model: saveModel
},
})
p3xrCommon.toast({
Expand Down
24 changes: 11 additions & 13 deletions src/core/clone.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
const cloneDeepWith = require('lodash/cloneDeepWith')
const isObject = require('lodash/isObject')
const transform = require('lodash/transform')

function customizer(value) {
if (isObject(value)) {
// Remove keys that start with '$'
return transform(value, (result, val, key) => {
if (key !== '$$hashKey') {
result[key] = val;
}
});
}
// For other types, no custom behavior
}
function removeHashKeys(data) {
return transform(data, (result, value, key) => {
// Exclude $$hashKey from the transformation
if (key !== '$$hashKey') {
// Recursively apply transformation for objects and arrays, else assign value directly
result[key] = isObject(value) ? removeHashKeys(value) : value;
}
});
}


p3xr.clone = (value) => {
//console.warn('clone, executed', value)
return cloneDeepWith(value, customizer)
return removeHashKeys(value)
}

0 comments on commit fe54e5f

Please sign in to comment.