diff options
author | ralph isenmann | 2021-02-17 10:54:35 +0100 |
---|---|---|
committer | ralph isenmann | 2021-02-17 10:54:35 +0100 |
commit | 5daa582be29e2e06e55d0495835da4f7c11e6c38 (patch) | |
tree | e647ac556e2a711c5ea9612d11101c9946bac91a | |
parent | [client] Update Language Tags (i18n) (diff) | |
download | tutor-module-5daa582be29e2e06e55d0495835da4f7c11e6c38.tar.gz tutor-module-5daa582be29e2e06e55d0495835da4f7c11e6c38.tar.xz tutor-module-5daa582be29e2e06e55d0495835da4f7c11e6c38.zip |
[client] Fix changeMonitor in Lecture- and Imagesdetails
- In Images and Lectures with non Container context, no input from ContainerPanel should be monitored by changeMonitor.
3 files changed, 13 insertions, 8 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java index d4e49fe6..7c116867 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java @@ -37,6 +37,8 @@ public class ContainerPanel extends JPanel { private ContainerDefinition containerDefinition = null; + private boolean isFirstTime = true; + public ContainerPanel() { JPanel pnlContainerMeta = new JPanel(); @@ -132,11 +134,14 @@ public class ContainerPanel extends JPanel { } public void addToChangeMonitor(DialogChangeMonitor changeMonitor) { - changeMonitor.add(txtContainerRecipe) - .addConstraint(new DialogChangeMonitor.TextNotEmptyConstraint( - "ContainerPanel.Constraint.NoEmptyDockerfile.text")); - changeMonitor.add(txtContainerRun); - changeMonitor.add(bindMountConfigurator); + if (isFirstTime) { + changeMonitor.add(txtContainerRecipe) + .addConstraint(new DialogChangeMonitor.TextNotEmptyConstraint( + I18n.PANEL.getString("ContainerPanel.Constraint.NoEmptyDockerfile.text"))); + changeMonitor.add(txtContainerRun); + changeMonitor.add(bindMountConfigurator); + isFirstTime = false; + } } /** diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java index e8ac7091..d4cacc0c 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java @@ -354,8 +354,6 @@ import java.util.*; changeMonitor.add(chkDefaultPermAdmin); changeListenerPermissions = changeMonitor.add(ctlImagePermissionConfigurator); - this.pnlTabContainer.addToChangeMonitor(changeMonitor); - // update default permissions hook for the permission configurator to apply to newly added users final ItemListener updateDefaultPermissionsListener = new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { @@ -825,6 +823,7 @@ import java.util.*; if (image != null && image.getVirtId().equals(TConst.VIRT_DOCKER)) { lblVirtualizer.setText(TConst.VIRT_DOCKER); pnlTabContainer.init(Session.getSatelliteToken(), image, ContainerPanel.IMAGE_CONTEXT); + pnlTabContainer.addToChangeMonitor(changeMonitor); showContainerTab(); // TODO Currently, do not allow user to upload a new version or share an Container Image. diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java index 00f138f4..cb242092 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java @@ -195,7 +195,6 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements ctlNetshareConfigurator.addToChangeMonitor(changeMonitor); ctlLdapFilterConfigurator.addToChangeMonitor(changeMonitor); - pnlTabContainer.addToChangeMonitor(changeMonitor); // TODO: LDAP/NetShare: Having uncommitted changes in the input fields should be // handled too // End change monitor @@ -349,6 +348,8 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements { showContainerTab(); pnlTabContainer.init(Session.getSatelliteToken(), image, ContainerPanel.CONTAINER_CONTEXT); + + pnlTabContainer.addToChangeMonitor(changeMonitor); } // init permission info |