mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
add current version to admin-information
This commit is contained in:
@@ -5,6 +5,9 @@
|
|||||||
"informationNavLink": "Informationen",
|
"informationNavLink": "Informationen",
|
||||||
"settingsNavLink": "Einstellungen",
|
"settingsNavLink": "Einstellungen",
|
||||||
"generalNavLink": "Generell"
|
"generalNavLink": "Generell"
|
||||||
|
},
|
||||||
|
"information": {
|
||||||
|
"currentAppVersion": "Aktuelle Software-Versionsnummer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"repositoryRole": {
|
"repositoryRole": {
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
"informationNavLink": "Information",
|
"informationNavLink": "Information",
|
||||||
"settingsNavLink": "Settings",
|
"settingsNavLink": "Settings",
|
||||||
"generalNavLink": "General"
|
"generalNavLink": "General"
|
||||||
|
},
|
||||||
|
"information": {
|
||||||
|
"currentAppVersion": "Current Application Version"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"repositoryRole": {
|
"repositoryRole": {
|
||||||
|
|||||||
@@ -1,19 +1,22 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { translate } from "react-i18next";
|
import { translate } from "react-i18next";
|
||||||
import { Title, Loading, ErrorNotification } from "@scm-manager/ui-components";
|
import {Loading, Subtitle} from "@scm-manager/ui-components";
|
||||||
|
import {getAppVersion} from "../../modules/indexResource";
|
||||||
|
import {connect} from "react-redux";
|
||||||
|
import Title from "@scm-manager/ui-components/src/layout/Title";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
loading: boolean,
|
loading: boolean,
|
||||||
error: Error,
|
error: Error,
|
||||||
|
|
||||||
|
version: string,
|
||||||
|
|
||||||
// context objects
|
// context objects
|
||||||
t: string => string
|
t: string => string
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AdminDetails extends React.Component<Props> {
|
class AdminDetails extends React.Component<Props> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { t, loading } = this.props;
|
const { t, loading } = this.props;
|
||||||
|
|
||||||
@@ -21,10 +24,18 @@ class AdminDetails extends React.Component<Props> {
|
|||||||
return <Loading />;
|
return <Loading />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return <>
|
||||||
<>Nothing special.</>
|
<Title title={t("admin.information.currentAppVersion")}/>
|
||||||
);
|
<Subtitle subtitle={this.props.version}/>
|
||||||
|
</>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default translate("admin")(AdminDetails);
|
const mapStateToProps = (state: any) => {
|
||||||
|
const version = getAppVersion(state);
|
||||||
|
return {
|
||||||
|
version
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(mapStateToProps)(translate("admin")(AdminDetails));
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ export default function reducer(
|
|||||||
case FETCH_INDEXRESOURCES_SUCCESS:
|
case FETCH_INDEXRESOURCES_SUCCESS:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
version: action.payload.version,
|
||||||
links: action.payload._links
|
links: action.payload._links
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
@@ -107,6 +108,10 @@ export function getLinkCollection(state: Object, name: string): Link[] {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getAppVersion(state: Object) {
|
||||||
|
return state.indexResources.version;
|
||||||
|
}
|
||||||
|
|
||||||
export function getUiPluginsLink(state: Object) {
|
export function getUiPluginsLink(state: Object) {
|
||||||
return getLink(state, "uiPlugins");
|
return getLink(state, "uiPlugins");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user