Skip to content

Commit

Permalink
mods. to DeviceTab classes to correctly handle background dev. manage…
Browse files Browse the repository at this point in the history
…ment tabs
  • Loading branch information
Agnul97 authored and Coduz committed Apr 17, 2023
1 parent 4723cc1 commit 0fb2895
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ public void setEntity(GwtDevice gwtDevice) {
setEnabled(false);
getHeader().setVisible(false);
}
assetsValues.setDevice(gwtDevice);
doRefresh();

if (selectedEntity != null) {
assetsValues.setDevice(gwtDevice);
}

}

@Override
Expand All @@ -66,7 +69,7 @@ public void doRefresh() {
return;
}

if (tabsPanel.getSelectedItem() == this) {
if (tabsPanel.getSelectedItem() == tabValues) {
assetsValues.refresh();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public class DeviceTabBundles extends KapuaTabItem<GwtDevice> {

private final GwtDeviceManagementServiceAsync gwtDeviceManagementService = GWT.create(GwtDeviceManagementService.class);
private final GwtSecurityTokenServiceAsync gwtXSRFService = GWT.create(GwtSecurityTokenService.class);

private DeviceView devicesView;

private boolean initialized;
Expand Down Expand Up @@ -107,7 +106,6 @@ public void setEntity(GwtDevice gwtDevice) {
setEnabled(false);
getHeader().setVisible(false);
}
doRefresh();
}

@Override
Expand Down Expand Up @@ -406,7 +404,7 @@ public DataLoadListener() {
@Override
public void loaderBeforeLoad(LoadEvent le) {
disableButtons();
grid.mask(MSGS.loading());
//grid.mask(MSGS.loading());
}

@Override
Expand All @@ -422,7 +420,6 @@ public void loaderLoad(LoadEvent le) {

@Override
public void loaderLoadException(LoadEvent le) {

if (le.exception != null && le.exception instanceof GwtKapuaException) {
FailureHandler.handle(le.exception);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public void setEntity(GwtDevice gwtDevice) {
setEnabled(false);
getHeader().setVisible(false);
}
doRefresh();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ public DeviceConfigComponents(GwtSession currentSession, DeviceTabConfiguration
public void setDevice(GwtDevice selectedDevice) {
dirty = true;
this.selectedDevice = selectedDevice;
refresh();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,32 @@ public void setEntity(GwtDevice gwtDevice) {
setEnabled(false);
getHeader().setVisible(false);
}
doRefresh();

if (selectedEntity != null) {
// Configurations
configComponents.setDevice(selectedEntity);

// Snapshot
configSnapshots.setDevice(selectedEntity);
}

}

@Override
public void doRefresh() {

if (tabsPanel == null) {
return;
}

if (selectedEntity != null) {
tabSnapshots.setEnabled(selectedEntity.isOnline());
}
if (tabsPanel.getSelectedItem() == tabComponents) {
configComponents.refresh();
} else if (tabsPanel.getSelectedItem() == tabSnapshots) {
configSnapshots.refresh();
}
if (selectedEntity != null) {
configComponents.setDevice(selectedEntity);
configSnapshots.setDevice(selectedEntity);
}

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ public void setEntity(GwtDevice gwtDevice) {
tabsPanel.setSelection(inventoryDeploymentPackageTab);
}

if (toolBar != null) {
toolBar.setEnabled(getSelectedDevice() != null);
}

doRefresh();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ public void setEntity(GwtDevice gwtDevice) {
getHeader().setVisible(false);
}

refresh();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public void setEntity(GwtDevice gwtDevice) {
historyPackageTab.setEntity(gwtDevice);
}

doRefresh();
}

@Override
Expand Down

0 comments on commit 0fb2895

Please sign in to comment.