You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/05/23 10:52:01 UTC

[GitHub] [cloudstack] shwstppr commented on a diff in pull request #6400: UI: fix create vpc private gateway for regular user

shwstppr commented on code in PR #6400:
URL: https://github.com/apache/cloudstack/pull/6400#discussion_r879308712


##########
ui/src/views/network/VpcTab.vue:
##########
@@ -684,10 +684,19 @@ export default {
 
       switch (e) {
         case 'privateGateways':
-          this.rules = {
-            ipaddress: [{ required: true, message: this.$t('label.required') }],
-            gateway: [{ required: true, message: this.$t('label.required') }],
-            netmask: [{ required: true, message: this.$t('label.required') }]
+          if (this.isAdmin()) {
+            this.rules = {
+              ipaddress: [{ required: true, message: this.$t('label.required') }],
+              gateway: [{ required: true, message: this.$t('label.required') }],
+              netmask: [{ required: true, message: this.$t('label.required') }]
+            }
+          } else {
+            this.rules = {
+              ipaddress: [{ required: true, message: this.$t('label.required') }],
+              gateway: [{ required: true, message: this.$t('label.required') }],
+              netmask: [{ required: true, message: this.$t('label.required') }],
+              associatednetworkid: [{ required: true, message: this.$t('label.required') }]
+            }
           }

Review Comment:
   ```suggestion
             this.rules = {
               ipaddress: [{ required: true, message: this.$t('label.required') }],
               gateway: [{ required: true, message: this.$t('label.required') }],
               netmask: [{ required: true, message: this.$t('label.required') }]
             }
             if (!this.isAdmin()) {
               this.rules.associatednetworkid = [{ required: true, message: this.$t('label.required') }]
             }
   ```
   @weizhouapache can this be simplified?



-- 
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: commits-unsubscribe@cloudstack.apache.org

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