Skip to content

Commit

Permalink
Enhancement: Setting Reject status will now require text before rejec…
Browse files Browse the repository at this point in the history
…ting. (#1218)

* Force user input before reject

* remove semi colon

* formatting and redundant code
  • Loading branch information
Matte22 authored Feb 29, 2024
1 parent a7756b1 commit e5c5af8
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions client/src/js/collectionReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -1655,29 +1655,40 @@ async function addCollectionReview ( params ) {
const textArea = new Ext.form.TextArea({
emptyText: 'Provide feedback explaining this rejection.',
maxLength: 255,
enableKeyEvents: true,
listeners: {
valid: () => {
submitBtn.enable()
},
invalid: () => {
submitBtn.disable()
keyup: (field) => {
if (field.isValid() && field.getValue().trim().length > 0) {
submitBtn.enable()
}
else {
submitBtn.disable()
}
}
}
})
const submitBtn = new Ext.Button({
text: 'Reject with this feedback',
action: 'reject',
iconCls: 'sm-rejected-icon',
disabled: true,
handler
})
const cancelBtn = new Ext.Button( {
text: 'Cancel',
action: 'cancel',
handler
})
function handler (btn) {
if (btn.action === 'reject') {
const value = textArea.getValue()
const value = textArea.getValue()
if (btn.action === 'reject'){
fpwindow.close()
resolve(value)
}
fpwindow.close()
reject()
else{
fpwindow.close()
reject()
}
}
const fpwindow = new Ext.Window({
title: `Reject Reviews`,
Expand All @@ -1690,22 +1701,11 @@ async function addCollectionReview ( params ) {
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'right',
items: [
textArea
],
buttons: [
{
text: 'Cancel',
action: 'cancel',
handler
},
submitBtn
]
items: [textArea],
buttons: [cancelBtn,submitBtn]
})
fpwindow.show()

})

}

async function handleStatusChange (grid, sm, status) {
Expand Down

0 comments on commit e5c5af8

Please sign in to comment.