File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ function BadgeReport(props) {
4242 const canDeleteBadges = props . hasPermission ( 'deleteBadges' ) ;
4343 const canUpdateBadges = props . hasPermission ( 'updateBadges' ) ;
4444 const darkMode = props . darkMode ;
45+ const canAssignBadges = props . hasPermission ( 'assignBadges' ) ;
46+ const canModifyBadgeAmount = props . hasPermission ( 'modifyBadgeAmount' ) ;
4547
4648 async function imageToUri ( url , callback ) {
4749 const canvas = document . createElement ( 'canvas' ) ;
@@ -452,7 +454,7 @@ function BadgeReport(props) {
452454 </ >
453455 </ td >
454456 < td >
455- { canUpdateBadges ? (
457+ { canUpdateBadges || canModifyBadgeAmount ? (
456458 < Input
457459 type = "number"
458460 value = { Math . round ( value . count ) }
@@ -492,6 +494,7 @@ function BadgeReport(props) {
492494 onChange = { e => {
493495 featuredChange ( value , index , e ) ;
494496 } }
497+ disabled = { canModifyBadgeAmount && ! ( canUpdateBadges || canAssignBadges ) }
495498 />
496499 </ FormGroup >
497500 </ td >
Original file line number Diff line number Diff line change @@ -274,6 +274,12 @@ export const permissionLabels = [
274274 description :
275275 'Gives the user permission to delete a badge on "Other Links" -> "Badge Management"' ,
276276 } ,
277+ {
278+ label : 'Modify Badge Amount' ,
279+ key : 'modifyBadgeAmount' ,
280+ description :
281+ 'Gives the user permission to increase or decrease the count of a badge on the Badge Reports Component' ,
282+ } ,
277283 {
278284 label : 'Assign Badges' ,
279285 key : 'assignBadges' ,
Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ export const Badges = (props) => {
4545
4646 // Added restriction: Jae's badges only editable by Jae or Owner
4747 const isRecordBelongsToJaeAndUneditable = props . isRecordBelongsToJaeAndUneditable && props . role !== 'Owner' ;
48+ // const canAssignBadges = props.hasPermission('assignBadges');
49+ const canModifyBadgeAmount = props . hasPermission ( 'modifyBadgeAmount' ) ;
50+
4851 const toggle = ( ) => setOpen ( ! isOpen ) ;
4952
5053 const toggleBadge = ( ) => { setIsBadgeOpen ( ! isBadgeOpen ) } ;
@@ -125,7 +128,7 @@ export const Badges = (props) => {
125128 </ span >
126129
127130 < div className = 'd-flex' >
128- { ( props . canEdit || props . role == 'Owner' || props . role == 'Administrator' ) && (
131+ { ( props . canEdit || props . role == 'Owner' || props . role == 'Administrator' || canModifyBadgeAmount ) && (
129132 < >
130133 < Button className = "btn--dark-sea-green" onClick = { toggle } style = { darkMode ? boxStyleDark : boxStyle } >
131134 Select Featured
You can’t perform that action at this time.
0 commit comments