Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHE-3614: Rework Git commit window #5081

Merged
merged 17 commits into from
May 31, 2017
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,6 @@ public interface GitLocalizationConstant extends Messages {
@Key("view.commit.title")
String commitTitle();

@Key("view.commit.all_field_title")
String commitAddAllFieldTitle();

@Key("view.commit.selection_field_title")
String commitSelectionFieldTitle();

@Key("view.commit.all_project_field_title")
String commitAllFieldTitle();

@Key("view.commit.amend_field_title")
String commitAmendFieldTitle();

Expand All @@ -376,6 +367,12 @@ public interface GitLocalizationConstant extends Messages {
@Key("view.commit.grid.comment")
String commitGridComment();

@Key("view.commit.push.checkbox.title")
String commitPushCheckboxTitle();

@Key("view.commit.nothing_to_commit.text")
String commitNothingToCommitMessageText();

@Key("view.push.title")
String pushViewTitle();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.eclipse.che.ide.api.resources.Project;
import org.eclipse.che.ide.api.resources.Resource;
import org.eclipse.che.ide.ext.git.client.GitLocalizationConstant;
import org.eclipse.che.ide.ext.git.client.compare.branchList.BranchListPresenter;
import org.eclipse.che.ide.ext.git.client.compare.branchlist.BranchListPresenter;

import static com.google.common.base.Preconditions.checkState;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.eclipse.che.ide.ext.git.client.GitLocalizationConstant;
import org.eclipse.che.ide.ext.git.client.compare.ComparePresenter;
import org.eclipse.che.ide.ext.git.client.compare.FileStatus.Status;
import org.eclipse.che.ide.ext.git.client.compare.changedList.ChangedListPresenter;
import org.eclipse.che.ide.ext.git.client.compare.changedlist.ChangedListPresenter;
import org.eclipse.che.ide.api.dialogs.DialogFactory;

import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.eclipse.che.ide.api.resources.Project;
import org.eclipse.che.ide.api.resources.Resource;
import org.eclipse.che.ide.ext.git.client.GitLocalizationConstant;
import org.eclipse.che.ide.ext.git.client.compare.revisionsList.RevisionListPresenter;
import org.eclipse.che.ide.ext.git.client.compare.revisionslist.RevisionListPresenter;

import javax.validation.constraints.NotNull;

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@
*******************************************************************************/
package org.eclipse.che.ide.ext.git.client.commit;

import org.eclipse.che.api.git.shared.Branch;
import org.eclipse.che.ide.api.mvp.View;
import org.eclipse.che.ide.ext.git.client.compare.changedpanel.ChangedPanelView;
import org.eclipse.che.ide.resource.Path;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Set;

/**
* The view of {@link CommitPresenter}.
Expand All @@ -31,16 +36,33 @@ interface ActionDelegate {
/** Performs any actions appropriate in response to the user having changed something. */
void onValueChanged();

/**
* Set the commit message for an amend commit.
*/
/** Performs any actions appropriate in response to the user having clicked on changed file check-box. */
void onFileNodeCheckBoxValueChanged(Path path, boolean newCheckBoxValue);

/** Set the commit message for an amend commit. */
void setAmendCommitMessage();

/** Get list of changed files paths. */
Set<String> getChangedFiles();
}

/** @return entered message */
@NotNull
String getMessage();

/**
* Mark check-boxes of given paths as checked.
*
* @param paths
* pats of nodes
*/
void checkCheckBoxes(Set<Path> paths);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setMarkedPaths( or smth else, checkCheck sounds not good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to setMarkedPaths()


/**
* Returns selected remote branch from branches drop-down list.
*/
String getRemoteBranch();

/**
* Set content into message field.
*
Expand All @@ -50,51 +72,45 @@ interface ActionDelegate {
void setMessage(@NotNull String message);

/**
* Returns <code>true</code> if need to add all changes to index except from new files before commit, and <code>false</code> otherwise
* Set list of remote branches to drop-down.
*/
boolean isAddAllExceptNew();
void setRemoteBranchesList(List<Branch> branches);

/**
* Set status of flag that represents add all changes to index except from new files before commit.
*
* @param addAllExceptNew
* <code>true</code> if need to add all changes to index except from new files before commit,
* <code>false</code> otherwise
*/
void setAddAllExceptNew(boolean addAllExceptNew);
/** Returns <code>true</code> if need to amend the last commit, and <code>false</code> otherwise */
boolean isAmend();

/** Set checked or unchecked the 'Amend' checkbox. */
void setValueToAmendCheckBox(boolean value);

/** Returns true if the selection must be added to index before commit, and <code>false</code> otherwise. */
boolean isAddSelectedFiles();
/** Set checked or unchecked the 'Push after commit' checkbox. */
void setValueToPushAfterCommitCheckBox(boolean value);

/**
* Sets the status of flag that represents add selected files.
* Change the enable state of the 'Amend' check-box.
*
* @param addSelectedFiles
* <code>true</code> if need to add selected files before commit, <code>false</code> otherwise
* @param enable
* <code>true</code> to enable the check-box, <code>false</code> to disable it
*/
void setAddSelectedFiles(boolean addSelectedFiles);

/** Returns <code>true</code> if need to commit all files in the project, and <code>false</code> otherwise. */
boolean isCommitAllFiles();
void setEnableAmendCheckBox(boolean enable);

/**
* Sets the status of flag that represents add selected files.
* Change the enable state of the 'Push after commit' check-box.
*
* @param commitAllFiles
* <code>true</code> if need to add selected files before commit, <code>false</code> otherwise
* @param enable
* <code>true</code> to enable the check-box, <code>false</code> to disable it
*/
void setCommitAllFiles(boolean commitAllFiles);

/** Returns <code>true</code> if need to amend the last commit, and <code>false</code> otherwise. */
boolean isAmend();
void setEnablePushAfterCommitCheckBox(boolean enable);

/**
* Set status of amend the last commit.
* Change the enable state of the 'Remote branches' drop-down list.
*
* @param isAmend
* <code>true</code> need to amend the last commit, <code>false</code> need to create new commit
* @param enable
* <code>true</code> to enable the drop-down list, <code>false</code> to disable it
*/
void setAmend(boolean isAmend);
void setEnableRemoteBranchesDropDownLis(boolean enable);

/** Returns <code>true</code> if need to push after commit, and <code>false</code> otherwise */
boolean isPushAfterCommit();

/**
* Change the enable state of the commit button.
Expand All @@ -112,4 +128,9 @@ interface ActionDelegate {

/** Show dialog. */
void showDialog();
}

/**
* Initialize changed panel.
*/
void setChangedPanelView(ChangedPanelView changedPanelView);
}
Loading