From d1e7ccbe008eb3e78550df2aea99c5a31741caf4 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 21 Feb 2022 17:25:12 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20saving=20of=20custom=20i?= =?UTF-8?q?ntegrations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Ghost/pull/14183 refs https://github.com/TryGhost/Admin/commit/3ee0c3ff53fc768b28c7f1fe9d255c68f8325345 - unskipped test for integration saving - fixed missed rename from `save` to `saveTask` - fixed `saveTask` throwing from a "handled" validation error --- ghost/admin/app/controllers/settings/integration.js | 11 ++++++++++- ghost/admin/app/templates/settings/integration.hbs | 2 +- .../tests/acceptance/settings/integrations-test.js | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ghost/admin/app/controllers/settings/integration.js b/ghost/admin/app/controllers/settings/integration.js index d1221d7543..8c24cc0b29 100644 --- a/ghost/admin/app/controllers/settings/integration.js +++ b/ghost/admin/app/controllers/settings/integration.js @@ -186,7 +186,16 @@ export default class IntegrationController extends Controller { } @task(function* () { - return yield this.integration.save(); + try { + return yield this.integration.save(); + } catch (e) { + if (e === undefined) { + // validation error + return false; + } + + throw e; + } }) saveTask; diff --git a/ghost/admin/app/templates/settings/integration.hbs b/ghost/admin/app/templates/settings/integration.hbs index 17402937fb..d719a7b29d 100644 --- a/ghost/admin/app/templates/settings/integration.hbs +++ b/ghost/admin/app/templates/settings/integration.hbs @@ -9,7 +9,7 @@ {{this.integration.name}}
- +
diff --git a/ghost/admin/tests/acceptance/settings/integrations-test.js b/ghost/admin/tests/acceptance/settings/integrations-test.js index 5ecaf9ff57..a5ca970148 100644 --- a/ghost/admin/tests/acceptance/settings/integrations-test.js +++ b/ghost/admin/tests/acceptance/settings/integrations-test.js @@ -278,7 +278,7 @@ describe('Acceptance: Settings - Integrations - Custom', function () { ).to.equal('/settings/integrations/1'); }); - it.skip('can manage an integration', async function () { + it('can manage an integration', async function () { this.server.create('integration'); await visit('/settings/integrations/1');