Added ability to change placeholder text, and make comment replies optional

This commit is contained in:
ahammouda 2022-10-01 17:47:04 -04:00
parent f4d9ccaf08
commit 9369b56174
2 changed files with 45 additions and 25 deletions

View File

@ -100,14 +100,34 @@ const CommentWidget = props => {
onDelete={props.onRemoveBody}
onSaveAndClose={props.onSaveAndClose} />
)}
{ !props.readOnly && props.annotation &&
{ comments.length === 0 && !props.readOnly && props.disableReply && props.annotation &&
<div className="r6o-widget comment editable">
<TextEntryField
focus={props.focus}
content={draftReply.value}
editable={true}
placeholder={comments.length > 0 ? i18n.t('Add a reply...') : i18n.t('Add a comment...')}
placeholder={props.textPlaceHolder || i18n.t('Add a comment...') }
onChange={onEditReply}
onSaveAndClose={() => props.onSaveAndClose()}
/>
{ props.purposeSelector && draftReply.value.length > 0 &&
<PurposeSelect
editable={true}
content={draftReply.purpose}
onChange={onChangeReplyPurpose}
onSaveAndClose={() => props.onSaveAndClose()}
/>
}
</div>
}
{ !props.readOnly && !props.disableReply && props.annotation &&
<div className="r6o-widget comment editable">
<TextEntryField
focus={props.focus}
content={draftReply.value}
editable={true}
placeholder={comments.length > 0 ? i18n.t('Add a reply...') : (props.textPlaceHolder || i18n.t('Add a comment...'))}
onChange={onEditReply}
onSaveAndClose={() => props.onSaveAndClose()}
/>

View File

@ -98,7 +98,7 @@ const TagWidget = props => {
{!props.readOnly &&
<Autocomplete
focus={props.focus}
placeholder={i18n.t('Add tag...')}
placeholder={props.textPlaceHolder || i18n.t('Add tag...')}
vocabulary={props.vocabulary || []}
onChange={onDraftChange}
onSubmit={onSubmit}/>