diff --git a/.circleci/config.yml b/.circleci/config.yml index 98ffbff8f2..76390d0629 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -79,7 +79,7 @@ jobs: frontend-tests: docker: - - image: greenpeaceinternational/p4-unit-tests:node16.19.0 + - image: greenpeaceinternational/p4-unit-tests:node16.20.2-update-eslint auth: <<: *docker_auth steps: @@ -246,6 +246,7 @@ jobs: --test-instance $(cat /tmp/workspace/test-instance) create-zip: + resource_class: large docker: - image: cimg/node:16.19 auth: @@ -278,8 +279,8 @@ jobs: name: Zip file size sanity check command: | ls -lh /tmp/workspace/planet4-master-theme.zip - if [ $(wc -c { const {columns} = attributes; @@ -61,8 +61,10 @@ const renderEdit = (attributes, toAttribute, setAttributes, isSelected) => { return (
diff --git a/assets/src/blocks/ENForm/CountrySelector.js b/assets/src/blocks/ENForm/CountrySelector.js index 7626154f1f..ead496a4bb 100644 --- a/assets/src/blocks/ENForm/CountrySelector.js +++ b/assets/src/blocks/ENForm/CountrySelector.js @@ -1,15 +1,13 @@ -export const CountrySelector = attributes => { - const { - name = 'country-selector', - id = null, - default_text = '', - class_name = '', - error_message = '', - required = false, - onInputChange = null, - onBlur = null, - } = attributes; - +export const CountrySelector = ({ + name = 'country-selector', + id = null, + default_text = '', + class_name = '', + error_message = '', + required = false, + onInputChange = null, + onBlur = null, +}) => { const options = [ , ...countries.map(c => { diff --git a/assets/src/blocks/ENForm/ENFormBlock.js b/assets/src/blocks/ENForm/ENFormBlock.js index 016abe8152..28b75a4715 100644 --- a/assets/src/blocks/ENForm/ENFormBlock.js +++ b/assets/src/blocks/ENForm/ENFormBlock.js @@ -8,37 +8,6 @@ const {__} = wp.i18n; export const BLOCK_NAME = 'planet4-blocks/enform'; -export const attributes = { - en_page_id: {type: 'integer'}, - enform_goal: {type: 'string'}, - en_form_style: {type: 'string', default: 'side-style'}, - title: {type: 'string'}, - description: {type: 'string'}, - campaign_logo: {type: 'boolean'}, - content_title: {type: 'string'}, - content_title_size: {type: 'string', default: 'h1'}, - content_description: {type: 'string'}, - button_text: {type: 'string'}, - text_below_button: {type: 'string'}, - thankyou_title: {type: 'string'}, - thankyou_subtitle: {type: 'string'}, - thankyou_donate_message: {type: 'string'}, - thankyou_social_media_message: {type: 'string'}, - donate_button_checkbox: {type: 'boolean'}, - donate_text: {type: 'string', default: __('Donate', 'planet4-engagingnetworks')}, - thankyou_url: {type: 'string'}, - custom_donate_url: {type: 'string'}, - background: {type: 'integer'}, - background_image_src: {type: 'string', default: ''}, - background_image_srcset: {type: 'string'}, - background_image_sizes: {type: 'string'}, - background_image_focus: {type: 'string', default: '50% 50%'}, - en_form_id: {type: 'integer'}, - en_form_fields: {type: 'array', default: []}, - social: {type: 'object', default: {}}, - social_accounts: {type: 'object', default: {}}, -}; - export const registerENForm = () => { const {registerBlockType} = wp.blocks; const {RawHTML} = wp.element; @@ -55,7 +24,36 @@ export const registerENForm = () => { {name: 'full-width', label: 'Page body/text size width'}, {name: 'side-style', label: 'Form on the side', isDefault: true}, ], - attributes, + attributes: { + en_page_id: {type: 'integer'}, + enform_goal: {type: 'string'}, + en_form_style: {type: 'string', default: 'side-style'}, + title: {type: 'string'}, + description: {type: 'string'}, + campaign_logo: {type: 'boolean'}, + content_title: {type: 'string'}, + content_title_size: {type: 'string', default: 'h1'}, + content_description: {type: 'string'}, + button_text: {type: 'string'}, + text_below_button: {type: 'string'}, + thankyou_title: {type: 'string'}, + thankyou_subtitle: {type: 'string'}, + thankyou_donate_message: {type: 'string'}, + thankyou_social_media_message: {type: 'string'}, + donate_button_checkbox: {type: 'boolean'}, + donate_text: {type: 'string', default: __('Donate', 'planet4-engagingnetworks')}, + thankyou_url: {type: 'string'}, + custom_donate_url: {type: 'string'}, + background: {type: 'integer'}, + background_image_src: {type: 'string', default: ''}, + background_image_srcset: {type: 'string'}, + background_image_sizes: {type: 'string'}, + background_image_focus: {type: 'string', default: '50% 50%'}, + en_form_id: {type: 'integer'}, + en_form_fields: {type: 'array', default: []}, + social: {type: 'object', default: {}}, + social_accounts: {type: 'object', default: {}}, + }, edit: ENFormEditor, save: props => { // Sort attributes in a predictable order diff --git a/assets/src/blocks/ENForm/deprecated/ENFormV2.js b/assets/src/blocks/ENForm/deprecated/ENFormV2.js index 8dfbcf6c13..01ece30cac 100644 --- a/assets/src/blocks/ENForm/deprecated/ENFormV2.js +++ b/assets/src/blocks/ENForm/deprecated/ENFormV2.js @@ -1,8 +1,39 @@ -import {BLOCK_NAME, attributes} from '../ENFormBlock'; +import {BLOCK_NAME} from '../ENFormBlock'; import {frontendRendered} from '../../../functions/frontendRendered'; +const {__} = wp.i18n; + export const ENFormV2 = { - attributes, + attributes: { + en_page_id: {type: 'integer'}, + enform_goal: {type: 'string'}, + en_form_style: {type: 'string', default: 'side-style'}, + title: {type: 'string'}, + description: {type: 'string'}, + campaign_logo: {type: 'boolean'}, + content_title: {type: 'string'}, + content_title_size: {type: 'string', default: 'h1'}, + content_description: {type: 'string'}, + button_text: {type: 'string'}, + text_below_button: {type: 'string'}, + thankyou_title: {type: 'string'}, + thankyou_subtitle: {type: 'string'}, + thankyou_donate_message: {type: 'string'}, + thankyou_social_media_message: {type: 'string'}, + donate_button_checkbox: {type: 'boolean'}, + donate_text: {type: 'string', default: __('Donate', 'planet4-engagingnetworks')}, + thankyou_url: {type: 'string'}, + custom_donate_url: {type: 'string'}, + background: {type: 'integer'}, + background_image_src: {type: 'string', default: ''}, + background_image_srcset: {type: 'string'}, + background_image_sizes: {type: 'string'}, + background_image_focus: {type: 'string', default: '50% 50%'}, + en_form_id: {type: 'integer'}, + en_form_fields: {type: 'array', default: []}, + social: {type: 'object', default: {}}, + social_accounts: {type: 'object', default: {}}, + }, save: props => { // Sort attributes in a predictable order const ordered_attrs = Object.fromEntries(Object.entries(props.attributes).sort()); diff --git a/assets/src/blocks/Spreadsheet/SpreadsheetEditor.js b/assets/src/blocks/Spreadsheet/SpreadsheetEditor.js index 5323c22a28..438f05b7f2 100644 --- a/assets/src/blocks/Spreadsheet/SpreadsheetEditor.js +++ b/assets/src/blocks/Spreadsheet/SpreadsheetEditor.js @@ -54,20 +54,20 @@ export const SpreadsheetEditor = ({
  • - {/* eslint-disable-next-line no-restricted-syntax */} + {/* eslint-disable-next-line no-restricted-syntax, @wordpress/i18n-no-collapsible-whitespace */} { __(`From Your Google Spreadsheet Table choose File -> Publish on web. No need to choose the output format, any of them will work. A pop-up window will show up, click on the Publish button and then OK when the confirmation message is displayed. Copy the URL that is highlighted and paste it in this block.`, 'planet4-blocks-backend') }
  • - {/* eslint-disable-next-line no-restricted-syntax */} + {/* eslint-disable-next-line no-restricted-syntax, @wordpress/i18n-no-collapsible-whitespace */} { __(`If you make changes to the sheet after publishing then these changes do not always immediately get reflected, even when "Automatically republish when changes are made" is checked.`, 'planet4-blocks-backend') }
  • - {/* eslint-disable-next-line no-restricted-syntax */} + {/* eslint-disable-next-line no-restricted-syntax, @wordpress/i18n-no-collapsible-whitespace */} { __(`You can force an update by unpublishing and republishing the sheet. This will not change the sheet's public url.`, 'planet4-blocks-backend') }
  • diff --git a/assets/src/js/Components/ArchivePicker/ArchivePickerToolbar.js b/assets/src/js/Components/ArchivePicker/ArchivePickerToolbar.js index c21620512c..063b27abaa 100644 --- a/assets/src/js/Components/ArchivePicker/ArchivePickerToolbar.js +++ b/assets/src/js/Components/ArchivePicker/ArchivePickerToolbar.js @@ -23,9 +23,8 @@ export default function ArchivePickerToolbar() { {!bulkSelect &&

    {__('Greenpeace Media', 'planet4-master-theme-backend')}

    }