Skip to content

Commit

Permalink
open role and group members in new tab
Browse files Browse the repository at this point in the history
Signed-off-by: aporss <[email protected]>
  • Loading branch information
ArtjomsPorss committed Sep 6, 2024
1 parent 64ee24f commit b51b221
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion ui/src/components/group/GroupRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ class GroupRow extends React.Component {
this.props.router.push(route, route);
}

// opens new tab on cmd + click or ctrl + click
onClickNewTabFunction(route, args) {
if(args.metaKey || args.ctrlKey) {
args.view.open(args.view.origin + route, '_blank', 'noopener,norefferer');
} else {
this.props.router.push(route, route);
}
}

onSubmitDelete() {
let groupName = this.state.deleteName;
if (
Expand Down Expand Up @@ -154,7 +163,7 @@ class GroupRow extends React.Component {
let color = this.props.color;
let idx = this.props.idx;

let clickMembers = this.onClickFunction.bind(
let clickMembers = this.onClickNewTabFunction.bind(
this,
`/domain/${this.props.domain}/group/${this.state.name}/members`
);
Expand Down
11 changes: 10 additions & 1 deletion ui/src/components/role/RoleRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ class RoleRow extends React.Component {
this.props.router.push(route, route);
}

// opens new tab on cmd + click or ctrl + click
onClickNewTabFunction(route, args) {
if(args.metaKey || args.ctrlKey) {
args.view.open(args.view.origin + route, '_blank', 'noopener,norefferer');
} else {
this.props.router.push(route, route);
}
}

onSubmitDelete(domain) {
let roleName = this.state.deleteName;
if (
Expand Down Expand Up @@ -173,7 +182,7 @@ class RoleRow extends React.Component {
let color = this.props.color;
let idx = this.props.idx;

let clickMembers = this.onClickFunction.bind(
let clickMembers = this.onClickNewTabFunction.bind(
this,
`/domain/${this.props.domain}/role/${this.state.name}/members`
);
Expand Down

0 comments on commit b51b221

Please sign in to comment.