Skip to content

Commit

Permalink
[PROD-7416] Allow to post only poll in activity
Browse files Browse the repository at this point in the history
  • Loading branch information
amincdev committed May 21, 2024
1 parent a80df25 commit 3765c14
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/bp-templates/bp-nouveau/js/buddypress-activity-post-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -5401,7 +5401,17 @@ window.bp = window.bp || {};
}

// validation for content editor.
if ( $( $.parseHTML( content ) ).text().trim() === '' && ( ! _.isUndefined( this.model.get( 'link_success' ) ) && true !== this.model.get( 'link_success' ) ) && ( ( ! _.isUndefined( self.model.get( 'video' ) ) && ! self.model.get( 'video' ).length ) && ( ! _.isUndefined( self.model.get( 'document' ) ) && ! self.model.get( 'document' ).length ) && ( ! _.isUndefined( self.model.get( 'media' ) ) && ! self.model.get( 'media' ).length ) && ( ! _.isUndefined( self.model.get( 'gif_data' ) ) && ! Object.keys( self.model.get( 'gif_data' ) ).length ) ) ) {
if (
$( $.parseHTML( content ) ).text().trim() === '' &&
( ! _.isUndefined( this.model.get( 'link_success' ) ) && true !== this.model.get( 'link_success' ) ) &&
(
( ! _.isUndefined( self.model.get( 'video' ) ) && ! self.model.get( 'video' ).length ) &&
( ! _.isUndefined( self.model.get( 'document' ) ) && ! self.model.get( 'document' ).length ) &&
( ! _.isUndefined( self.model.get( 'media' ) ) && ! self.model.get( 'media' ).length ) &&
( ! _.isUndefined( self.model.get( 'gif_data' ) ) && ! Object.keys( self.model.get( 'gif_data' ) ).length ) &&
( _.isUndefined( self.model.get( 'activity_poll_title' ) ) || self.model.get( 'activity_poll_title' ).trim() === '' )
)
) {
self.model.set(
'errors',
{
Expand Down

Large diffs are not rendered by default.

0 comments on commit 3765c14

Please sign in to comment.