From c4629e0118a0f7ea8d968696f44cad1e40ef388c Mon Sep 17 00:00:00 2001 From: Nick Moreton Date: Wed, 7 Jun 2023 16:05:38 +0100 Subject: [PATCH] Added transparency grid and event tracking to Image Editor (#16959) --- ghost/admin/app/components/koenig-image-editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/components/koenig-image-editor.js b/ghost/admin/app/components/koenig-image-editor.js index 2d79465bde..dff7cf5799 100644 --- a/ghost/admin/app/components/koenig-image-editor.js +++ b/ghost/admin/app/components/koenig-image-editor.js @@ -1,4 +1,5 @@ import Component from '@glimmer/component'; +import trackEvent from '../utils/analytics'; import {action} from '@ember/object'; import {inject} from 'ghost-admin/decorators/inject'; import {inject as service} from '@ember/service'; @@ -144,10 +145,11 @@ export default class KoenigImageEditor extends Component { if (!imageUrl.searchParams.has('v')) { imageUrl.searchParams.set('v', Date.now()); } - + trackEvent('Image Edit Button Clicked', {location: 'admin'}); const imageSrc = imageUrl.href; const editor = window.pintura.openDefaultEditor({ src: imageSrc, + enableTransparencyGrid: true, util: 'crop', utils: [ 'crop', @@ -214,6 +216,7 @@ export default class KoenigImageEditor extends Component { if (this.args.saveUrl) { uploader.setFiles([result.dest]); } + trackEvent('Image Edit Saved', {location: 'admin'}); } catch (e) { // Failed to save edited image }