Skip to content

Commit

Permalink
save documents before publishing them; fixes #1821
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcphers committed Dec 11, 2017
1 parent 30fd018 commit 7c7cb26
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Expand Up @@ -174,6 +174,11 @@ public void onEnabledChanged(AppCommand command)
events_.addHandler(RPubsUploadStatusEvent.TYPE, this);
}

public void onPublishInvoked(Command onPublishInvoked)
{
onPublishInvoked_ = onPublishInvoked;
}

@Override
public void setVisible(boolean visible)
{
Expand Down Expand Up @@ -365,8 +370,13 @@ public void invokePublish()

// Private methods --------------------------------------------------------


private void onPublishButtonClick()
{
// let host know if requested
if (onPublishInvoked_ != null)
onPublishInvoked_.execute();

// if the publish button is clicked without the droplist ever being
// invoked, then we need to grab the list of existing deployments to
// determine what the default one will be.
Expand Down Expand Up @@ -838,6 +848,7 @@ public void onError(ServerError error)
private boolean visible_ = false;

private final AppCommand boundCommand_;
private Command onPublishInvoked_;

private RSConnectDeploymentRecord defaultRec_;

Expand Down
Expand Up @@ -410,6 +410,7 @@ public void onValueChange(ValueChangeEvent<Boolean> event)
publishButton_ = new RSConnectPublishButton(
RSConnectPublishButton.HOST_EDITOR,
RSConnect.CONTENT_TYPE_APP, false, null);
publishButton_.onPublishInvoked(() -> target_.save());
toolbar.addRightWidget(publishButton_);
}

Expand Down

0 comments on commit 7c7cb26

Please sign in to comment.