spice-js 2.6.17 → 2.6.19
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.
|
@@ -877,6 +877,8 @@ class SpiceModel {
|
|
|
877
877
|
|
|
878
878
|
columnList.push("_permissions"); // Always include _permissions
|
|
879
879
|
|
|
880
|
+
columnList.push("_permissions_"); // Always include _permissions
|
|
881
|
+
|
|
880
882
|
columnList.push("id"); // Always include _permissions
|
|
881
883
|
|
|
882
884
|
return _.map(data, entry => _.pick(entry, columnList));
|
package/package.json
CHANGED
package/src/models/SpiceModel.js
CHANGED
|
@@ -779,6 +779,7 @@ export default class SpiceModel {
|
|
|
779
779
|
return column.includes(".") ? _.last(column.split(".")) : column;
|
|
780
780
|
}); // Convert comma-separated string to array
|
|
781
781
|
columnList.push("_permissions"); // Always include _permissions
|
|
782
|
+
columnList.push("_permissions_"); // Always include _permissions
|
|
782
783
|
columnList.push("id"); // Always include _permissions
|
|
783
784
|
return _.map(data, (entry) => _.pick(entry, columnList));
|
|
784
785
|
}
|
|
@@ -846,6 +847,15 @@ export default class SpiceModel {
|
|
|
846
847
|
}
|
|
847
848
|
}
|
|
848
849
|
|
|
850
|
+
function formatSortComponent(sortComponent) {
|
|
851
|
+
// Split the string by spaces to get individual parts
|
|
852
|
+
const parts = sortComponent.split(" ");
|
|
853
|
+
// Assuming the first part is the column name, add backticks around it
|
|
854
|
+
parts[0] = `\`${parts[0]}\``;
|
|
855
|
+
// Rejoin the parts back into a string and return
|
|
856
|
+
return parts.join(" ");
|
|
857
|
+
}
|
|
858
|
+
|
|
849
859
|
if (hasSQLInjection(query)) {
|
|
850
860
|
return [];
|
|
851
861
|
}
|
|
@@ -864,7 +874,9 @@ export default class SpiceModel {
|
|
|
864
874
|
let new_sort_array = [];
|
|
865
875
|
for (let i = 0; i < sort_array.length; i++) {
|
|
866
876
|
if (!sort_array[i].includes(".")) {
|
|
867
|
-
new_sort_array.push(
|
|
877
|
+
new_sort_array.push(
|
|
878
|
+
`\`${this.type}\`.${formatSortComponent(sort_array[i])}`
|
|
879
|
+
);
|
|
868
880
|
} else {
|
|
869
881
|
new_sort_array.push(sort_array[i]);
|
|
870
882
|
}
|
|
@@ -943,9 +955,8 @@ export default class SpiceModel {
|
|
|
943
955
|
this.type
|
|
944
956
|
).get(key);
|
|
945
957
|
results = cached_results?.value;
|
|
946
|
-
let shouleForceRefresh =
|
|
947
|
-
cached_results
|
|
948
|
-
);
|
|
958
|
+
let shouleForceRefresh =
|
|
959
|
+
await this.shouldForceRefresh(cached_results);
|
|
949
960
|
if (cached_results?.value == undefined || shouleForceRefresh) {
|
|
950
961
|
results = await this.database.search(
|
|
951
962
|
this.type,
|
|
@@ -989,6 +1000,8 @@ export default class SpiceModel {
|
|
|
989
1000
|
await this.propsToBeRemoved(results.data)
|
|
990
1001
|
);
|
|
991
1002
|
}
|
|
1003
|
+
if (this.type == "resourcedetail");
|
|
1004
|
+
|
|
992
1005
|
if (args.skip_hooks != true) {
|
|
993
1006
|
await this.run_hook(results.data, "list", "after");
|
|
994
1007
|
}
|