diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index b0a0d0ff4e..f0517b6cd3 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -1,7 +1,7 @@ --- name: Bug report about: Report a bug so we can get to squashing it. - +labels: bug --- ### Description: @@ -22,4 +22,4 @@ about: Report a bug so we can get to squashing it. ### Technical info * WordPress version: x.x.x -* Theme version: x.x.x \ No newline at end of file +* Theme version: x.x.x diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md index ce597c84ff..633054731d 100644 --- a/.github/ISSUE_TEMPLATE/Feature_request.md +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -1,7 +1,7 @@ --- name: Feature request about: Suggest a feature that we can implement. - +labels: enhancement --- ### Description: diff --git a/.github/workflows/build-dev-artifacts.yml b/.github/workflows/build-dev-artifacts.yml index a485bb01e5..6782294917 100644 --- a/.github/workflows/build-dev-artifacts.yml +++ b/.github/workflows/build-dev-artifacts.yml @@ -5,6 +5,9 @@ on: types: [ opened, synchronize, ready_for_review ] branches-ignore: - "update_dependencies" +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true jobs: dev-zip: name: Build ZIP and upload to s3 diff --git a/.github/workflows/cancel-old-runs.yml b/.github/workflows/cancel-old-runs.yml deleted file mode 100644 index 47d8614c89..0000000000 --- a/.github/workflows/cancel-old-runs.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Auto Cancel - -on: - push: - branches-ignore: - - master -jobs: - cancel: - name: 'Cancel Previous Runs' - if: github.event.pull_request.head.repo.fork == false - runs-on: ubuntu-latest - steps: - - uses: styfle/cancel-workflow-action@0.8.0 - with: - workflow_id: build-dev-artifacts.yml - access_token: ${{ secrets.BOT_TOKEN }} - - uses: styfle/cancel-workflow-action@0.8.0 - with: - workflow_id: e2e-storybook.yml - access_token: ${{ secrets.BOT_TOKEN }} diff --git a/.github/workflows/e2e-storybook.yml b/.github/workflows/e2e-storybook.yml index 503cb3a6c3..a75671ace3 100644 --- a/.github/workflows/e2e-storybook.yml +++ b/.github/workflows/e2e-storybook.yml @@ -11,6 +11,9 @@ on: - '.github/e2e-storybook.yml' - 'package.json' - 'stories/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true jobs: e2e-storybook: strategy: diff --git a/.github/workflows/merge-conflicts.yml b/.github/workflows/merge-conflicts.yml index 61ea8d4b18..f671df4024 100644 --- a/.github/workflows/merge-conflicts.yml +++ b/.github/workflows/merge-conflicts.yml @@ -10,4 +10,4 @@ jobs: - uses: mschilde/auto-label-merge-conflicts@master with: CONFLICT_LABEL_NAME: 'has conflicts' - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} diff --git a/.github/workflows/sync-qa.yml b/.github/workflows/sync-qa.yml index 42db022b47..11ca7f26eb 100644 --- a/.github/workflows/sync-qa.yml +++ b/.github/workflows/sync-qa.yml @@ -4,6 +4,9 @@ on: branches: - development - "!master" +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true jobs: deploy: name: Deploy to QA server diff --git a/.github/workflows/test-npm.yml b/.github/workflows/test-npm.yml index e358ff2a05..0343e9acc6 100644 --- a/.github/workflows/test-npm.yml +++ b/.github/workflows/test-npm.yml @@ -5,6 +5,9 @@ on: branches-ignore: - 'master' +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true jobs: npm: runs-on: ubuntu-latest diff --git a/.github/workflows/test-php.yml b/.github/workflows/test-php.yml index c58c0ae551..cb115e9adc 100644 --- a/.github/workflows/test-php.yml +++ b/.github/workflows/test-php.yml @@ -7,6 +7,9 @@ on: env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true CYPRESS_INSTALL_BINARY: 0 +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true jobs: phplint: name: PHP Lint diff --git a/CHANGELOG.md b/CHANGELOG.md index 2604263d42..18e7611e8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +#### [Version 3.4.0](https://github.com/Codeinwp/neve/compare/v3.3.7...v3.4.0) (2022-09-19) + +- [Feat] Add the possibility to search for options in Customizer - [Learn more](https://docs.themeisle.com/article/1716-how-to-search-for-settings-in-the-customizer) +- [Feat] Show comments but hide reply form if the "allow comments" setting is unchecked +- [Feat] Add relative CSS unit support for some customizer controls +- [Fix] Secondary button options applying on the search submit button +- [Fix] Expand the first level of the submenu option +- Update Google Fonts + ##### [Version 3.3.7](https://github.com/Codeinwp/neve/compare/v3.3.6...v3.3.7) (2022-08-31) - [Feat] Add margin control for menu label diff --git a/assets/apps/components/package.json b/assets/apps/components/package.json index e5965291ee..b4266f51e9 100644 --- a/assets/apps/components/package.json +++ b/assets/apps/components/package.json @@ -1,6 +1,6 @@ { "name": "@neve-wp/components", - "version": "0.0.34", + "version": "0.0.35", "description": "Neve React Components", "author": "themeisle ", "license": "GPL-2.0-or-later", diff --git a/assets/apps/components/src/Common/svg.js b/assets/apps/components/src/Common/svg.js index 7eff752996..806fe2ced5 100644 --- a/assets/apps/components/src/Common/svg.js +++ b/assets/apps/components/src/Common/svg.js @@ -475,6 +475,92 @@ const SVG = { ), + mcIcon1: ( + + ), + mcIcon2: ( + + ), + mcIcon3: ( + + ), + mcIcon4: ( + + ), + mcIcon5: ( + + ), + mcIcon6: ( + + ), }; export default SVG; diff --git a/assets/apps/components/src/Controls/FormTokenFieldControl.js b/assets/apps/components/src/Controls/FormTokenFieldControl.js new file mode 100644 index 0000000000..97ad5b598c --- /dev/null +++ b/assets/apps/components/src/Controls/FormTokenFieldControl.js @@ -0,0 +1,84 @@ +import PropTypes from 'prop-types'; +import { FormTokenField } from '@wordpress/components'; + +const FormTokenFieldControl = ({ + label, + description, + choices, + onChange, + value, +}) => { + const updateValue = (nextVal) => { + // Convert option labels into ids + const selectedOptionsArray = []; + + for (const optionName of nextVal) { + const matchingPost = choices.find((option) => { + return option.label === optionName; + }); + if (matchingPost !== undefined) { + selectedOptionsArray.push(matchingPost.id); + } + } + + onChange(selectedOptionsArray); + }; + + const getValueKeys = () => { + // Convert option ids into labels + const valueKeys = []; + for (const optionId of value) { + const wantedPost = choices.find((option) => { + return option.id === optionId; + }); + if (wantedPost === undefined || !wantedPost) { + continue; + } + valueKeys.push(wantedPost.label); + } + return valueKeys; + }; + + const getOptionNames = () => { + return choices.map((option) => option.label); + }; + + const hasSubArray = (master, sub) => { + return sub.every((e) => master.includes(e)); + }; + + const validateInput = (newVal) => { + return hasSubArray( + choices.map((el) => el.label), + Array.isArray(newVal) ? newVal : [newVal] + ); + }; + + return ( +
+ {label && ( + /* eslint-disable-next-line jsx-a11y/label-has-for */ + + )} + +
+ ); +}; + +FormTokenFieldControl.propTypes = { + label: PropTypes.string, + description: PropTypes.string, + choices: PropTypes.object.isRequired, + onChange: PropTypes.func.isRequired, + value: PropTypes.object.isRequired, +}; + +export default FormTokenFieldControl; diff --git a/assets/apps/components/src/Controls/GroupSelectControl.js b/assets/apps/components/src/Controls/GroupSelectControl.js new file mode 100644 index 0000000000..cdfda94464 --- /dev/null +++ b/assets/apps/components/src/Controls/GroupSelectControl.js @@ -0,0 +1,95 @@ +import PropTypes from 'prop-types'; +import { SelectControl } from '@wordpress/components'; + +const GroupSelectControl = ({ + multiple, + label, + description, + disabled, + options, + onChange, + value, +}) => { + const getParsedValue = () => { + const parsedValue = []; + Object.entries(value).forEach((groupOption) => { + const [groupKey, groupValue] = groupOption; + groupValue.forEach((val) => { + parsedValue.push( + JSON.stringify({ group: groupKey, value: val }) + ); + }); + }); + return parsedValue; + }; + + const updateValue = (nextVal) => { + const saveValue = {}; + nextVal.forEach((option) => { + const currentOpt = JSON.parse(option); + if (!saveValue[currentOpt.group]) { + saveValue[currentOpt.group] = []; + } + saveValue[currentOpt.group].push(currentOpt.value); + }); + onChange(saveValue); + }; + + const getKeyByValue = (obj, objValue) => { + return Object.keys(obj).find((key) => obj[key] === objValue); + }; + + return ( +
+ {label && ( + /* eslint-disable-next-line jsx-a11y/label-has-for */ + + )} + + {Object.values(options).map((option) => { + const objKey = getKeyByValue(options, option); + return ( + + {Object.values(option.value).map( + (groupedOption) => { + const key = `${option.label}-${groupedOption}`; + return ( + + ); + } + )} + + ); + })} + +

{description}

+
+ ); +}; + +GroupSelectControl.propTypes = { + multiple: PropTypes.bool, + label: PropTypes.string, + description: PropTypes.string, + disabled: PropTypes.bool, + options: PropTypes.object.isRequired, + onChange: PropTypes.func.isRequired, + value: PropTypes.object.isRequired, +}; + +export default GroupSelectControl; diff --git a/assets/apps/components/src/Controls/RadioImage.js b/assets/apps/components/src/Controls/RadioImage.js index 0e908d3de4..bc47029f63 100644 --- a/assets/apps/components/src/Controls/RadioImage.js +++ b/assets/apps/components/src/Controls/RadioImage.js @@ -51,7 +51,7 @@ const RadioImage = ({ choices, onClick, value, label, documentation }) => { return (
{/*eslint-disable-next-line jsx-a11y/label-has-for */} -