Sentry logging and minor UI
This commit is contained in:
31
App.js
31
App.js
@@ -12,40 +12,11 @@ import { client } from "./graphql/client";
|
|||||||
import { persistor, store } from "./redux/store";
|
import { persistor, store } from "./redux/store";
|
||||||
import "./translations/i18n";
|
import "./translations/i18n";
|
||||||
|
|
||||||
Sentry.init({
|
|
||||||
dsn: 'https://8d6c3de1940a4e4f8b81cf4d2150bdea@o492140.ingest.us.sentry.io/5558869',
|
|
||||||
|
|
||||||
// Adds more context data to events (IP address, cookies, user, etc.)
|
|
||||||
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
|
|
||||||
sendDefaultPii: true,
|
|
||||||
|
|
||||||
// Enable Logs
|
|
||||||
enableLogs: true,
|
|
||||||
|
|
||||||
// Configure Session Replay
|
|
||||||
replaysSessionSampleRate: 0.1,
|
|
||||||
replaysOnErrorSampleRate: 1,
|
|
||||||
integrations: [Sentry.mobileReplayIntegration(), Sentry.feedbackIntegration()],
|
|
||||||
ignoreErrors: [/.*Network Error.*/i]
|
|
||||||
// uncomment the line below to enable Spotlight (https://spotlightjs.com)
|
|
||||||
// spotlight: __DEV__,
|
|
||||||
});
|
|
||||||
|
|
||||||
// Sentry.init({
|
|
||||||
// dsn: "https://8d6c3de1940a4e4f8b81cf4d2150bdea@o492140.ingest.sentry.io/5558869",
|
|
||||||
// enableInExpoDevelopment: true,
|
|
||||||
// // tracesSampleRate: 0.2,
|
|
||||||
// // integrations: [
|
|
||||||
// // new Sentry.ReactNativeTracing({
|
|
||||||
// // tracingOrigins: ["localhost", "imex.online", "cloudinary.com", /^\//],
|
|
||||||
// // // ... other options
|
|
||||||
// // }),
|
|
||||||
// // ],
|
|
||||||
// //debug: true, // Sentry will try to print out useful debugging information if something goes wrong with sending an event. Set this to `false` in production.
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaProvider>
|
<SafeAreaProvider>
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
|
|||||||
@@ -4,11 +4,13 @@ import { selectBodyshop, selectCurrentUser } from "@/redux/user/user.selectors";
|
|||||||
import { ApolloProvider } from "@apollo/client";
|
import { ApolloProvider } from "@apollo/client";
|
||||||
import { loadDevMessages, loadErrorMessages } from "@apollo/client/dev";
|
import { loadDevMessages, loadErrorMessages } from "@apollo/client/dev";
|
||||||
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
|
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DarkTheme,
|
DarkTheme,
|
||||||
DefaultTheme,
|
DefaultTheme,
|
||||||
ThemeProvider,
|
ThemeProvider,
|
||||||
} from "@react-navigation/native";
|
} from "@react-navigation/native";
|
||||||
|
import * as Sentry from "@sentry/react-native";
|
||||||
import * as Notifications from "expo-notifications";
|
import * as Notifications from "expo-notifications";
|
||||||
import { Stack } from "expo-router";
|
import { Stack } from "expo-router";
|
||||||
import {
|
import {
|
||||||
@@ -19,8 +21,11 @@ import {
|
|||||||
} from "expo-router/unstable-native-tabs";
|
} from "expo-router/unstable-native-tabs";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { ActivityIndicator, Platform, View } from "react-native";
|
import { Platform, View } from "react-native";
|
||||||
import { Provider as PaperProvider } from "react-native-paper";
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
Provider as PaperProvider,
|
||||||
|
} from "react-native-paper";
|
||||||
import { connect, Provider } from "react-redux";
|
import { connect, Provider } from "react-redux";
|
||||||
import { PersistGate } from "redux-persist/integration/react";
|
import { PersistGate } from "redux-persist/integration/react";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -33,9 +38,27 @@ import { registerForPushNotificationsAsync } from "../util/notificationHandler";
|
|||||||
loadDevMessages();
|
loadDevMessages();
|
||||||
loadErrorMessages();
|
loadErrorMessages();
|
||||||
|
|
||||||
|
Sentry.init({
|
||||||
|
dsn: "https://8d6c3de1940a4e4f8b81cf4d2150bdea@o492140.ingest.us.sentry.io/5558869",
|
||||||
|
// Adds more context data to events (IP address, cookies, user, etc.)
|
||||||
|
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
|
||||||
|
sendDefaultPii: true,
|
||||||
|
// Enable Logs
|
||||||
|
enableLogs: true,
|
||||||
|
// Configure Session Replay
|
||||||
|
replaysSessionSampleRate: 0.1,
|
||||||
|
replaysOnErrorSampleRate: 1,
|
||||||
|
integrations: [
|
||||||
|
Sentry.mobileReplayIntegration(),
|
||||||
|
Sentry.feedbackIntegration(),
|
||||||
|
],
|
||||||
|
ignoreErrors: [/.*Network Error.*/i],
|
||||||
|
});
|
||||||
|
|
||||||
function AuthenticatedLayout() {
|
function AuthenticatedLayout() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const paperTheme = usePaperTheme();
|
const paperTheme = usePaperTheme();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
value={paperTheme.theme === "dark" ? DarkTheme : DefaultTheme}
|
value={paperTheme.theme === "dark" ? DarkTheme : DefaultTheme}
|
||||||
@@ -146,6 +169,9 @@ function AppContent({ currentUser, checkUserSession, bodyshop }: any) {
|
|||||||
console.log("Notification response received:", response);
|
console.log("Notification response received:", response);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Clear the badges.
|
||||||
|
Notifications.setBadgeCountAsync(0);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
notificationListener.remove();
|
notificationListener.remove();
|
||||||
responseListener.remove();
|
responseListener.remove();
|
||||||
@@ -183,7 +209,7 @@ const ConnectedAppContent = connect(
|
|||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(AppContent);
|
)(AppContent);
|
||||||
|
|
||||||
export default function AppLayout() {
|
function AppLayout() {
|
||||||
return (
|
return (
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<PersistGate persistor={persistor}>
|
<PersistGate persistor={persistor}>
|
||||||
@@ -194,3 +220,5 @@ export default function AppLayout() {
|
|||||||
</Provider>
|
</Provider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default Sentry.wrap(AppLayout);
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export default function GlobalSearch() {
|
|||||||
{!loading && (
|
{!loading && (
|
||||||
<Text variant="titleSmall" style={{ margin: 12, alignSelf: "center" }}>
|
<Text variant="titleSmall" style={{ margin: 12, alignSelf: "center" }}>
|
||||||
{
|
{
|
||||||
results.length - 1 //Need to subtract for the spacer.
|
Math.max(0, results.length - 1) //Need to subtract for the spacer.
|
||||||
}{" "}
|
}{" "}
|
||||||
results found
|
results found
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -43,7 +43,16 @@ function JobListItemComponent({ openImagePicker, item }) {
|
|||||||
const roNumber = item.ro_number || t("general.labels.na");
|
const roNumber = item.ro_number || t("general.labels.na");
|
||||||
|
|
||||||
if (item.id === "footer-spacer") {
|
if (item.id === "footer-spacer") {
|
||||||
return <View style={{ height: item.height || 64 }} />;
|
return (
|
||||||
|
//This has to be nested for some reason?
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
height: item.height || 96,
|
||||||
|
}}
|
||||||
|
></View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Pressable
|
<Pressable
|
||||||
|
|||||||
@@ -55,10 +55,7 @@ export function JobListComponent({ bodyshop, openImagePicker }) {
|
|||||||
const jobs = data ? [...(data?.jobs || []), { id: "footer-spacer" }] : [];
|
const jobs = data ? [...(data?.jobs || []), { id: "footer-spacer" }] : [];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView
|
<SafeAreaView style={{ flex: 1, marginHorizontal: 12 }} edges={["top"]}>
|
||||||
style={{ flex: 1, marginHorizontal: 12, paddingBottom: 48 }}
|
|
||||||
edges={["top"]}
|
|
||||||
>
|
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@@ -73,7 +70,11 @@ export function JobListComponent({ bodyshop, openImagePicker }) {
|
|||||||
>
|
>
|
||||||
{t("joblist.titles.jobtab")}
|
{t("joblist.titles.jobtab")}
|
||||||
</Text>
|
</Text>
|
||||||
<Button icon="cloud-upload-outline" mode="outlined" onPress={handleTempUpload}>
|
<Button
|
||||||
|
icon="cloud-upload-outline"
|
||||||
|
mode="outlined"
|
||||||
|
onPress={handleTempUpload}
|
||||||
|
>
|
||||||
{t("joblist.labels.tempdocs")}
|
{t("joblist.labels.tempdocs")}
|
||||||
</Button>
|
</Button>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ function Tab({ bodyshop, currentUser, signOutStart }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={{ flex: 1, paddingBottom: 48 }}>
|
<SafeAreaView style={{ flex: 1 }} edges={["top"]}>
|
||||||
<Text variant="headlineMedium" style={styles.title}>
|
<Text variant="headlineMedium" style={styles.title}>
|
||||||
{t("settings.titles.settings")}
|
{t("settings.titles.settings")}
|
||||||
</Text>
|
</Text>
|
||||||
@@ -230,6 +230,7 @@ const styles = StyleSheet.create({
|
|||||||
container: {
|
container: {
|
||||||
paddingVertical: 24,
|
paddingVertical: 24,
|
||||||
paddingHorizontal: 12,
|
paddingHorizontal: 12,
|
||||||
|
paddingBottom: 96,
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
marginHorizontal: 12,
|
marginHorizontal: 12,
|
||||||
|
|||||||
@@ -106,9 +106,6 @@ export function* onSignInSuccess() {
|
|||||||
|
|
||||||
export function* signInSuccessSaga({ payload }) {
|
export function* signInSuccessSaga({ payload }) {
|
||||||
try {
|
try {
|
||||||
// Analytics.setUserId(payload.email);//JF:commenting out the firebase analytics portion
|
|
||||||
|
|
||||||
|
|
||||||
const shop = yield client.query({ query: QUERY_BODYSHOP });
|
const shop = yield client.query({ query: QUERY_BODYSHOP });
|
||||||
logImEXEvent("imexmobile_sign_in_success", payload);
|
logImEXEvent("imexmobile_sign_in_success", payload);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user