diff --git a/CHANGELOG-WIP.md b/CHANGELOG-WIP.md index 1f2f420b453..c13233e3383 100644 --- a/CHANGELOG-WIP.md +++ b/CHANGELOG-WIP.md @@ -8,7 +8,8 @@ - Added the `--format` option to the `db/backup` and `db/restore` commands for PostgreSQL installs. ([#14931](https://github.com/craftcms/cms/pull/14931)) - The `db/restore` command now autodetects the backup format for PostgreSQL installs, if `--format` isn’t passed. ([#14931](https://github.com/craftcms/cms/pull/14931)) - The `install` command and web-based installer now validate the existing project config files at the outset, and abort installation if there are any issues. -- The web-based installer now displays the error message when installation fails. +- The web-based installer now displays the error message when installation fails. +- GraphQL schema edit pages now have a “Save and continue editing” alternate action. ### Development - Added `craft\elements\ElementCollection::find()`, which can return an element or elements in the collection based on a given element or ID. ([#15023](https://github.com/craftcms/cms/discussions/15023)) diff --git a/src/controllers/GraphqlController.php b/src/controllers/GraphqlController.php index 8927690a9f7..e6fe1ae1d92 100644 --- a/src/controllers/GraphqlController.php +++ b/src/controllers/GraphqlController.php @@ -597,7 +597,6 @@ public function actionEditSchema(?int $schemaId = null, ?GqlSchema $schema = nul $title = trim($schema->name) ?: Craft::t('app', 'Create a new GraphQL Schema'); } - return $this->renderTemplate('graphql/schemas/_edit.twig', compact( 'schema', 'title' @@ -718,7 +717,7 @@ public function actionSaveSchema(): ?Response } $this->setSuccessFlash(Craft::t('app', 'Schema saved.')); - return $this->redirectToPostedUrl(); + return $this->redirectToPostedUrl($schema); } /** diff --git a/src/templates/graphql/schemas/_edit.twig b/src/templates/graphql/schemas/_edit.twig index b62194eb850..aa7e9574115 100644 --- a/src/templates/graphql/schemas/_edit.twig +++ b/src/templates/graphql/schemas/_edit.twig @@ -4,6 +4,15 @@ {% set fullPageForm = true %} +{% set formActions = [ + { + label: 'Save and continue editing'|t('app'), + redirect: (schema.isPublic ? 'graphql/schemas/public' : 'graphql/schemas/{id}')|hash, + shortcut: true, + retainScroll: true, + }, +] %} + {% set crumbs = [ { label: "GraphQL Schemas"|t('app'), url: url('graphql/schemas') } ] %}