mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-06 23:52:12 +01:00
clarified langs, added repo settings menu, changed git config binding, fixed small css issue with div in navi
This commit is contained in:
@@ -28,7 +28,7 @@ binder.bind(
|
||||
binder.bind("repos.repository-avatar", GitAvatar, gitPredicate);
|
||||
|
||||
cfgBinder.bindRepository(
|
||||
"/configuration",
|
||||
"/settings/configuration",
|
||||
"scm-git-plugin.repo-config.link",
|
||||
"configuration",
|
||||
RepositoryConfig
|
||||
|
||||
@@ -17,11 +17,15 @@
|
||||
"create-button": "Create"
|
||||
},
|
||||
"repository-root": {
|
||||
"navigationLabel": "Repository Navigation",
|
||||
"historyNavLink": "Commits",
|
||||
"informationNavLink": "Information",
|
||||
"permissionsNavLink": "Permissions",
|
||||
"sourcesNavLink": "Sources",
|
||||
"menu": {
|
||||
"navigationLabel": "Repository Navigation",
|
||||
"informationNavLink": "Information",
|
||||
"historyNavLink": "Commits",
|
||||
"sourcesNavLink": "Sources",
|
||||
"settingsNavLink": "Settings",
|
||||
"editNavLink": "General",
|
||||
"permissionsNavLink": "Permissions"
|
||||
},
|
||||
"errorTitle": "Error",
|
||||
"errorSubtitle": "Unknown repository error"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { NavAction, confirmAlert } from "@scm-manager/ui-components";
|
||||
import { Subtitle, DeleteButton, confirmAlert } from "@scm-manager/ui-components";
|
||||
import type { Repository } from "@scm-manager/ui-types";
|
||||
|
||||
type Props = {
|
||||
@@ -25,15 +25,15 @@ class DeleteNavAction extends React.Component<Props> {
|
||||
confirmDelete = () => {
|
||||
const { t } = this.props;
|
||||
confirmAlert({
|
||||
title: t("delete-nav-action.confirm-alert.title"),
|
||||
message: t("delete-nav-action.confirm-alert.message"),
|
||||
title: t("repository.delete.confirm-alert.title"),
|
||||
message: t("repository.delete.confirm-alert.message"),
|
||||
buttons: [
|
||||
{
|
||||
label: t("delete-nav-action.confirm-alert.submit"),
|
||||
label: t("repository.delete.confirm-alert.submit"),
|
||||
onClick: () => this.delete()
|
||||
},
|
||||
{
|
||||
label: t("delete-nav-action.confirm-alert.cancel"),
|
||||
label: t("repository.delete.confirm-alert.cancel"),
|
||||
onClick: () => null
|
||||
}
|
||||
]
|
||||
@@ -51,7 +51,20 @@ class DeleteNavAction extends React.Component<Props> {
|
||||
if (!this.isDeletable()) {
|
||||
return null;
|
||||
}
|
||||
return <NavAction label={t("delete-nav-action.label")} action={action} />;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Subtitle subtitle={t("repository.delete.subtitle")} />
|
||||
<div className="columns">
|
||||
<div className="column">
|
||||
<DeleteButton
|
||||
label={t("repository.delete.button")}
|
||||
action={action}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class EditNavLink extends React.Component<Props> {
|
||||
return null;
|
||||
}
|
||||
const { editUrl, t } = this.props;
|
||||
return <NavLink to={editUrl} label={t("edit-nav-link.label")} />;
|
||||
return <NavLink to={editUrl} label={t("repository-root.menu.editNavLink")} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class PermissionsNavLink extends React.Component<Props> {
|
||||
}
|
||||
const { permissionUrl, t } = this.props;
|
||||
return (
|
||||
<NavLink to={permissionUrl} label={t("repository-root.permissionsNavLink")} />
|
||||
<NavLink to={permissionUrl} label={t("repository-root.menu.permissionsNavLink")} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,6 @@ describe("PermissionsNavLink", () => {
|
||||
<PermissionsNavLink repository={repository} permissionUrl="" />,
|
||||
options.get()
|
||||
);
|
||||
expect(navLink.text()).toBe("repository-root.permissions");
|
||||
expect(navLink.text()).toBe("repository-root.menu.permissions");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import {
|
||||
Subtitle,
|
||||
InputField,
|
||||
Select,
|
||||
SubmitButton,
|
||||
@@ -82,29 +83,32 @@ class RepositoryForm extends React.Component<Props, State> {
|
||||
const repository = this.state.repository;
|
||||
|
||||
return (
|
||||
<form onSubmit={this.submit}>
|
||||
{this.renderCreateOnlyFields()}
|
||||
<InputField
|
||||
label={t("repository.contact")}
|
||||
onChange={this.handleContactChange}
|
||||
value={repository ? repository.contact : ""}
|
||||
validationError={this.state.contactValidationError}
|
||||
errorMessage={t("validation.contact-invalid")}
|
||||
helpText={t("help.contactHelpText")}
|
||||
/>
|
||||
<>
|
||||
<Subtitle subtitle={t("repository.edit.subtitle")} />
|
||||
<form onSubmit={this.submit}>
|
||||
{this.renderCreateOnlyFields()}
|
||||
<InputField
|
||||
label={t("repository.contact")}
|
||||
onChange={this.handleContactChange}
|
||||
value={repository ? repository.contact : ""}
|
||||
validationError={this.state.contactValidationError}
|
||||
errorMessage={t("validation.contact-invalid")}
|
||||
helpText={t("help.contactHelpText")}
|
||||
/>
|
||||
|
||||
<Textarea
|
||||
label={t("repository.description")}
|
||||
onChange={this.handleDescriptionChange}
|
||||
value={repository ? repository.description : ""}
|
||||
helpText={t("help.descriptionHelpText")}
|
||||
/>
|
||||
<SubmitButton
|
||||
disabled={!this.isValid()}
|
||||
loading={loading}
|
||||
label={t("repository-form.submit")}
|
||||
/>
|
||||
</form>
|
||||
<Textarea
|
||||
label={t("repository.description")}
|
||||
onChange={this.handleDescriptionChange}
|
||||
value={repository ? repository.description : ""}
|
||||
helpText={t("help.descriptionHelpText")}
|
||||
/>
|
||||
<SubmitButton
|
||||
disabled={!this.isValid()}
|
||||
loading={loading}
|
||||
label={t("repository-form.submit")}
|
||||
/>
|
||||
</form>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ class Edit extends React.Component<Props> {
|
||||
this.props.modifyRepo(repo, this.repoModified);
|
||||
}}
|
||||
/>
|
||||
<hr />
|
||||
<p>TODO: DeleteRepo hier einbinden. Aktuell heißt es noch DeleteNavAction</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {connect} from "react-redux";
|
||||
import {Route, Switch} from "react-router-dom";
|
||||
import type {Repository} from "@scm-manager/ui-types";
|
||||
|
||||
import {ErrorPage, Loading, Navigation, NavLink, Page, Section} from "@scm-manager/ui-components";
|
||||
import {ErrorPage, Loading, Navigation, SubNavigation, NavLink, Page, Section} from "@scm-manager/ui-components";
|
||||
import {translate} from "react-i18next";
|
||||
import RepositoryDetails from "../components/RepositoryDetails";
|
||||
import DeleteNavAction from "../components/DeleteNavAction";
|
||||
@@ -109,11 +109,11 @@ class RepositoryRoot extends React.Component<Props> {
|
||||
component={() => <RepositoryDetails repository={repository} />}
|
||||
/>
|
||||
<Route
|
||||
path={`${url}/edit`}
|
||||
path={`${url}/settings/general`}
|
||||
component={() => <Edit repository={repository} />}
|
||||
/>
|
||||
<Route
|
||||
path={`${url}/permissions`}
|
||||
path={`${url}/settings/permissions`}
|
||||
render={() => (
|
||||
<Permissions
|
||||
namespace={this.props.repository.namespace}
|
||||
@@ -168,13 +168,13 @@ class RepositoryRoot extends React.Component<Props> {
|
||||
</div>
|
||||
<div className="column">
|
||||
<Navigation>
|
||||
<Section label={t("repository-root.navigationLabel")}>
|
||||
<NavLink to={url} label={t("repository-root.informationNavLink")} />
|
||||
<Section label={t("repository-root.menu.navigationLabel")}>
|
||||
<NavLink to={url} label={t("repository-root.menu.informationNavLink")} />
|
||||
<RepositoryNavLink
|
||||
repository={repository}
|
||||
linkName="changesets"
|
||||
to={`${url}/changesets/`}
|
||||
label={t("repository-root.historyNavLink")}
|
||||
label={t("repository-root.menu.historyNavLink")}
|
||||
activeWhenMatch={this.matches}
|
||||
activeOnlyWhenExact={false}
|
||||
/>
|
||||
@@ -182,18 +182,24 @@ class RepositoryRoot extends React.Component<Props> {
|
||||
repository={repository}
|
||||
linkName="sources"
|
||||
to={`${url}/sources`}
|
||||
label={t("repository-root.sourcesNavLink")}
|
||||
label={t("repository-root.menu.sourcesNavLink")}
|
||||
activeOnlyWhenExact={false}
|
||||
/>
|
||||
<PermissionsNavLink
|
||||
permissionUrl={`${url}/permissions`}
|
||||
repository={repository}
|
||||
/>
|
||||
<ExtensionPoint
|
||||
name="repository.navigation"
|
||||
props={extensionProps}
|
||||
renderAll={true}
|
||||
/>
|
||||
<SubNavigation
|
||||
to={`${url}/settings/general`}
|
||||
label={t("repository-root.menu.settingsNavLink")}
|
||||
>
|
||||
<EditNavLink repository={repository} editUrl={`${url}/settings/general`} />
|
||||
<PermissionsNavLink
|
||||
permissionUrl={`${url}/settings/permissions`}
|
||||
repository={repository}
|
||||
/>
|
||||
<ExtensionPoint
|
||||
name="repository.navigation"
|
||||
props={extensionProps}
|
||||
renderAll={true}
|
||||
/>
|
||||
</SubNavigation>
|
||||
</Section>
|
||||
</Navigation>
|
||||
</div>
|
||||
|
||||
@@ -2,15 +2,20 @@
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import type { User } from "@scm-manager/ui-types";
|
||||
import { DeleteButton, confirmAlert } from "@scm-manager/ui-components";
|
||||
import {connect} from "react-redux";
|
||||
import {
|
||||
deleteUser, fetchUserByName,
|
||||
Subtitle,
|
||||
DeleteButton,
|
||||
confirmAlert
|
||||
} from "@scm-manager/ui-components";
|
||||
import { connect } from "react-redux";
|
||||
import {
|
||||
deleteUser,
|
||||
fetchUserByName,
|
||||
getDeleteUserFailure,
|
||||
getUserByName,
|
||||
isDeleteUserPending,
|
||||
isDeleteUserPending
|
||||
} from "../modules/users";
|
||||
import type {History} from "history";
|
||||
import type { History } from "history";
|
||||
|
||||
type Props = {
|
||||
user: User,
|
||||
@@ -71,7 +76,19 @@ class DeleteUser extends React.Component<Props> {
|
||||
if (!this.isDeletable()) {
|
||||
return null;
|
||||
}
|
||||
return <DeleteButton label={t("single-user.delete.button")} action={action} />;
|
||||
return (
|
||||
<>
|
||||
<Subtitle subtitle={t("single-user.delete.subtitle")} />
|
||||
<div className="columns">
|
||||
<div className="column">
|
||||
<DeleteButton
|
||||
label={t("single-user.delete.button")}
|
||||
action={action}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
validation as validator
|
||||
} from "@scm-manager/ui-components";
|
||||
import * as userValidator from "./userValidation";
|
||||
import DeleteUser from "./DeleteUser";
|
||||
|
||||
type Props = {
|
||||
submitForm: User => void,
|
||||
@@ -159,13 +158,6 @@ class UserForm extends React.Component<Props, State> {
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<hr />
|
||||
<Subtitle subtitle={t("single-user.delete.subtitle")} />
|
||||
<div className="columns">
|
||||
<div className="column">
|
||||
<DeleteUser user={user} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { withRouter } from "react-router-dom";
|
||||
import UserForm from "./../components/UserForm";
|
||||
import DeleteUser from "./../components/DeleteUser";
|
||||
import type { User } from "@scm-manager/ui-types";
|
||||
import {
|
||||
modifyUser,
|
||||
@@ -49,6 +50,8 @@ class EditUser extends React.Component<Props> {
|
||||
user={user}
|
||||
loading={loading}
|
||||
/>
|
||||
<hr />
|
||||
<DeleteUser user={user} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,10 +21,7 @@ import {
|
||||
isFetchUserPending,
|
||||
getFetchUserFailure
|
||||
} from "../modules/users";
|
||||
import {
|
||||
EditUserNavLink,
|
||||
SetPasswordNavLink
|
||||
} from "./../components/navLinks";
|
||||
import { EditUserNavLink, SetPasswordNavLink } from "./../components/navLinks";
|
||||
import { translate } from "react-i18next";
|
||||
import { getUsersLink } from "../../modules/indexResource";
|
||||
import SetUserPassword from "../components/SetUserPassword";
|
||||
@@ -105,7 +102,10 @@ class SingleUser extends React.Component<Props> {
|
||||
to={`${url}/settings/general`}
|
||||
label={t("single-user.menu.settingsNavLink")}
|
||||
>
|
||||
<EditUserNavLink user={user} editUrl={`${url}/settings/general`} />
|
||||
<EditUserNavLink
|
||||
user={user}
|
||||
editUrl={`${url}/settings/general`}
|
||||
/>
|
||||
<SetPasswordNavLink
|
||||
user={user}
|
||||
passwordUrl={`${url}/settings/password`}
|
||||
|
||||
@@ -297,4 +297,7 @@ $fa-font-path: "webfonts";
|
||||
li:last-child {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
div {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user