Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/header/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,21 @@ export const useSettingMenuItems = (courseId: string) => {
},
...(isAuthzEnabled
? [{
href: `${getConfig().ADMIN_CONSOLE_URL}/authz?scope=${encodeURIComponent(courseId)}`,
title: intl.formatMessage(messages['header.links.roles.permissions']),
href: '#',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacobo-dominguez-wgu @rodmgwgu
right now the current component that renders these items on the menu does not support target="_blank"
so I had to do this.
currently all of these items redirect in the same tab.
The correct solution is to update
import { StudioHeader } from '@edx/frontend-component-header';
in the other repository to support this, although not sure if is worth it because this is gonna be updated to frontend-base in the near future.
I would like to know your thoughts on this.
Thank you!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we can go with it for now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, let me fix the tests, thank you

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gviedma-aulasneo What do you think? What's the context behind the requirement for having this link open in a new tab? From the technical perspective, I would prefer not doing this solution if possible as it's not clean.

I would propose for now not changing the behaviour on the course outline, we can add a ticket to solve this in a better way on next phases.

title: (
<span
onClick={(e) => {
e.preventDefault();
window.open(
`${getConfig().ADMIN_CONSOLE_URL}/authz?scope=${encodeURIComponent(courseId)}`,
'_blank',
'noopener,noreferrer',
);
}}
>
{intl.formatMessage(messages['header.links.roles.permissions'])}
</span>
),
}]
: [{
href: `/course/${courseId}/course_team`,
Expand Down
1 change: 1 addition & 0 deletions src/studio-home/StudioHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const StudioHome = () => {
variant="primary"
iconBefore={ManageAccounts}
size="sm"
target="_blank"
>
{intl.formatMessage(messages.addRolesPermissionsBtnText)}
</Button>
Expand Down
Loading