-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:10up/convert-to-blocks into feat…
…ure/58-settings-ui
- Loading branch information
Showing
21 changed files
with
3,222 additions
and
5,267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,9 @@ | |
/.git | ||
/.github | ||
/.wordpress-org | ||
/assets | ||
/bin | ||
/config | ||
/node_modules | ||
/tests | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Build release zip | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- trunk | ||
|
||
jobs: | ||
build: | ||
name: Build release zip | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Cache node_modules | ||
id: cache-node-modules | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: Setup node version and npm cache | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: 'npm' | ||
|
||
- name: Install Node dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: npm ci --no-optional | ||
|
||
- name: Build plugin | ||
run: npm run build | ||
|
||
- name: Generate ZIP file | ||
uses: 10up/action-wordpress-plugin-build-zip@stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: No Response | ||
|
||
# **What it does**: Closes issues where the original author doesn't respond to a request for information. | ||
# **Why we have it**: To remove the need for maintainers to remember to check back on issues periodically to see if contributors have responded. | ||
# **Who does it impact**: Everyone that works on docs or docs-internal. | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
schedule: | ||
# Schedule for five minutes after the hour, every hour | ||
- cron: '5 * * * *' | ||
|
||
jobs: | ||
noResponse: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: lee-dohm/no-response@v0.5.0 | ||
with: | ||
token: ${{ github.token }} | ||
daysUntilClose: 14 # Number of days of inactivity before an Issue is closed for lack of response | ||
responseRequiredLabel: "needs:feedback" # Label indicating that a response from the original author is required | ||
closeComment: > | ||
This issue has been automatically closed because there has been no response | ||
to our request for more information. With only the | ||
information that is currently in the issue, we don't have enough information | ||
to take action. Please reach out if you have or find the answers we need so | ||
that we can investigate further. See [this blog post on bug reports and the | ||
importance of repro steps](https://www.lee-dohm.com/2015/01/04/writing-good-bug-reports/) | ||
for more information about the kind of information that may be helpful. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: "WordPress version checker" | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
- trunk | ||
pull_request: | ||
branches: | ||
- develop | ||
schedule: | ||
- cron: '0 0 * * 1' | ||
|
||
jobs: | ||
wordpress-version-checker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: WordPress version checker | ||
uses: skaut/wordpress-version-checker@v1.2.0 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
const { wp, location } = window; | ||
|
||
/** | ||
* MigrationClient provides the client-side support for the BE MigrationAgent. | ||
*/ | ||
class MigrationClient { | ||
/** | ||
* Initializes the client with the specified config settings. | ||
* | ||
* @param {object} config The convert to blocks config | ||
*/ | ||
constructor(config) { | ||
this.config = config; | ||
this.saved = false; | ||
this.didNext = false; | ||
} | ||
|
||
/** | ||
* Saves the curent post by manually dispatching savePost. | ||
*/ | ||
save() { | ||
// don't rerun after save | ||
if (this.saved) { | ||
return; | ||
} | ||
|
||
this.saved = true; | ||
|
||
const { dispatch, subscribe } = wp.data; | ||
const editor = dispatch('core/editor'); | ||
|
||
subscribe(this.didSave.bind(this)); | ||
editor.savePost(); | ||
} | ||
|
||
/** | ||
* On Post save, runs the next post migration. | ||
*/ | ||
didSave() { | ||
const { select } = wp.data; | ||
const isSavingPost = select('core/editor').isSavingPost(); | ||
const isAutosavingPost = select('core/editor').isAutosavingPost(); | ||
|
||
if (isAutosavingPost && !isSavingPost) { | ||
return; | ||
} | ||
|
||
if (this.hasNext()) { | ||
this.next(); | ||
} | ||
} | ||
|
||
/** | ||
* Checks if there is a post in the queue. | ||
* | ||
* @returns {boolean} True or false if next is present. | ||
*/ | ||
hasNext() { | ||
if (this.didNext) { | ||
return false; | ||
} | ||
|
||
if (!this.hasNextConfig()) { | ||
return false; | ||
} | ||
|
||
return this.config.agent.next; | ||
} | ||
|
||
/** | ||
* Navigates to the next post to migrate. | ||
*/ | ||
next() { | ||
if (!this.hasNextConfig()) { | ||
return; | ||
} | ||
|
||
this.didNext = true; | ||
location.href = this.config.agent.next; | ||
} | ||
|
||
/** | ||
* Checks if the next migration post data is present in config. | ||
* | ||
* @returns {boolean} True or false if next config is present | ||
*/ | ||
hasNextConfig() { | ||
if (!this.config) { | ||
return false; | ||
} | ||
|
||
if (!this.config.agent) { | ||
return false; | ||
} | ||
|
||
if (!this.config.agent.next) { | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
} | ||
|
||
export default MigrationClient; |
Oops, something went wrong.