Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
rhbz867167 - translation history clear selection for each text flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Oct 17, 2012
1 parent 8ff0af7 commit 4496731
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Expand Up @@ -85,17 +85,17 @@ public void onSuccess(GetTranslationHistoryResult result)

protected void popupAndShowLoading(String title)
{

//here we CANNOT use listDataProvider.setList() because we need to retain the same list reference which is used by ColumnSortEvent.ListHandler
listDataProvider.getList().clear();
listDataProvider.setLoading(true);
selectionModel.clear();
display.setTitle(title);
display.resetView();
display.center();
}

protected void displayEntries(TransHistoryItem latest, List<TransHistoryItem> otherEntries)
{
//here we CANNOT use listDataProvider.setList() because we need to retain the same list reference which is used by ColumnSortEvent.ListHandler
listDataProvider.getList().clear();
if (latest != null)
{
//add indicator for latest version
Expand Down
Expand Up @@ -348,7 +348,7 @@ public interface WebTransMessages extends Messages
@DefaultMessage("User")
String modifiedBy();

@DefaultMessage("Modified Date")
@DefaultMessage("Date")
String modifiedDate();

@DefaultMessage("Paste into Editor")
Expand Down
Expand Up @@ -134,6 +134,7 @@ public void willNotifyErrorAndHideTranslationHistoryOnFailure()
// Then:
verify(dataProvider).setLoading(true);
verify(display).setTitle("translation history");
verify(selectionModel).clear();
verify(display).resetView();
verify(display).center();
assertThat(actionCaptor.getValue().getTransUnitId(), Matchers.equalTo(transUnitId));
Expand All @@ -150,6 +151,7 @@ public void willNotifyErrorAndHideTranslationHistoryOnFailure()
public void willShowTranslationHistoryOnSuccess()
{
// Given: text flow has one history item and one latest translation
when(messages.translationHistory()).thenReturn("translation history");
TransHistoryItem historyItem = historyItem("1");
String latestVersion = "2";
TransHistoryItem latest = historyItem(latestVersion);
Expand All @@ -161,6 +163,11 @@ public void willShowTranslationHistoryOnSuccess()
presenter.showTranslationHistory(transUnitId);

// Then:on success
verify(dataProvider).setLoading(true);
verify(display).setTitle("translation history");
verify(selectionModel).clear();
verify(display).resetView();
verify(display).center();
AsyncCallback<GetTranslationHistoryResult> result = resultCaptor.getValue();
result.onSuccess(createTranslationHistory(latest, historyItem));
MatcherAssert.assertThat(dataProvider.getList(), Matchers.contains(latest, historyItem));
Expand Down

0 comments on commit 4496731

Please sign in to comment.