From d7b1eda8596bd329363d9d30186ef3ca12a06b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Mon, 18 Feb 2019 08:47:29 +0100 Subject: [PATCH 1/7] Show own groups in me page --- scm-ui/src/containers/ProfileInfo.js | 48 ++++++++++++++++++---------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/scm-ui/src/containers/ProfileInfo.js b/scm-ui/src/containers/ProfileInfo.js index 49c79f1fe8..230c50786c 100644 --- a/scm-ui/src/containers/ProfileInfo.js +++ b/scm-ui/src/containers/ProfileInfo.js @@ -1,7 +1,11 @@ // @flow import React from "react"; import type { Me } from "@scm-manager/ui-types"; -import { MailLink, AvatarWrapper, AvatarImage } from "@scm-manager/ui-components"; +import { + MailLink, + AvatarWrapper, + AvatarImage +} from "@scm-manager/ui-components"; import { compose } from "redux"; import { translate } from "react-i18next"; @@ -21,27 +25,39 @@ class ProfileInfo extends React.Component {

- +

- - - - - - - - - - - - + + + + + + + + + + + + + + + +
{t("profile.username")}{me.name}
{t("profile.displayName")}{me.displayName}
{t("profile.mail")} - -
+ {t("profile.username")} + {me.name}
+ {t("profile.displayName")} + {me.displayName}
+ {t("profile.mail")} + + +
+ {t("profile.groups")} + {me.groups.join(", ")}
From 7bb1f4632f2825ad262ba153222b3433f188dd21 Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Tue, 19 Feb 2019 15:05:55 +0100 Subject: [PATCH 2/7] changed groups list to dotted list --- scm-ui/src/containers/ProfileInfo.js | 43 ++++-- scm-ui/src/groups/components/table/Details.js | 138 +++++++++--------- 2 files changed, 102 insertions(+), 79 deletions(-) diff --git a/scm-ui/src/containers/ProfileInfo.js b/scm-ui/src/containers/ProfileInfo.js index 230c50786c..b4f32f55c7 100644 --- a/scm-ui/src/containers/ProfileInfo.js +++ b/scm-ui/src/containers/ProfileInfo.js @@ -8,16 +8,23 @@ import { } from "@scm-manager/ui-components"; import { compose } from "redux"; import { translate } from "react-i18next"; +import injectSheet from "react-jss"; type Props = { me: Me, // Context props + classes: any, t: string => string }; -type State = {}; -class ProfileInfo extends React.Component { +const styles = { + spacing: { + padding: "0 !important" + } +}; + +class ProfileInfo extends React.Component { render() { const { me, t } = this.props; return ( @@ -30,7 +37,7 @@ class ProfileInfo extends React.Component {
- +
- - - - + {this.renderGroups()}
@@ -52,18 +59,34 @@ class ProfileInfo extends React.Component {
- {t("profile.groups")} - {me.groups.join(", ")}
); } + + renderGroups() { + const { me, t, classes } = this.props; + + let groups = null; + if (me.groups.length > 0) { + groups = ( + + {t("profile.groups")} + +
    + {me.groups.map((group, index) => { + return
  • {group}
  • ; + })} +
+ + + ); + } + return groups; + } } -export default compose(translate("commons"))(ProfileInfo); +export default compose(injectSheet(styles)(translate("commons")(ProfileInfo))); diff --git a/scm-ui/src/groups/components/table/Details.js b/scm-ui/src/groups/components/table/Details.js index eb4c3fa0d5..65e146b7bd 100644 --- a/scm-ui/src/groups/components/table/Details.js +++ b/scm-ui/src/groups/components/table/Details.js @@ -1,69 +1,69 @@ -//@flow -import React from "react"; -import type { Group } from "@scm-manager/ui-types"; -import { translate } from "react-i18next"; -import GroupMember from "./GroupMember"; -import { DateFromNow } from "@scm-manager/ui-components"; - -type Props = { - group: Group, - t: string => string -}; - -class Details extends React.Component { - render() { - const { group, t } = this.props; - return ( - - - - - - - - - - - - - - - - - - - - - - - {this.renderMembers()} - -
{t("group.name")}{group.name}
{t("group.description")}{group.description}
{t("group.type")}{group.type}
{t("group.creationDate")} - -
{t("group.lastModified")} - -
- ); - } - - renderMembers() { - if (this.props.group.members.length > 0) { - return ( - - - {this.props.t("group.members")} -
    - {this.props.group._embedded.members.map((member, index) => { - return ; - })} -
- - - ); - } else { - return; - } - } -} - -export default translate("groups")(Details); +//@flow +import React from "react"; +import type { Group } from "@scm-manager/ui-types"; +import { translate } from "react-i18next"; +import GroupMember from "./GroupMember"; +import { DateFromNow } from "@scm-manager/ui-components"; + +type Props = { + group: Group, + t: string => string +}; + +class Details extends React.Component { + render() { + const { group, t } = this.props; + return ( + + + + + + + + + + + + + + + + + + + + + + + {this.renderMembers()} + +
{t("group.name")}{group.name}
{t("group.description")}{group.description}
{t("group.type")}{group.type}
{t("group.creationDate")} + +
{t("group.lastModified")} + +
+ ); + } + + renderMembers() { + if (this.props.group.members.length > 0) { + return ( + + + {this.props.t("group.members")} +
    + {this.props.group._embedded.members.map((member, index) => { + return ; + })} +
+ + + ); + } else { + return; + } + } +} + +export default translate("groups")(Details); From 98905b4a369b1ae92a60ed3da6a775fa6707ec92 Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Tue, 19 Feb 2019 15:07:00 +0100 Subject: [PATCH 3/7] unified users list for group details --- scm-ui/src/groups/components/table/Details.js | 82 +++++++++++-------- 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/scm-ui/src/groups/components/table/Details.js b/scm-ui/src/groups/components/table/Details.js index 65e146b7bd..820ffb431b 100644 --- a/scm-ui/src/groups/components/table/Details.js +++ b/scm-ui/src/groups/components/table/Details.js @@ -1,69 +1,81 @@ //@flow import React from "react"; import type { Group } from "@scm-manager/ui-types"; -import { translate } from "react-i18next"; import GroupMember from "./GroupMember"; import { DateFromNow } from "@scm-manager/ui-components"; +import { translate } from "react-i18next"; +import injectSheet from "react-jss"; type Props = { group: Group, + + // Context props + classes: any, t: string => string }; +const styles = { + spacing: { + padding: "0 !important" + } +}; + class Details extends React.Component { render() { const { group, t } = this.props; return ( - - - - - - - - - - - - - - - - - - - - - {this.renderMembers()} + + + + + + + + + + + + + + + + + + + + + {this.renderMembers()}
{t("group.name")}{group.name}
{t("group.description")}{group.description}
{t("group.type")}{group.type}
{t("group.creationDate")} - -
{t("group.lastModified")} - -
{t("group.name")}{group.name}
{t("group.description")}{group.description}
{t("group.type")}{group.type}
{t("group.creationDate")} + +
{t("group.lastModified")} + +
); } renderMembers() { - if (this.props.group.members.length > 0) { - return ( + const { group, t, classes } = this.props; + + let member = null; + if (group.members.length > 0) { + member = ( - - {this.props.t("group.members")} + {t("group.members")} +
    - {this.props.group._embedded.members.map((member, index) => { - return ; + {group._embedded.members.map((member, index) => { + return ; })}
); - } else { - return; } + return member; } } -export default translate("groups")(Details); +export default injectSheet(styles)(translate("groups")(Details)); From 01a833740c1427905f82f09a6aac95899af09d46 Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Tue, 19 Feb 2019 15:22:20 +0100 Subject: [PATCH 4/7] fix? --- scm-ui/src/containers/ProfileInfo.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scm-ui/src/containers/ProfileInfo.js b/scm-ui/src/containers/ProfileInfo.js index b4f32f55c7..42413e6a01 100644 --- a/scm-ui/src/containers/ProfileInfo.js +++ b/scm-ui/src/containers/ProfileInfo.js @@ -89,4 +89,7 @@ class ProfileInfo extends React.Component { } } -export default compose(injectSheet(styles)(translate("commons")(ProfileInfo))); +export default compose( + injectSheet(styles), + translate("commons") +)(ProfileInfo); From 90cb047ccb08ddffcdeb2e4c8ff5bef891fb5015 Mon Sep 17 00:00:00 2001 From: Philipp Czora Date: Wed, 20 Feb 2019 09:47:35 +0100 Subject: [PATCH 5/7] SubmitButton: scroll to top after performing action --- .../packages/ui-components/src/buttons/SubmitButton.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scm-ui-components/packages/ui-components/src/buttons/SubmitButton.js b/scm-ui-components/packages/ui-components/src/buttons/SubmitButton.js index 3abf805749..0f03d850b2 100644 --- a/scm-ui-components/packages/ui-components/src/buttons/SubmitButton.js +++ b/scm-ui-components/packages/ui-components/src/buttons/SubmitButton.js @@ -4,12 +4,16 @@ import Button, { type ButtonProps } from "./Button"; class SubmitButton extends React.Component { render() { + const { action } = this.props; return (