Skip to content

Commit d0f8ffe

Browse files
authored
Frontend - Add Epoch Slot in block production table - #655
Frontend - Add Epoch Slot in block production table - #655
2 parents cc46112 + 968adf7 commit d0f8ffe

File tree

7 files changed

+21
-14
lines changed

7 files changed

+21
-14
lines changed

.github/workflows/docker.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,16 @@ jobs:
181181
needs:
182182
- build-openmina-frontend-image
183183
steps:
184+
- name: Git checkout
185+
uses: actions/checkout@v3
186+
187+
- name: Extract Version from package.json
188+
id: extract_version
189+
run: |
190+
VERSION=$(jq -r '.version' ../../frontend/package.json)
191+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
192+
echo "Extracted version: ${VERSION}"
193+
184194
- name: Download digests
185195
uses: actions/download-artifact@v4
186196
with:
@@ -191,13 +201,6 @@ jobs:
191201
- name: Set up Docker Buildx
192202
uses: docker/setup-buildx-action@v3
193203

194-
- name: Extract Version from package.json
195-
id: extract_version
196-
run: |
197-
VERSION=$(jq -r '.version' ../../frontend/package.json)
198-
echo "VERSION=${VERSION}" >> $GITHUB_ENV
199-
echo "Extracted version: ${VERSION}"
200-
201204
- name: Docker meta
202205
id: meta
203206
uses: docker/metadata-action@v5

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ describe('BLOCK PRODUCTION WON SLOTS TABLE', () => {
122122
}));
123123

124124
it('sort by transactions', () => execute(() => {
125-
cy.get('mina-block-production-won-slots-table .head > span:nth-child(5)')
125+
cy.get('mina-block-production-won-slots-table .head > span:nth-child(6)')
126126
.click()
127127
.window()
128128
.its('store')
@@ -135,7 +135,7 @@ describe('BLOCK PRODUCTION WON SLOTS TABLE', () => {
135135
}));
136136

137137
it('sort by snark fees', () => execute(() => {
138-
cy.get('mina-block-production-won-slots-table .head > span:nth-child(7)')
138+
cy.get('mina-block-production-won-slots-table .head > span:nth-child(8)')
139139
.click()
140140
.window()
141141
.its('store')
@@ -148,7 +148,7 @@ describe('BLOCK PRODUCTION WON SLOTS TABLE', () => {
148148
}));
149149

150150
it('sort by snark coinbase rewards', () => execute(() => {
151-
cy.get('mina-block-production-won-slots-table .head > span:nth-child(8)')
151+
cy.get('mina-block-production-won-slots-table .head > span:nth-child(9)')
152152
.click()
153153
.window()
154154
.its('store')
@@ -161,7 +161,7 @@ describe('BLOCK PRODUCTION WON SLOTS TABLE', () => {
161161
}));
162162

163163
it('sort by snark tx fees rewards', () => execute(() => {
164-
cy.get('mina-block-production-won-slots-table .head > span:nth-child(9)')
164+
cy.get('mina-block-production-won-slots-table .head > span:nth-child(10)')
165165
.click()
166166
.window()
167167
.its('store')

frontend/src/app/features/block-production/won-slots/block-production-won-slots.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export class BlockProductionWonSlotsService {
3636
age: this.calculateTimeAgo(attempt),
3737
slotTime: attempt.won_slot.slot_time,
3838
globalSlot: attempt.won_slot.global_slot,
39+
slotInEpoch: attempt.won_slot.global_slot % 7140,
3940
vrfValueWithThreshold: attempt.won_slot.value_with_threshold,
4041
active: attempt.active,
4142

frontend/src/app/features/block-production/won-slots/cards/block-production-won-slots-cards.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
22
import { StoreDispatcher } from '@shared/base-classes/store-dispatcher.class';
33
import { BlockProductionWonSlotsSelectors } from '@block-production/won-slots/block-production-won-slots.state';
4-
import { lastItem, ONE_BILLION, ONE_MILLION, ONE_THOUSAND } from '@openmina/shared';
4+
import { lastItem, ONE_BILLION, ONE_MILLION, ONE_THOUSAND, toReadableDate } from '@openmina/shared';
55
import { getTimeDiff } from '@shared/helpers/date.helper';
66
import { filter } from 'rxjs';
77
import {

frontend/src/app/features/block-production/won-slots/table/block-production-won-slots-table.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<span>{{ row.age }}</span>
1717
<span>{{ row.height ?? '-' }}</span>
1818
<span>{{ row.globalSlot }}</span>
19+
<span>{{ row.slotInEpoch ?? '-' }}</span>
1920
<span
2021
[tooltipDisabled]="true"
2122
[tooltip]="row.payments + ' payments, ' + row.delegations + ' delegations, ' + row.zkapps + ' zkapps'"

frontend/src/app/features/block-production/won-slots/table/block-production-won-slots-table.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export class BlockProductionWonSlotsTableComponent extends MinaTableRustWrapper<
3232
{ name: 'status', sort: 'message' },
3333
{ name: 'age', sort: 'slotTime' },
3434
{ name: 'height' },
35-
{ name: 'slot in epoch', sort: 'globalSlot' },
35+
{ name: 'global slot', sort: 'globalSlot' },
36+
{ name: 'epoch slot', sort: 'slotInEpoch' },
3637
{ name: 'transactions', sort: 'transactionsTotal' },
3738
{ name: 'SNARKs', sort: 'completedWorksCount' },
3839
{ name: 'SNARK fees', sort: 'snarkFees' },
@@ -56,7 +57,7 @@ export class BlockProductionWonSlotsTableComponent extends MinaTableRustWrapper<
5657
}
5758

5859
protected override setupTable(): void {
59-
this.table.gridTemplateColumns = [210, 140, 110, 120, 120, 120, 120, 150, 150];
60+
this.table.gridTemplateColumns = [210, 140, 90, 110, 120, 120, 120, 120, 150, 150];
6061
this.table.propertyForActiveCheck = 'globalSlot';
6162
this.table.thGroupsTemplate = this.thGroupsTemplate;
6263
this.table.sortAction = BlockProductionWonSlotsActions.sort;

frontend/src/app/shared/types/block-production/won-slots/block-production-won-slots-slot.type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export interface BlockProductionWonSlotsSlot {
55
age: string;
66
slotTime: number;
77
globalSlot: number;
8+
slotInEpoch: number;
89
vrfValueWithThreshold: [number, number];
910
active: boolean;
1011
percentage: number;

0 commit comments

Comments
 (0)