Merge with 2.0.0-m3

This commit is contained in:
René Pfeuffer
2019-01-21 15:09:23 +01:00
27 changed files with 824 additions and 386 deletions

View File

@@ -1,53 +1,63 @@
// @flow
import React from "react";
import type { Me } from "@scm-manager/ui-types";
import { MailLink, AvatarWrapper, AvatarImage } from "@scm-manager/ui-components";
import { compose } from "redux";
import { translate } from "react-i18next";
type Props = {
me: Me,
// Context props
t: string => string
};
type State = {};
class ProfileInfo extends React.Component<Props, State> {
render() {
const { me, t } = this.props;
return (
<div className="media">
<AvatarWrapper>
<figure className="media-left">
<p className="image is-64x64">
<AvatarImage person={ me }/>
</p>
</figure>
</AvatarWrapper>
<div className="media-content">
<table className="table">
<tbody>
<tr>
<td className="has-text-weight-semibold">{t("profile.username")}</td>
<td>{me.name}</td>
</tr>
<tr>
<td className="has-text-weight-semibold">{t("profile.displayName")}</td>
<td>{me.displayName}</td>
</tr>
<tr>
<td className="has-text-weight-semibold">{t("profile.mail")}</td>
<td>
<MailLink address={me.mail} />
</td>
</tr>
</tbody>
</table>
</div>
</div>
);
}
}
export default compose(translate("commons"))(ProfileInfo);
// @flow
import React from "react";
import type { Me } from "@scm-manager/ui-types";
import { MailLink, AvatarWrapper, AvatarImage } from "@scm-manager/ui-components";
import { compose } from "redux";
import { translate } from "react-i18next";
type Props = {
me: Me,
// Context props
t: string => string
};
type State = {};
class ProfileInfo extends React.Component<Props, State> {
render() {
const { me, t } = this.props;
return (
<div className="media">
<AvatarWrapper>
<figure className="media-left">
<p className="image is-64x64">
<AvatarImage person={ me }/>
</p>
</figure>
</AvatarWrapper>
<div className="media-content">
<table className="table">
<tbody>
<tr>
<td className="has-text-weight-semibold">{t("profile.username")}</td>
<td>{me.name}</td>
</tr>
<tr>
<td className="has-text-weight-semibold">{t("profile.displayName")}</td>
<td>{me.displayName}</td>
</tr>
<tr>
<td className="has-text-weight-semibold">{t("profile.mail")}</td>
<td>
<MailLink address={me.mail} />
</td>
</tr>
<tr>
<td className="has-text-weight-semibold">{t("profile.groups")}</td>
<td className="content">
<ul>
{me.groups.map((group) => {
return <li>{group}</li>;
})}
</ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
);
}
}
export default compose(translate("commons"))(ProfileInfo);

View File

@@ -32,6 +32,7 @@ import { translate } from "react-i18next";
import EditGroup from "./EditGroup";
import { getGroupsLink } from "../../modules/indexResource";
import SetPermissions from "../../permissions/components/SetPermissions";
import {ExtensionPoint} from "@scm-manager/ui-extensions";
type Props = {
name: string,
@@ -93,6 +94,11 @@ class SingleGroup extends React.Component<Props> {
const url = this.matchedUrl();
const extensionProps = {
group,
url
};
return (
<Page title={group.name}>
<div className="columns">
@@ -107,6 +113,11 @@ class SingleGroup extends React.Component<Props> {
exact
component={() => <EditGroup group={group} />}
/>
<ExtensionPoint
name="group.route"
props={extensionProps}
renderAll={true}
/>
<Route
path={`${url}/permissions`}
exact
@@ -134,6 +145,11 @@ class SingleGroup extends React.Component<Props> {
/>
<EditGroupNavLink group={group} editUrl={`${url}/edit`} />
<NavLink to="/groups" label={t("single-group.back-label")} />
<ExtensionPoint
name="group.navigation"
props={extensionProps}
renderAll={true}
/>
</Section>
</Navigation>
</div>

View File

@@ -134,15 +134,6 @@ const callFetchMe = (link: string): Promise<Me> => {
.get(link)
.then(response => {
return response.json();
})
.then(json => {
const { name, displayName, mail, _links } = json;
return {
name,
displayName,
mail,
_links
};
});
};