Added Sentry logging for unsaved changes modal in admin (#20408)

ref https://linear.app/tryghost/issue/ONC-94
- adds Sentry logging for the unsaved changes modal in Admin (tags,
members, collections)

This will let us monitor for spikes in rates so we know if a change to
Ghost has caused faulty logic in detecting dirty models.
This commit is contained in:
Steve Larson 2024-06-18 13:44:43 -05:00 committed by GitHub
parent dbd4aa61d0
commit 783984d4d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,4 @@
import * as Sentry from '@sentry/ember';
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import ConfirmUnsavedChangesModal from '../components/modals/confirm-unsaved-changes';
import {action} from '@ember/object';
@ -77,6 +78,7 @@ export default class CollectionRoute extends AuthenticatedRoute {
async confirmUnsavedChanges() {
if (this.controller.model?.hasDirtyAttributes) {
Sentry.captureMessage('showing unsaved changes modal for collections route');
this.confirmModal = this.modals
.open(ConfirmUnsavedChangesModal)
.finally(() => {

View File

@ -1,3 +1,4 @@
import * as Sentry from '@sentry/ember';
import AdminRoute from 'ghost-admin/routes/admin';
import ConfirmUnsavedChangesModal from '../components/modals/confirm-unsaved-changes';
import {action} from '@ember/object';
@ -96,6 +97,7 @@ export default class MembersRoute extends AdminRoute {
}
async confirmUnsavedChanges() {
Sentry.captureMessage('showing unsaved changes modal for members route');
this.confirmModal = this.modals
.open(ConfirmUnsavedChangesModal)
.finally(() => {

View File

@ -1,3 +1,4 @@
import * as Sentry from '@sentry/ember';
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import ConfirmUnsavedChangesModal from '../components/modals/confirm-unsaved-changes';
import {action} from '@ember/object';
@ -77,6 +78,7 @@ export default class TagRoute extends AuthenticatedRoute {
async confirmUnsavedChanges() {
if (this.controller.model?.hasDirtyAttributes) {
Sentry.captureMessage('showing unsaved changes modal for tags route');
this.confirmModal = this.modals
.open(ConfirmUnsavedChangesModal)
.finally(() => {