forked from pkp/ui-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp/pkp-lib#7495 Improvements&Fixes to pass end2tests for new workflow
- Loading branch information
1 parent
2eaa82c
commit 4902482
Showing
25 changed files
with
538 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
import {computed} from 'vue'; | ||
export const EditorialRoles = [ | ||
pkp.const.ROLE_ID_SITE_ADMIN, | ||
pkp.const.ROLE_ID_MANAGER, | ||
pkp.const.ROLE_ID_SUB_EDITOR, | ||
pkp.const.ROLE_ID_ASSISTANT, | ||
]; | ||
|
||
export function useCurrentUser() { | ||
const isSiteAdmin = computed( | ||
() => | ||
!!pkp.currentUser.roles.find( | ||
(role) => role === pkp.const.ROLE_ID_SITE_ADMIN, | ||
), | ||
); | ||
const isManager = computed( | ||
() => | ||
!!pkp.currentUser.roles.find( | ||
(role) => role === pkp.const.ROLE_ID_MANAGER, | ||
), | ||
); | ||
|
||
function hasCurrentUserAtLeastOneRole(roles = []) { | ||
return roles.some((role) => pkp.currentUser.roles.includes(role)); | ||
} | ||
|
||
return {isSiteAdmin, isManager, hasCurrentUserAtLeastOneRole}; | ||
function getCurrentUserId() { | ||
return pkp.currentUser.id; | ||
} | ||
|
||
return {hasCurrentUserAtLeastOneRole, getCurrentUserId}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import {useLocalize} from './useLocalize'; | ||
|
||
const {t, tk} = useLocalize(); | ||
|
||
export const ExtendedStages = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.