Copilot commented on code in PR #12468:
URL: https://github.com/apache/cloudstack/pull/12468#discussion_r2705877552


##########
api/src/main/java/org/apache/cloudstack/api/response/SnapshotResponse.java:
##########
@@ -155,6 +155,14 @@ public class SnapshotResponse extends 
BaseResponseWithTagInformation implements
     @Param(description = "download progress of a snapshot", since = "4.19.0")
     private Map<String, String> downloadDetails;
 
+    @SerializedName("parent")
+    @Param(description = "The parent ID of the Snapshot", since = "4.22.1")
+    private String parent;
+
+    @SerializedName("parentname")
+    @Param(description = "The parent name of the Snapshot", since = "4.22.1")
+    private String parentName;

Review Comment:
   The parent and parentName fields are missing getter methods. While setters 
have been added (lines 325-331), corresponding getter methods should be added 
for consistency with other fields in this class and to allow programmatic 
access to these values. Add getParent() and getParentName() methods that return 
their respective field values.



##########
ui/src/config/section/storage.js:
##########
@@ -324,7 +329,7 @@ export default {
         fields.push('zonename')
         return fields
       },
-      details: ['name', 'id', 'volumename', 'volumetype', 'snapshottype', 
'intervaltype', 'physicalsize', 'virtualsize', 'chainsize', 'account', 
'domain', 'created'],
+      details: ['name', 'id', 'volumename', 'volumetype', 'snapshottype', 
'intervaltype', 'physicalsize', 'virtualsize', 'chainsize', 'parentname', 
'account', 'domain', 'created'],

Review Comment:
   The details array unconditionally includes 'parentname' but the 'parent' 
field is missing. The details array should include 'parent' before 'parentname' 
for consistency with the API response fields. Additionally, consider whether 
these fields should be conditionally included in the details array based on the 
snapshotshowchainsize feature flag, similar to how they are conditionally added 
to the columns array on lines 315-318.
   ```suggestion
         details: () => {
           const fields = ['name', 'id', 'volumename', 'volumetype', 
'snapshottype', 'intervaltype', 'physicalsize', 'virtualsize', 'account', 
'domain', 'created']
           if (store.getters.features.snapshotshowchainsize) {
             fields.splice(fields.indexOf('account'), 0, 'chainsize', 'parent', 
'parentname')
           }
           return fields
         },
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to