Skip to content

Commit

Permalink
feedback with attachment (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-garcia authored Mar 15, 2024
1 parent c3db6a2 commit ae97604
Show file tree
Hide file tree
Showing 9 changed files with 245 additions and 127 deletions.
330 changes: 230 additions & 100 deletions src/NuGetTrends.Web/Portal/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/NuGetTrends.Web/Portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"@angular/platform-browser": "^17.1.3",
"@angular/platform-browser-dynamic": "^17.1.3",
"@angular/router": "^17.1.3",
"@sentry/angular-ivy": "^7.100.1",
"@sentry/integrations": "^7.100.1",
"@sentry/angular-ivy": "^8.0.0-alpha.4",
"@sentry-internal/feedback": "^8.0.0-alpha.4",
"@types/chart.js": "2.9.32",
"bulma": "^0.9.4",
"bulma-start": "^0.0.5",
Expand Down
16 changes: 6 additions & 10 deletions src/NuGetTrends.Web/Portal/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { DatePipe } from '@angular/common';
import { HttpClientModule } from '@angular/common/http';
import { Router } from '@angular/router';
import * as Sentry from '@sentry/angular-ivy';
import { feedbackIntegration, feedbackModalIntegration, feedbackScreenshotIntegration } from "@sentry-internal/feedback";

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routes.module';
Expand Down Expand Up @@ -41,7 +42,7 @@ Sentry.init({
networkResponseHeaders: ["Server"],
}),
Sentry.replayCanvasIntegration(),
Sentry.feedbackIntegration({
feedbackIntegration({
colorScheme: "light", // no dark theme yet
themeLight: {
submitBackground: '#215C84',
Expand All @@ -51,17 +52,12 @@ Sentry.init({
inputForeground: '#374151',
},
}),
new Sentry.BrowserTracing({
routingInstrumentation: Sentry.instrumentAngularRouting,
feedbackModalIntegration(),
feedbackScreenshotIntegration(),
Sentry.browserTracingIntegration({
idleTimeout: 30000,
heartbeatInterval:10000,
_experiments: {
enableInteractions: true,
// If you want automatic route transactions in react or similar
onStartRouteTransaction: Sentry.onProfilingStartRouteTransaction,
}
}),
new Sentry.BrowserProfilingIntegration(),
Sentry.browserProfilingIntegration(),
],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { IPackageDownloadHistory, IDownloadStats } from '../shared/models/packag
styleUrls: ['./packages.component.scss'],
animations: [AppAnimations.slideInOutAnimation]
})
@Sentry.TraceClassDecorator()
@Sentry.TraceClass({ name: 'HeaderComponent' })
export class PackagesComponent implements OnInit, OnDestroy {

private trendChart!: Chart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LoadingIndicatorService } from './loading-indicator.service';
templateUrl: './loading-indicator.component.html',
styleUrls: ['./loading-indicator.component.scss']
})
@Sentry.TraceClassDecorator()
@Sentry.TraceClass({ name: 'LoadingIndicatorComponent' })
export class LoadingIndicatorComponent implements AfterViewInit, OnDestroy {

loadingSubscription?: Subscription;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as Sentry from "@sentry/angular-ivy";
templateUrl: './package-list.component.html',
styleUrls: ['./package-list.component.scss']
})
@Sentry.TraceClassDecorator()
@Sentry.TraceClass({ name: 'HeaderComponent' })
export class PackageListComponent implements OnDestroy {
packageList: Array<IPackageColor>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { PackagesService, PackageInteractionService } from '../../../core';
styleUrls: ['./search-input.component.scss'],
encapsulation: ViewEncapsulation.None,
})
@Sentry.TraceClassDecorator()
@Sentry.TraceClass({ name: 'SearchInputComponent' })
export class SearchInputComponent implements AfterViewInit {
@ViewChild(MatAutocomplete) autoComplete!: MatAutocomplete;
@ViewChild('searchBox') searchBox!: ElementRef;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { SocialShareService } from 'src/app/core/services/social-share.service';
templateUrl: './share-popover.component.html',
styleUrls: ['./share-popover.component.scss']
})
@Sentry.TraceClassDecorator()
@Sentry.TraceClass({ name: 'SharePopoverComponent' })
export class SharePopoverComponent {
@Input() buttonText = '';
@Output() shared = new EventEmitter();
Expand Down
12 changes: 2 additions & 10 deletions src/NuGetTrends.Web/Portal/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,12 @@ if (environment.production) {
enableProdMode();
}

const activeTransaction = Sentry.getActiveTransaction();
const bootstrapSpan =
activeTransaction &&
activeTransaction.startChild({
description: "platform-browser-dynamic",
op: "ui.angular.bootstrap",
});
const span = Sentry.startInactiveSpan({ name: 'platform-browser-dynamic', op: 'ui.angular.bootstrap' });

platformBrowserDynamic()
.bootstrapModule(AppModule)
.then(() => console.log(`Bootstrap success`))
.catch(err => console.error(err))
.finally(() => {
if (bootstrapSpan) {
bootstrapSpan.finish();
}
span.end();
});

0 comments on commit ae97604

Please sign in to comment.