Skip to content

Commit

Permalink
Fix file-open-save-new-core to make it fully-functional
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiromu Hota committed Feb 6, 2020
1 parent e17afe0 commit d90d0eb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ public void testOpenSaveMenus() {
assertFalse( isMenuItemDisabled( "//div[text() = 'Save as (VFS)...']" ) );
}

@Test
public void testOpenSaveNewDialog() {
clickElement( "//div[text() = 'File']" );
assertFalse( isMenuItemDisabled( "//div[text() = 'Open URL...']" ) );
clickElement( "//div[text() = 'Open URL...']" ); // Open the new dialog
driver.switchTo().frame( driver.findElement( By.xpath(".//iframe[starts-with(@src, '/spoon/osgi/@pentaho/[email protected]/index.html')]") ) );
wait.until( ExpectedConditions.presenceOfElementLocated( By.xpath( "//div[contains(text(),'Local')]" ) ) );
assertEquals( 1, driver.findElements( By.xpath( "//div[contains(text(),'Local')]" ) ).size() );
}

@Test
public void testDatabaseConnectionDialog() throws Exception {
// Create a new transformation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,25 @@ public void open( FileDialogOperation fileDialogOperation ) {

new BrowserFunction( browser, "close" ) {
@Override public Object function( Object[] arguments ) {
Runnable execute = () -> {
closeBrowser( browser );
};
display.asyncExec( execute );
return true;
}
};

new BrowserFunction( browser, "select" ) {
@Override public Object function( Object[] arguments ) {
Runnable execute = () -> {
try {
setProperties( arguments );
closeBrowser( browser );
} catch ( Exception e ) {
log.logError( "Error in processing select() from file-open-save app: ", e );
}
};
display.asyncExec( execute );
return true;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ define(

var options = {
method: method,
url: _cacheBust(url),
url: CONTEXT_PATH + _cacheBust(url),
headers: {
Accept: "application/json"
},
Expand Down Expand Up @@ -335,7 +335,7 @@ define(
function _wrapHttp(method, url, data, timeout) {
var options = {
method: method,
url: _cacheBust(url),
url: CONTEXT_PATH + _cacheBust(url),
headers: {
Accept: "application/json"
},
Expand All @@ -360,6 +360,8 @@ define(
} else {
url += "?v=" + value;
}
var cid = getConnectionId();
url += "&cid=" + cid;
return url;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ define(
function _wrapHttp(method, url, data) {
var options = {
method: method,
url: _cacheBust(url),
url: CONTEXT_PATH + _cacheBust(url),
headers: {
Accept: "application/json"
}
Expand All @@ -133,6 +133,8 @@ define(
} else {
url += "?v=" + value;
}
var cid = getConnectionId();
url += "&cid=" + cid;
return url;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<bean class="org.pentaho.di.plugins.fileopensave.endpoints.JsonProvider">
<argument ref="providerService" />
</bean>
<bean class="org.pentaho.di.ui.repo.endpoints.WebSpoonFilter"/>
</jaxrs:providers>

</jaxrs:server>
Expand Down

0 comments on commit d90d0eb

Please sign in to comment.