Amit Aviram has uploaded a new change for review. Change subject: webadmin: Date formatting when deleting a snapshot ......................................................................
webadmin: Date formatting when deleting a snapshot When deleting a VM's snapshot a formatted date is now shown based on a constant taken from another component in the system (DiskGeneralModel) for system consistency. this constant is intended to be exported to some UTILS class later on. Bug-Url: https://bugzilla.redhat.com/1158959 Change-Id: I5d6a3f43557696fd35256b4a3fc55a5fbf59fdba Signed-off-by: Amit Aviram <aavi...@redhat.com> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java 2 files changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/37/34837/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java index 12e036e..3f10c77 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java @@ -5,6 +5,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; + +import com.google.gwt.i18n.client.DateTimeFormat; import org.ovirt.engine.core.common.VdcActionUtils; import org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters; import org.ovirt.engine.core.common.action.RemoveSnapshotParameters; @@ -50,6 +52,8 @@ @SuppressWarnings("unused") public class VmSnapshotListModel extends SearchableListModel { + // This constant is intendend to be exported to a generic UTILS class later on + private final String DATE_FORMAT = "yyyy-MM-dd, HH:mm"; //$NON-NLS-1$ private UICommand privateNewCommand; @@ -359,9 +363,8 @@ model.setHashName("delete_snapshot"); //$NON-NLS-1$ model.setMessage(ConstantsManager.getInstance() .getMessages() - .areYouSureYouWantToDeleteSanpshot(snapshot.getCreationDate(), + .areYouSureYouWantToDeleteSanpshot( DateTimeFormat.getFormat(DATE_FORMAT).format(snapshot.getCreationDate()), snapshot.getDescription())); - UICommand tempVar = new UICommand("OnRemove", this); //$NON-NLS-1$ tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok()); tempVar.setIsDefault(true); diff --git a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java index 4e09612..cb3329d 100644 --- a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java +++ b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java @@ -142,7 +142,7 @@ String errConnectingVmUsingRdpMsg(Object errCode); @DefaultMessage("Are you sure you want to delete snapshot from {0} with description ''{1}''?") - String areYouSureYouWantToDeleteSanpshot(Date from, Object description); + String areYouSureYouWantToDeleteSanpshot(String from, Object description); @DefaultMessage("Edit Bond Interface {0}") String editBondInterfaceTitle(String name); -- To view, visit http://gerrit.ovirt.org/34837 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5d6a3f43557696fd35256b4a3fc55a5fbf59fdba Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Amit Aviram <aavi...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches