🐛 Fixed saving of custom integrations

closes https://github.com/TryGhost/Ghost/pull/14183
refs 3ee0c3ff53

- unskipped test for integration saving
- fixed missed rename from `save` to `saveTask`
- fixed `saveTask` throwing from a "handled" validation error
This commit is contained in:
Kevin Ansfield 2022-02-21 17:25:12 +00:00
parent 26388774cc
commit d1e7ccbe00
3 changed files with 12 additions and 3 deletions

View File

@ -186,7 +186,16 @@ export default class IntegrationController extends Controller {
} }
@task(function* () { @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; saveTask;

View File

@ -9,7 +9,7 @@
{{this.integration.name}} {{this.integration.name}}
</h2> </h2>
<section class="view-actions"> <section class="view-actions">
<GhTaskButton @task={{this.save}} @class="gh-btn gh-btn-primary gh-btn-icon" data-test-button="save" /> <GhTaskButton @task={{this.saveTask}} @class="gh-btn gh-btn-primary gh-btn-icon" data-test-button="save" />
</section> </section>
</GhCanvasHeader> </GhCanvasHeader>

View File

@ -278,7 +278,7 @@ describe('Acceptance: Settings - Integrations - Custom', function () {
).to.equal('/settings/integrations/1'); ).to.equal('/settings/integrations/1');
}); });
it.skip('can manage an integration', async function () { it('can manage an integration', async function () {
this.server.create('integration'); this.server.create('integration');
await visit('/settings/integrations/1'); await visit('/settings/integrations/1');