[gnome-shell] js: Reindent some code



commit 29dfde5a4a062ac76d157bf01cce51bb7d20425c
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Feb 7 16:03:55 2022 +0100

    js: Reindent some code
    
    ... to make sure it conforms to the non-legacy style
    before touching it.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2160>

 js/ui/components/networkAgent.js | 120 +++++++++++++++++++++++++++++----------
 js/ui/status/network.js          |  26 +++++----
 2 files changed, 103 insertions(+), 43 deletions(-)
---
diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js
index 68ac05f0cc..94772c0761 100644
--- a/js/ui/components/networkAgent.js
+++ b/js/ui/components/networkAgent.js
@@ -205,9 +205,13 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
         case 'wpa-none':
         case 'wpa-psk':
         case 'sae':
-            secrets.push({ label: _('Password'), key: 'psk',
-                           value: wirelessSecuritySetting.psk || '',
-                           validate: this._validateWpaPsk, password: true });
+            secrets.push({
+                label: _('Password'),
+                key: 'psk',
+                value: wirelessSecuritySetting.psk || '',
+                validate: this._validateWpaPsk,
+                password: true,
+            });
             break;
         case 'none': // static WEP
             secrets.push({
@@ -221,8 +225,12 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
             break;
         case 'ieee8021x':
             if (wirelessSecuritySetting.auth_alg == 'leap') { // Cisco LEAP
-                secrets.push({ label: _('Password'), key: 'leap-password',
-                               value: wirelessSecuritySetting.leap_password || '', password: true });
+                secrets.push({
+                    label: _('Password'),
+                    key: 'leap-password',
+                    value: wirelessSecuritySetting.leap_password || '',
+                    password: true,
+                });
             } else { // Dynamic (IEEE 802.1x) WEP
                 this._get8021xSecrets(secrets);
             }
@@ -241,16 +249,28 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
         /* If hints were given we know exactly what we need to ask */
         if (this._settingName == "802-1x" && this._hints.length) {
             if (this._hints.includes('identity')) {
-                secrets.push({ label: _('Username'), key: 'identity',
-                               value: ieee8021xSetting.identity || '', password: false });
+                secrets.push({
+                    label: _('Username'),
+                    key: 'identity',
+                    value: ieee8021xSetting.identity || '',
+                    password: false,
+                });
             }
             if (this._hints.includes('password')) {
-                secrets.push({ label: _('Password'), key: 'password',
-                               value: ieee8021xSetting.password || '', password: true });
+                secrets.push({
+                    label: _('Password'),
+                    key: 'password',
+                    value: ieee8021xSetting.password || '',
+                    password: true,
+                });
             }
             if (this._hints.includes('private-key-password')) {
-                secrets.push({ label: _('Private key password'), key: 'private-key-password',
-                               value: ieee8021xSetting.private_key_password || '', password: true });
+                secrets.push({
+                    label: _('Private key password'),
+                    key: 'private-key-password',
+                    value: ieee8021xSetting.private_key_password || '',
+                    password: true,
+                });
             }
             return;
         }
@@ -264,16 +284,32 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
             // TTLS and PEAP are actually much more complicated, but this complication
             // is not visible here since we only care about phase2 authentication
             // (and don't even care of which one)
-            secrets.push({ label: _('Username'), key: null,
-                           value: ieee8021xSetting.identity || '', password: false });
-            secrets.push({ label: _('Password'), key: 'password',
-                           value: ieee8021xSetting.password || '', password: true });
+            secrets.push({
+                label: _('Username'),
+                key: null,
+                value: ieee8021xSetting.identity || '',
+                password: false,
+            });
+            secrets.push({
+                label: _('Password'),
+                key: 'password',
+                value: ieee8021xSetting.password || '',
+                password: true,
+            });
             break;
         case 'tls':
-            secrets.push({ label: _('Identity'), key: null,
-                           value: ieee8021xSetting.identity || '', password: false });
-            secrets.push({ label: _('Private key password'), key: 'private-key-password',
-                           value: ieee8021xSetting.private_key_password || '', password: true });
+            secrets.push({
+                label: _('Identity'),
+                key: null,
+                value: ieee8021xSetting.identity || '',
+                password: false,
+            });
+            secrets.push({
+                label: _('Private key password'),
+                key: 'private-key-password',
+                value: ieee8021xSetting.private_key_password || '',
+                password: true,
+            });
             break;
         default:
             log('Invalid EAP/IEEE802.1x method: %s'.format(ieee8021xSetting.get_eap_method(0)));
@@ -282,12 +318,22 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
 
     _getPPPoESecrets(secrets) {
         let pppoeSetting = this._connection.get_setting_pppoe();
-        secrets.push({ label: _('Username'), key: 'username',
-                       value: pppoeSetting.username || '', password: false });
-        secrets.push({ label: _('Service'), key: 'service',
-                       value: pppoeSetting.service || '', password: false });
-        secrets.push({ label: _('Password'), key: 'password',
-                       value: pppoeSetting.password || '', password: true });
+        secrets.push({
+            label: _('Username'),
+            key: 'username',
+            value: pppoeSetting.username || '',
+            password: false,
+        });
+        secrets.push({
+            label: _('Service'), key: 'service',
+            value: pppoeSetting.service || '',
+            password: false,
+        });
+        secrets.push({
+            label: _('Password'), key: 'password',
+            value: pppoeSetting.password || '',
+            password: true,
+        });
     }
 
     _getMobileSecrets(secrets, connectionType) {
@@ -296,8 +342,12 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
             setting = this._connection.get_setting_cdma() || this._connection.get_setting_gsm();
         else
             setting = this._connection.get_setting_by_name(connectionType);
-        secrets.push({ label: _('Password'), key: 'password',
-                       value: setting.value || '', password: true });
+        secrets.push({
+            label: _('Password'),
+            key: 'password',
+            value: setting.value || '',
+            password: true,
+        });
     }
 
     _getContent() {
@@ -320,8 +370,12 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
         case '802-3-ethernet':
             content.title = _("Wired 802.1X authentication");
             content.message = null;
-            content.secrets.push({ label: _('Network name'), key: null,
-                                   value: connectionSetting.get_id(), password: false });
+            content.secrets.push({
+                label: _('Network name'),
+                key: null,
+                value: connectionSetting.get_id(),
+                password: false,
+            });
             this._get8021xSecrets(content.secrets);
             break;
         case 'pppoe':
@@ -334,8 +388,12 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
                 let gsmSetting = this._connection.get_setting_gsm();
                 content.title = _("PIN code required");
                 content.message = _("PIN code is needed for the mobile broadband device");
-                content.secrets.push({ label: _('PIN'), key: 'pin',
-                                       value: gsmSetting.pin || '', password: true });
+                content.secrets.push({
+                    label: _('PIN'),
+                    key: 'pin',
+                    value: gsmSetting.pin || '',
+                    password: true,
+                });
                 break;
             }
             // fall through
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index fc89f2beda..7e5b63c6f5 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -2127,18 +2127,20 @@ class Indicator extends PanelMenu.SystemIndicator {
         if (this._portalHelperProxy) {
             this._portalHelperProxy.AuthenticateRemote(path, '', timestamp);
         } else {
-            new PortalHelperProxy(Gio.DBus.session, 'org.gnome.Shell.PortalHelper',
-                                  '/org/gnome/Shell/PortalHelper', (proxy, error) => {
-                                      if (error) {
-                                          log('Error launching the portal helper: %s'.format(error));
-                                          return;
-                                      }
-
-                                      this._portalHelperProxy = proxy;
-                                      proxy.connectSignal('Done', this._portalHelperDone.bind(this));
-
-                                      proxy.AuthenticateRemote(path, '', timestamp);
-                                  });
+            new PortalHelperProxy(Gio.DBus.session,
+                'org.gnome.Shell.PortalHelper',
+                '/org/gnome/Shell/PortalHelper',
+                (proxy, error) => {
+                    if (error) {
+                        log('Error launching the portal helper: %s'.format(error));
+                        return;
+                    }
+
+                    this._portalHelperProxy = proxy;
+                    proxy.connectSignal('Done', this._portalHelperDone.bind(this));
+
+                    proxy.AuthenticateRemote(path, '', timestamp);
+                });
         }
 
         this._connectivityQueue.push(path);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]