Skip to content

Commit d8ec4b3

Browse files
authored
Frontend - Leaderboard CSV files #1071
Frontend - Leaderboard CSV files
2 parents f2bf64c + 08ae769 commit d8ec4b3

File tree

16 files changed

+269
-64
lines changed

16 files changed

+269
-64
lines changed

frontend/cypress/e2e/block-production/won-slots/side-panel.cy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ describe('BLOCK PRODUCTION WON SLOTS SIDE PANEL', () => {
101101
.then((state: BlockProductionWonSlotsState) => {
102102
expect(state.activeSlot.globalSlot).to.equal(expectedActiveSlot.globalSlot);
103103
expect(state.activeSlot.height).to.equal(expectedActiveSlot.height);
104-
console.log(expectedActiveSlot.times);
105104
})
106105
.get('mina-block-production-won-slots-side-panel .percentage')
107106
.should('have.text', ([

frontend/package-lock.json

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

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frontend",
3-
"version": "1.0.124",
3+
"version": "1.0.129",
44
"scripts": {
55
"install:deps": "npm install",
66
"start": "npm install && ng serve --configuration local --open",

frontend/src/app/app.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export class AppComponent extends StoreDispatcher implements OnInit {
7878
}
7979

8080
private initAppFunctionalities(): void {
81-
console.log('initAppFunctionalities');
8281
if (this.webNodeService.hasWebNodeConfig() && !this.webNodeService.isWebNodeLoaded()) {
8382
if (!getWindow()?.location.href.includes(`/${Routes.LOADING_WEB_NODE}`)) {
8483
this.router.navigate([Routes.LOADING_WEB_NODE], { queryParamsHandling: 'preserve' });

frontend/src/app/app.module.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,21 @@ export class AppGlobalErrorhandler implements ErrorHandler {
128128
}
129129
}
130130

131+
const firebaseProviders = [
132+
provideClientHydration(),
133+
provideHttpClient(withFetch()),
134+
provideFirebaseApp(() => initializeApp(CONFIG.globalConfig.firebase)),
135+
provideAnalytics(() => getAnalytics()),
136+
ScreenTrackingService,
137+
// provideAppCheck(() => {
138+
// // TODO get a reCAPTCHA Enterprise here https://console.cloud.google.com/security/recaptcha?project=_
139+
// const provider = new ReCaptchaEnterpriseProvider(/* reCAPTCHA Enterprise site key */);
140+
// return initializeAppCheck(undefined, { provider, isTokenAutoRefreshEnabled: true });
141+
// }),
142+
providePerformance(() => getPerformance()),
143+
provideFirestore(() => getFirestore()),
144+
];
145+
131146
@NgModule({
132147
declarations: [
133148
AppComponent,
@@ -181,18 +196,7 @@ export class AppGlobalErrorhandler implements ErrorHandler {
181196
deps: [Sentry.TraceService],
182197
multi: true,
183198
},
184-
provideClientHydration(),
185-
provideHttpClient(withFetch()),
186-
provideFirebaseApp(() => initializeApp(CONFIG.globalConfig.firebase)),
187-
provideAnalytics(() => getAnalytics()),
188-
ScreenTrackingService,
189-
// provideAppCheck(() => {
190-
// // TODO get a reCAPTCHA Enterprise here https://console.cloud.google.com/security/recaptcha?project=_
191-
// const provider = new ReCaptchaEnterpriseProvider(/* reCAPTCHA Enterprise site key */);
192-
// return initializeAppCheck(undefined, { provider, isTokenAutoRefreshEnabled: true });
193-
// }),
194-
providePerformance(() => getPerformance()),
195-
provideFirestore(() => getFirestore()),
199+
...[CONFIG.globalConfig.firebase ? firebaseProviders : []],
196200
],
197201
bootstrap: [AppComponent],
198202
exports: [

frontend/src/app/app.service.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Injectable } from '@angular/core';
2-
import { map, Observable, of, tap } from 'rxjs';
2+
import { map, Observable, of } from 'rxjs';
33
import { MinaNode } from '@shared/types/core/environment/mina-env.type';
44
import { CONFIG } from '@shared/constants/config';
55
import { RustService } from '@core/services/rust.service';
@@ -8,15 +8,13 @@ import { getNetwork } from '@shared/helpers/mina.helper';
88
import { getLocalStorage, nanOrElse, ONE_MILLION } from '@openmina/shared';
99
import { BlockProductionWonSlotsStatus } from '@shared/types/block-production/won-slots/block-production-won-slots-slot.type';
1010
import { AppEnvBuild } from '@shared/types/app/app-env-build.type';
11-
import { FirestoreService } from '@core/services/firestore.service';
1211

1312
@Injectable({
1413
providedIn: 'root',
1514
})
1615
export class AppService {
1716

18-
constructor(private rust: RustService,
19-
private firestoreService: FirestoreService) { }
17+
constructor(private rust: RustService) { }
2018

2119
getActiveNode(nodes: MinaNode[]): Observable<MinaNode> {
2220
const nodeName = new URL(location.href).searchParams.get('node');
@@ -54,16 +52,6 @@ export class AppService {
5452
producingBlockGlobalSlot: data.current_block_production_attempt?.won_slot.global_slot,
5553
producingBlockStatus: data.current_block_production_attempt?.status,
5654
} as AppNodeDetails)),
57-
tap((details: any) => {
58-
// undefined not allowed. Firestore does not accept undefined values
59-
// foreach undefined value, we set it to null
60-
Object.keys(details).forEach((key: string) => {
61-
if (details[key] === undefined) {
62-
details[key] = null;
63-
}
64-
});
65-
// this.firestoreService.addHeartbeat(details);
66-
}),
6755
);
6856
}
6957

frontend/src/app/core/services/firestore.service.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
import { Injectable } from '@angular/core';
2-
import {
3-
Firestore,
4-
CollectionReference,
5-
collection,
6-
addDoc,
7-
doc,
8-
setDoc,
9-
updateDoc,
10-
deleteDoc,
11-
DocumentData,
12-
} from '@angular/fire/firestore';
1+
import { Injectable, Optional } from '@angular/core';
2+
import { collection, CollectionReference, deleteDoc, doc, DocumentData, Firestore, updateDoc } from '@angular/fire/firestore';
133
import { HttpClient } from '@angular/common/http';
14-
import { catchError, EMPTY, Observable, of } from 'rxjs';
4+
import { catchError, Observable, of } from 'rxjs';
155

166
@Injectable({
177
providedIn: 'root',
@@ -20,9 +10,11 @@ export class FirestoreService {
2010
private heartbeatCollection: CollectionReference<DocumentData>;
2111
private cloudFunctionUrl = 'https://us-central1-webnode-gtm-test.cloudfunctions.net/handleValidationAndStore';
2212

23-
constructor(private firestore: Firestore,
13+
constructor(@Optional() private firestore: Firestore,
2414
private http: HttpClient) {
25-
this.heartbeatCollection = collection(this.firestore, 'heartbeat');
15+
if (this.firestore) {
16+
this.heartbeatCollection = collection(this.firestore, 'heartbeat');
17+
}
2618
}
2719

2820
addHeartbeat(data: any): Observable<any> {

frontend/src/app/core/services/rust.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export class RustService {
1515
private webNodeService: WebNodeService) {}
1616

1717
changeRustNode(node: MinaNode): void {
18-
console.log('Changing Rust node to:', node);
1918
this.node = node;
2019
}
2120

frontend/src/app/core/services/web-node.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export class WebNodeService {
6060
}
6161

6262
loadWasm$(): Observable<void> {
63-
console.log('Loading wasm');
6463
this.webNodeStartTime = Date.now();
6564

6665
if (isBrowser()) {

frontend/src/app/features/leaderboard/leaderboard-filters/leaderboard-filters.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
padding: 0 24px;
1919
border-radius: 44px;
2020
font-size: 16px;
21-
transition: all 0.15s ease;
2221
background-color: $mina-base-divider;
2322
color: $black;
2423
cursor: pointer;
2524
position: relative;
2625
overflow: hidden;
26+
transition: all 0.15s ease;
2727

2828
&:hover {
2929
box-shadow: 0 2px 4px 0 $black3;
@@ -106,7 +106,6 @@
106106
.search input,
107107
.search input::placeholder {
108108
font-size: 3.3vw;
109-
110109
}
111110
}
112111
}

0 commit comments

Comments
 (0)