Skip to content

Commit f865e8f

Browse files
committed
web: Fix build errors
Signed-off-by: Kwong Tung Nan <tungnan5636@gmail.com>
1 parent ffba9fb commit f865e8f

File tree

10 files changed

+109
-43
lines changed

10 files changed

+109
-43
lines changed

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
# npm test
52
npx lint-staged

eslint.config.mjs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { FlatCompat } from "@eslint/eslintrc";
2+
import js from "@eslint/js";
3+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
4+
import tsParser from "@typescript-eslint/parser";
5+
import globals from "globals";
6+
import path from "node:path";
7+
import { fileURLToPath } from "node:url";
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
recommendedConfig: js.configs.recommended,
14+
allConfig: js.configs.all
15+
});
16+
17+
export default [
18+
...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"),
19+
{
20+
plugins: {
21+
"@typescript-eslint": typescriptEslint,
22+
},
23+
24+
languageOptions: {
25+
globals: {
26+
...globals.browser,
27+
...globals.node,
28+
},
29+
30+
parser: tsParser,
31+
ecmaVersion: "latest",
32+
sourceType: "module",
33+
},
34+
35+
rules: {
36+
indent: ["error", 4],
37+
"linebreak-style": ["error", "unix"],
38+
quotes: ["error", "double"],
39+
semi: ["error", "always"],
40+
"@typescript-eslint/no-explicit-any": "off",
41+
"@typescript-eslint/no-unused-vars": "off",
42+
"@typescript-eslint/no-inferrable-types": ["warn", {
43+
ignoreParameters: true,
44+
ignoreProperties: true,
45+
}],
46+
},
47+
},
48+
];

package-lock.json

Lines changed: 30 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
"@angular/cli": "^18.2.12",
7070
"@angular/compiler-cli": "^18.2.13",
7171
"@codecov/webpack-plugin": "^1.6.0",
72+
"@eslint/eslintrc": "^3.2.0",
73+
"@eslint/js": "^9.17.0",
7274
"@sentry/webpack-plugin": "^2.5.0",
7375
"@types/geojson": "^7946.0.14",
7476
"@types/jasmine": "~5.1.4",
@@ -79,6 +81,7 @@
7981
"eslint": "^9.17.0",
8082
"eslint-config-prettier": "^9.0.0",
8183
"eslint-plugin-json": "^4.0.0",
84+
"globals": "^15.14.0",
8285
"gtfs-types": "^4.0.0",
8386
"husky": "^9.0.0",
8487
"jasmine-core": "~5.5.0",

src/app/app.module.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
RecaptchaFormsModule,
66
RecaptchaV3Module,
77
ReCaptchaV3Service,
8-
} from "ng-recaptcha";
8+
} from "ng-recaptcha-2";
99
import { NzAlertModule } from "ng-zorro-antd/alert";
1010
import { NzDrawerService } from "ng-zorro-antd/drawer";
1111
import { en_US, NZ_I18N } from "ng-zorro-antd/i18n";
@@ -16,6 +16,7 @@ import { NzNotificationModule } from "ng-zorro-antd/notification";
1616
import { MarkdownModule, provideMarkdown } from "ngx-markdown";
1717

1818
import { registerLocaleData } from "@angular/common";
19+
import { provideHttpClient } from "@angular/common/http";
1920
import en from "@angular/common/locales/en";
2021
import { APP_INITIALIZER, ErrorHandler, NgModule } from "@angular/core";
2122
import {
@@ -33,9 +34,8 @@ import { getStorage, provideStorage } from "@angular/fire/storage";
3334
import { BrowserModule } from "@angular/platform-browser";
3435
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
3536
import { Router } from "@angular/router";
36-
import * as Sentry from "@sentry/angular-ivy";
37+
import * as Sentry from "@sentry/angular";
3738

38-
// import build from "../build";
3939
import { environment } from "../environments/environment";
4040
import { FooterComponent } from "./@ui/footer/footer.component";
4141
import { AppRoutingModule } from "./app-routing.module";
@@ -85,7 +85,7 @@ const providers: any[] = [
8585
},
8686
{
8787
provide: APP_INITIALIZER,
88-
// eslint-disable-next-line @typescript-eslint/no-empty-function
88+
8989
useFactory: () => () => {},
9090
deps: [Sentry.TraceService],
9191
multi: true,
@@ -105,6 +105,7 @@ const providers: any[] = [
105105
provideDatabase(() => getDatabase()),
106106
provideStorage(() => getStorage()),
107107
provideMarkdown(),
108+
provideHttpClient(),
108109
NzModalService,
109110
NzImageService,
110111
NzDrawerService,

src/app/console/events-table/events-table.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export class ConsoleEventsTableComponent implements OnInit, OnDestroy {
243243
return !rows.includes(elem.id);
244244
});
245245
}
246-
this.showLoading = loading;
246+
this.showLoading = loading ?? false;
247247
});
248248
}
249249

src/app/console/services/mark-read.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Apollo, gql } from "apollo-angular";
2-
import { ReCaptchaV3Service } from "ng-recaptcha";
2+
import { ReCaptchaV3Service } from "ng-recaptcha-2";
33
import { firstValueFrom } from "rxjs";
44
import { AuthService } from "src/app/services/auth.service";
55

src/app/header/menu/menu.component.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
Output,
1212
} from "@angular/core";
1313
import { Router } from "@angular/router";
14-
import * as Sentry from "@sentry/angular-ivy";
14+
import * as Sentry from "@sentry/angular";
1515

1616
@Component({
1717
selector: "d-header-menu",
@@ -29,8 +29,11 @@ export class MenuComponent implements OnInit, OnDestroy {
2929

3030
hadUpload: boolean = false;
3131

32-
constructor(public router: Router, private themeService: ThemeService,
33-
private imageUploadService: ImageUploadService) {
32+
constructor(
33+
public router: Router,
34+
private themeService: ThemeService,
35+
private imageUploadService: ImageUploadService
36+
) {
3437
return;
3538
}
3639

@@ -46,13 +49,13 @@ export class MenuComponent implements OnInit, OnDestroy {
4649
(count) => {
4750
this.countIcon = count;
4851

49-
if(!this.hadUpload && count > 0) {
52+
if (!this.hadUpload && count > 0) {
5053
this.hadUpload = true;
5154
}
5255
}
5356
);
5457
}
55-
58+
5659
ngOnDestroy(): void {
5760
this.$countIcon?.unsubscribe();
5861
}
@@ -72,12 +75,13 @@ export class MenuComponent implements OnInit, OnDestroy {
7275
this.curLanguage = lang;
7376
}
7477

75-
reportBug(): void {
76-
const feedback = Sentry.feedbackIntegration();
77-
feedback.openDialog();
78+
async reportBug(): Promise<void> {
79+
const form = await Sentry.feedbackIntegration().createForm();
80+
form.appendToDom();
81+
form.open();
7882
}
7983

80-
toggleTheme(): void{
84+
toggleTheme(): void {
8185
this.themeService.toggleTheme();
8286
}
8387
}

src/app/profile/spottings/spottings.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
LoadingModule,
66
TableWidthConfig,
77
} from "ng-devui";
8-
import { ReCaptchaV3Service } from "ng-recaptcha";
8+
import { ReCaptchaV3Service } from "ng-recaptcha-2";
99
import { NzToolTipModule } from "ng-zorro-antd/tooltip";
1010
import { firstValueFrom, lastValueFrom, Subscription } from "rxjs";
1111
import {

src/main.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { galaxyTheme, infinityTheme } from "ng-devui/theme-collection";
55

66
import { enableProdMode } from "@angular/core";
77
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
8-
import * as Sentry from "@sentry/angular-ivy";
8+
import * as Sentry from "@sentry/angular";
99

1010
import { AppModule } from "./app/app.module";
1111
import { environment } from "./environments/environment";
@@ -15,13 +15,13 @@ Sentry.init({
1515
tunnel: environment.sentry.tunnel,
1616
environment: environment.sentry.environment,
1717
integrations: [
18-
Sentry.browserTracingIntegration({
19-
tracingOrigins: environment.sentry.tracingOrigins,
20-
_experiments: {
21-
enableInteractions: true,
22-
}
23-
}),
18+
Sentry.browserTracingIntegration(),
2419
Sentry.replayIntegration(),
20+
Sentry.feedbackIntegration({
21+
// Additional SDK configuration goes in here, for example:
22+
colorScheme: "system",
23+
autoInject: false,
24+
}),
2525
],
2626

2727
// Set tracesSampleRate to 1.0 to capture 100%

0 commit comments

Comments
 (0)