Skip to content

Do not show WiFi configuration link if there are no WiFi devices#374

Merged
teclator merged 6 commits intomasterfrom
wifi_devices
Jan 2, 2023
Merged

Do not show WiFi configuration link if there are no WiFi devices#374
teclator merged 6 commits intomasterfrom
wifi_devices

Conversation

@teclator
Copy link
Contributor

@teclator teclator commented Dec 15, 2022

Problem

In #316 we added logic to hide the link for connecting to a WiFi network but only in case the WiFi was enable based on rfkill but if there are no WiFi devices at all then it does not makes sense to show the link.

Solution

Do not show the link for connecting to a WiFi network if there are no WiFi devices.

Update: and also do not show an empty network section when there is no connection detected and no WiFi device available.

Testing

  • Added a new unit test
  • Tested manually

Screenshots

With a network connection Whitout network connection
Screenshot from 2023-01-02 11-29-04 Screenshot from 2023-01-02 11-26-53
Screenshot from 2023-01-02 11-33-33 Screenshot from 2023-01-02 11-36-22

@coveralls
Copy link

coveralls commented Dec 15, 2022

Coverage Status

Coverage: 76.218% (+0.1%) from 76.117% when pulling 8c466bb on wifi_devices into dc0edb9 on master.

@teclator teclator changed the title [WIP] Do not show WiFi configuration link if there are no WiFi devices Do not show WiFi configuration link if there are no WiFi devices Dec 15, 2022
Copy link
Contributor

@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we have plenty of time, I would take the opportunity to improve a few things. For instance, if the network is not initialized, we display display nothing, and it says nothing to the user. Additionally, if you do not have any network device (e.g., the network cable is disconnected and you do not have any wireless device), you basically see an empty section, right?

@teclator teclator requested a review from imobachgs December 16, 2022 10:42
@teclator teclator force-pushed the wifi_devices branch 2 times, most recently from 3f4c0a2 to f9af886 Compare December 16, 2022 11:00
@teclator
Copy link
Contributor Author

@imobachgs I addressed the suggestions from our previous comment, so, only deciding what to show in case that the section is completely empty.

Screenshot from 2022-12-16 11-29-26

@dgdavid
Copy link
Contributor

dgdavid commented Dec 19, 2022

@imobachgs I addressed the suggestions from our previous comment, so, only deciding what to show in case that the section is completely empty.

I know we (the YaST team) haven't talk about that yet, but in my opinion the summary mustn't contain an empty section. The section can be there or not, depending on the - not yet ready - [product|architecture|workflow] configuration, but no empty.

So, I'd add a summary telling the user that D-Installer was not able to find neither, a wired network connection nor a network hardware for connection to a WiFi network.

@teclator teclator closed this Dec 30, 2022
@teclator teclator reopened this Dec 30, 2022
@teclator teclator force-pushed the wifi_devices branch 2 times, most recently from 613c7be to 751e76d Compare January 2, 2023 11:20
@teclator teclator changed the title Do not show WiFi configuration link if there are no WiFi devices Do not show WiFi configuration link if there are no WiFi devices & do not show an empty network section Jan 2, 2023
@teclator teclator changed the title Do not show WiFi configuration link if there are no WiFi devices & do not show an empty network section Do not show WiFi configuration link if there are no WiFi devices Jan 2, 2023
@teclator
Copy link
Contributor Author

teclator commented Jan 2, 2023

Screenshot from 2023-01-02 11-26-53

Copy link
Contributor

@dgdavid dgdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

Comment on lines +506 to +520
/*
* Returns the list of WiFi devices available in the system
*
* @return {object[]} list of available WiFi devices
*/
availableWifiDevices() {
return Object.values(this.proxies.devices).filter(d => d.DeviceType === NM_DEVICE_TYPE_WIFI);
}

/*
* Returns whether the system is able to scan wifi networks based on rfkill and the presence of
* some wifi device
*
* @return {boolean}
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP: looks to me that those comments are miss-aligned.

/*
*

should actually be

/* 
 *


/*
* Returns NetworkManager general settings
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP: Ah, I see we have a mix on comments style :) So keep them as they are 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think these are mixed styles, just miss-aligned comments :) And sure we have more of them. 😞

Copy link
Contributor

@dgdavid dgdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not forget to update the .changes file.

Copy link
Contributor

@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment in the changes log. Otherwise, LGTM. Thanks!

@teclator teclator merged commit b9d549b into master Jan 2, 2023
@teclator teclator deleted the wifi_devices branch January 2, 2023 12:07
@imobachgs imobachgs mentioned this pull request Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants