Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion framework/python/src/net_orc/ip_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""IP Control Module"""
import subprocess
import psutil
import typing as t
from common import logger
Expand Down
2 changes: 1 addition & 1 deletion modules/ui/src/app/app.store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe('AppStore', () => {
isMenuOpen: true,
interfaces: {},
settingMissedError: null,
hasInternetConnection: true,
hasInternetConnection: null,
});
done();
});
Expand Down
2 changes: 1 addition & 1 deletion modules/ui/src/app/app.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class AppStore extends ComponentStore<AppComponentState> {
consentShown: sessionStorage.getItem(CONSENT_SHOWN_KEY) !== null,
isStatusLoaded: false,
systemStatus: null,
hasInternetConnection: true,
hasInternetConnection: null,
});
}
}
6 changes: 3 additions & 3 deletions modules/ui/src/app/components/wifi/wifi.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<button
mat-icon-button
class="app-toolbar-button wifi-button"
[attr.aria-label]="getLabel(on)"
[disabled]="disable"
[matTooltip]="getLabel(on)">
[attr.aria-label]="getLabel(on, disable)"
[class.disabled]="disable"
[matTooltip]="getLabel(on, disable)">
<mat-icon>
{{ on === true || on === null ? 'wifi' : 'wifi_off' }}
</mat-icon>
Expand Down
4 changes: 4 additions & 0 deletions modules/ui/src/app/components/wifi/wifi.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@import '../../../theming/colors';

$icon-size: 24px;

.app-toolbar-button {
border-radius: 20px;
border: 1px solid transparent;
Expand All @@ -25,6 +26,9 @@ $icon-size: 24px;
height: 34px;
margin: 11px 0;
line-height: 50% !important;
&.disabled {
opacity: 0.6;
}
}

.wifi-icon {
Expand Down
22 changes: 17 additions & 5 deletions modules/ui/src/app/components/wifi/wifi.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,25 @@ describe('WifiComponent', () => {
describe('Class tests', () => {
describe('with internet connection', () => {
it('should return label', () => {
expect(component.getLabel(true)).toEqual('Internet connection');
expect(component.getLabel(true)).toEqual(
'Testrun detects a working internet connection for the device under test.'
);
});
});

describe('should have no wifi icon', () => {
describe('with no internet connection', () => {
it('should return label', () => {
expect(component.getLabel(false)).toEqual(
'No internet connection detected for the device under test.'
);
});
});

describe('with N/A internet connection', () => {
it('should return label', () => {
expect(component.getLabel(false)).toEqual('No Internet connection');
expect(component.getLabel(false, true)).toEqual(
'Internet connection is not being monitored.'
);
});
});
});
Expand Down Expand Up @@ -74,15 +86,15 @@ describe('WifiComponent', () => {
});
});

it(' button should be disables', () => {
it('button should be disabled', () => {
component.disable = true;
fixture.detectChanges();

const shutdownButton = compiled.querySelector(
'.wifi-button'
) as HTMLButtonElement;

expect(shutdownButton.disabled).toBeTrue();
expect(shutdownButton?.classList.contains('disabled')).toBeTrue();
});
});
});
11 changes: 8 additions & 3 deletions modules/ui/src/app/components/wifi/wifi.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ import { MatButton, MatIconButton } from '@angular/material/button';
styleUrl: './wifi.component.scss',
})
export class WifiComponent {
@Input() on: boolean | null = true;
@Input() on: boolean | null = null;
@Input() disable: boolean = false;

getLabel(on: boolean | null) {
return on ? 'Internet connection' : 'No Internet connection';
getLabel(on: boolean | null, disable: boolean = false) {
if (disable) {
return 'Internet connection is not being monitored.';
}
return on
? 'Testrun detects a working internet connection for the device under test.'
: 'No internet connection detected for the device under test.';
}
}