mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
moved config components in admin dir
This commit is contained in:
@@ -99,7 +99,7 @@ class ConfigForm extends React.Component<Props, State> {
|
||||
return (
|
||||
<Notification
|
||||
type={"danger"}
|
||||
children={t("config-form.no-read-permission-notification")}
|
||||
children={t("config.form.no-read-permission-notification")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -108,7 +108,7 @@ class ConfigForm extends React.Component<Props, State> {
|
||||
noPermissionNotification = (
|
||||
<Notification
|
||||
type={"info"}
|
||||
children={t("config-form.no-write-permission-notification")}
|
||||
children={t("config.form.no-write-permission-notification")}
|
||||
onClose={() => this.onClose()}
|
||||
/>
|
||||
);
|
||||
@@ -167,7 +167,7 @@ class ConfigForm extends React.Component<Props, State> {
|
||||
<hr />
|
||||
<SubmitButton
|
||||
loading={loading}
|
||||
label={t("config-form.submit")}
|
||||
label={t("config.form.submit")}
|
||||
disabled={
|
||||
!configUpdatePermission || this.hasError() || !this.state.changed
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
// @flow
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import {Redirect, Route, Switch} from "react-router-dom";
|
||||
import { ExtensionPoint } from "@scm-manager/ui-extensions";
|
||||
import type { History } from "history";
|
||||
import { connect } from "react-redux";
|
||||
import { compose } from "redux";
|
||||
import type { Links } from "@scm-manager/ui-types";
|
||||
import { Page, Navigation, NavLink, Section } from "@scm-manager/ui-components";
|
||||
import { Page, Navigation, NavLink, Section, SubNavigation } from "@scm-manager/ui-components";
|
||||
import { getLinks } from "../../modules/indexResource";
|
||||
import AdminDetails from "./AdminDetails";
|
||||
import GlobalConfig from "./GlobalConfig";
|
||||
import RepositoryRoles from "../roles/containers/RepositoryRoles";
|
||||
import SingleRepositoryRole from "../roles/containers/SingleRepositoryRole";
|
||||
@@ -23,7 +24,7 @@ type Props = {
|
||||
history: History
|
||||
};
|
||||
|
||||
class Config extends React.Component<Props> {
|
||||
class Admin extends React.Component<Props> {
|
||||
stripEndingSlash = (url: string) => {
|
||||
if (url.endsWith("/")) {
|
||||
return url.substring(0, url.length - 2);
|
||||
@@ -55,7 +56,9 @@ class Config extends React.Component<Props> {
|
||||
<div className="columns">
|
||||
<div className="column is-three-quarters">
|
||||
<Switch>
|
||||
<Route path={url} exact component={GlobalConfig} />
|
||||
<Redirect exact from={url} to={`${url}/info`} />
|
||||
<Route path={`${url}/info`} exact component={AdminDetails} />
|
||||
<Route path={`${url}/settings/general`} exact component={GlobalConfig} />
|
||||
<Route
|
||||
path={`${url}/role/:role`}
|
||||
render={() => (
|
||||
@@ -86,7 +89,7 @@ class Config extends React.Component<Props> {
|
||||
)}
|
||||
/>
|
||||
<ExtensionPoint
|
||||
name="config.route"
|
||||
name="admin.route"
|
||||
props={extensionProps}
|
||||
renderAll={true}
|
||||
/>
|
||||
@@ -94,22 +97,38 @@ class Config extends React.Component<Props> {
|
||||
</div>
|
||||
<div className="column is-one-quarter">
|
||||
<Navigation>
|
||||
<Section label={t("config.navigationLabel")}>
|
||||
<Section label={t("admin.menu.navigationLabel")}>
|
||||
<NavLink
|
||||
to={`${url}`}
|
||||
label={t("config.globalConfigurationNavLink")}
|
||||
to={`${url}/info`}
|
||||
icon="fas fa-info-circle"
|
||||
label={t("admin.menu.informationNavLink")}
|
||||
/>
|
||||
<NavLink
|
||||
to={`${url}/roles/`}
|
||||
icon="fas fa-user-shield"
|
||||
label={t("repositoryRole.navLink")}
|
||||
activeWhenMatch={this.matchesRoles}
|
||||
activeOnlyWhenExact={false}
|
||||
/>
|
||||
<ExtensionPoint
|
||||
name="config.navigation"
|
||||
name="admin.navigation"
|
||||
props={extensionProps}
|
||||
renderAll={true}
|
||||
/>
|
||||
<SubNavigation
|
||||
to={`${url}/settings/general`}
|
||||
label={t("admin.menu.settingsNavLink")}
|
||||
>
|
||||
<NavLink
|
||||
to={`${url}/settings/general`}
|
||||
label={t("admin.menu.generalNavLink")}
|
||||
/>
|
||||
<ExtensionPoint
|
||||
name="admin.setting"
|
||||
props={extensionProps}
|
||||
renderAll={true}
|
||||
/>
|
||||
</SubNavigation>
|
||||
</Section>
|
||||
</Navigation>
|
||||
</div>
|
||||
@@ -128,5 +147,5 @@ const mapStateToProps = (state: any) => {
|
||||
|
||||
export default compose(
|
||||
connect(mapStateToProps),
|
||||
translate("config")
|
||||
)(Config);
|
||||
translate("admin")
|
||||
)(Admin);
|
||||
30
scm-ui/src/admin/containers/AdminDetails.js
Normal file
30
scm-ui/src/admin/containers/AdminDetails.js
Normal file
@@ -0,0 +1,30 @@
|
||||
// @flow
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { Title, Loading, ErrorNotification } from "@scm-manager/ui-components";
|
||||
|
||||
type Props = {
|
||||
loading: boolean,
|
||||
error: Error,
|
||||
|
||||
// context objects
|
||||
t: string => string
|
||||
};
|
||||
|
||||
|
||||
class AdminDetails extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
const { t, loading } = this.props;
|
||||
|
||||
if (loading) {
|
||||
return <Loading />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>Nothing special.</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("admin")(AdminDetails);
|
||||
@@ -80,7 +80,7 @@ class GlobalConfig extends React.Component<Props, State> {
|
||||
className="delete"
|
||||
onClick={() => this.setState({ configChanged: false })}
|
||||
/>
|
||||
{this.props.t("config-form.submit-success-notification")}
|
||||
{this.props.t("config.form.submit-success-notification")}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
// @flow
|
||||
|
||||
import * as types from "../../modules/types";
|
||||
import type { Action, NamespaceStrategies } from "@scm-manager/ui-types";
|
||||
import { apiClient } from "@scm-manager/ui-components";
|
||||
@@ -47,4 +47,4 @@ class PermissionRoleDetails extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("config")(PermissionRoleDetails);
|
||||
export default translate("admin")(PermissionRoleDetails);
|
||||
@@ -35,4 +35,4 @@ class PermissionRoleDetailsTable extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("config")(PermissionRoleDetailsTable);
|
||||
export default translate("admin")(PermissionRoleDetailsTable);
|
||||
@@ -34,4 +34,4 @@ class PermissionRoleTable extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("config")(PermissionRoleTable);
|
||||
export default translate("admin")(PermissionRoleTable);
|
||||
@@ -34,4 +34,4 @@ class SystemRoleTag extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default injectSheet(styles)(translate("config")(SystemRoleTag));
|
||||
export default injectSheet(styles)(translate("admin")(SystemRoleTag));
|
||||
@@ -85,4 +85,4 @@ const mapDispatchToProps = dispatch => {
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(translate("config")(CreateRepositoryRole));
|
||||
)(translate("admin")(CreateRepositoryRole));
|
||||
@@ -45,15 +45,15 @@ class DeleteRepositoryRole extends React.Component<Props> {
|
||||
confirmDelete = () => {
|
||||
const { t } = this.props;
|
||||
confirmAlert({
|
||||
title: t("deleteRole.confirmAlert.title"),
|
||||
message: t("deleteRole.confirmAlert.message"),
|
||||
title: t("repositoryRole.delete.confirmAlert.title"),
|
||||
message: t("repositoryRole.delete.confirmAlert.message"),
|
||||
buttons: [
|
||||
{
|
||||
label: t("deleteRole.confirmAlert.submit"),
|
||||
label: t("repositoryRole.delete.confirmAlert.submit"),
|
||||
onClick: () => this.deleteRole()
|
||||
},
|
||||
{
|
||||
label: t("deleteRole.confirmAlert.cancel"),
|
||||
label: t("repositoryRole.delete.confirmAlert.cancel"),
|
||||
onClick: () => null
|
||||
}
|
||||
]
|
||||
@@ -74,12 +74,12 @@ class DeleteRepositoryRole extends React.Component<Props> {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Subtitle subtitle={t("deleteRole.subtitle")} />
|
||||
<Subtitle subtitle={t("repositoryRole.delete.subtitle")} />
|
||||
<div className="columns">
|
||||
<div className="column">
|
||||
<ErrorNotification error={error} />
|
||||
<DeleteButton
|
||||
label={t("deleteRole.button")}
|
||||
label={t("repositoryRole.delete.button")}
|
||||
action={action}
|
||||
loading={loading}
|
||||
/>
|
||||
@@ -110,4 +110,4 @@ const mapDispatchToProps = dispatch => {
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(withRouter(translate("config")(DeleteRepositoryRole)));
|
||||
)(withRouter(translate("admin")(DeleteRepositoryRole)));
|
||||
@@ -78,4 +78,4 @@ const mapDispatchToProps = dispatch => {
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(translate("config")(EditRepositoryRole));
|
||||
)(translate("admin")(EditRepositoryRole));
|
||||
@@ -169,4 +169,4 @@ const mapDispatchToProps = dispatch => {
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(translate("config")(RepositoryRoleForm));
|
||||
)(translate("admin")(RepositoryRoleForm));
|
||||
@@ -151,5 +151,5 @@ export default withRouter(
|
||||
connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(translate("config")(RepositoryRoles))
|
||||
)(translate("admin")(RepositoryRoles))
|
||||
);
|
||||
@@ -129,5 +129,5 @@ export default withRouter(
|
||||
connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(translate("config")(SingleRepositoryRole))
|
||||
)(translate("admin")(SingleRepositoryRole))
|
||||
);
|
||||
Reference in New Issue
Block a user