mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 17:56:17 +01:00
cleanup
This commit is contained in:
@@ -38,8 +38,6 @@ const DeleteBranch: FC<Props> = ({ repository, branch }: Props) => {
|
|||||||
const [t] = useTranslation("repos");
|
const [t] = useTranslation("repos");
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
console.log("branchview", repository, branch);
|
|
||||||
|
|
||||||
const deleteBranch = () => {
|
const deleteBranch = () => {
|
||||||
apiClient
|
apiClient
|
||||||
.delete((branch._links.delete as Link).href)
|
.delete((branch._links.delete as Link).href)
|
||||||
@@ -51,27 +49,24 @@ const DeleteBranch: FC<Props> = ({ repository, branch }: Props) => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let confirmAlert = null;
|
const confirmAlert = (
|
||||||
if (showConfirmAlert) {
|
<ConfirmAlert
|
||||||
confirmAlert = (
|
title={t("branch.delete.confirmAlert.title")}
|
||||||
<ConfirmAlert
|
message={t("branch.delete.confirmAlert.message")}
|
||||||
title={t("branch.delete.confirmAlert.title")}
|
buttons={[
|
||||||
message={t("branch.delete.confirmAlert.message")}
|
{
|
||||||
buttons={[
|
className: "is-outlined",
|
||||||
{
|
label: t("branch.delete.confirmAlert.submit"),
|
||||||
className: "is-outlined",
|
onClick: () => deleteBranch()
|
||||||
label: t("branch.delete.confirmAlert.submit"),
|
},
|
||||||
onClick: () => deleteBranch()
|
{
|
||||||
},
|
label: t("branch.delete.confirmAlert.cancel"),
|
||||||
{
|
onClick: () => null
|
||||||
label: t("branch.delete.confirmAlert.cancel"),
|
}
|
||||||
onClick: () => null
|
]}
|
||||||
}
|
close={() => setShowConfirmAlert(false)}
|
||||||
]}
|
/>
|
||||||
close={() => setShowConfirmAlert(false)}
|
);
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import de.otto.edison.hal.HalRepresentation;
|
|||||||
import de.otto.edison.hal.Link;
|
import de.otto.edison.hal.Link;
|
||||||
import de.otto.edison.hal.Links;
|
import de.otto.edison.hal.Links;
|
||||||
import sonia.scm.repository.Branch;
|
import sonia.scm.repository.Branch;
|
||||||
import sonia.scm.repository.NamespaceAndName;
|
|
||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
import sonia.scm.repository.RepositoryPermissions;
|
import sonia.scm.repository.RepositoryPermissions;
|
||||||
|
|
||||||
|
|||||||
@@ -24,15 +24,14 @@
|
|||||||
|
|
||||||
package sonia.scm.api.v2.resources;
|
package sonia.scm.api.v2.resources;
|
||||||
|
|
||||||
import sonia.scm.repository.NamespaceAndName;
|
|
||||||
import sonia.scm.repository.Repository;
|
|
||||||
import sonia.scm.security.gpg.UserPublicKeyResource;
|
import sonia.scm.security.gpg.UserPublicKeyResource;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
@SuppressWarnings("squid:S1192") // string literals should not be duplicated
|
@SuppressWarnings("squid:S1192")
|
||||||
|
// string literals should not be duplicated
|
||||||
class ResourceLinks {
|
class ResourceLinks {
|
||||||
|
|
||||||
private final ScmPathInfoStore scmPathInfoStore;
|
private final ScmPathInfoStore scmPathInfoStore;
|
||||||
@@ -274,13 +273,13 @@ class ResourceLinks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AutoCompleteLinks autoComplete() {
|
AutoCompleteLinks autoComplete() {
|
||||||
return new AutoCompleteLinks (scmPathInfoStore.get());
|
return new AutoCompleteLinks(scmPathInfoStore.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
static class AutoCompleteLinks {
|
static class AutoCompleteLinks {
|
||||||
private final LinkBuilder linkBuilder;
|
private final LinkBuilder linkBuilder;
|
||||||
|
|
||||||
AutoCompleteLinks (ScmPathInfo pathInfo) {
|
AutoCompleteLinks(ScmPathInfo pathInfo) {
|
||||||
linkBuilder = new LinkBuilder(pathInfo, AutoCompleteResource.class);
|
linkBuilder = new LinkBuilder(pathInfo, AutoCompleteResource.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,11 +514,11 @@ class ResourceLinks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String changesets(String namespace, String name) {
|
public String changesets(String namespace, String name) {
|
||||||
return toTemplateParams(incomingLinkBuilder.method("getRepositoryResource").parameters(namespace, name).method("incoming").parameters().method("incomingChangesets").parameters("source","target").href());
|
return toTemplateParams(incomingLinkBuilder.method("getRepositoryResource").parameters(namespace, name).method("incoming").parameters().method("incomingChangesets").parameters("source", "target").href());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String changesets(String namespace, String name, String source, String target) {
|
public String changesets(String namespace, String name, String source, String target) {
|
||||||
return incomingLinkBuilder.method("getRepositoryResource").parameters(namespace, name).method("incoming").parameters().method("incomingChangesets").parameters(source,target).href();
|
return incomingLinkBuilder.method("getRepositoryResource").parameters(namespace, name).method("incoming").parameters().method("incomingChangesets").parameters(source, target).href();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String diff(String namespace, String name) {
|
public String diff(String namespace, String name) {
|
||||||
@@ -596,6 +595,7 @@ class ResourceLinks {
|
|||||||
ModificationsLinks(ScmPathInfo pathInfo) {
|
ModificationsLinks(ScmPathInfo pathInfo) {
|
||||||
modificationsLinkBuilder = new LinkBuilder(pathInfo, RepositoryRootResource.class, RepositoryResource.class, ModificationsRootResource.class);
|
modificationsLinkBuilder = new LinkBuilder(pathInfo, RepositoryRootResource.class, RepositoryResource.class, ModificationsRootResource.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
String self(String namespace, String name, String revision) {
|
String self(String namespace, String name, String revision) {
|
||||||
return modificationsLinkBuilder.method("getRepositoryResource").parameters(namespace, name).method("modifications").parameters().method("get").parameters(revision).href();
|
return modificationsLinkBuilder.method("getRepositoryResource").parameters(namespace, name).method("modifications").parameters().method("get").parameters(revision).href();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user