Skip to content

Commit

Permalink
AF-1113: quick (and dirty) fix for a long issue introduced by the new…
Browse files Browse the repository at this point in the history
… UX of workbench: display the git external access url's.

this initial implementation aims to be a quick hack, enabling this long time request available for upcoming release.
It's expected to improve the UI visulation, bringing something like GitHub has.
  • Loading branch information
porcelli committed Mar 26, 2018
1 parent f612867 commit 04d26b6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public Promise<Void> setup(final ProjectScreenModel model) {
view.setGroupId(pom.getGav().getGroupId());
view.setArtifactId(pom.getGav().getArtifactId());
view.setVersion(pom.getGav().getVersion());
view.setURL(pom.getUrl() != null ? pom.getUrl() : "");
view.setURL(model.getGitUrl());

return promises.create((resolve, reject) -> {
gavPreferences.load(projectScopedResolutionStrategySupplier.get(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h3 data-i18n-key="GeneralSettings" data-field="title"></h3>
</div>
<div class="form-group">
<label for="url" data-i18n-key="URL"></label>
<input type="text" class="form-control" id="url">
<input type="text" class="form-control" id="url" readonly>
</div>
<div class="checkbox">
<label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class ProjectScreenModel {

private POM pom;
private KModuleModel KModule;
private String gitUrl;
private ProjectImports projectImports;
private ModuleRepositories repositories;
private WhiteList whiteList;
Expand Down Expand Up @@ -59,6 +60,14 @@ public void setKModule(final KModuleModel KModule) {
this.KModule = KModule;
}

public String getGitUrl() {
return gitUrl;
}

public void setGitUrl(String gitUrl) {
this.gitUrl = gitUrl;
}

public ProjectImports getProjectImports() {
return projectImports;
}
Expand Down Expand Up @@ -186,6 +195,9 @@ public boolean equals(Object o) {
if (KModule != null ? !KModule.equals(that.KModule) : that.KModule != null) {
return false;
}
if (gitUrl != null ? !gitUrl.equals(that.gitUrl) : that.gitUrl != null) {
return false;
}
if (pathToKModule != null ? !pathToKModule.equals(that.pathToKModule) : that.pathToKModule != null) {
return false;
}
Expand Down Expand Up @@ -232,6 +244,8 @@ public int hashCode() {
result = ~~result;
result = 31 * result + (KModule != null ? KModule.hashCode() : 0);
result = ~~result;
result = 31 * result + (gitUrl != null ? gitUrl.hashCode() : 0);
result = ~~result;
result = 31 * result + (pathToKModule != null ? pathToKModule.hashCode() : 0);
result = ~~result;
result = 31 * result + (KModuleMetaData != null ? KModuleMetaData.hashCode() : 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public ProjectScreenModel load() {

loadPOM();
loadKModule();
loadGitURL();
loadImports();
loadWhiteList();
loadRepositories();
Expand All @@ -103,6 +104,17 @@ private void loadKModule() {
model.setPathToKModule(project.getKModuleXMLPath());
}

private void loadGitURL() {
String value = "";
try {
value = Paths.convert(project.getRootPath()).getFileSystem().toString();
} catch (final Exception ignore) {
//this is basically for tests that don't use git file system
}

model.setGitUrl(value.replace("\n", " | "));
}

private void loadImports() {
model.setProjectImports(importsService.load(project.getImportsPath()));
model.setProjectImportsMetaData(getMetadata(project.getImportsPath()));
Expand Down

0 comments on commit 04d26b6

Please sign in to comment.