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",
|
||||
"settingsNavLink": "Einstellungen",
|
||||
"generalNavLink": "Generell"
|
||||
},
|
||||
"information": {
|
||||
"currentAppVersion": "Aktuelle Software-Versionsnummer"
|
||||
}
|
||||
},
|
||||
"repositoryRole": {
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
"informationNavLink": "Information",
|
||||
"settingsNavLink": "Settings",
|
||||
"generalNavLink": "General"
|
||||
},
|
||||
"information": {
|
||||
"currentAppVersion": "Current Application Version"
|
||||
}
|
||||
},
|
||||
"repositoryRole": {
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
// @flow
|
||||
import React from "react";
|
||||
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 = {
|
||||
loading: boolean,
|
||||
error: Error,
|
||||
|
||||
version: string,
|
||||
|
||||
// context objects
|
||||
t: string => string
|
||||
};
|
||||
|
||||
|
||||
class AdminDetails extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
const { t, loading } = this.props;
|
||||
|
||||
@@ -21,10 +24,18 @@ class AdminDetails extends React.Component<Props> {
|
||||
return <Loading />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>Nothing special.</>
|
||||
);
|
||||
return <>
|
||||
<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:
|
||||
return {
|
||||
...state,
|
||||
version: action.payload.version,
|
||||
links: action.payload._links
|
||||
};
|
||||
default:
|
||||
@@ -107,6 +108,10 @@ export function getLinkCollection(state: Object, name: string): Link[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
export function getAppVersion(state: Object) {
|
||||
return state.indexResources.version;
|
||||
}
|
||||
|
||||
export function getUiPluginsLink(state: Object) {
|
||||
return getLink(state, "uiPlugins");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user