Skip to content

The Unified and Autonomous Development Platform

Add pull request number field

robin shinee05e607164e8
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/CoreModule.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/CoreModule.java
index d2278b36c6..3d3fbd923f 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/CoreModule.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/CoreModule.java
@@ -29,7 +29,7 @@ import com.pmease.gitplex.core.listener.PullRequestListener;
import com.pmease.gitplex.core.listener.RefListener;
import com.pmease.gitplex.core.manager.AccountManager;
import com.pmease.gitplex.core.manager.AttachmentManager;
-import com.pmease.gitplex.core.manager.AuxiliaryManager;
+import com.pmease.gitplex.core.manager.CommitInfoManager;
import com.pmease.gitplex.core.manager.BranchWatchManager;
import com.pmease.gitplex.core.manager.CodeCommentManager;
import com.pmease.gitplex.core.manager.CodeCommentReplyManager;
@@ -57,7 +57,7 @@ import com.pmease.gitplex.core.manager.VerificationManager;
import com.pmease.gitplex.core.manager.WorkManager;
import com.pmease.gitplex.core.manager.impl.DefaultAccountManager;
import com.pmease.gitplex.core.manager.impl.DefaultAttachmentManager;
-import com.pmease.gitplex.core.manager.impl.DefaultAuxiliaryManager;
+import com.pmease.gitplex.core.manager.impl.DefaultCommitInfoManager;
import com.pmease.gitplex.core.manager.impl.DefaultBranchWatchManager;
import com.pmease.gitplex.core.manager.impl.DefaultCodeCommentManager;
import com.pmease.gitplex.core.manager.impl.DefaultCodeCommentReplyManager;
@@ -175,7 +175,7 @@ public class CoreModule extends AbstractPluginModule {
bind(BranchWatchManager.class).to(DefaultBranchWatchManager.class);
bind(PullRequestWatchManager.class).to(DefaultPullRequestWatchManager.class);
bind(NotificationManager.class).to(DefaultNotificationManager.class);
- bind(AuxiliaryManager.class).to(DefaultAuxiliaryManager.class);
+ bind(CommitInfoManager.class).to(DefaultCommitInfoManager.class);
bind(WorkManager.class).to(DefaultWorkManager.class);
bind(SequentialWorkManager.class).to(DefaultSequentialWorkManager.class);
bind(TeamManager.class).to(DefaultTeamManager.class);
@@ -192,10 +192,10 @@ public class CoreModule extends AbstractPluginModule {
contribute(CodeCommentListener.class, DefaultAttachmentManager.class);
contribute(DepotListener.class, DefaultPullRequestManager.class);
- contribute(DepotListener.class, DefaultAuxiliaryManager.class);
+ contribute(DepotListener.class, DefaultCommitInfoManager.class);
contribute(DepotListener.class, DefaultTeamAuthorizationManager.class);
contribute(RefListener.class, DefaultPullRequestManager.class);
- contribute(RefListener.class, DefaultAuxiliaryManager.class);
+ contribute(RefListener.class, DefaultCommitInfoManager.class);
contribute(RefListener.class, DefaultDepotManager.class);
contribute(PullRequestListener.class, DefaultNotificationManager.class);
contribute(PullRequestListener.class, DefaultPullRequestWatchManager.class);
@@ -203,7 +203,7 @@ public class CoreModule extends AbstractPluginModule {
contribute(LifecycleListener.class, DefaultPullRequestManager.class);
contribute(LifecycleListener.class, DefaultAccountManager.class);
contribute(LifecycleListener.class, DefaultDepotManager.class);
- contribute(LifecycleListener.class, DefaultAuxiliaryManager.class);
+ contribute(LifecycleListener.class, DefaultCommitInfoManager.class);
contribute(LifecycleListener.class, DefaultWorkManager.class);
contribute(LifecycleListener.class, DefaultSequentialWorkManager.class);
contribute(LifecycleListener.class, DefaultAttachmentManager.class);
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/CodeComment.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/CodeComment.java
index 4f65410fc6..1cf4f7d690 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/CodeComment.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/CodeComment.java
@@ -71,7 +71,7 @@ public class CodeComment extends AbstractEntity {
private Collection<CodeCommentReply> replies = new ArrayList<>();
@Column(nullable=false)
- private String attachmentDirUUID;
+ private String uuid;
public Depot getDepot() {
return depot;
@@ -154,12 +154,12 @@ public class CodeComment extends AbstractEntity {
this.replies = replies;
}
- public String getAttachmentDirUUID() {
- return attachmentDirUUID;
+ public String getUUID() {
+ return uuid;
}
- public void setAttachmentDirUUID(String attachmentDirUUID) {
- this.attachmentDirUUID = attachmentDirUUID;
+ public void setUUID(String uuid) {
+ this.uuid = uuid;
}
}
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/Depot.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/Depot.java
index a686c49010..5728cb6f19 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/Depot.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/Depot.java
@@ -125,7 +125,7 @@ public class Depot extends AbstractEntity implements AccountBelonging {
private String description;
private boolean publicRead;
-
+
/*
* Optimistic lock is necessary to ensure database integrity when update
* gate keepers and integration policies upon depot renaming/deletion
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/PullRequest.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/PullRequest.java
index 4cd6843438..5ee48c3445 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/PullRequest.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/PullRequest.java
@@ -9,7 +9,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.concurrent.Callable;
import javax.annotation.Nullable;
import javax.persistence.CascadeType;
@@ -22,8 +21,8 @@ import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
-import javax.persistence.PrePersist;
import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
import org.apache.commons.lang3.StringUtils;
@@ -40,7 +39,6 @@ import com.pmease.commons.git.GitUtils;
import com.pmease.commons.hibernate.AbstractEntity;
import com.pmease.commons.hibernate.dao.Dao;
import com.pmease.commons.jackson.ExternalView;
-import com.pmease.commons.util.LockUtils;
import com.pmease.gitplex.core.GitPlex;
import com.pmease.gitplex.core.entity.component.CloseInfo;
import com.pmease.gitplex.core.entity.component.DepotAndBranch;
@@ -49,7 +47,6 @@ import com.pmease.gitplex.core.gatekeeper.checkresult.Blocking;
import com.pmease.gitplex.core.gatekeeper.checkresult.CheckResult;
import com.pmease.gitplex.core.gatekeeper.checkresult.Failed;
import com.pmease.gitplex.core.gatekeeper.checkresult.Pending;
-import com.pmease.gitplex.core.manager.ConfigManager;
import com.pmease.gitplex.core.manager.PullRequestManager;
import com.pmease.gitplex.core.manager.ReviewManager;
import com.pmease.gitplex.core.security.ObjectPermission;
@@ -61,7 +58,8 @@ import com.pmease.gitplex.core.security.ObjectPermission;
* which can be updated from background thread.
*/
@DynamicUpdate
-@Table(indexes={@Index(columnList="title"), @Index(columnList="idStr"), @Index(columnList="noSpaceTitle")})
+@Table(indexes={@Index(columnList="title"), @Index(columnList="uuid"), @Index(columnList="numberStr"), @Index(columnList="noSpaceTitle")},
+ uniqueConstraints={@UniqueConstraint(columnNames={"g_targetdepot_id", "number"})})
public class PullRequest extends AbstractEntity {
private static final long serialVersionUID = 1L;
@@ -180,9 +178,9 @@ public class PullRequest extends AbstractEntity {
@ManyToOne(fetch=FetchType.LAZY)
private Account assignee;
- // used for id search in markdown editor
+ // used for number search in markdown editor
@Column(nullable=false)
- private String idStr;
+ private String numberStr;
// used for title search in markdown editor
@Column(nullable=false)
@@ -210,7 +208,9 @@ public class PullRequest extends AbstractEntity {
private IntegrationStrategy integrationStrategy;
@Column(nullable=false)
- private String attachmentDirUUID;
+ private String uuid;
+
+ private long number;
@OneToMany(mappedBy="request", cascade=CascadeType.REMOVE)
private Collection<PullRequestUpdate> updates = new ArrayList<>();
@@ -627,13 +627,13 @@ public class PullRequest extends AbstractEntity {
@JsonView(ExternalView.class)
public String getBaseRef() {
Preconditions.checkNotNull(getId());
- return Depot.REFS_GITPLEX + "pulls/" + getId() + "/base";
+ return Depot.REFS_GITPLEX + "pulls/" + getNumber() + "/base";
}
@JsonView(ExternalView.class)
public String getIntegrateRef() {
Preconditions.checkNotNull(getId());
- return Depot.REFS_GITPLEX + "pulls/" + getId() + "/integrate";
+ return Depot.REFS_GITPLEX + "pulls/" + getNumber() + "/integrate";
}
/**
@@ -645,12 +645,6 @@ public class PullRequest extends AbstractEntity {
git.deleteRef(getIntegrateRef(), null, null);
}
- public <T> T lockAndCall(Callable<T> callable) {
- Preconditions.checkNotNull(getId());
-
- return LockUtils.call("pull request: " + getId(), callable);
- }
-
/**
* Invite specified number of users in candidates to review this request.
* <p>
@@ -900,18 +894,8 @@ public class PullRequest extends AbstractEntity {
return null;
}
- public String getUrl() {
- return GitPlex.getInstance(ConfigManager.class).getSystemSetting().getServerUrl()
- + "/" + getTargetDepot().getFQN() + "/pull_requests/" + getId() + "/overview";
- }
-
- @PrePersist
- public void prePersist() {
- idStr = getId().toString();
- }
-
- public String getIdStr() {
- return idStr;
+ public String getNumberStr() {
+ return numberStr;
}
public String getNoSpaceTitle() {
@@ -922,12 +906,21 @@ public class PullRequest extends AbstractEntity {
return version;
}
- public String getAttachmentDirUUID() {
- return attachmentDirUUID;
+ public String getUUID() {
+ return uuid;
+ }
+
+ public void setUUID(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public long getNumber() {
+ return number;
}
- public void setAttachmentDirUUID(String attachmentDirUUID) {
- this.attachmentDirUUID = attachmentDirUUID;
+ public void setNumber(long number) {
+ this.number = number;
+ numberStr = String.valueOf(number);
}
}
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/PullRequestUpdate.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/PullRequestUpdate.java
index b28cb39c26..d329d52d5a 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/PullRequestUpdate.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/PullRequestUpdate.java
@@ -17,9 +17,11 @@ import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
+import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
+import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Preconditions;
@@ -33,6 +35,7 @@ import com.pmease.gitplex.core.GitPlex;
import com.pmease.gitplex.core.manager.StorageManager;
@Entity
+@Table(indexes={@Index(columnList="uuid"), @Index(columnList="date")})
public class PullRequestUpdate extends AbstractEntity {
private static final long serialVersionUID = 1L;
@@ -50,6 +53,9 @@ public class PullRequestUpdate extends AbstractEntity {
@OneToMany(mappedBy="update", cascade=CascadeType.REMOVE)
private Collection<Review> reviews = new ArrayList<Review>();
+ @Column(nullable=false)
+ private String uuid;
+
private transient List<Commit> commits;
private transient CachedInfo cachedInfo;
@@ -143,6 +149,14 @@ public class PullRequestUpdate extends AbstractEntity {
return request.getBaseCommit();
}
+ public String getUUID() {
+ return uuid;
+ }
+
+ public void setUUID(String uuid) {
+ this.uuid = uuid;
+ }
+
private CachedInfo getCachedInfo() {
if (cachedInfo == null) {
Callable<CachedInfo> callable = new Callable<CachedInfo>() {
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/persistlistener/PullRequestPersistListener.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/persistlistener/PullRequestPersistListener.java
index daedd751ec..d83503e45e 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/persistlistener/PullRequestPersistListener.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/persistlistener/PullRequestPersistListener.java
@@ -111,9 +111,7 @@ public class PullRequestPersistListener implements PersistListener {
if (entity instanceof PullRequest) {
PullRequest request = (PullRequest) entity;
for (int i=0; i<propertyNames.length; i++) {
- if (propertyNames[i].equals("idStr")) {
- state[i] = id.toString();
- } else if (propertyNames[i].equals("description")) {
+ if (propertyNames[i].equals("description")) {
String description = (String) state[i];
if (description != null) {
String html = markdownManager.parse(description);
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/AuxiliaryManager.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/CommitInfoManager.java
similarity index 72%
rename from gitplex.core/src/main/java/com/pmease/gitplex/core/manager/AuxiliaryManager.java
rename to gitplex.core/src/main/java/com/pmease/gitplex/core/manager/CommitInfoManager.java
index 6a4b40535b..21f8502d26 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/AuxiliaryManager.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/CommitInfoManager.java
@@ -1,53 +1,53 @@
-package com.pmease.gitplex.core.manager;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jgit.lib.ObjectId;
-
-import com.pmease.commons.git.NameAndEmail;
-import com.pmease.gitplex.core.entity.Depot;
-
-public interface AuxiliaryManager {
-
- void collect(Depot depot);
-
- void collect(Depot depot, ObjectId commit);
-
- List<String> getFiles(Depot depot);
-
- int getCommitCount(Depot depot);
-
- List<NameAndEmail> getContributors(Depot depot);
-
- Map<String, Map<NameAndEmail, Long>> getContributions(Depot depot, Set<String> files);
-
- Map<NameAndEmail, Long> getContributions(Depot depot, String file);
-
- /**
- * Given an ancestor commit, get all its descendant commits known to this auxiliary.
- * The result might be incomplete if some commits have not be collected yet
- *
- * @param depot
- * repository to get descendant commits
- * @param ancestor
- * for which commit to get descendants
- * @return
- * descendant commits
- */
- Set<ObjectId> getDescendants(Depot depot, ObjectId ancestor);
-
- /**
- * Given a parent commit, get all its child commits known to this auxiliary.
- * The result might be incomplete if some commits have not be collected yet
- *
- * @param depot
- * repository to get descendant commits
- * @param parent
- * for which commit to get children
- * @return
- * child commits
- */
- Set<ObjectId> getChildren(Depot depot, ObjectId parent);
-}
+package com.pmease.gitplex.core.manager;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.jgit.lib.ObjectId;
+
+import com.pmease.commons.git.NameAndEmail;
+import com.pmease.gitplex.core.entity.Depot;
+
+public interface CommitInfoManager {
+
+ void collect(Depot depot);
+
+ void collect(Depot depot, ObjectId commit);
+
+ List<String> getFiles(Depot depot);
+
+ int getCommitCount(Depot depot);
+
+ List<NameAndEmail> getContributors(Depot depot);
+
+ Map<String, Map<NameAndEmail, Long>> getContributions(Depot depot, Set<String> files);
+
+ Map<NameAndEmail, Long> getContributions(Depot depot, String file);
+
+ /**
+ * Given an ancestor commit, get all its descendant commits. The result might be incomplete
+ * if some commits have not be cached yet
+ *
+ * @param depot
+ * repository to get descendant commits
+ * @param ancestor
+ * for which commit to get descendants
+ * @return
+ * descendant commits
+ */
+ Set<ObjectId> getDescendants(Depot depot, ObjectId ancestor);
+
+ /**
+ * Given a parent commit, get all its child commits. The result might be incomplete if some commits
+ * have not be collected yet
+ *
+ * @param depot
+ * repository to get descendant commits
+ * @param parent
+ * for which commit to get children
+ * @return
+ * child commits
+ */
+ Set<ObjectId> getChildren(Depot depot, ObjectId parent);
+}
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/PullRequestManager.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/PullRequestManager.java
index cef0a57c4f..85126b114a 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/PullRequestManager.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/PullRequestManager.java
@@ -23,6 +23,9 @@ public interface PullRequestManager extends EntityDao<PullRequest> {
Collection<PullRequest> queryOpen(DepotAndBranch sourceOrTarget);
+ @Nullable
+ PullRequest find(Depot target, long number);
+
boolean canIntegrate(PullRequest request);
/**
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultAttachmentManager.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultAttachmentManager.java
index f9228e9e5a..ab2f8f040e 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultAttachmentManager.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultAttachmentManager.java
@@ -106,7 +106,7 @@ public class DefaultAttachmentManager implements AttachmentManager, SchedulableT
@Override
public void run() {
- makeAttachmentPermanent(comment.getDepot(), comment.getAttachmentDirUUID());
+ makeAttachmentPermanent(comment.getDepot(), comment.getUUID());
}
});
@@ -114,7 +114,7 @@ public class DefaultAttachmentManager implements AttachmentManager, SchedulableT
@Override
public void onDeleteComment(CodeComment comment) {
- File permanentAttachmentDir = getPermanentAttachmentDir(comment.getDepot(), comment.getAttachmentDirUUID());
+ File permanentAttachmentDir = getPermanentAttachmentDir(comment.getDepot(), comment.getUUID());
if (permanentAttachmentDir.exists())
FileUtils.deleteDir(permanentAttachmentDir);
}
@@ -166,7 +166,7 @@ public class DefaultAttachmentManager implements AttachmentManager, SchedulableT
@Override
public void run() {
- makeAttachmentPermanent(request.getTargetDepot(), request.getAttachmentDirUUID());
+ makeAttachmentPermanent(request.getTargetDepot(), request.getUUID());
}
});
@@ -234,7 +234,7 @@ public class DefaultAttachmentManager implements AttachmentManager, SchedulableT
@Override
public void onDeleteRequest(PullRequest request) {
- FileUtils.deleteDir(getPermanentAttachmentDir(request.getTargetDepot(), request.getAttachmentDirUUID()));
+ FileUtils.deleteDir(getPermanentAttachmentDir(request.getTargetDepot(), request.getUUID()));
}
@Override
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultAuxiliaryManager.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultCommitInfoManager.java
similarity index 95%
rename from gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultAuxiliaryManager.java
rename to gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultCommitInfoManager.java
index 5689beafe0..280f384f5d 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultAuxiliaryManager.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultCommitInfoManager.java
@@ -53,7 +53,7 @@ import com.pmease.gitplex.core.entity.Depot;
import com.pmease.gitplex.core.listener.DepotListener;
import com.pmease.gitplex.core.listener.LifecycleListener;
import com.pmease.gitplex.core.listener.RefListener;
-import com.pmease.gitplex.core.manager.AuxiliaryManager;
+import com.pmease.gitplex.core.manager.CommitInfoManager;
import com.pmease.gitplex.core.manager.DepotManager;
import com.pmease.gitplex.core.manager.SequentialWorkManager;
import com.pmease.gitplex.core.manager.StorageManager;
@@ -71,16 +71,16 @@ import jetbrains.exodus.env.TransactionalComputable;
import jetbrains.exodus.env.TransactionalExecutable;
@Singleton
-public class DefaultAuxiliaryManager implements AuxiliaryManager, DepotListener,
+public class DefaultCommitInfoManager implements CommitInfoManager, DepotListener,
RefListener, LifecycleListener {
- private static final Logger logger = LoggerFactory.getLogger(DefaultAuxiliaryManager.class);
+ private static final Logger logger = LoggerFactory.getLogger(DefaultCommitInfoManager.class);
- private static final String AUXILIARY_DIR = "auxiliary";
+ private static final String DB_DIR = "commits";
private static final String DEFAULT_STORE = "default";
- private static final String COMMITS_STORE = "commmits";
+ private static final String COMMITS_STORE = "commits";
private static final String CONTRIBUTIONS_STORE = "contributions";
@@ -115,7 +115,7 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, DepotListener,
private final Map<Long, List<NameAndEmail>> contributorsCache = new ConcurrentHashMap<>();
@Inject
- public DefaultAuxiliaryManager(DepotManager depotManager, StorageManager storageManager,
+ public DefaultCommitInfoManager(DepotManager depotManager, StorageManager storageManager,
WorkManager workManager, SequentialWorkManager sequentialWorkManager,
UnitOfWork unitOfWork, ExecutorService executorService) {
this.depotManager = depotManager;
@@ -127,11 +127,11 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, DepotListener,
}
private String getSequentialExecutorKey(Depot depot) {
- return "repository-" + depot.getId() + "-checkAuxiliary";
+ return "repository-" + depot.getId() + "-checkCommits";
}
private void doCollect(Depot depot, ObjectId commit) {
- logger.info("Collecting auxiliary information (repository: {}, until commit: {})",
+ logger.info("Caching commits information (repository: {}, until commit: {})",
depot.getFQN(), commit.name());
Environment env = getEnv(depot);
final Store defaultStore = getStore(env, DEFAULT_STORE);
@@ -351,7 +351,7 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, DepotListener,
}
});
- logger.info("Auxiliary information collected (repository: {}, until commit: {})", depot.getFQN(), commit.name());
+ logger.info("Commit information cached (repository: {}, until commit: {})", depot.getFQN(), commit.name());
}
@Override
@@ -379,7 +379,7 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, DepotListener,
}).get();
} catch (InterruptedException | ExecutionException e) {
- logger.error("Error collecting auxiliary information", e);
+ logger.error("Error caching commit information", e);
}
}
@@ -393,17 +393,17 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, DepotListener,
config.setLogCacheShared(false);
config.setMemoryUsage(1024*1024*64);
config.setLogFileSize(64*1024);
- env = Environments.newInstance(getAuxiliaryDir(depot), config);
+ env = Environments.newInstance(getCacheDir(depot), config);
envs.put(depot.getId(), env);
}
return env;
}
- private File getAuxiliaryDir(Depot depot) {
- File auxiliaryDir = new File(storageManager.getCacheDir(depot), AUXILIARY_DIR);
- if (!auxiliaryDir.exists())
- FileUtils.createDir(auxiliaryDir);
- return auxiliaryDir;
+ private File getCacheDir(Depot depot) {
+ File cacheDir = new File(storageManager.getCacheDir(depot), DB_DIR);
+ if (!cacheDir.exists())
+ FileUtils.createDir(cacheDir);
+ return cacheDir;
}
private Store getStore(final Environment env, final String storeName) {
@@ -614,7 +614,7 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, DepotListener,
if (env != null)
env.close();
filesCache.remove(depot.getId());
- FileUtils.deleteDir(getAuxiliaryDir(depot));
+ FileUtils.deleteDir(getCacheDir(depot));
}
@Override
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultDepotManager.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultDepotManager.java
index 1d32bfd9bf..31f00c6ca2 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultDepotManager.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultDepotManager.java
@@ -48,7 +48,7 @@ import com.pmease.gitplex.core.listener.DepotListener;
import com.pmease.gitplex.core.listener.LifecycleListener;
import com.pmease.gitplex.core.listener.RefListener;
import com.pmease.gitplex.core.manager.AccountManager;
-import com.pmease.gitplex.core.manager.AuxiliaryManager;
+import com.pmease.gitplex.core.manager.CommitInfoManager;
import com.pmease.gitplex.core.manager.DepotManager;
import com.pmease.gitplex.core.manager.PullRequestManager;
import com.pmease.gitplex.core.manager.StorageManager;
@@ -66,7 +66,7 @@ public class DefaultDepotManager extends AbstractEntityDao<Depot> implements Dep
private final AccountManager userManager;
- private final AuxiliaryManager auxiliaryManager;
+ private final CommitInfoManager commitInfoManager;
private final PullRequestManager pullRequestManager;
@@ -85,14 +85,14 @@ public class DefaultDepotManager extends AbstractEntityDao<Depot> implements Dep
@Inject
public DefaultDepotManager(Dao dao, AccountManager userManager,
TeamAuthorizationManager teamAuthorizationManager,
- StorageManager storageManager, AuxiliaryManager auxiliaryManager,
+ StorageManager storageManager, CommitInfoManager commitInfoManager,
PullRequestManager pullRequestManager, Provider<Set<DepotListener>> listenersProvider) {
super(dao);
this.storageManager = storageManager;
this.userManager = userManager;
this.teamAuthorizationManager = teamAuthorizationManager;
- this.auxiliaryManager = auxiliaryManager;
+ this.commitInfoManager = commitInfoManager;
this.pullRequestManager = pullRequestManager;
this.listenersProvider = listenersProvider;
@@ -185,7 +185,7 @@ public class DefaultDepotManager extends AbstractEntityDao<Depot> implements Dep
}
if (isNew) {
checkSanity(depot);
- auxiliaryManager.collect(depot);
+ commitInfoManager.collect(depot);
}
}
@@ -351,7 +351,7 @@ public class DefaultDepotManager extends AbstractEntityDao<Depot> implements Dep
public void systemStarted() {
for (Depot depot: all()) {
checkSanity(depot);
- auxiliaryManager.collect(depot);
+ commitInfoManager.collect(depot);
}
pullRequestManager.checkSanity();
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultPullRequestManager.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultPullRequestManager.java
index f1ad889fc0..de420b6d6d 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultPullRequestManager.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultPullRequestManager.java
@@ -14,9 +14,14 @@ import static com.pmease.gitplex.core.entity.PullRequest.Status.PENDING_UPDATE;
import java.io.File;
import java.util.Collection;
+import java.util.Collections;
import java.util.Date;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicLong;
import javax.annotation.Nullable;
import javax.inject.Inject;
@@ -27,8 +32,10 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.wicket.request.cycle.RequestCycle;
import org.eclipse.jetty.util.ConcurrentHashSet;
import org.eclipse.jgit.lib.ObjectId;
+import org.hibernate.Criteria;
import org.hibernate.Query;
import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions;
import org.joda.time.DateTime;
import org.slf4j.Logger;
@@ -110,6 +117,8 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
private final WorkManager workManager;
private final PullRequestActivityManager pullRequestActivityManager;
+
+ private final Map<Long, AtomicLong> nextNumbers = Collections.synchronizedMap(new HashMap<>());
@Inject
public DefaultPullRequestManager(Dao dao,
@@ -296,13 +305,13 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
Git sourceGit = sourceDepot.git();
String sourceRef = request.getSourceRef();
sourceGit.updateRef(sourceRef, integrated, preview.getRequestHead(),
- "Pull request #" + request.getId());
+ "Pull request #" + request.getNumber());
sourceDepot.cacheObjectId(request.getSourceRef(), integratedCommit);
onRefUpdate(sourceDepot, sourceRef, ObjectId.fromString(preview.getRequestHead()), integratedCommit);
}
String targetRef = request.getTargetRef();
- git.updateRef(targetRef, integrated, preview.getTargetHead(), "Pull request #" + request.getId());
+ git.updateRef(targetRef, integrated, preview.getTargetHead(), "Pull request #" + request.getNumber());
targetDepot.cacheObjectId(request.getTargetRef(), ObjectId.fromString(integrated));
onRefUpdate(targetDepot, targetRef, ObjectId.fromString(preview.getTargetHead()), integratedCommit);
@@ -339,8 +348,10 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
@Transactional
@Override
public void open(PullRequest request, Object listenerData) {
+ AtomicLong nextNumber = Preconditions.checkNotNull(nextNumbers.get(request.getTargetDepot().getId()));
+ request.setNumber(nextNumber.getAndIncrement());
persist(request);
-
+
PullRequestActivity activity = new PullRequestActivity();
activity.setDate(request.getSubmitDate());
activity.setAction(PullRequestActivity.Action.OPEN);
@@ -442,6 +453,7 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
public void onSourceBranchUpdate(PullRequest request, boolean notify) {
if (!request.getLatestUpdate().getHeadCommitHash().equals(request.getSource().getObjectName())) {
PullRequestUpdate update = new PullRequestUpdate();
+ update.setUUID(UUID.randomUUID().toString());
update.setRequest(request);
update.setDate(new Date());
update.setHeadCommitHash(request.getSource().getObjectName());
@@ -451,7 +463,7 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
closeIfMerged(request);
if (request.isOpen()) {
- final Long requestId = request.getId();
+ Long requestId = request.getId();
afterCommit(new Runnable() {
@Override
@@ -547,9 +559,10 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
try {
if (!integrationPreviewCalculatingRequestIds.contains(requestId)) {
integrationPreviewCalculatingRequestIds.add(requestId);
- logger.info("Calculating integration preview of pull request #{}...", requestId);
try {
PullRequest request = load(requestId);
+ logger.info("Calculating integration preview of pull request #{} in repository '{}'...",
+ request.getNumber(), request.getTargetDepot());
IntegrationPreview preview = request.getLastIntegrationPreview();
if (request.isOpen() && (preview == null || preview.isObsolete(request))) {
String requestHead = request.getLatestUpdate().getHeadCommitHash();
@@ -589,7 +602,7 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
String commitMessage = request.getTitle() + "\n\n";
if (request.getDescription() != null)
commitMessage += request.getDescription() + "\n\n";
- commitMessage += "(squashed commit of pull request #" + request.getId() + ")\n";
+ commitMessage += "(squashed commit of pull request #" + request.getNumber() + ")\n";
integrated = tempGit.squash(requestHead, null, null, commitMessage);
} else {
FastForwardMode fastForwardMode;
@@ -597,7 +610,7 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
fastForwardMode = FastForwardMode.NO_FF;
else
fastForwardMode = FastForwardMode.FF;
- String commitMessage = "Merge pull request #" + request.getId()
+ String commitMessage = "Merge pull request #" + request.getNumber()
+ "\n\n" + request.getTitle() + "\n";
integrated = tempGit.merge(requestHead, fastForwardMode, null, null, commitMessage);
}
@@ -624,13 +637,14 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
for (PullRequestListener listener: pullRequestListeners)
listener.onIntegrationPreviewCalculated(request);
}
+ logger.info("Integration preview of pull request #{} in repository '{}' is calculated.",
+ request.getNumber(), request.getTargetDepot());
} finally {
integrationPreviewCalculatingRequestIds.remove(requestId);
- logger.info("Integration preview of pull request #{} is calculated.", requestId);
}
}
} catch (Exception e) {
- logger.error("Error calculating integration preview of pull request #" + requestId, e);
+ logger.error("Error calculating pull request integration preview", e);
} finally {
unitOfWork.end();
}
@@ -653,8 +667,17 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
}
+ @Sessional
@Override
public void systemStarted() {
+ Criteria criteria = getSession().createCriteria(PullRequest.class);
+ criteria.setProjection(Projections.projectionList()
+ .add(Projections.groupProperty("targetDepot.id"))
+ .add(Projections.max("number")));
+ for (Object row: criteria.list()) {
+ Object[] rowProps = (Object[]) row;
+ nextNumbers.put((Long) rowProps[0], new AtomicLong((Long)rowProps[1]+1));
+ }
}
@Override
@@ -668,6 +691,7 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
@Transactional
@Override
public void onDeleteDepot(Depot depot) {
+ nextNumbers.remove(depot.getId());
for (PullRequest request: depot.getOutgoingRequests()) {
if (!request.getTargetDepot().equals(depot) && request.isOpen())
discard(request, "Source repository is deleted.");
@@ -700,10 +724,10 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
if (depot.getObjectId(request.getBaseCommitHash(), false) != null)
onSourceBranchUpdate(request, true);
else
- logger.error("Unable to update pull request #{} due to unexpected source repository.", request.getId());
+ logger.error("Unable to update pull request #{} due to unexpected source repository.", request.getNumber());
}
- final Long repoId = depot.getId();
+ Long depotId = depot.getId();
afterCommit(new Runnable() {
@Override
@@ -712,14 +736,13 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
@Override
public void run() {
- DepotAndBranch depotAndBranch = new DepotAndBranch(repoId, branch);
+ DepotAndBranch depotAndBranch = new DepotAndBranch(depotId, branch);
Criterion criterion = Restrictions.and(ofOpen(), ofTarget(depotAndBranch));
for (PullRequest request: query(EntityCriteria.of(PullRequest.class).add(criterion))) {
if (request.getSourceDepot().getObjectId(request.getBaseCommitHash(), false) != null)
onTargetBranchUpdate(request);
else
- logger.error("Unable to update pull request #{} due to unexpected target repository.", request.getId());
-
+ logger.error("Unable to update pull request #{} due to unexpected target repository.", request.getNumber());
}
}
@@ -805,7 +828,7 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
else
onSourceBranchUpdate(request, true);
} else {
- logger.error("Unable to update pull request #{} due to unexpected source repository", request.getId());
+ logger.error("Unable to update pull request #{} due to unexpected source repository", request.getNumber());
}
}
@@ -824,7 +847,7 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
else
onTargetBranchUpdate(request);
} else {
- logger.error("Unable to update pull request #{} due to unexpected target repository", request.getId());
+ logger.error("Unable to update pull request #{} due to unexpected target repository", request.getNumber());
}
}
}
@@ -850,6 +873,17 @@ public class DefaultPullRequestManager extends AbstractEntityDao<PullRequest> im
@Override
public void onSaveDepot(Depot depot) {
+ nextNumbers.put(depot.getId(), new AtomicLong(1));
+ }
+
+ @Sessional
+ @Override
+ public PullRequest find(Depot target, long number) {
+ EntityCriteria<PullRequest> criteria = newCriteria();
+ criteria.add(Restrictions.eq("targetDepot", target));
+ criteria.add(Restrictions.eq("number", number));
+
+ return find(criteria);
}
}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentPanel.java
index ab1049fad6..2aedfebb9b 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentPanel.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentPanel.java
@@ -33,6 +33,7 @@ import com.pmease.commons.wicket.component.markdownviewer.MarkdownViewer;
import com.pmease.gitplex.core.GitPlex;
import com.pmease.gitplex.core.entity.CodeComment;
import com.pmease.gitplex.core.entity.CodeCommentReply;
+import com.pmease.gitplex.core.entity.Depot;
import com.pmease.gitplex.core.entity.component.CompareContext;
import com.pmease.gitplex.core.entity.component.DepotAndRevision;
import com.pmease.gitplex.core.manager.CodeCommentManager;
@@ -149,7 +150,12 @@ public abstract class CodeCommentPanel extends GenericPanel<CodeComment> {
@Override
protected AttachmentSupport getAttachmentSupport() {
- return new DepotAttachmentSupport(getComment().getDepot(), getComment().getAttachmentDirUUID());
+ return new DepotAttachmentSupport(getComment().getDepot(), getComment().getUUID());
+ }
+
+ @Override
+ protected Depot getDepot() {
+ return getComment().getDepot();
}
};
@@ -342,7 +348,12 @@ public abstract class CodeCommentPanel extends GenericPanel<CodeComment> {
@Override
protected AttachmentSupport getAttachmentSupport() {
- return new DepotAttachmentSupport(getComment().getDepot(), getComment().getAttachmentDirUUID());
+ return new DepotAttachmentSupport(getComment().getDepot(), getComment().getUUID());
+ }
+
+ @Override
+ protected Depot getDepot() {
+ return getComment().getDepot();
}
};
@@ -455,7 +466,12 @@ public abstract class CodeCommentPanel extends GenericPanel<CodeComment> {
@Override
protected AttachmentSupport getAttachmentSupport() {
- return new DepotAttachmentSupport(getComment().getDepot(), getComment().getAttachmentDirUUID());
+ return new DepotAttachmentSupport(getComment().getDepot(), getComment().getUUID());
+ }
+
+ @Override
+ protected Depot getDepot() {
+ return getComment().getDepot();
}
};
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CommentInput.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CommentInput.java
index 446bfd0bcb..c77c256590 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CommentInput.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CommentInput.java
@@ -29,6 +29,7 @@ import com.pmease.commons.wicket.behavior.markdown.AttachmentSupport;
import com.pmease.commons.wicket.behavior.markdown.MarkdownBehavior;
import com.pmease.gitplex.core.GitPlex;
import com.pmease.gitplex.core.entity.Account;
+import com.pmease.gitplex.core.entity.Depot;
import com.pmease.gitplex.core.entity.PullRequest;
import com.pmease.gitplex.web.avatar.AvatarManager;
@@ -83,9 +84,9 @@ public abstract class CommentInput extends TextArea<String> {
List<Map<String, String>> requestList = new ArrayList<>();
for (PullRequest request: queryRequests(requestQuery, ATWHO_LIMIT)) {
Map<String, String> requestMap = new HashMap<>();
- requestMap.put("requestId", request.getIdStr());
+ requestMap.put("requestNumber", request.getNumberStr());
requestMap.put("requestTitle", request.getTitle());
- requestMap.put("searchKey", request.getIdStr() + " " + request.getNoSpaceTitle());
+ requestMap.put("searchKey", request.getNumberStr() + " " + request.getNoSpaceTitle());
requestList.add(requestMap);
}
@@ -136,16 +137,19 @@ public abstract class CommentInput extends TextArea<String> {
protected List<PullRequest> queryRequests(String query, int count) {
EntityCriteria<PullRequest> criteria = EntityCriteria.of(PullRequest.class);
+ criteria.add(Restrictions.eq("targetDepot", getDepot()));
if (StringUtils.isNotBlank(query)) {
query = StringUtils.deleteWhitespace(query);
criteria.add(Restrictions.or(
Restrictions.ilike("noSpaceTitle", query, MatchMode.ANYWHERE),
- Restrictions.ilike("idStr", query, MatchMode.START)));
+ Restrictions.ilike("numberStr", query, MatchMode.START)));
}
- criteria.addOrder(Order.desc("id"));
+ criteria.addOrder(Order.desc("number"));
return GitPlex.getInstance(Dao.class).query(criteria, 0, count);
}
protected abstract AttachmentSupport getAttachmentSupport();
+ protected abstract Depot getDepot();
+
}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/PullRequestTransformer.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/PullRequestTransformer.java
index 27a714057a..f468040df1 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/PullRequestTransformer.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/PullRequestTransformer.java
@@ -1,26 +1,26 @@
-package com.pmease.gitplex.web.component.comment;
-
-import org.apache.wicket.request.cycle.RequestCycle;
-import org.jsoup.nodes.Element;
-
-import com.pmease.commons.markdown.extensionpoint.HtmlTransformer;
-import com.pmease.gitplex.core.entity.PullRequest;
-import com.pmease.gitplex.core.util.markdown.PullRequestParser;
-import com.pmease.gitplex.web.page.depot.pullrequest.requestdetail.overview.RequestOverviewPage;
-
-public class PullRequestTransformer extends PullRequestParser implements HtmlTransformer {
-
- @Override
- public Element transform(Element body) {
- parseRequests(body);
- return body;
- }
-
- @Override
- protected String toHtml(PullRequest request) {
- CharSequence url = RequestCycle.get().urlFor(
- RequestOverviewPage.class, RequestOverviewPage.paramsOf(request));
- return String.format("<a href='%s' class='request'>#%d</a>", url, request.getId());
- }
-
-}
+package com.pmease.gitplex.web.component.comment;
+
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.jsoup.nodes.Element;
+
+import com.pmease.commons.markdown.extensionpoint.HtmlTransformer;
+import com.pmease.gitplex.core.entity.PullRequest;
+import com.pmease.gitplex.core.util.markdown.PullRequestParser;
+import com.pmease.gitplex.web.page.depot.pullrequest.requestdetail.overview.RequestOverviewPage;
+
+public class PullRequestTransformer extends PullRequestParser implements HtmlTransformer {
+
+ @Override
+ public Element transform(Element body) {
+ parseRequests(body);
+ return body;
+ }
+
+ @Override
+ protected String toHtml(PullRequest request) {
+ CharSequence url = RequestCycle.get().urlFor(
+ RequestOverviewPage.class, RequestOverviewPage.paramsOf(request));
+ return String.format("<a href='%s' class='request'>#%d</a>", url, request.getNumber());
+ }
+
+}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/comment-input.js b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/comment-input.js
index fdeed3ac60..32d4f47549 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/comment-input.js
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/comment-input.js
@@ -32,8 +32,8 @@ gitplex.comment = function(inputId, atWhoLimit, callback) {
callback("requestQuery", query);
}
},
- displayTpl: "<li><span class='text-muted'>#${requestId}</span> - ${requestTitle}</li>",
- insertTpl: '#${requestId}',
+ displayTpl: "<li><span class='text-muted'>#${requestNumber}</span> - ${requestTitle}</li>",
+ insertTpl: '#${requestNumber}',
limit: atWhoLimit
});
}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.java
index fb9278d8a2..2960f67b9b 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.java
@@ -432,6 +432,11 @@ public class SourceViewPanel extends BlobViewPanel {
protected DepotAttachmentSupport getAttachmentSupport() {
return new DepotAttachmentSupport(context.getDepot(), attachmentDirUUID);
}
+
+ @Override
+ protected Depot getDepot() {
+ return context.getDepot();
+ }
});
input.setRequired(true);
@@ -469,7 +474,7 @@ public class SourceViewPanel extends BlobViewPanel {
super.onSubmit(target, form);
CodeComment comment = new CodeComment();
- comment.setAttachmentDirUUID(attachmentDirUUID);
+ comment.setUUID(attachmentDirUUID);
comment.setCommit(context.getCommit().name());
comment.setPath(context.getBlobIdent().path);
comment.setContent(input.getModelObject());
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.java
index 5c40fe3ae0..fd78775557 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.java
@@ -782,6 +782,11 @@ public class RevisionDiffPanel extends Panel {
protected DepotAttachmentSupport getAttachmentSupport() {
return new DepotAttachmentSupport(depotModel.getObject(), attachmentDirUUID);
}
+
+ @Override
+ protected Depot getDepot() {
+ return depotModel.getObject();
+ }
});
input.setRequired(true);
@@ -819,7 +824,7 @@ public class RevisionDiffPanel extends Panel {
super.onSubmit(target, form);
CodeComment comment = new CodeComment();
- comment.setAttachmentDirUUID(attachmentDirUUID);
+ comment.setUUID(attachmentDirUUID);
comment.setDepot(depotModel.getObject());
comment.setUser(SecurityUtils.getAccount());
comment.setCommit(mark.getCommit());
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/DepotPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/DepotPage.java
index 227579896e..f774436337 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/DepotPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/DepotPage.java
@@ -37,7 +37,7 @@ import com.pmease.commons.wicket.component.tabbable.Tabbable;
import com.pmease.gitplex.core.GitPlex;
import com.pmease.gitplex.core.entity.Account;
import com.pmease.gitplex.core.entity.Depot;
-import com.pmease.gitplex.core.manager.AuxiliaryManager;
+import com.pmease.gitplex.core.manager.CommitInfoManager;
import com.pmease.gitplex.core.manager.DepotManager;
import com.pmease.gitplex.core.manager.PullRequestManager;
import com.pmease.gitplex.core.security.SecurityUtils;
@@ -136,7 +136,7 @@ public abstract class DepotPage extends AccountPage {
tabs.add(new DepotTab(Model.of("Overview"), "fa fa-fw fa-list-alt", 0, DepotOverviewPage.class));
tabs.add(new DepotTab(Model.of("Files"), "fa fa-fw fa-file-text-o", 0, DepotFilePage.class));
tabs.add(new DepotTab(Model.of("Commits"), "fa fa-fw fa-ext fa-commit",
- GitPlex.getInstance(AuxiliaryManager.class).getCommitCount(getDepot()),
+ GitPlex.getInstance(CommitInfoManager.class).getCommitCount(getDepot()),
DepotCommitsPage.class, CommitDetailPage.class));
tabs.add(new DepotTab(Model.of("Branches"), "fa fa-fw fa-code-fork",
getDepot().getRefs(Constants.R_HEADS).size(), DepotBranchesPage.class));
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/commit/CommitDetailPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/commit/CommitDetailPage.java
index cf1986b28d..aca44fef8f 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/commit/CommitDetailPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/commit/CommitDetailPage.java
@@ -44,8 +44,8 @@ import com.pmease.gitplex.core.GitPlex;
import com.pmease.gitplex.core.entity.CodeComment;
import com.pmease.gitplex.core.entity.Depot;
import com.pmease.gitplex.core.entity.PullRequest;
-import com.pmease.gitplex.core.manager.AuxiliaryManager;
import com.pmease.gitplex.core.manager.CodeCommentManager;
+import com.pmease.gitplex.core.manager.CommitInfoManager;
import com.pmease.gitplex.web.component.avatar.ContributorAvatars;
import com.pmease.gitplex.web.component.contributorpanel.ContributorPanel;
import com.pmease.gitplex.web.component.createbranch.CreateBranchLink;
@@ -157,7 +157,7 @@ public class CommitDetailPage extends DepotPage implements MarkSupport {
@Override
protected List<Ref> load() {
- Set<ObjectId> descendants = GitPlex.getInstance(AuxiliaryManager.class)
+ Set<ObjectId> descendants = GitPlex.getInstance(CommitInfoManager.class)
.getDescendants(getDepot(), getCommit().getId());
descendants.add(getCommit().getId());
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/commit/QueryAssistBehavior.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/commit/QueryAssistBehavior.java
index a0a1f85c4d..36ac68bf11 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/commit/QueryAssistBehavior.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/commit/QueryAssistBehavior.java
@@ -1,212 +1,212 @@
-package com.pmease.gitplex.web.page.depot.commit;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.model.IModel;
-
-import com.pmease.commons.antlr.codeassist.FenceAware;
-import com.pmease.commons.antlr.codeassist.InputSuggestion;
-import com.pmease.commons.antlr.codeassist.ParentedElement;
-import com.pmease.commons.antlr.grammar.ElementSpec;
-import com.pmease.commons.antlr.grammar.LexerRuleRefElementSpec;
-import com.pmease.commons.git.NameAndEmail;
-import com.pmease.commons.util.Range;
-import com.pmease.commons.util.StringUtils;
-import com.pmease.commons.util.match.PatternApplied;
-import com.pmease.commons.util.match.WildcardUtils;
-import com.pmease.commons.wicket.behavior.inputassist.ANTLRAssistBehavior;
-import com.pmease.gitplex.core.GitPlex;
-import com.pmease.gitplex.core.entity.Depot;
-import com.pmease.gitplex.core.manager.AuxiliaryManager;
-import com.pmease.gitplex.web.Constants;
-import com.pmease.gitplex.web.util.SuggestionUtils;
-
-@SuppressWarnings("serial")
-public class QueryAssistBehavior extends ANTLRAssistBehavior {
-
- private final IModel<Depot> depotModel;
-
- private static final String VALUE_OPEN = "(";
-
- private static final String VALUE_CLOSE = ")";
-
- private static final String[] DATE_EXAMPLES = new String[]{
- "one hour ago", "2 hours ago", "3PM", "noon", "today", "yesterday",
- "yesterday midnight", "3 days ago", "last week", "last Monday",
- "4 weeks ago", "1 month 2 days ago", "1 year ago"};
-
- public QueryAssistBehavior(IModel<Depot> depotModel) {
- super(CommitQueryParser.class, "query");
- this.depotModel = depotModel;
- }
-
- @Override
- public void detach(Component component) {
- super.detach(component);
- depotModel.detach();
- }
-
- @Override
- protected List<InputSuggestion> suggest(final ParentedElement expectedElement, String matchWith, int count) {
- if (expectedElement.getSpec() instanceof LexerRuleRefElementSpec) {
- LexerRuleRefElementSpec spec = (LexerRuleRefElementSpec) expectedElement.getSpec();
- if (spec.getRuleName().equals("Value")) {
- return new FenceAware(codeAssist.getGrammar(), VALUE_OPEN, VALUE_CLOSE) {
-
- @Override
- protected List<InputSuggestion> match(String unfencedMatchWith, int count) {
- int tokenType = expectedElement.getRoot().getLastMatchedToken().getType();
- String unfencedLowerCaseMatchWith = unfencedMatchWith.toLowerCase();
- List<InputSuggestion> suggestions = new ArrayList<>();
- Depot depot = depotModel.getObject();
- switch (tokenType) {
- case CommitQueryParser.BRANCH:
- suggestions.addAll(SuggestionUtils.suggestBranch(depot, unfencedMatchWith, count, null, null));
- break;
- case CommitQueryParser.TAG:
- suggestions.addAll(SuggestionUtils.suggestTag(depot, unfencedMatchWith, count));
- break;
- case CommitQueryParser.AUTHOR:
- case CommitQueryParser.COMMITTER:
- Map<String, Range> suggestedInputs = new LinkedHashMap<>();
- AuxiliaryManager auxiliaryManager = GitPlex.getInstance(AuxiliaryManager.class);
- List<NameAndEmail> contributors = auxiliaryManager.getContributors(depot);
- for (NameAndEmail contributor: contributors) {
- String content;
- if (StringUtils.isNotBlank(contributor.getEmailAddress()))
- content = contributor.getName() + " <" + contributor.getEmailAddress() + ">";
- else
- content = contributor.getName();
- content = content.trim();
- PatternApplied applied = WildcardUtils.applyPattern(unfencedLowerCaseMatchWith, content, false);
- if (applied != null) {
- suggestedInputs.put(applied.getText(), applied.getMatchRange());
- if (suggestedInputs.size() == count)
- break;
- }
- }
-
- for (Map.Entry<String, Range> entry: suggestedInputs.entrySet())
- suggestions.add(new InputSuggestion(entry.getKey(), -1, true, null, entry.getValue()));
- break;
- case CommitQueryParser.BEFORE:
- case CommitQueryParser.AFTER:
- if (!unfencedMatchWith.contains(VALUE_CLOSE)) {
- if (unfencedMatchWith.length() != 0) {
- String fenced = VALUE_OPEN + unfencedMatchWith + VALUE_CLOSE;
- Range matchRange = new Range(0, fenced.length());
- if (suggestions.size() < count)
- suggestions.add(new InputSuggestion(fenced, -1, true, getFencingDescription(), matchRange));
- }
- if (suggestions.size() < count)
- suggestions.add(new InputSuggestion(Constants.DATETIME_FORMATTER.print(System.currentTimeMillis())));
- if (suggestions.size() < count)
- suggestions.add(new InputSuggestion(Constants.DATE_FORMATTER.print(System.currentTimeMillis())));
- for (String dateExample: DATE_EXAMPLES) {
- if (suggestions.size() < count)
- suggestions.add(new InputSuggestion(dateExample));
- }
- }
- break;
- case CommitQueryParser.PATH:
- suggestions.addAll(SuggestionUtils.suggestPath(depotModel.getObject(), unfencedMatchWith, count));
- break;
- }
- return suggestions;
- }
-
- @Override
- protected String getFencingDescription() {
- return "value needs to be enclosed in brackets";
- }
-
- }.suggest(expectedElement.getSpec(), matchWith, count);
- }
- }
- return null;
- }
-
- @Override
- protected List<String> getHints(ParentedElement expectedElement, String matchWith) {
- List<String> hints = new ArrayList<>();
- if (expectedElement.getSpec() instanceof LexerRuleRefElementSpec) {
- LexerRuleRefElementSpec spec = (LexerRuleRefElementSpec) expectedElement.getSpec();
- if (spec.getRuleName().equals("Value") && !matchWith.contains(VALUE_CLOSE)) {
- int tokenType = expectedElement.getRoot().getLastMatchedToken().getType();
- if (tokenType == CommitQueryParser.COMMITTER) {
- hints.add("Use * to match any part of committer");
- } else if (tokenType == CommitQueryParser.AUTHOR) {
- hints.add("Use * to match any part of author");
- } else if (tokenType == CommitQueryParser.PATH) {
- hints.add("Use * to match any part of path");
- } else if (tokenType == CommitQueryParser.MESSAGE) {
- hints.add("Git log basic regular expression is accepted here");
- hints.add("Use '\\\\' to escape special characters in regular expression");
- hints.add("Use '\\(' and '\\)' to represent brackets in message");
- }
- }
- }
- return hints;
- }
-
- @Override
- protected int getEndOfMatch(ElementSpec spec, String content) {
- if (content.startsWith(VALUE_OPEN+VALUE_CLOSE))
- return 2;
- else
- return super.getEndOfMatch(spec, content);
- }
-
- @Override
- protected InputSuggestion wrapAsSuggestion(ParentedElement expectedElement,
- String suggestedLiteral, boolean complete) {
- String description;
- switch (suggestedLiteral) {
- case "branch":
- description = "commits of branch";
- break;
- case "tag":
- description = "commits of tag";
- break;
- case "id":
- description = "commits of hash";
- break;
- case "committer":
- description = "committed by";
- break;
- case "author":
- description = "authored by";
- break;
- case "message":
- description = "commit message contains";
- break;
- case "before":
- description = "before specified date";
- break;
- case "after":
- description = "after specified date";
- break;
- case "path":
- description = "touching specified path";
- break;
- case "^":
- description = "exclude revision";
- break;
- case "..":
- case "...":
- description = "revision range";
- break;
- case " ":
- description = "space";
- break;
- default:
- description = null;
- }
- return new InputSuggestion(suggestedLiteral, description, null);
- }
-
-}
+package com.pmease.gitplex.web.page.depot.commit;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.model.IModel;
+
+import com.pmease.commons.antlr.codeassist.FenceAware;
+import com.pmease.commons.antlr.codeassist.InputSuggestion;
+import com.pmease.commons.antlr.codeassist.ParentedElement;
+import com.pmease.commons.antlr.grammar.ElementSpec;
+import com.pmease.commons.antlr.grammar.LexerRuleRefElementSpec;
+import com.pmease.commons.git.NameAndEmail;
+import com.pmease.commons.util.Range;
+import com.pmease.commons.util.StringUtils;
+import com.pmease.commons.util.match.PatternApplied;
+import com.pmease.commons.util.match.WildcardUtils;
+import com.pmease.commons.wicket.behavior.inputassist.ANTLRAssistBehavior;
+import com.pmease.gitplex.core.GitPlex;
+import com.pmease.gitplex.core.entity.Depot;
+import com.pmease.gitplex.core.manager.CommitInfoManager;
+import com.pmease.gitplex.web.Constants;
+import com.pmease.gitplex.web.util.SuggestionUtils;
+
+@SuppressWarnings("serial")
+public class QueryAssistBehavior extends ANTLRAssistBehavior {
+
+ private final IModel<Depot> depotModel;
+
+ private static final String VALUE_OPEN = "(";
+
+ private static final String VALUE_CLOSE = ")";
+
+ private static final String[] DATE_EXAMPLES = new String[]{
+ "one hour ago", "2 hours ago", "3PM", "noon", "today", "yesterday",
+ "yesterday midnight", "3 days ago", "last week", "last Monday",
+ "4 weeks ago", "1 month 2 days ago", "1 year ago"};
+
+ public QueryAssistBehavior(IModel<Depot> depotModel) {
+ super(CommitQueryParser.class, "query");
+ this.depotModel = depotModel;
+ }
+
+ @Override
+ public void detach(Component component) {
+ super.detach(component);
+ depotModel.detach();
+ }
+
+ @Override
+ protected List<InputSuggestion> suggest(final ParentedElement expectedElement, String matchWith, int count) {
+ if (expectedElement.getSpec() instanceof LexerRuleRefElementSpec) {
+ LexerRuleRefElementSpec spec = (LexerRuleRefElementSpec) expectedElement.getSpec();
+ if (spec.getRuleName().equals("Value")) {
+ return new FenceAware(codeAssist.getGrammar(), VALUE_OPEN, VALUE_CLOSE) {
+
+ @Override
+ protected List<InputSuggestion> match(String unfencedMatchWith, int count) {
+ int tokenType = expectedElement.getRoot().getLastMatchedToken().getType();
+ String unfencedLowerCaseMatchWith = unfencedMatchWith.toLowerCase();
+ List<InputSuggestion> suggestions = new ArrayList<>();
+ Depot depot = depotModel.getObject();
+ switch (tokenType) {
+ case CommitQueryParser.BRANCH:
+ suggestions.addAll(SuggestionUtils.suggestBranch(depot, unfencedMatchWith, count, null, null));
+ break;
+ case CommitQueryParser.TAG:
+ suggestions.addAll(SuggestionUtils.suggestTag(depot, unfencedMatchWith, count));
+ break;
+ case CommitQueryParser.AUTHOR:
+ case CommitQueryParser.COMMITTER:
+ Map<String, Range> suggestedInputs = new LinkedHashMap<>();
+ CommitInfoManager commitInfoManager = GitPlex.getInstance(CommitInfoManager.class);
+ List<NameAndEmail> contributors = commitInfoManager.getContributors(depot);
+ for (NameAndEmail contributor: contributors) {
+ String content;
+ if (StringUtils.isNotBlank(contributor.getEmailAddress()))
+ content = contributor.getName() + " <" + contributor.getEmailAddress() + ">";
+ else
+ content = contributor.getName();
+ content = content.trim();
+ PatternApplied applied = WildcardUtils.applyPattern(unfencedLowerCaseMatchWith, content, false);
+ if (applied != null) {
+ suggestedInputs.put(applied.getText(), applied.getMatchRange());
+ if (suggestedInputs.size() == count)
+ break;
+ }
+ }
+
+ for (Map.Entry<String, Range> entry: suggestedInputs.entrySet())
+ suggestions.add(new InputSuggestion(entry.getKey(), -1, true, null, entry.getValue()));
+ break;
+ case CommitQueryParser.BEFORE:
+ case CommitQueryParser.AFTER:
+ if (!unfencedMatchWith.contains(VALUE_CLOSE)) {
+ if (unfencedMatchWith.length() != 0) {
+ String fenced = VALUE_OPEN + unfencedMatchWith + VALUE_CLOSE;
+ Range matchRange = new Range(0, fenced.length());
+ if (suggestions.size() < count)
+ suggestions.add(new InputSuggestion(fenced, -1, true, getFencingDescription(), matchRange));
+ }
+ if (suggestions.size() < count)
+ suggestions.add(new InputSuggestion(Constants.DATETIME_FORMATTER.print(System.currentTimeMillis())));
+ if (suggestions.size() < count)
+ suggestions.add(new InputSuggestion(Constants.DATE_FORMATTER.print(System.currentTimeMillis())));
+ for (String dateExample: DATE_EXAMPLES) {
+ if (suggestions.size() < count)
+ suggestions.add(new InputSuggestion(dateExample));
+ }
+ }
+ break;
+ case CommitQueryParser.PATH:
+ suggestions.addAll(SuggestionUtils.suggestPath(depotModel.getObject(), unfencedMatchWith, count));
+ break;
+ }
+ return suggestions;
+ }
+
+ @Override
+ protected String getFencingDescription() {
+ return "value needs to be enclosed in brackets";
+ }
+
+ }.suggest(expectedElement.getSpec(), matchWith, count);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ protected List<String> getHints(ParentedElement expectedElement, String matchWith) {
+ List<String> hints = new ArrayList<>();
+ if (expectedElement.getSpec() instanceof LexerRuleRefElementSpec) {
+ LexerRuleRefElementSpec spec = (LexerRuleRefElementSpec) expectedElement.getSpec();
+ if (spec.getRuleName().equals("Value") && !matchWith.contains(VALUE_CLOSE)) {
+ int tokenType = expectedElement.getRoot().getLastMatchedToken().getType();
+ if (tokenType == CommitQueryParser.COMMITTER) {
+ hints.add("Use * to match any part of committer");
+ } else if (tokenType == CommitQueryParser.AUTHOR) {
+ hints.add("Use * to match any part of author");
+ } else if (tokenType == CommitQueryParser.PATH) {
+ hints.add("Use * to match any part of path");
+ } else if (tokenType == CommitQueryParser.MESSAGE) {
+ hints.add("Git log basic regular expression is accepted here");
+ hints.add("Use '\\\\' to escape special characters in regular expression");
+ hints.add("Use '\\(' and '\\)' to represent brackets in message");
+ }
+ }
+ }
+ return hints;
+ }
+
+ @Override
+ protected int getEndOfMatch(ElementSpec spec, String content) {
+ if (content.startsWith(VALUE_OPEN+VALUE_CLOSE))
+ return 2;
+ else
+ return super.getEndOfMatch(spec, content);
+ }
+
+ @Override
+ protected InputSuggestion wrapAsSuggestion(ParentedElement expectedElement,
+ String suggestedLiteral, boolean complete) {
+ String description;
+ switch (suggestedLiteral) {
+ case "branch":
+ description = "commits of branch";
+ break;
+ case "tag":
+ description = "commits of tag";
+ break;
+ case "id":
+ description = "commits of hash";
+ break;
+ case "committer":
+ description = "committed by";
+ break;
+ case "author":
+ description = "authored by";
+ break;
+ case "message":
+ description = "commit message contains";
+ break;
+ case "before":
+ description = "before specified date";
+ break;
+ case "after":
+ description = "after specified date";
+ break;
+ case "path":
+ description = "touching specified path";
+ break;
+ case "^":
+ description = "exclude revision";
+ break;
+ case "..":
+ case "...":
+ description = "revision range";
+ break;
+ case " ":
+ description = "space";
+ break;
+ default:
+ description = null;
+ }
+ return new InputSuggestion(suggestedLiteral, description, null);
+ }
+
+}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/file/ContributionPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/file/ContributionPanel.java
index e0df6f97d2..099bbd3a0e 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/file/ContributionPanel.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/file/ContributionPanel.java
@@ -22,7 +22,7 @@ import com.pmease.commons.git.NameAndEmail;
import com.pmease.commons.wicket.component.DropdownLink;
import com.pmease.gitplex.core.GitPlex;
import com.pmease.gitplex.core.entity.Depot;
-import com.pmease.gitplex.core.manager.AuxiliaryManager;
+import com.pmease.gitplex.core.manager.CommitInfoManager;
import com.pmease.gitplex.web.component.avatar.Avatar;
import com.pmease.gitplex.web.component.avatar.AvatarLink;
import com.pmease.gitplex.web.component.contributorpanel.ContributorPanel;
@@ -73,7 +73,7 @@ class ContributionPanel extends Panel {
@Override
protected List<NameAndEmail> load() {
- Map<NameAndEmail, Long> contributorsMap = GitPlex.getInstance(AuxiliaryManager.class)
+ Map<NameAndEmail, Long> contributorsMap = GitPlex.getInstance(CommitInfoManager.class)
.getContributions(depotModel.getObject(), blobIdent.path);
List<NameAndEmail> contributors = new ArrayList<>(contributorsMap.keySet());
contributors.sort((element1, element2)
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/overview/DepotOverviewPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/overview/DepotOverviewPage.java
index 0c9dd2a202..5a349d8ef0 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/overview/DepotOverviewPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/overview/DepotOverviewPage.java
@@ -23,7 +23,7 @@ import com.pmease.commons.git.Blob;
import com.pmease.commons.git.BlobIdent;
import com.pmease.commons.wicket.component.markdownviewer.MarkdownViewer;
import com.pmease.gitplex.core.GitPlex;
-import com.pmease.gitplex.core.manager.AuxiliaryManager;
+import com.pmease.gitplex.core.manager.CommitInfoManager;
import com.pmease.gitplex.core.manager.UrlManager;
import com.pmease.gitplex.web.component.depotfile.filelist.FileListPanel;
import com.pmease.gitplex.web.page.depot.DepotPage;
@@ -82,14 +82,14 @@ public class DepotOverviewPage extends DepotPage {
@Override
protected void onConfigure() {
super.onConfigure();
- setVisible(GitPlex.getInstance(AuxiliaryManager.class).getCommitCount(getDepot()) != 0);
+ setVisible(GitPlex.getInstance(CommitInfoManager.class).getCommitCount(getDepot()) != 0);
}
@Override
protected void onInitialize() {
super.onInitialize();
- AuxiliaryManager auxiliaryManager = GitPlex.getInstance(AuxiliaryManager.class);
- add(new Label("count", auxiliaryManager.getCommitCount(getDepot()) + " commits"));
+ CommitInfoManager commitInfoManager = GitPlex.getInstance(CommitInfoManager.class);
+ add(new Label("count", commitInfoManager.getCommitCount(getDepot()) + " commits"));
}
});
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/newrequest/NewRequestPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/newrequest/NewRequestPage.java
index 003136a9a2..a216fff0fb 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/newrequest/NewRequestPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/newrequest/NewRequestPage.java
@@ -147,12 +147,13 @@ public class NewRequestPage extends PullRequestPage implements MarkSupport {
if (pullRequest == null) {
pullRequest = new PullRequest();
- pullRequest.setAttachmentDirUUID(UUID.randomUUID().toString());
+ pullRequest.setUUID(UUID.randomUUID().toString());
pullRequest.setTarget(target);
pullRequest.setSource(source);
pullRequest.setSubmitter(currentUser);
PullRequestUpdate update = new PullRequestUpdate();
+ update.setUUID(UUID.randomUUID().toString());
pullRequest.addUpdate(update);
update.setRequest(pullRequest);
update.setHeadCommitHash(source.getObjectName());
@@ -591,7 +592,12 @@ public class NewRequestPage extends PullRequestPage implements MarkSupport {
@Override
protected AttachmentSupport getAttachmentSupport() {
- return new DepotAttachmentSupport(getDepot(), getPullRequest().getAttachmentDirUUID());
+ return new DepotAttachmentSupport(getDepot(), getPullRequest().getUUID());
+ }
+
+ @Override
+ protected Depot getDepot() {
+ return NewRequestPage.this.getDepot();
}
});
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestdetail/RequestDetailPage.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestdetail/RequestDetailPage.html
index 573372baeb..f3e3380235 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestdetail/RequestDetailPage.html
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestdetail/RequestDetailPage.html
@@ -1,113 +1,113 @@
-<wicket:extend>
- <div id="request-detail">
- <div wicket:id="requestHead" class="head clearfix">
- <div wicket:id="title" class="title pull-left"></div>
- <div wicket:id="id" class="id pull-left"></div>
- <a wicket:id="editLink" title="Edit title" class="edit"><i class="fa fa-pencil"></i></a>
- <form wicket:id="editForm" class="pull-left form-inline">
- <input wicket:id="title" type="text" placeholder="Input title" class="form-control focusable"></input>
- <input wicket:id="save" type="submit" value="Save" class="btn btn-primary"/>
- <input wicket:id="cancel" type="button" value="Cancel" class="btn btn-default"/>
- </form>
- </div>
- <div wicket:id="statusAndBranches" class="status-and-branches clearfix">
- <div wicket:id="status" class="label pull-left status"></div>
- <div class="pull-left branches">
- <span wicket:id="user"></span> <span wicket:id="action"></span> into <a wicket:id="target" class="branch"></a>
- from <a wicket:id="source" class="branch"></a> <span wicket:id="date"></span>
- </div>
- </div>
- <div wicket:id="requestSummary" class="summary well">
- <div wicket:id="discardedNote">
- <i class="fa fa-info-circle"></i> This pull request has been discarded.
- </div>
- <div wicket:id="pendingUpdateNote">
- <i class="fa fa-exclamation-triangle"></i> This pull request does not pass gate keeper
- checks below, and needs to be updated with new commits.
- </div>
- <div wicket:id="pendingApprovalNote">
- <i class="fa fa-exclamation-triangle"></i> This pull request needs to be approved before it can
- be integrated.
- </div>
- <div wicket:id="integratedNote" class="integrated-note">
- <div wicket:id="fastForwarded">
- <i class="fa fa-info-circle"></i> Target branch was fast-forwarded to source branch.
- </div>
- <div wicket:id="merged">
- <i class="fa fa-info-circle"></i> Target branch was merged with source branch.
- </div>
- <div wicket:id="mergedOutside">
- <i class="fa fa-info-circle"></i> Target branch was merged with source branch by someone outside of this pull request.
- </div>
- <div wicket:id="squashed">
- <p><i class="fa fa-info-circle"></i> Per integration strategy, pending commits in source branch was squashed
- before merging into target branch. Run this command if you want to sync local
- branch with the source branch:
- <kbd>git fetch origin && git rebase</kbd>
- </p>
- </div>
- <div wicket:id="sourceRebased">
- <p><i class="fa fa-info-circle"></i> Per integration strategy, pending commits in source branch was rebased
- before merging into target branch. Run this command if you want to sync local
- branch with the source branch:
- <kbd>git fetch origin && git rebase</kbd>
- </p>
- </div>
- <div wicket:id="targetRebased">
- <p><i class="fa fa-info-circle"></i> Per integration strategy, target branch was rebased on top of source branch.
- Run this command if you want to sync local branch with the target branch:
- <kbd>git fetch origin && git rebase</kbd>
- </p>
- </div>
- </div>
- <div wicket:id="statusReasons" class="status-reasons">
- <ul><li wicket:id="reasons" class="reason"><span wicket:id="reason"></span></li></ul>
- </div>
- <div wicket:id="integrationPreview" class="integration-preview">
- <div wicket:id="calculating">
- <wicket:link>
- <img src="ajax-indicator.gif"></img> Calculating integration preview...
- </wicket:link>
- </div>
- <div wicket:id="noConflict" class="no-conflict">
- <label><i class="fa fa-check-circle"></i> Able to integrate without conflicts.</label>
- <wicket:enclosure child="preview">
- <span class="fa fa-arrow-right"></span> <a wicket:id="preview">Preview</a> the integration result.
- </wicket:enclosure>
- <wicket:enclosure child="verification">
- <span class="fa fa-arrow-right"></span> Build of the integration is <span wicket:id="verification"></span>
- </wicket:enclosure>
- </div>
- <div wicket:id="conflict" class="conflict">
- <span><i class="fa fa-warning"></i> There are integration conflicts.</span>
- <wicket:enclosure child="resolveInstructionsTrigger">
- Please follow <a wicket:id="resolveInstructionsTrigger" href="javascript:void(0);">this instruction</a> to resolve the conflicts.
- </wicket:enclosure>
- </div>
- </div>
- <div wicket:id="operations" class="operations">
- <div class="buttons">
- <a wicket:id="approve" class="btn btn-primary">Approve</a>
- <a wicket:id="disapprove" class="btn btn-primary">Disapprove</a>
- <a wicket:id="integrate" class="btn btn-success">Integrate</a>
- <a wicket:id="discard" class="btn btn-danger">Discard</a>
- <a wicket:id="reopen" class="btn btn-primary">Reopen</a>
- <a wicket:id="deleteSourceBranch" class="btn btn-primary">Delete source branch</a>
- <a wicket:id="restoreSourceBranch" class="btn btn-primary">Restore source branch</a>
- </div>
- <div wicket:id="confirm" class="confirm"></div>
- </div>
- </div>
- <ul wicket:id="requestTabs" class="tabs nav nav-tabs"></ul>
- <wicket:child></wicket:child>
- <div wicket:id="backToTop"></div>
- </div>
- <wicket:fragment wicket:id="operationConfirmFrag">
- <form wicket:id="form" class="leave-confirm">
- <div wicket:id="feedback"></div>
- <textarea wicket:id="note" class="form-control focusable" rows="5" placeholder="Leave a comment"></textarea>
- <input wicket:id="submit" type="submit" value="Confirm" class="btn"></input>
- <input wicket:id="cancel" type="button" value="Cancel" class="btn btn-default"></input>
- </form>
- </wicket:fragment>
+<wicket:extend>
+ <div id="request-detail">
+ <div wicket:id="requestHead" class="head clearfix">
+ <div wicket:id="title" class="title pull-left"></div>
+ <div wicket:id="number" class="number pull-left"></div>
+ <a wicket:id="editLink" title="Edit title" class="edit"><i class="fa fa-pencil"></i></a>
+ <form wicket:id="editForm" class="pull-left form-inline">
+ <input wicket:id="title" type="text" placeholder="Input title" class="form-control focusable"></input>
+ <input wicket:id="save" type="submit" value="Save" class="btn btn-primary"/>
+ <input wicket:id="cancel" type="button" value="Cancel" class="btn btn-default"/>
+ </form>
+ </div>
+ <div wicket:id="statusAndBranches" class="status-and-branches clearfix">
+ <div wicket:id="status" class="label pull-left status"></div>
+ <div class="pull-left branches">
+ <span wicket:id="user"></span> <span wicket:id="action"></span> into <a wicket:id="target" class="branch"></a>
+ from <a wicket:id="source" class="branch"></a> <span wicket:id="date"></span>
+ </div>
+ </div>
+ <div wicket:id="requestSummary" class="summary well">
+ <div wicket:id="discardedNote">
+ <i class="fa fa-info-circle"></i> This pull request has been discarded.
+ </div>
+ <div wicket:id="pendingUpdateNote">
+ <i class="fa fa-exclamation-triangle"></i> This pull request does not pass gate keeper
+ checks below, and needs to be updated with new commits.
+ </div>
+ <div wicket:id="pendingApprovalNote">
+ <i class="fa fa-exclamation-triangle"></i> This pull request needs to be approved before it can
+ be integrated.
+ </div>
+ <div wicket:id="integratedNote" class="integrated-note">
+ <div wicket:id="fastForwarded">
+ <i class="fa fa-info-circle"></i> Target branch was fast-forwarded to source branch.
+ </div>
+ <div wicket:id="merged">
+ <i class="fa fa-info-circle"></i> Target branch was merged with source branch.
+ </div>
+ <div wicket:id="mergedOutside">
+ <i class="fa fa-info-circle"></i> Target branch was merged with source branch by someone outside of this pull request.
+ </div>
+ <div wicket:id="squashed">
+ <p><i class="fa fa-info-circle"></i> Per integration strategy, pending commits in source branch was squashed
+ before merging into target branch. Run this command if you want to sync local
+ branch with the source branch:
+ <kbd>git fetch origin && git rebase</kbd>
+ </p>
+ </div>
+ <div wicket:id="sourceRebased">
+ <p><i class="fa fa-info-circle"></i> Per integration strategy, pending commits in source branch was rebased
+ before merging into target branch. Run this command if you want to sync local
+ branch with the source branch:
+ <kbd>git fetch origin && git rebase</kbd>
+ </p>
+ </div>
+ <div wicket:id="targetRebased">
+ <p><i class="fa fa-info-circle"></i> Per integration strategy, target branch was rebased on top of source branch.
+ Run this command if you want to sync local branch with the target branch:
+ <kbd>git fetch origin && git rebase</kbd>
+ </p>
+ </div>
+ </div>
+ <div wicket:id="statusReasons" class="status-reasons">
+ <ul><li wicket:id="reasons" class="reason"><span wicket:id="reason"></span></li></ul>
+ </div>
+ <div wicket:id="integrationPreview" class="integration-preview">
+ <div wicket:id="calculating">
+ <wicket:link>
+ <img src="ajax-indicator.gif"></img> Calculating integration preview...
+ </wicket:link>
+ </div>
+ <div wicket:id="noConflict" class="no-conflict">
+ <label><i class="fa fa-check-circle"></i> Able to integrate without conflicts.</label>
+ <wicket:enclosure child="preview">
+ <span class="fa fa-arrow-right"></span> <a wicket:id="preview">Preview</a> the integration result.
+ </wicket:enclosure>
+ <wicket:enclosure child="verification">
+ <span class="fa fa-arrow-right"></span> Build of the integration is <span wicket:id="verification"></span>
+ </wicket:enclosure>
+ </div>
+ <div wicket:id="conflict" class="conflict">
+ <span><i class="fa fa-warning"></i> There are integration conflicts.</span>
+ <wicket:enclosure child="resolveInstructionsTrigger">
+ Please follow <a wicket:id="resolveInstructionsTrigger" href="javascript:void(0);">this instruction</a> to resolve the conflicts.
+ </wicket:enclosure>
+ </div>
+ </div>
+ <div wicket:id="operations" class="operations">
+ <div class="buttons">
+ <a wicket:id="approve" class="btn btn-primary">Approve</a>
+ <a wicket:id="disapprove" class="btn btn-primary">Disapprove</a>
+ <a wicket:id="integrate" class="btn btn-success">Integrate</a>
+ <a wicket:id="discard" class="btn btn-danger">Discard</a>
+ <a wicket:id="reopen" class="btn btn-primary">Reopen</a>
+ <a wicket:id="deleteSourceBranch" class="btn btn-primary">Delete source branch</a>
+ <a wicket:id="restoreSourceBranch" class="btn btn-primary">Restore source branch</a>
+ </div>
+ <div wicket:id="confirm" class="confirm"></div>
+ </div>
+ </div>
+ <ul wicket:id="requestTabs" class="tabs nav nav-tabs"></ul>
+ <wicket:child></wicket:child>
+ <div wicket:id="backToTop"></div>
+ </div>
+ <wicket:fragment wicket:id="operationConfirmFrag">
+ <form wicket:id="form" class="leave-confirm">
+ <div wicket:id="feedback"></div>
+ <textarea wicket:id="note" class="form-control focusable" rows="5" placeholder="Leave a comment"></textarea>
+ <input wicket:id="submit" type="submit" value="Confirm" class="btn"></input>
+ <input wicket:id="cancel" type="button" value="Cancel" class="btn btn-default"></input>
+ </form>
+ </wicket:fragment>
</wicket:extend>
\ No newline at end of file
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestdetail/RequestDetailPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestdetail/RequestDetailPage.java
index 332d7cb9c9..7bca191387 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestdetail/RequestDetailPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestdetail/RequestDetailPage.java
@@ -61,6 +61,7 @@ import com.pmease.commons.wicket.component.tabbable.Tab;
import com.pmease.commons.wicket.component.tabbable.Tabbable;
import com.pmease.commons.wicket.websocket.WebSocketRenderBehavior.PageId;
import com.pmease.gitplex.core.GitPlex;
+import com.pmease.gitplex.core.entity.Depot;
import com.pmease.gitplex.core.entity.PullRequest;
import com.pmease.gitplex.core.entity.PullRequest.IntegrationStrategy;
import com.pmease.gitplex.core.entity.PullRequest.Status;
@@ -68,6 +69,7 @@ import com.pmease.gitplex.core.entity.PullRequestUpdate;
import com.pmease.gitplex.core.entity.Verification;
import com.pmease.gitplex.core.entity.component.DepotAndBranch;
import com.pmease.gitplex.core.entity.component.IntegrationPreview;
+import com.pmease.gitplex.core.manager.PullRequestManager;
import com.pmease.gitplex.core.security.SecurityUtils;
import com.pmease.gitplex.web.component.AccountLink;
import com.pmease.gitplex.web.component.BranchLink;
@@ -105,7 +107,7 @@ public abstract class RequestDetailPage extends PullRequestPage {
@Override
protected PullRequest load() {
- return GitPlex.getInstance(Dao.class).load(PullRequest.class, params.get("request").toLong());
+ return Preconditions.checkNotNull(GitPlex.getInstance(PullRequestManager.class).find(getDepot(), params.get("request").toLong()));
}
};
@@ -139,7 +141,7 @@ public abstract class RequestDetailPage extends PullRequestPage {
});
- requestTitle.add(new Label("id", "#" + request.getId()) {
+ requestTitle.add(new Label("number", "#" + request.getNumber()) {
@Override
protected void onConfigure() {
@@ -642,7 +644,12 @@ public abstract class RequestDetailPage extends PullRequestPage {
@Override
protected AttachmentSupport getAttachmentSupport() {
return new DepotAttachmentSupport(requestModel.getObject().getTargetDepot(),
- requestModel.getObject().getAttachmentDirUUID());
+ requestModel.getObject().getUUID());
+ }
+
+ @Override
+ protected Depot getDepot() {
+ return requestModel.getObject().getTargetDepot();
}
});
@@ -662,7 +669,12 @@ public abstract class RequestDetailPage extends PullRequestPage {
@Override
protected AttachmentSupport getAttachmentSupport() {
return new DepotAttachmentSupport(requestModel.getObject().getTargetDepot(),
- requestModel.getObject().getAttachmentDirUUID());
+ requestModel.getObject().getUUID());
+ }
+
+ @Override
+ protected Depot getDepot() {
+ return requestModel.getObject().getTargetDepot();
}
});
@@ -902,7 +914,7 @@ public abstract class RequestDetailPage extends PullRequestPage {
public static PageParameters paramsOf(PullRequest request) {
PageParameters params = DepotPage.paramsOf(request.getTarget().getDepot());
- params.set("request", request.getId());
+ params.set("request", request.getNumber());
return params;
}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestdetail/overview/OpenActivityPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestdetail/overview/OpenActivityPanel.java
index 7cb8af6d13..71eaf182bd 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestdetail/overview/OpenActivityPanel.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestdetail/overview/OpenActivityPanel.java
@@ -22,6 +22,7 @@ import com.pmease.commons.wicket.ajaxlistener.ConfirmLeaveListener;
import com.pmease.commons.wicket.behavior.markdown.AttachmentSupport;
import com.pmease.commons.wicket.component.markdownviewer.MarkdownViewer;
import com.pmease.gitplex.core.GitPlex;
+import com.pmease.gitplex.core.entity.Depot;
import com.pmease.gitplex.core.entity.PullRequest;
import com.pmease.gitplex.core.security.SecurityUtils;
import com.pmease.gitplex.web.component.AccountLink;
@@ -121,7 +122,12 @@ class OpenActivityPanel extends AbstractActivityPanel {
@Override
protected AttachmentSupport getAttachmentSupport() {
return new DepotAttachmentSupport(requestModel.getObject().getTargetDepot(),
- requestModel.getObject().getAttachmentDirUUID());
+ requestModel.getObject().getUUID());
+ }
+
+ @Override
+ protected Depot getDepot() {
+ return requestModel.getObject().getTargetDepot();
}
};
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestlist/RequestListPage.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestlist/RequestListPage.html
index 87ec60cf82..13fc026b3a 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestlist/RequestListPage.html
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestlist/RequestListPage.html
@@ -1,41 +1,41 @@
-<wicket:extend>
- <div id="request-list">
- <div class="head">
- <a wicket:id="filters" class="btn btn-default btn-sm"><i class="fa fa-filter"></i> Filters <span class="caret"></span></a>
- <a wicket:id="sortBy" class="btn btn-default btn-sm"> <i class="fa fa-sort"></i> Sort by <span class="caret"></span></a>
- <a wicket:id="newRequest" class="btn btn-default btn-sm"><i class="fa fa-plus"></i> Open New</a>
- </div>
- <table class="body">
- <tr>
- <td class="filter">
- <form wicket:id="form">
- <button type="submit" class="btn btn-primary btn-block top"><i class="fa fa-search"></i> Search</button>
- <div wicket:id="editor"></div>
- <button type="submit" class="btn btn-primary btn-block bottom"><i class="fa fa-search"></i> Search</button>
- </form>
- </td>
- <td class="requests">
- <table wicket:id="pullRequests" class="table table-hover"></table>
- </td>
- </tr>
- </table>
- </div>
- <wicket:fragment wicket:id="requestFrag">
- <div class="first-line clearfix">
- <span wicket:id="title" class="title pull-left"></span>
- <span wicket:id="id" class="id pull-left"></span>
- <span wicket:id="status" class="status pull-right"></span>
- </div>
- <div class="second-line">
- <a wicket:id="targetBranch" class="branch"></a>
- <span class="fa fa-long-arrow-left"></span>
- <a wicket:id="source" class="branch"></a>
- <span class="auxiliary">, submitted by</span>
- <span wicket:id="submitter" class="submitter"></span>
- <span wicket:id="age" class="age"></span>
- <wicket:enclosure child="assignee">
- <span class="auxiliary">, assigned to</span> <span wicket:id="assignee"></span>
- </wicket:enclosure>
- </div>
- </wicket:fragment>
+<wicket:extend>
+ <div id="request-list">
+ <div class="head">
+ <a wicket:id="filters" class="btn btn-default btn-sm"><i class="fa fa-filter"></i> Filters <span class="caret"></span></a>
+ <a wicket:id="sortBy" class="btn btn-default btn-sm"> <i class="fa fa-sort"></i> Sort by <span class="caret"></span></a>
+ <a wicket:id="newRequest" class="btn btn-default btn-sm"><i class="fa fa-plus"></i> Open New</a>
+ </div>
+ <table class="body">
+ <tr>
+ <td class="filter">
+ <form wicket:id="form">
+ <button type="submit" class="btn btn-primary btn-block top"><i class="fa fa-search"></i> Search</button>
+ <div wicket:id="editor"></div>
+ <button type="submit" class="btn btn-primary btn-block bottom"><i class="fa fa-search"></i> Search</button>
+ </form>
+ </td>
+ <td class="requests">
+ <table wicket:id="pullRequests" class="table table-hover"></table>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <wicket:fragment wicket:id="requestFrag">
+ <div class="first-line clearfix">
+ <span wicket:id="title" class="title pull-left"></span>
+ <span wicket:id="number" class="number pull-left"></span>
+ <span wicket:id="status" class="status pull-right"></span>
+ </div>
+ <div class="second-line">
+ <a wicket:id="targetBranch" class="branch"></a>
+ <span class="fa fa-long-arrow-left"></span>
+ <a wicket:id="source" class="branch"></a>
+ <span class="auxiliary">, submitted by</span>
+ <span wicket:id="submitter" class="submitter"></span>
+ <span wicket:id="age" class="age"></span>
+ <wicket:enclosure child="assignee">
+ <span class="auxiliary">, assigned to</span> <span wicket:id="assignee"></span>
+ </wicket:enclosure>
+ </div>
+ </wicket:fragment>
</wicket:extend>
\ No newline at end of file
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestlist/RequestListPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestlist/RequestListPage.java
index a7ff0e785f..0150adc1d4 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestlist/RequestListPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestlist/RequestListPage.java
@@ -1,364 +1,364 @@
-package com.pmease.gitplex.web.page.depot.pullrequest.requestlist;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.behavior.AttributeAppender;
-import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.NavigationToolbar;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.NoRecordsToolbar;
-import org.apache.wicket.markup.head.CssHeaderItem;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.link.AbstractLink;
-import org.apache.wicket.markup.html.link.Link;
-import org.apache.wicket.markup.html.panel.Fragment;
-import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.markup.repeater.data.IDataProvider;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.LoadableDetachableModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.request.resource.CssResourceReference;
-
-import com.pmease.commons.hibernate.dao.Dao;
-import com.pmease.commons.hibernate.dao.EntityCriteria;
-import com.pmease.commons.wicket.component.menu.MenuItem;
-import com.pmease.commons.wicket.component.menu.MenuLink;
-import com.pmease.commons.wicket.editable.BeanContext;
-import com.pmease.gitplex.core.GitPlex;
-import com.pmease.gitplex.core.entity.Account;
-import com.pmease.gitplex.core.entity.Depot;
-import com.pmease.gitplex.core.entity.PullRequest;
-import com.pmease.gitplex.core.manager.AccountManager;
-import com.pmease.gitplex.web.Constants;
-import com.pmease.gitplex.web.component.AccountLink;
-import com.pmease.gitplex.web.component.BranchLink;
-import com.pmease.gitplex.web.component.pullrequest.requestlink.RequestLink;
-import com.pmease.gitplex.web.component.pullrequest.requeststatus.RequestStatusPanel;
-import com.pmease.gitplex.web.page.depot.DepotPage;
-import com.pmease.gitplex.web.page.depot.pullrequest.PullRequestPage;
-import com.pmease.gitplex.web.page.depot.pullrequest.newrequest.NewRequestPage;
-import com.pmease.gitplex.web.page.depot.pullrequest.requestlist.SearchOption.Status;
-import com.pmease.gitplex.web.util.DateUtils;
-
-@SuppressWarnings("serial")
-public class RequestListPage extends PullRequestPage {
-
- private static final Map<SortOption, String> sortNames = new LinkedHashMap<>();
-
- static {
- sortNames.put(new SortOption("submitDate", false), "Newest");
- sortNames.put(new SortOption("submitDate", true), "Oldest");
- sortNames.put(new SortOption("lastEventDate", false), "Recently updated");
- sortNames.put(new SortOption("lastEventDate", true), "Least recently updated");
- }
-
- private SearchOption searchOption;
-
- private SortOption sortOption;
-
- public RequestListPage(PageParameters params) {
- super(params);
-
- searchOption = new SearchOption(params);
- sortOption = new SortOption(params);
- }
-
- @Override
- protected void onInitialize() {
- super.onInitialize();
-
- add(new MenuLink("filters") {
-
- @Override
- protected List<MenuItem> getMenuItems() {
- List<MenuItem> menuItems = new ArrayList<>();
-
- Account currentUser = GitPlex.getInstance(AccountManager.class).getCurrent();
- if (currentUser != null) {
- final String userName = currentUser.getName();
- menuItems.add(new MenuItem() {
-
- @Override
- public String getIconClass() {
- return null;
- }
-
- @Override
- public String getLabel() {
- return "Open requests assigned to me";
- }
-
- @Override
- public AbstractLink newLink(String id) {
- return new Link<Void>(id) {
-
- @Override
- public void onClick() {
- searchOption = new SearchOption();
- searchOption.setStatus(Status.OPEN);
- searchOption.setAssigneeName(userName);
-
- setResponsePage(RequestListPage.class, paramsOf(getDepot(), searchOption, sortOption));
- }
-
- };
- }
-
- });
- menuItems.add(new MenuItem() {
-
- @Override
- public String getIconClass() {
- return null;
- }
-
- @Override
- public String getLabel() {
- return "Open requests submitted by me";
- }
-
- @Override
- public AbstractLink newLink(String id) {
- return new Link<Void>(id) {
-
- @Override
- public void onClick() {
- searchOption = new SearchOption();
- searchOption.setStatus(Status.OPEN);
- searchOption.setSubmitterName(userName);
-
- setResponsePage(RequestListPage.class, paramsOf(getDepot(), searchOption, sortOption));
- }
-
- };
- }
-
- });
- }
- menuItems.add(new MenuItem() {
-
- @Override
- public String getIconClass() {
- return null;
- }
-
- @Override
- public String getLabel() {
- return "All open requests";
- }
-
- @Override
- public AbstractLink newLink(String id) {
- return new Link<Void>(id) {
-
- @Override
- public void onClick() {
- searchOption = new SearchOption();
- searchOption.setStatus(Status.OPEN);
-
- setResponsePage(RequestListPage.class, paramsOf(getDepot(), searchOption, sortOption));
- }
-
- };
- }
-
- });
- menuItems.add(new MenuItem() {
-
- @Override
- public String getIconClass() {
- return null;
- }
-
- @Override
- public String getLabel() {
- return "All closed requests";
- }
-
- @Override
- public AbstractLink newLink(String id) {
- return new Link<Void>(id) {
-
- @Override
- public void onClick() {
- searchOption = new SearchOption();
- searchOption.setStatus(Status.CLOSED);
-
- setResponsePage(RequestListPage.class, paramsOf(getDepot(), searchOption, sortOption));
- }
-
- };
- }
-
- });
- return menuItems;
- }
-
- });
-
- add(new MenuLink("sortBy") {
-
- @Override
- protected List<MenuItem> getMenuItems() {
- List<MenuItem> menuItems = new ArrayList<>();
-
- for (Map.Entry<SortOption, String> entry: sortNames.entrySet()) {
- final SortOption sortOption = entry.getKey();
- final String displayName = entry.getValue();
- menuItems.add(new MenuItem() {
-
- @Override
- public String getLabel() {
- return displayName;
- }
-
- @Override
- public String getIconClass() {
- if (RequestListPage.this.sortOption.equals(sortOption))
- return "fa fa-check";
- else
- return null;
- }
-
- @Override
- public AbstractLink newLink(String id) {
- return new Link<Void>(id) {
-
- @Override
- public void onClick() {
- setResponsePage(RequestListPage.class, paramsOf(getDepot(), searchOption, sortOption));
- }
-
- };
- }
-
- });
- }
-
- return menuItems;
- }
-
- });
-
- add(new Link<Void>("newRequest") {
-
- @Override
- public void onClick() {
- DepotPage page = (DepotPage) getPage();
- setResponsePage(NewRequestPage.class, NewRequestPage.paramsOf(page.getDepot()));
- }
-
- });
-
- Form<?> form = new Form<Void>("form") {
-
- @Override
- protected void onSubmit() {
- super.onSubmit();
-
- setResponsePage(RequestListPage.class, paramsOf(getDepot(), searchOption, sortOption));
- }
-
- };
- form.add(BeanContext.editBean("editor", searchOption));
- add(form);
-
- List<IColumn<PullRequest, Void>> columns = new ArrayList<>();
- columns.add(new AbstractColumn<PullRequest, Void>(Model.of("Pull Request")) {
-
- @Override
- public void populateItem(Item<ICellPopulator<PullRequest>> cellItem,
- String componentId, final IModel<PullRequest> rowModel) {
- PullRequest request = rowModel.getObject();
- Fragment fragment = new Fragment(componentId, "requestFrag", RequestListPage.this);
- fragment.add(new Label("id", "#" + request.getId()));
- fragment.add(new RequestLink("title", rowModel));
- fragment.add(new RequestStatusPanel("status", rowModel, false));
- fragment.add(new AccountLink("submitter", rowModel.getObject().getSubmitter()));
- fragment.add(new BranchLink("targetBranch", request.getTarget()));
- fragment.add(new BranchLink("source", request.getSource()));
- fragment.add(new Label("age", DateUtils.formatAge(request.getSubmitDate())));
- fragment.add(new AccountLink("assignee", rowModel.getObject().getSubmitter())
- .setVisible(request.getAssignee() != null));
-
- cellItem.add(fragment);
-
- cellItem.add(AttributeAppender.append("class", "request"));
- }
-
- });
-
- IDataProvider<PullRequest> dataProvider = new IDataProvider<PullRequest>() {
-
- @Override
- public void detach() {
- }
-
- @Override
- public Iterator<? extends PullRequest> iterator(long first, long count) {
- DepotPage page = (DepotPage) getPage();
-
- EntityCriteria<PullRequest> criteria = searchOption.getCriteria(page.getDepot());
- criteria.addOrder(sortOption.getOrder());
- return GitPlex.getInstance(Dao.class).query(criteria, (int)first, (int)count).iterator();
- }
-
- @Override
- public long size() {
- DepotPage page = (DepotPage) getPage();
- return GitPlex.getInstance(Dao.class).count(searchOption.getCriteria(page.getDepot()));
- }
-
- @Override
- public IModel<PullRequest> model(PullRequest object) {
- final Long pullRequestId = object.getId();
- return new LoadableDetachableModel<PullRequest>() {
-
- @Override
- protected PullRequest load() {
- return GitPlex.getInstance(Dao.class).load(PullRequest.class, pullRequestId);
- }
-
- };
- }
-
- };
- DataTable<PullRequest, Void> dataTable = new DataTable<>("pullRequests", columns,
- dataProvider, Constants.DEFAULT_PAGE_SIZE);
- dataTable.addTopToolbar(new NavigationToolbar(dataTable));
- dataTable.addBottomToolbar(new NoRecordsToolbar(dataTable));
- dataTable.addBottomToolbar(new NavigationToolbar(dataTable));
- add(dataTable);
- }
-
- @Override
- public void renderHead(IHeaderResponse response) {
- super.renderHead(response);
-
- response.render(CssHeaderItem.forReference(
- new CssResourceReference(RequestListPage.class, "request-list.css")));
- }
-
- public static PageParameters paramsOf(Depot depot, SearchOption searchOption, SortOption sortOption) {
- PageParameters params = paramsOf(depot);
- searchOption.fillPageParams(params);
- sortOption.fillPageParams(params);
- return params;
- }
-
- @Override
- protected void onSelect(AjaxRequestTarget target, Depot depot) {
- setResponsePage(RequestListPage.class, paramsOf(depot));
- }
-
-}
+package com.pmease.gitplex.web.page.depot.pullrequest.requestlist;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.NavigationToolbar;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.NoRecordsToolbar;
+import org.apache.wicket.markup.head.CssHeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.link.AbstractLink;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.markup.repeater.data.IDataProvider;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.request.resource.CssResourceReference;
+
+import com.pmease.commons.hibernate.dao.Dao;
+import com.pmease.commons.hibernate.dao.EntityCriteria;
+import com.pmease.commons.wicket.component.menu.MenuItem;
+import com.pmease.commons.wicket.component.menu.MenuLink;
+import com.pmease.commons.wicket.editable.BeanContext;
+import com.pmease.gitplex.core.GitPlex;
+import com.pmease.gitplex.core.entity.Account;
+import com.pmease.gitplex.core.entity.Depot;
+import com.pmease.gitplex.core.entity.PullRequest;
+import com.pmease.gitplex.core.manager.AccountManager;
+import com.pmease.gitplex.web.Constants;
+import com.pmease.gitplex.web.component.AccountLink;
+import com.pmease.gitplex.web.component.BranchLink;
+import com.pmease.gitplex.web.component.pullrequest.requestlink.RequestLink;
+import com.pmease.gitplex.web.component.pullrequest.requeststatus.RequestStatusPanel;
+import com.pmease.gitplex.web.page.depot.DepotPage;
+import com.pmease.gitplex.web.page.depot.pullrequest.PullRequestPage;
+import com.pmease.gitplex.web.page.depot.pullrequest.newrequest.NewRequestPage;
+import com.pmease.gitplex.web.page.depot.pullrequest.requestlist.SearchOption.Status;
+import com.pmease.gitplex.web.util.DateUtils;
+
+@SuppressWarnings("serial")
+public class RequestListPage extends PullRequestPage {
+
+ private static final Map<SortOption, String> sortNames = new LinkedHashMap<>();
+
+ static {
+ sortNames.put(new SortOption("submitDate", false), "Newest");
+ sortNames.put(new SortOption("submitDate", true), "Oldest");
+ sortNames.put(new SortOption("lastEventDate", false), "Recently updated");
+ sortNames.put(new SortOption("lastEventDate", true), "Least recently updated");
+ }
+
+ private SearchOption searchOption;
+
+ private SortOption sortOption;
+
+ public RequestListPage(PageParameters params) {
+ super(params);
+
+ searchOption = new SearchOption(params);
+ sortOption = new SortOption(params);
+ }
+
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
+
+ add(new MenuLink("filters") {
+
+ @Override
+ protected List<MenuItem> getMenuItems() {
+ List<MenuItem> menuItems = new ArrayList<>();
+
+ Account currentUser = GitPlex.getInstance(AccountManager.class).getCurrent();
+ if (currentUser != null) {
+ final String userName = currentUser.getName();
+ menuItems.add(new MenuItem() {
+
+ @Override
+ public String getIconClass() {
+ return null;
+ }
+
+ @Override
+ public String getLabel() {
+ return "Open requests assigned to me";
+ }
+
+ @Override
+ public AbstractLink newLink(String id) {
+ return new Link<Void>(id) {
+
+ @Override
+ public void onClick() {
+ searchOption = new SearchOption();
+ searchOption.setStatus(Status.OPEN);
+ searchOption.setAssigneeName(userName);
+
+ setResponsePage(RequestListPage.class, paramsOf(getDepot(), searchOption, sortOption));
+ }
+
+ };
+ }
+
+ });
+ menuItems.add(new MenuItem() {
+
+ @Override
+ public String getIconClass() {
+ return null;
+ }
+
+ @Override
+ public String getLabel() {
+ return "Open requests submitted by me";
+ }
+
+ @Override
+ public AbstractLink newLink(String id) {
+ return new Link<Void>(id) {
+
+ @Override
+ public void onClick() {
+ searchOption = new SearchOption();
+ searchOption.setStatus(Status.OPEN);
+ searchOption.setSubmitterName(userName);
+
+ setResponsePage(RequestListPage.class, paramsOf(getDepot(), searchOption, sortOption));
+ }
+
+ };
+ }
+
+ });
+ }
+ menuItems.add(new MenuItem() {
+
+ @Override
+ public String getIconClass() {
+ return null;
+ }
+
+ @Override
+ public String getLabel() {
+ return "All open requests";
+ }
+
+ @Override
+ public AbstractLink newLink(String id) {
+ return new Link<Void>(id) {
+
+ @Override
+ public void onClick() {
+ searchOption = new SearchOption();
+ searchOption.setStatus(Status.OPEN);
+
+ setResponsePage(RequestListPage.class, paramsOf(getDepot(), searchOption, sortOption));
+ }
+
+ };
+ }
+
+ });
+ menuItems.add(new MenuItem() {
+
+ @Override
+ public String getIconClass() {
+ return null;
+ }
+
+ @Override
+ public String getLabel() {
+ return "All closed requests";
+ }
+
+ @Override
+ public AbstractLink newLink(String id) {
+ return new Link<Void>(id) {
+
+ @Override
+ public void onClick() {
+ searchOption = new SearchOption();
+ searchOption.setStatus(Status.CLOSED);
+
+ setResponsePage(RequestListPage.class, paramsOf(getDepot(), searchOption, sortOption));
+ }
+
+ };
+ }
+
+ });
+ return menuItems;
+ }
+
+ });
+
+ add(new MenuLink("sortBy") {
+
+ @Override
+ protected List<MenuItem> getMenuItems() {
+ List<MenuItem> menuItems = new ArrayList<>();
+
+ for (Map.Entry<SortOption, String> entry: sortNames.entrySet()) {
+ final SortOption sortOption = entry.getKey();
+ final String displayName = entry.getValue();
+ menuItems.add(new MenuItem() {
+
+ @Override
+ public String getLabel() {
+ return displayName;
+ }
+
+ @Override
+ public String getIconClass() {
+ if (RequestListPage.this.sortOption.equals(sortOption))
+ return "fa fa-check";
+ else
+ return null;
+ }
+
+ @Override
+ public AbstractLink newLink(String id) {
+ return new Link<Void>(id) {
+
+ @Override
+ public void onClick() {
+ setResponsePage(RequestListPage.class, paramsOf(getDepot(), searchOption, sortOption));
+ }
+
+ };
+ }
+
+ });
+ }
+
+ return menuItems;
+ }
+
+ });
+
+ add(new Link<Void>("newRequest") {
+
+ @Override
+ public void onClick() {
+ DepotPage page = (DepotPage) getPage();
+ setResponsePage(NewRequestPage.class, NewRequestPage.paramsOf(page.getDepot()));
+ }
+
+ });
+
+ Form<?> form = new Form<Void>("form") {
+
+ @Override
+ protected void onSubmit() {
+ super.onSubmit();
+
+ setResponsePage(RequestListPage.class, paramsOf(getDepot(), searchOption, sortOption));
+ }
+
+ };
+ form.add(BeanContext.editBean("editor", searchOption));
+ add(form);
+
+ List<IColumn<PullRequest, Void>> columns = new ArrayList<>();
+ columns.add(new AbstractColumn<PullRequest, Void>(Model.of("Pull Request")) {
+
+ @Override
+ public void populateItem(Item<ICellPopulator<PullRequest>> cellItem,
+ String componentId, final IModel<PullRequest> rowModel) {
+ PullRequest request = rowModel.getObject();
+ Fragment fragment = new Fragment(componentId, "requestFrag", RequestListPage.this);
+ fragment.add(new Label("number", "#" + request.getNumber()));
+ fragment.add(new RequestLink("title", rowModel));
+ fragment.add(new RequestStatusPanel("status", rowModel, false));
+ fragment.add(new AccountLink("submitter", rowModel.getObject().getSubmitter()));
+ fragment.add(new BranchLink("targetBranch", request.getTarget()));
+ fragment.add(new BranchLink("source", request.getSource()));
+ fragment.add(new Label("age", DateUtils.formatAge(request.getSubmitDate())));
+ fragment.add(new AccountLink("assignee", rowModel.getObject().getSubmitter())
+ .setVisible(request.getAssignee() != null));
+
+ cellItem.add(fragment);
+
+ cellItem.add(AttributeAppender.append("class", "request"));
+ }
+
+ });
+
+ IDataProvider<PullRequest> dataProvider = new IDataProvider<PullRequest>() {
+
+ @Override
+ public void detach() {
+ }
+
+ @Override
+ public Iterator<? extends PullRequest> iterator(long first, long count) {
+ DepotPage page = (DepotPage) getPage();
+
+ EntityCriteria<PullRequest> criteria = searchOption.getCriteria(page.getDepot());
+ criteria.addOrder(sortOption.getOrder());
+ return GitPlex.getInstance(Dao.class).query(criteria, (int)first, (int)count).iterator();
+ }
+
+ @Override
+ public long size() {
+ DepotPage page = (DepotPage) getPage();
+ return GitPlex.getInstance(Dao.class).count(searchOption.getCriteria(page.getDepot()));
+ }
+
+ @Override
+ public IModel<PullRequest> model(PullRequest object) {
+ final Long pullRequestId = object.getId();
+ return new LoadableDetachableModel<PullRequest>() {
+
+ @Override
+ protected PullRequest load() {
+ return GitPlex.getInstance(Dao.class).load(PullRequest.class, pullRequestId);
+ }
+
+ };
+ }
+
+ };
+ DataTable<PullRequest, Void> dataTable = new DataTable<>("pullRequests", columns,
+ dataProvider, Constants.DEFAULT_PAGE_SIZE);
+ dataTable.addTopToolbar(new NavigationToolbar(dataTable));
+ dataTable.addBottomToolbar(new NoRecordsToolbar(dataTable));
+ dataTable.addBottomToolbar(new NavigationToolbar(dataTable));
+ add(dataTable);
+ }
+
+ @Override
+ public void renderHead(IHeaderResponse response) {
+ super.renderHead(response);
+
+ response.render(CssHeaderItem.forReference(
+ new CssResourceReference(RequestListPage.class, "request-list.css")));
+ }
+
+ public static PageParameters paramsOf(Depot depot, SearchOption searchOption, SortOption sortOption) {
+ PageParameters params = paramsOf(depot);
+ searchOption.fillPageParams(params);
+ sortOption.fillPageParams(params);
+ return params;
+ }
+
+ @Override
+ protected void onSelect(AjaxRequestTarget target, Depot depot) {
+ setResponsePage(RequestListPage.class, paramsOf(depot));
+ }
+
+}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestlist/request-list.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestlist/request-list.css
index 7af47209e4..72815e0c31 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestlist/request-list.css
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/pullrequest/requestlist/request-list.css
@@ -1,48 +1,48 @@
-#request-list>.head {
- padding: 12px 20px;
- border-bottom: 1px solid #DDD;
- background: white;
-}
-#request-list>.head>a {
- margin-right: 16px;
-}
-
-#request-list td.filter {
- width: 200px;
- padding: 20px;
- border-right: 1px solid #EEE;
-}
-#request-list td.filter form button.top {
- margin-bottom: 10px;
-}
-#request-list td.filter .select2-container .avatar {
- display: none;
-}
-#request-list td.requests>table td {
- padding: 12px;
-}
-#request-list td.requests>table>thead td {
- border-bottom: 1px solid #DDD;
-}
-#request-list td.requests>table>tfoot td {
- border-top: none;
-}
-#request-list td.requests>table>tbody>tr:FIRST-CHILD>td {
- border-top: none;
-}
-#request-list td.request .first-line {
- font-size: 16px;
- margin-bottom: 4px;
-}
-#request-list td.request .first-line>span.pull-left {
- margin-right: 6px;
-}
-#request-list td.request .title {
- font-weight: bold;
-}
-#request-list td.request .title a {
- color: #444;
-}
-#request-list td.request .id, #request-list td.request .auxiliary {
- color: #888;
-}
+#request-list>.head {
+ padding: 12px 20px;
+ border-bottom: 1px solid #DDD;
+ background: white;
+}
+#request-list>.head>a {
+ margin-right: 16px;
+}
+
+#request-list td.filter {
+ width: 200px;
+ padding: 20px;
+ border-right: 1px solid #EEE;
+}
+#request-list td.filter form button.top {
+ margin-bottom: 10px;
+}
+#request-list td.filter .select2-container .avatar {
+ display: none;
+}
+#request-list td.requests>table td {
+ padding: 12px;
+}
+#request-list td.requests>table>thead td {
+ border-bottom: 1px solid #DDD;
+}
+#request-list td.requests>table>tfoot td {
+ border-top: none;
+}
+#request-list td.requests>table>tbody>tr:FIRST-CHILD>td {
+ border-top: none;
+}
+#request-list td.request .first-line {
+ font-size: 16px;
+ margin-bottom: 4px;
+}
+#request-list td.request .first-line>span.pull-left {
+ margin-right: 6px;
+}
+#request-list td.request .title {
+ font-weight: bold;
+}
+#request-list td.request .title a {
+ color: #444;
+}
+#request-list td.request .number, #request-list td.request .auxiliary {
+ color: #888;
+}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/util/SuggestionUtils.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/util/SuggestionUtils.java
index 46a52d6648..64d70a9c8c 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/util/SuggestionUtils.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/util/SuggestionUtils.java
@@ -21,7 +21,7 @@ import com.pmease.commons.util.match.PatternApplied;
import com.pmease.commons.util.match.WildcardUtils;
import com.pmease.gitplex.core.GitPlex;
import com.pmease.gitplex.core.entity.Depot;
-import com.pmease.gitplex.core.manager.AuxiliaryManager;
+import com.pmease.gitplex.core.manager.CommitInfoManager;
public class SuggestionUtils {
@@ -89,8 +89,8 @@ public class SuggestionUtils {
}
public static List<InputSuggestion> suggestPath(Depot depot, String matchWith, int count) {
- AuxiliaryManager auxiliaryManager = GitPlex.getInstance(AuxiliaryManager.class);
- return suggestPath(auxiliaryManager.getFiles(depot), matchWith, count);
+ CommitInfoManager commitInfoManager = GitPlex.getInstance(CommitInfoManager.class);
+ return suggestPath(commitInfoManager.getFiles(depot), matchWith, count);
}
private static Set<String> getChildren(List<PatternApplied> allApplied, String path) {