mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-06 20:30:52 +01:00
Merged in bugfix/fix_page_actions (pull request #201)
Fix page action buttons
This commit is contained in:
@@ -78,6 +78,7 @@ class Groups extends React.Component<Props> {
|
||||
<GroupTable groups={groups} />
|
||||
{this.renderPaginator()}
|
||||
{this.renderCreateButton()}
|
||||
{this.renderPageActionCreateButton()}
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
@@ -93,16 +94,23 @@ class Groups extends React.Component<Props> {
|
||||
renderCreateButton() {
|
||||
if (this.props.canAddGroups) {
|
||||
return (
|
||||
<>
|
||||
<CreateGroupButton />
|
||||
<PageActions>
|
||||
<Button
|
||||
label={this.props.t("create-group-button.label")}
|
||||
link="/groups/add"
|
||||
color="primary"
|
||||
/>
|
||||
</PageActions>
|
||||
</>
|
||||
<CreateGroupButton />
|
||||
);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
renderPageActionCreateButton() {
|
||||
if (this.props.canAddGroups) {
|
||||
return (
|
||||
<PageActions>
|
||||
<Button
|
||||
label={this.props.t("create-group-button.label")}
|
||||
link="/groups/add"
|
||||
color="primary"
|
||||
/>
|
||||
</PageActions>
|
||||
);
|
||||
} else {
|
||||
return;
|
||||
|
||||
@@ -73,6 +73,7 @@ class Overview extends React.Component<Props> {
|
||||
error={error}
|
||||
>
|
||||
{this.renderList()}
|
||||
{this.renderPageActionCreateButton()}
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
@@ -95,19 +96,23 @@ class Overview extends React.Component<Props> {
|
||||
const { showCreateButton, t } = this.props;
|
||||
if (showCreateButton) {
|
||||
return (
|
||||
<>
|
||||
<CreateButton
|
||||
<CreateButton label={t("overview.createButton")} link="/repos/create" />
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
renderPageActionCreateButton() {
|
||||
const { showCreateButton, t } = this.props;
|
||||
if (showCreateButton) {
|
||||
return (
|
||||
<PageActions>
|
||||
<Button
|
||||
label={t("overview.createButton")}
|
||||
link="/repos/create"
|
||||
color="primary"
|
||||
/>
|
||||
<PageActions>
|
||||
<Button
|
||||
label={t("overview.createButton")}
|
||||
link="/repos/create"
|
||||
color="primary"
|
||||
/>
|
||||
</PageActions>
|
||||
</>
|
||||
</PageActions>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -78,6 +78,7 @@ class Users extends React.Component<Props> {
|
||||
<UserTable users={users} />
|
||||
{this.renderPaginator()}
|
||||
{this.renderCreateButton()}
|
||||
{this.renderPageActionCreateButton()}
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
@@ -91,19 +92,25 @@ class Users extends React.Component<Props> {
|
||||
}
|
||||
|
||||
renderCreateButton() {
|
||||
const { t } = this.props;
|
||||
if (this.props.canAddUsers) {
|
||||
return <CreateButton label={t("users.createButton")} link="/users/add" />;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
renderPageActionCreateButton() {
|
||||
const { t } = this.props;
|
||||
if (this.props.canAddUsers) {
|
||||
return (
|
||||
<>
|
||||
<CreateButton label={t("users.createButton")} link="/users/add" />
|
||||
<PageActions>
|
||||
<Button
|
||||
label={t("users.createButton")}
|
||||
link="/users/add"
|
||||
color="primary"
|
||||
/>
|
||||
</PageActions>
|
||||
</>
|
||||
<PageActions>
|
||||
<Button
|
||||
label={t("users.createButton")}
|
||||
link="/users/add"
|
||||
color="primary"
|
||||
/>
|
||||
</PageActions>
|
||||
);
|
||||
} else {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user