Do not truncate notes created before WC 6.1 release (https://github.com/woocommerce/woocommerce-admin/pull/8023)

* Do not truncate notes created before WC 5.9 release

* Change WC version number
This commit is contained in:
Moon 2021-12-08 19:08:47 -08:00 committed by GitHub
parent 6b687e4196
commit 98c9d8adc5
1 changed files with 16 additions and 2 deletions

View File

@ -19,7 +19,7 @@ import {
InboxNotePlaceholder,
Text,
} from '@woocommerce/experimental';
import moment from 'moment';
/**
* Internal dependencies
*/
@ -181,10 +181,24 @@ const InboxPanel = ( { showHeader = true } ) => {
isResolving,
isNotesRequesting,
} = select( NOTES_STORE_NAME );
const WC_VERSION_61_RELEASE_DATE = moment(
'2022-01-11',
'YYYY-MM-DD'
).valueOf();
return {
notes: getNotes( INBOX_QUERY ).map( ( note ) => {
note.content = truncateRenderableHTML( note.content, 320 );
const noteDate = moment(
note.date_created_gmt,
'YYYY-MM-DD'
).valueOf();
if ( noteDate >= WC_VERSION_61_RELEASE_DATE ) {
note.content = truncateRenderableHTML(
note.content,
320
);
}
return note;
} ),
isError: Boolean(