Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
fxjordan committed Feb 10, 2022
2 parents 68c53aa + c6307d6 commit cc8ade5
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions src/views/Project.vue
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,18 @@ export default defineComponent({
watch(oidcIsAuthenticated, () => store.dispatch(ActionTypes.FetchProject, projectId));
const MEMBERS_TAB_LABEL = 'Members';
const MEMBERS_TAB_ITEM = {
label: MEMBERS_TAB_LABEL,
to: `/projects/${projectId}/members`
};
const tabItems = ref([
{
label: 'All Categories', // was: 'Overview'
to: `/projects/${projectId}`
},
{
label: 'Members',
to: `/projects/${projectId}/members`
}
/*
{
label: 'All Categories',
to: `/projects/${projectId}/all`
},*/
MEMBERS_TAB_ITEM
]);
const projectEditorName = ref('');
Expand All @@ -291,18 +289,14 @@ export default defineComponent({
//const role = project.value.userContext?.projectRole;
//if (['ProjectAdmin', 'SystemAdmin'].includes(role)) {
const membersItemId = tabItems.value.findIndex(item => item.label === 'Members');
const membersItemId = tabItems.value.findIndex(item => item.label === MEMBERS_TAB_LABEL);
if (!oidcIsAuthenticated.value && membersItemId > -1) {
tabItems.value.splice(membersItemId, 1);
}
if (oidcIsAuthenticated.value && project.value.userContext?.projectRole === 'ProjectAdmin') {
if (oidcIsAuthenticated.value) {
if (membersItemId === -1) {
tabItems.value.push(
{
label: 'Members',
to: `/projects/${projectId}/members`
}
);
// user is authentivated and memebrs tab not visible yet -> add to tab items
tabItems.value.push(MEMBERS_TAB_ITEM);
}
}
});
Expand Down

0 comments on commit cc8ade5

Please sign in to comment.