Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the gutenberg-pr Query API option #713

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/docs/site/docs/08-query-api/01-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ You can go ahead and try it out. The Playground will automatically install the t
| `mode` | `seamless` | Displays WordPress on a full-page or wraps it in a browser UI |
| `lazy` | | Defer loading the Playground assets until someone clicks on the "Run" button |
| `login` | `1` | Logs the user in as an admin |
| `gutenberg-pr` | | Loads the specified Gutenberg Pull Request |
| `storage` | | Selects the storage for Playground: `none` gets erased on page refresh, `browser` is stored in the browser, and `device` is stored in the selected directory on a device. The last two protect the user from accidentally losing their work upon page refresh. |

For example, the following code embeds a Playground with a preinstalled Gutenberg plugin, and opens the post editor:
Expand Down
38 changes: 0 additions & 38 deletions packages/playground/website/src/lib/make-blueprint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ interface MakeBlueprintOptions {
landingPage?: string;
theme?: string;
plugins?: string[];
gutenbergPR?: number;
}
export function makeBlueprint(options: MakeBlueprintOptions): Blueprint {
const plugins = options.plugins || [];
Expand Down Expand Up @@ -40,43 +39,6 @@ export function makeBlueprint(options: MakeBlueprintOptions): Blueprint {
},
progress: { weight: 2 },
})),
...(typeof options.gutenbergPR === 'number'
? applyGutenbergPRSteps(options.gutenbergPR)
: []),
],
};
}

function applyGutenbergPRSteps(prNumber: number): StepDefinition[] {
return [
{
step: 'mkdir',
path: '/wordpress/pr',
},
{
step: 'writeFile',
path: '/wordpress/pr/pr.zip',
data: {
resource: 'url',
url: `/plugin-proxy?org=WordPress&repo=gutenberg&workflow=Build%20Gutenberg%20Plugin%20Zip&artifact=gutenberg-plugin&pr=${prNumber}`,
caption: `Downloading Gutenberg PR ${prNumber}`,
},
progress: {
weight: 2,
caption: `Applying Gutenberg PR ${prNumber}`,
},
},
{
step: 'unzip',
zipPath: '/wordpress/pr/pr.zip',
extractToPath: '/wordpress/pr',
},
{
step: 'installPlugin',
pluginZipFile: {
resource: 'vfs',
path: '/wordpress/pr/gutenberg.zip',
},
},
];
}
3 changes: 0 additions & 3 deletions packages/playground/website/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ try {
plugins: query.getAll('plugin'),
landingPage: query.get('url') || undefined,
phpExtensionBundles: query.getAll('php-extension-bundle') || [],
gutenbergPR: query.has('gutenberg-pr')
? Number(query.get('gutenberg-pr'))
: undefined,
});
}

Expand Down
Loading