You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/06/22 08:02:11 UTC

[GitHub] [cloudstack-primate] shwstppr opened a new pull request #441: autogenview: fix fill edit/update forms

shwstppr opened a new pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441


   Fix update host form issue (update forms in general)
   
   Fixes #417 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] rhtyd merged pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
rhtyd merged pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] shwstppr edited a comment on pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
shwstppr edited a comment on pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441#issuecomment-647648737


   @rhtyd code setting name of entity instead of ID in a-select. In updateHost form it sets oscategoryname value in the form element instead of oscategoryid.
   Maybe to further enhance prefilling edit forms we can get the id from select list if the id param is not available. But that might be little tricky.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] shwstppr commented on pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
shwstppr commented on pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441#issuecomment-647648737


   @rhtyd code setting name of entity instead of ID in a-select. In updateHost form it sets oscategoryname value in the form element instead of oscategoryid.
   Maybe to further enhance prefilling edit forms we can get the id from select list if the id param is noy available. But that might be little tricky.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] shwstppr commented on a change in pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
shwstppr commented on a change in pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441#discussion_r444655129



##########
File path: src/views/AutogenView.vue
##########
@@ -740,7 +740,8 @@ export default {
       this.currentAction.paramFields.map(field => {
         let fieldValue = null
         let fieldName = null
-        if (field.type === 'list' || field.name === 'account' || (this.currentAction.mapping && field.name in this.currentAction.mapping)) {
+        if (field.type === 'list' || field.name === 'account' ||
+          (this.currentAction.mapping && field.name in this.currentAction.mapping && !(field.name in this.resource))) {

Review comment:
       @rhtyd we already have a mapping for `oscategoryid` in `hosts.js` which is why we are seeing this problem.
   https://github.com/apache/cloudstack-primate/blob/master/src/config/section/infra/hosts.js#L63-L67
   While prefilling current values of params in edit forms, code is replacing `oscategoryid` to `oscategoryname` and using the value for `oscategoryname` from the resource.
   IMO, it should not do this replacement just because we have a mapping for a param but since I'm not sure if removing it completely will break some case I just added an additional condition to stop this replacement when the original param (`oscategoryid` in `listHost` response) is available in the resource object.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] rhtyd commented on pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441#issuecomment-647926614


   @blueorangutan package


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] blueorangutan commented on pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441#issuecomment-647941178


   @rhtyd a Jenkins job has been kicked to build primate packages. I'll keep you posted as I make progress.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] shwstppr edited a comment on pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
shwstppr edited a comment on pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441#issuecomment-647648737


   @rhtyd code is setting name of entity instead of ID in a-select. In updateHost form it sets oscategoryname value in the form element instead of oscategoryid.
   Maybe to further enhance prefilling edit forms we can get the id from select list if the id param is not available. But that might be little tricky.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] rhtyd commented on a change in pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
rhtyd commented on a change in pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441#discussion_r444621521



##########
File path: src/views/AutogenView.vue
##########
@@ -740,7 +740,8 @@ export default {
       this.currentAction.paramFields.map(field => {
         let fieldValue = null
         let fieldName = null
-        if (field.type === 'list' || field.name === 'account' || (this.currentAction.mapping && field.name in this.currentAction.mapping)) {
+        if (field.type === 'list' || field.name === 'account' ||
+          (this.currentAction.mapping && field.name in this.currentAction.mapping && !(field.name in this.resource))) {

Review comment:
       actually a field name could have a custom mapping and be in a resource (there are a few example), so this may break such cases; can you fix it by rather adding a mapping to the edit host action @shwstppr but retain the `this.currentAction.mapping && field.name in this.currentAction.mapping` check




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] shwstppr commented on pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
shwstppr commented on pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441#issuecomment-648031280


   @rhtyd AddHost form seems to be working fine. The only difference from legacy UI is that the form closes only after host addition result is received. In legacy UI, the form used to get closed instantly after clicking OK.
   Also, does the current change look okay to you? We can open PR for review if it is.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] blueorangutan commented on pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441#issuecomment-647941088


   @rhtyd a Jenkins job has been kicked to build primate packages. I'll keep you posted as I make progress.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] blueorangutan commented on pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441#issuecomment-647945426


   Packaging result: :heavy_check_mark:centos :heavy_check_mark:debian :heavy_check_mark:archive.
   QA: http://primate-qa.cloudstack.cloud:8080/client/pr/441 (JID-2088)


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] rhtyd commented on pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441#issuecomment-647578598


   Can you explain what is the cause and fix @shwstppr ?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [cloudstack-primate] rhtyd commented on pull request #441: autogenview: fix fill edit/update forms

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #441:
URL: https://github.com/apache/cloudstack-primate/pull/441#issuecomment-647854306


   @blueorangutan package


----------------------------------------------------------------
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:
users@infra.apache.org