From 3f342793518ff08ba483eea4df3cd47a4905115c Mon Sep 17 00:00:00 2001 From: Scott Prue Date: Sun, 26 Jul 2020 21:25:36 -0400 Subject: [PATCH] v0.10.1 --- package.json | 2 +- .../Actions/components/ActionsPage/useActionsPage.js | 10 ++++++---- .../components/EnvironmentsPage/useEnvironmentsPage.js | 6 +++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 2e3c42bb..7b159242 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fireadmin", - "version": "0.10.0", + "version": "0.10.1", "description": "Application for Managing Firebase Applications. Includes support for multiple environments and data migrations.", "scripts": { "clean": "rimraf build", diff --git a/src/routes/Projects/routes/Project/routes/Actions/components/ActionsPage/useActionsPage.js b/src/routes/Projects/routes/Project/routes/Actions/components/ActionsPage/useActionsPage.js index 37dc60ab..ebc30b6c 100644 --- a/src/routes/Projects/routes/Project/routes/Actions/components/ActionsPage/useActionsPage.js +++ b/src/routes/Projects/routes/Project/routes/Actions/components/ActionsPage/useActionsPage.js @@ -47,6 +47,7 @@ export default function useActionRunner({ const firestore = useFirestore() const user = useUser() const { FieldValue } = useFirestore + const { ServerValue } = useDatabase const environmentsRef = firestore.collection( `${PROJECTS_COLLECTION}/${projectId}/environments` ) @@ -80,7 +81,7 @@ export default function useActionRunner({ 'A valid template must be selected in order to run an action' showError(errMsg) triggerAnalyticsEvent('invalidTemplateRunAttempt', { - projectId: projectId, + projectId, environmentValues }) return errMsg @@ -89,12 +90,13 @@ export default function useActionRunner({ const { templateId } = selectedTemplate // Build request object for action run const actionRequest = { - projectId: projectId, + ...omit(formValues, ['_highlightResult', 'updatedAt', 'createdAt']), + projectId, serviceAccountType: 'firestore', templateId, createdBy: user.uid, - template: omit(selectedTemplate, ['_highlightResult']), - ...omit(formValues, ['_highlightResult', 'updatedAt']) + createdAt: ServerValue.TIMESTAMP, + template: omit(selectedTemplate, ['_highlightResult']) } // Convert selected environment keys into their associated environment objects diff --git a/src/routes/Projects/routes/Project/routes/Environments/components/EnvironmentsPage/useEnvironmentsPage.js b/src/routes/Projects/routes/Project/routes/Environments/components/EnvironmentsPage/useEnvironmentsPage.js index 71b46f40..e00ca4e1 100644 --- a/src/routes/Projects/routes/Project/routes/Environments/components/EnvironmentsPage/useEnvironmentsPage.js +++ b/src/routes/Projects/routes/Project/routes/Environments/components/EnvironmentsPage/useEnvironmentsPage.js @@ -5,6 +5,7 @@ import { useFirestoreCollectionData, useStorage } from 'reactfire' +import * as Sentry from '@sentry/browser' import useNotifications from 'modules/notification/useNotifications' import { triggerAnalyticsEvent, createProjectEvent } from 'utils/analytics' import { to } from 'utils/async' @@ -80,6 +81,7 @@ export default function useEnvironmentsPage({ projectId }) { 'Error uploading service account: ', uploadErr.message || 'Could not add project' ) + Sentry.captureException(uploadErr) throw uploadErr } @@ -106,6 +108,7 @@ export default function useEnvironmentsPage({ projectId }) { if (newEnvErr) { console.error('Error creating environment', newEnvErr) // eslint-disable-line no-console showError('Error creating new environment: ', newEnvErr.message) + Sentry.captureException(newEnvErr) throw newEnvErr } @@ -165,6 +168,7 @@ export default function useEnvironmentsPage({ projectId }) { } catch (err) { console.error('error', err) // eslint-disable-line no-console showError('Error: ', err.message || 'Could not remove environment') + Sentry.captureException(err) } } @@ -204,7 +208,7 @@ export default function useEnvironmentsPage({ projectId }) { } catch (err) { console.error('Error updating environment:', err.message) // eslint-disable-line no-console showError('Error: ', err.message || 'Could not update environment') - throw err + Sentry.captureException(err) } }