Set value if rollout is edited
Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
@@ -348,6 +348,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
|
||||
|
||||
private void populateValuesOfDistribution(final Long editDistId) {
|
||||
this.editDistId = editDistId;
|
||||
|
||||
if (editDistId == null) {
|
||||
return;
|
||||
}
|
||||
@@ -368,13 +369,12 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
|
||||
if (distSet.getDescription() != null) {
|
||||
descTextArea.setValue(distSet.getDescription());
|
||||
}
|
||||
populateDistSetTypeNameCombo();
|
||||
}
|
||||
|
||||
public CommonDialogWindow getWindow(final Long editDistId) {
|
||||
eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
|
||||
resetComponents();
|
||||
|
||||
populateDistSetTypeNameCombo();
|
||||
populateValuesOfDistribution(editDistId);
|
||||
window = SPUIWindowDecorator.getWindow(i18n.get("caption.add.new.dist"), null,
|
||||
SPUIDefinitions.CREATE_UPDATE_WINDOW, this, event -> saveDistribution(), event -> discardDistribution(),
|
||||
@@ -386,7 +386,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
|
||||
/**
|
||||
* Populate DistributionSet Type name combo.
|
||||
*/
|
||||
public void populateDistSetTypeNameCombo() {
|
||||
private void populateDistSetTypeNameCombo() {
|
||||
distsetTypeNameComboBox.setContainerDataSource(getDistSetTypeLazyQueryContainer());
|
||||
distsetTypeNameComboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);
|
||||
distsetTypeNameComboBox.setValue(getDefaultDistributionSetType().getName());
|
||||
|
||||
@@ -155,8 +155,9 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
|
||||
buildLayout();
|
||||
}
|
||||
|
||||
public CommonDialogWindow getWindow() {
|
||||
public CommonDialogWindow getWindow(final Long rolloutId) {
|
||||
resetComponents();
|
||||
populateData(rolloutId);
|
||||
window = SPUIWindowDecorator.getWindow(i18n.get("caption.configure.rollout"), null,
|
||||
SPUIDefinitions.CREATE_UPDATE_WINDOW, this, event -> onRolloutSave(), event -> onDiscard(),
|
||||
uiProperties.getLinks().getDocumentation().getRolloutView(), this, i18n);
|
||||
@@ -728,8 +729,11 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
|
||||
* @param rolloutId
|
||||
* rollout id
|
||||
*/
|
||||
public void populateData(final Long rolloutId) {
|
||||
resetComponents();
|
||||
private void populateData(final Long rolloutId) {
|
||||
if (rolloutId == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
editRolloutEnabled = Boolean.TRUE;
|
||||
rolloutForEdit = rolloutManagement.findRolloutById(rolloutId);
|
||||
rolloutName.setValue(rolloutForEdit.getName());
|
||||
|
||||
@@ -431,8 +431,7 @@ public class RolloutListGrid extends AbstractGrid {
|
||||
}
|
||||
|
||||
private void onUpdate(final ContextMenuData contextMenuData) {
|
||||
addUpdateRolloutWindow.populateData(contextMenuData.getRolloutId());
|
||||
final CommonDialogWindow addTargetWindow = addUpdateRolloutWindow.getWindow();
|
||||
final CommonDialogWindow addTargetWindow = addUpdateRolloutWindow.getWindow(contextMenuData.getRolloutId());
|
||||
addTargetWindow.setCaption(i18n.get("caption.update.rollout"));
|
||||
UI.getCurrent().addWindow(addTargetWindow);
|
||||
addTargetWindow.setVisible(Boolean.TRUE);
|
||||
|
||||
@@ -91,8 +91,7 @@ public class RolloutListHeader extends AbstractGridHeader {
|
||||
|
||||
@Override
|
||||
protected void addNewItem(final ClickEvent event) {
|
||||
addUpdateRolloutWindow.resetComponents();
|
||||
final Window addTargetWindow = addUpdateRolloutWindow.getWindow();
|
||||
final Window addTargetWindow = addUpdateRolloutWindow.getWindow(null);
|
||||
UI.getCurrent().addWindow(addTargetWindow);
|
||||
addTargetWindow.setVisible(Boolean.TRUE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user