1. nx
  2. squashtest-tm

Commits

gfouquet  committed 975cd1b

[Issue 1776] Added execution page refresh when changing current step / closing
the optimized runner

  • Participants
  • Parent commits 69c76cb
  • Branches default

Comments (0)

Files changed (8)

File tm/tm.service/src/main/java/org/squashtest/csp/tm/domain/campaign/Iteration.java

View file
 	public Map<TestSuite, List<Integer>> createTestSuitesPastableCopy() {
 		Map<TestSuite, List<Integer>> resultMap = new HashMap<TestSuite, List<Integer>>();
 		List<IterationTestPlanItem> testPlanWithoutDeletedTestCases = getTestPlanWithoutDeletedTestCases();
+		
 		for (TestSuite testSuite : getTestSuites()) {
 			List<IterationTestPlanItem> testSuiteTestPlan = testSuite.getTestPlan();
 			TestSuite testSuiteCopy = testSuite.createCopy();
 			List<Integer> testPlanIndex = new ArrayList<Integer>();
+			
 			for (IterationTestPlanItem iterationTestPlanItem : testSuiteTestPlan) {
 				int testPlanItemIndex = testPlanWithoutDeletedTestCases.indexOf(iterationTestPlanItem);
 				testPlanIndex.add(testPlanItemIndex);
 			}
+			
 			resultMap.put(testSuiteCopy, testPlanIndex);
 		}
+		
 		return resultMap;
 	}
 

File tm/tm.service/src/main/java/org/squashtest/csp/tm/domain/requirement/RequirementVersionNumberComparator.java

View file
 	 * Compare requirement versions according to their version number for a descending order..
 	 */
 	public int compare(RequirementVersion o1, RequirementVersion o2) {
+		// XXX replace with more efficient : return -(rv1.versionNumber - rv2.versionNumber) 
 		return -((Integer)o1.getVersionNumber()).compareTo((Integer)o2.getVersionNumber());
 	}
 

File tm/tm.service/src/main/java/org/squashtest/csp/tm/internal/service/CampaignLibraryNavigationServiceImpl.java

View file
 		CampaignLibraryNavigationService {
 	
 	private static final String OR_HAS_ROLE_ADMIN = "or hasRole('ROLE_ADMIN')";
-	@Inject
-	private TreeNodeCopier copier;
-
 	
 	@Inject
 	private CampaignLibraryDao campaignLibraryDao;
 		return suiteDao.findAllByIterationId(iterationId);
 	}
 	
-	@SuppressWarnings("unchecked")
 	@Override
 	public String getPathAsString(long entityId) {
 		//get

File tm/tm.service/src/main/java/org/squashtest/csp/tm/internal/service/RequirementLibraryNavigationServiceImpl.java

View file
 	@Inject
 	private RequirementTestCaseLinksImporter requirementTestCaseLinksImporter;
 	@Inject
-	private TreeNodeCopier copier;
-	@Inject
 	@Qualifier("squashtest.tm.service.internal.PasteToRequirementFolderStrategy")
 	private PasteStrategy<RequirementFolder, RequirementLibraryNode> pasteToRequirementFolderStrategy;
 	@Inject

File tm/tm.service/src/main/java/org/squashtest/csp/tm/internal/service/TestCaseLibraryNavigationServiceImpl.java

View file
 	@Inject
 	@Qualifier("squashtest.tm.repository.TestCaseLibraryNodeDao")
 	private LibraryNodeDao<TestCaseLibraryNode> testCaseLibraryNodeDao;
-	@Inject
-	private TreeNodeCopier copier;
 
 	@Inject
 	private TestCaseImporter testCaseImporter;

File tm/tm.service/src/main/java/org/squashtest/csp/tm/internal/service/TreeNodeCopier.java

View file
 		source.accept(this);
 		return copy;
 	}
-	
-	
 
 	@SuppressWarnings({ "unchecked", "rawtypes" })
 	public void visit(Folder source, FolderDao dao) {

File tm/tm.web/src/main/webapp/scripts/execution-processing/ieo-manager.js

View file
 				
 				currentStepStatus : undefined
 				
-				
 		}, settings);
-		
-
 
 		// ***************** private stuffs ****************
 		
 		
 		
 		var getJson = $.proxy(function(url){
-			return $.get(url, null, null, "json")			
+			return $.get(url, null, null, "json");		
 		}, this);
 		
 
 				$.squash.openMessage(settings.completeTitle, settings.completeSuiteMessage).done(function() {
 					refreshParent();// see "comment[1]"
 					window.close();
-	 			});				
+				});
 			}
 			
 		}, this);
 		
 		var navigateLeftPanel = $.proxy(function(url){
 			parent.frameleft.document.location.href = url;
+			refreshParent();
 		}, this);
 		
 		//************ public functions ****************
 			try{
 				this.rightPane.find('iframe').attr('src', url);
 			}catch(ex){
-				console.log(ex);
 				this.rightPane.find('iframe body').text(ex);
 			}
 				
 			if (! isPrologue()){
 				var prevStep = state.currentStepIndex - 1;
 				this.navigateRandom(prevStep);
-			}			
+			}
 		};
 		
-		this.navigatePrologue = function(){
+		this.navigatePrologue = function() {
 			var state = this.state;
-			var url = state.baseStepUrl+"prologue?optimized=true&suitemode="+state.testSuiteMode;
+			var url = state.baseStepUrl + "prologue?optimized=true&suitemode=" + state.testSuiteMode;
 			navigateLeftPanel(url);
 			state.currentStepIndex = 0;
-			this.control.ieoControl("navigateRandom", 0);		
+			this.control.ieoControl("navigateRandom", 0);
 		};
-		
-		
+
 		this.navigateRandom = function(newStepIndex){
 			var state = this.state;
 			var control = this.control;
 			
 			if (newStepIndex === 0){
 				this.navigatePrologue();
-			}
-			else{			
+			} else {			
 				var zeroBasedIndex = newStepIndex -1;	
 				var nextUrl = state.baseStepUrl+"/"+zeroBasedIndex+"?optimized=true&suitemode="+state.testSuiteMode;
 				
-				getJson(nextUrl)
-				.success(function(json){
-					
+				getJson(nextUrl).success(function(json){
 					state.currentStepStatus = json.currentStepStatus;
 					state.currentStepId = json.currentStepId;
-					
+
 					var frameLeftUrl = state.baseStepUrl+zeroBasedIndex+"?optimized=true&suitemode="+state.testSuiteMode;
-					navigateLeftPanel(frameLeftUrl);	
+					navigateLeftPanel(frameLeftUrl);
 
 					state.currentStepIndex = newStepIndex;
-					control.ieoControl("navigateRandom", newStepIndex);		
+					control.ieoControl("navigateRandom", newStepIndex);
 
-				});				
+				});
 			}
 		};
 		
 		};
 		
 		this.closeWindow = function(){
+			refreshParent();
 			window.close();
 		};
 
-
 		this.getState = function(){
 			return this.state;
 		};
 		var isPrologue = $.proxy(function(){
 			return (this.state.currentStepIndex===this.state.firstStepIndex);
 		}, this);
-		
-		
 
 		// *********** setters etc *********************
 
 			var mvTCButton = control.ieoControl("getNextTestCaseButton");
 			var statusCombo = control.ieoControl("getStatusCombo");
 			
-			nextButton.click(function(){
-				self.navigateNext();
-			});
+			nextButton.click(self.navigateNext);
 			
-			prevButton.click(function(){
-				self.navigatePrevious();
-			});
+			prevButton.click(self.navigatePrevious);
 			
-			mvTCButton.click(function(){
-				self.navigateNextTestCase();		
-			});	
+			mvTCButton.click(self.navigateNextTestCase);	
 			
-			stopButton.click(function(){
-				window.close();
-			});
+			stopButton.click(self.closeWindow);
 			
 			statusCombo.change(function(){
 				var cbox = this;
 			this.rightPane = rightPane;
 		};
 		
-	}
+	};
 	
 });

File tm/tm.web/src/main/webapp/scripts/execution-processing/jquery.ieo-control.js

View file
 			var positionLeft = $.cookie("ieo-toolbox-position-left");
 			var positionTop = $.cookie("ieo-toolbox-position-top");
 			
-			if ( positionLeft != null && positionTop != null ) {
+			if ((!!positionLeft) && (!!positionTop)) {
 				this.element.offset({top : positionTop, left: positionLeft});
 			}