[GitHub] [cloudstack] RodrigoDLopez commented on a change in pull request #4194: enable update tags on disk offerings

2020-08-30 Thread GitBox


RodrigoDLopez commented on a change in pull request #4194:
URL: https://github.com/apache/cloudstack/pull/4194#discussion_r479778348



##
File path: ui/scripts/configuration.js
##
@@ -2939,7 +2940,41 @@
 label: 'label.cache.mode'
 },
 tags: {
-label: 'label.storage.tags'
+label: 'label.storage.tags',
+docID: 'helpPrimaryStorageTags',
+isEditable: true,
+isTokenInput: true,
+dataProvider: function(args) {
+$.ajax({
+url: 
createURL("listStorageTags"),
+dataType: "json",
+success: function(json) {
+var item = 
json.liststoragetagsresponse.storagetag;

Review comment:
   Hi @rhtyd I believe yes, some changes will be necessary on Cloud-Primate
   I will take a look on this project, but i'm not familiarized with VUE.js





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [cloudstack] RodrigoDLopez commented on a change in pull request #4194: enable update tags on disk offerings

2020-07-29 Thread GitBox


RodrigoDLopez commented on a change in pull request #4194:
URL: https://github.com/apache/cloudstack/pull/4194#discussion_r461859143



##
File path: 
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##
@@ -3183,7 +3184,7 @@ public DiskOffering updateDiskOffering(final 
UpdateDiskOfferingCmd cmd) {
 throw new InvalidParameterValueException(String.format("Unable to 
update disk offering: %s by id user: %s because it is not root-admin or 
domain-admin", diskOfferingHandle.getUuid(), user.getUuid()));
 }
 
-final boolean updateNeeded = name != null || displayText != null || 
sortKey != null || displayDiskOffering != null;
+final boolean updateNeeded = name != null || displayText != null || 
sortKey != null || displayDiskOffering != null || tags != null;

Review comment:
   I extract this to an method, and add documentation for this new method

##
File path: 
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##
@@ -3207,30 +3208,13 @@ public DiskOffering updateDiskOffering(final 
UpdateDiskOfferingCmd cmd) {
 diskOffering.setDisplayOffering(displayDiskOffering);
 }
 
-// Note: tag editing commented out for now;keeping the code intact,
-// might need to re-enable in next releases
-// if (tags != null)
-// {
-// if (tags.trim().isEmpty() && diskOfferingHandle.getTags() == null)
-// {
-// //no new tags; no existing tags
-// diskOffering.setTagsArray(csvTagsToList(null));
-// }
-// else if (!tags.trim().isEmpty() && diskOfferingHandle.getTags() !=
-// null)
-// {
-// //new tags + existing tags
-// List oldTags = csvTagsToList(diskOfferingHandle.getTags());
-// List newTags = csvTagsToList(tags);
-// oldTags.addAll(newTags);
-// diskOffering.setTagsArray(oldTags);
-// }
-// else if(!tags.trim().isEmpty())
-// {
-// //new tags; NO existing tags
-// diskOffering.setTagsArray(csvTagsToList(tags));
-// }
-// }
+if (tags != null){
+if(tags.isBlank()){

Review comment:
   done... thanks for the hint





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [cloudstack] RodrigoDLopez commented on a change in pull request #4194: enable update tags on disk offerings

2020-07-13 Thread GitBox


RodrigoDLopez commented on a change in pull request #4194:
URL: https://github.com/apache/cloudstack/pull/4194#discussion_r453699456



##
File path: 
api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java
##
@@ -77,6 +77,13 @@
 since = "4.13")
 private String zoneIds;
 
+@Parameter(name = ApiConstants.TAGS,
+type = CommandType.STRING,
+description = "comma-separated list of tags for the disk offering, 
tags should match with existing storage pool tags",
+since = "4.15")
+private String tags;

Review comment:
   code has been updated, thanks for the hint @weizhouapache 





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [cloudstack] RodrigoDLopez commented on a change in pull request #4194: enable update tags on disk offerings

2020-07-01 Thread GitBox


RodrigoDLopez commented on a change in pull request #4194:
URL: https://github.com/apache/cloudstack/pull/4194#discussion_r448483807



##
File path: 
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##
@@ -3207,30 +3208,13 @@ public DiskOffering updateDiskOffering(final 
UpdateDiskOfferingCmd cmd) {
 diskOffering.setDisplayOffering(displayDiskOffering);
 }
 
-// Note: tag editing commented out for now;keeping the code intact,
-// might need to re-enable in next releases
-// if (tags != null)
-// {
-// if (tags.trim().isEmpty() && diskOfferingHandle.getTags() == null)
-// {
-// //no new tags; no existing tags
-// diskOffering.setTagsArray(csvTagsToList(null));
-// }
-// else if (!tags.trim().isEmpty() && diskOfferingHandle.getTags() !=
-// null)
-// {
-// //new tags + existing tags
-// List oldTags = csvTagsToList(diskOfferingHandle.getTags());
-// List newTags = csvTagsToList(tags);
-// oldTags.addAll(newTags);
-// diskOffering.setTagsArray(oldTags);
-// }
-// else if(!tags.trim().isEmpty())
-// {
-// //new tags; NO existing tags
-// diskOffering.setTagsArray(csvTagsToList(tags));
-// }
-// }
+if (tags != null){
+if(tags.isBlank()){
+diskOffering.setTags(null);
+}else {
+diskOffering.setTags(tags);
+}
+}

Review comment:
   done, fixed checkstyle issue





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [cloudstack] RodrigoDLopez commented on a change in pull request #4194: enable update tags on disk offerings

2020-07-01 Thread GitBox


RodrigoDLopez commented on a change in pull request #4194:
URL: https://github.com/apache/cloudstack/pull/4194#discussion_r448483662



##
File path: 
api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java
##
@@ -77,6 +77,13 @@
 since = "4.13")
 private String zoneIds;
 
+@Parameter(name = ApiConstants.TAGS,
+type = CommandType.STRING,
+description = "Comma-separated list of tags to be added to disk 
offering",

Review comment:
   i will improve this description





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org