Skip to content

Commit 8bcab7e

Browse files
authored
chore: update configuration (#1867)
Signed-off-by: Simon Viénot <simon.vienot@icloud.com>
1 parent 4ee00a0 commit 8bcab7e

File tree

8 files changed

+97
-59
lines changed

8 files changed

+97
-59
lines changed

chart/values.yaml

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ autoscaling:
2525

2626
# Environment variables to add to the container. The value can either be a string or an EnvVarSource. Evaluated as a template.
2727
env: {}
28-
# DOCKER_LOCAL_MIRROR_NODE_URL: "http://localhost:5551"
2928
# BAR:
3029
# valueFrom:
3130
# secretKeyRef:
@@ -173,38 +172,75 @@ volumes:
173172
# /api: "http://{{ .Release.Name }}-rest"
174173
proxyPass: {}
175174

175+
# Network configuration of the Explorer. One array element per exposed network.
176+
# See configuration details at https://github.com/hiero-ledger/hiero-mirror-node-explorer/blob/main/CONFIGURATION.md
176177
config: |
177178
[
178179
{
179180
"name": "mainnet",
180181
"displayName": "MAINNET",
181182
"url": "https://mainnet-public.mirrornode.hedera.com/",
182-
"ledgerID": "00"
183+
"ledgerID": "00",
184+
"baseRealm": 0,
185+
"baseShard": 0,
186+
"enableWallet": false,
187+
"enableStaking": false,
188+
"enableExpiry": false,
189+
"enableMarket": false,
190+
"erc20IndexURL": null,
191+
"erc721IndexURL": null,
192+
"sourcifySetup": null
183193
},
184194
{
185195
"name": "testnet",
186196
"displayName": "TESTNET",
187197
"url": "https://testnet.mirrornode.hedera.com/",
188-
"ledgerID": "01"
198+
"ledgerID": "01",
199+
"baseRealm": 0,
200+
"baseShard": 0,
201+
"enableWallet": false,
202+
"enableStaking": false,
203+
"enableExpiry": false,
204+
"enableMarket": false,
205+
"erc20IndexURL": null,
206+
"erc721IndexURL": null,
207+
"sourcifySetup": null
189208
},
190209
{
191210
"name": "previewnet",
192211
"displayName": "PREVIEWNET",
193212
"url": "https://previewnet.mirrornode.hedera.com/",
194-
"ledgerID": "02"
213+
"ledgerID": "02",
214+
"baseRealm": 0,
215+
"baseShard": 0,
216+
"enableWallet": false,
217+
"enableStaking": false,
218+
"enableExpiry": false,
219+
"enableMarket": false,
220+
"erc20IndexURL": null,
221+
"erc721IndexURL": null,
222+
"sourcifySetup": null
195223
}
196224
]
225+
226+
# Core configuration of the Explorer. A null value means the default configuration will be used.
227+
# See configuration details at https://github.com/hiero-ledger/hiero-mirror-node-explorer/blob/main/CONFIGURATION.md
197228
core-config: |
198229
{
199230
"productName": null,
200-
"productLogoURL": null,
231+
"productLogoLightURL": null",
232+
"productLogoDarkURL": null,
233+
"productMiniLogoLightURL": null,
234+
"productMiniLogoDarkURL": null,
201235
"documentTitlePrefix": null,
202236
"productDescription": null,
203237
"metaDescription": null,
204238
"metaURL": null,
205-
"builtOnLogoURL": null,
239+
"builtOnLogoLightURL": null,
240+
"builtOnLogoDarkURL": null,
206241
"builtOnURL": null,
207-
"sponsorLogoURL": null,
242+
"sponsorLogoLightURL": null,
243+
"sponsorLogoDarkURL": null,
208244
"sponsorURL": null,
209245
"termsOfUseURL": null,
210246
"estimatorNotice": null,
@@ -214,5 +250,9 @@ core-config: |
214250
"ipfsGatewayURL": null,
215251
"arweaveServerURL": null,
216252
"cryptoName": null,
217-
"cryptoSymbol": null
253+
"cryptoSymbol": null,
254+
"cryptoLogoLightURL": null,
255+
"cryptoLogoDarkURL": null,
256+
"walletConnectID": null,
257+
"hgraphKey": null
218258
}

public/core-config.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"productName": null,
3-
"productLogoLightURL": "product-logo-light.png",
4-
"productLogoDarkURL": "product-logo-dark.png",
3+
"productLogoLightURL": null,
4+
"productLogoDarkURL": null,
55
"productMiniLogoLightURL": null,
66
"productMiniLogoDarkURL": null,
77
"documentTitlePrefix": null,
8-
"productDescription": "Hiero Explorer is a ledger explorer for the Hiero network.",
8+
"productDescription": null,
99
"metaDescription": null,
1010
"metaURL": null,
11-
"builtOnLogoLightURL": "technology-logo-light.svg",
12-
"builtOnLogoDarkURL": "technology-logo-dark.svg",
11+
"builtOnLogoLightURL": null,
12+
"builtOnLogoDarkURL": null,
1313
"builtOnURL": null,
14-
"sponsorLogoLightURL": "sponsor-logo-light.png",
15-
"sponsorLogoDarkURL": "sponsor-logo-dark.png",
14+
"sponsorLogoLightURL": null,
15+
"sponsorLogoDarkURL": null,
1616
"sponsorURL": null,
17-
"termsOfUseURL": "",
17+
"termsOfUseURL": null,
1818
"estimatorNotice": null,
1919
"walletChooserDisclaimerPopup": null,
2020
"googleTagID": null,
@@ -23,8 +23,8 @@
2323
"arweaveServerURL": null,
2424
"cryptoName": null,
2525
"cryptoSymbol": null,
26-
"cryptoLogoLightURL": "crypto-logo-light.svg",
27-
"cryptoLogoDarkURL": "crypto-logo-dark.svg",
26+
"cryptoLogoLightURL": null,
27+
"cryptoLogoDarkURL": null,
2828
"walletConnectID": null,
2929
"hgraphKey": null
3030
}

src/components/ThemeController.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ export class ThemeController {
116116
document.documentElement.style.setProperty('--status-error-color', 'var(--dark-status-error-color)')
117117
document.documentElement.style.setProperty('--search-bar-default', 'var(--dark-search-bar-default)')
118118
document.documentElement.style.setProperty('--graph-line-color', 'var(--dark-graph-line-color)')
119-
document.getElementById('product-logo')?.setAttribute('src', this.coreConfig.productLogoDarkURL ?? '')
119+
document.getElementById('product-logo')?.setAttribute('src', this.coreConfig.productLogoDarkURL)
120120
document.getElementById('product-mini-logo')?.setAttribute('src', this.coreConfig.productMiniLogoDarkURL ?? '')
121-
document.getElementById('sponsor-logo')?.setAttribute('src', this.coreConfig.sponsorLogoDarkURL ?? '')
122-
document.getElementById('built-on-logo')?.setAttribute('src', this.coreConfig.builtOnLogoDarkURL ?? '')
123-
document.getElementById('crypto-logo')?.setAttribute('src', this.coreConfig.cryptoLogoDarkURL ?? '')
121+
document.getElementById('sponsor-logo')?.setAttribute('src', this.coreConfig.sponsorLogoDarkURL)
122+
document.getElementById('built-on-logo')?.setAttribute('src', this.coreConfig.builtOnLogoDarkURL)
123+
document.getElementById('crypto-logo')?.setAttribute('src', this.coreConfig.cryptoLogoDarkURL)
124124

125125
} else {
126126
AppStorage.setTheme('light')
@@ -161,11 +161,11 @@ export class ThemeController {
161161
document.documentElement.style.setProperty('--status-error-color', 'var(--light-status-error-color)')
162162
document.documentElement.style.setProperty('--search-bar-default', 'var(--light-search-bar-default)')
163163
document.documentElement.style.setProperty('--graph-line-color', 'var(--light-graph-line-color)')
164-
document.getElementById('product-logo')?.setAttribute('src', this.coreConfig.productLogoLightURL ?? '')
164+
document.getElementById('product-logo')?.setAttribute('src', this.coreConfig.productLogoLightURL)
165165
document.getElementById('product-mini-logo')?.setAttribute('src', this.coreConfig.productMiniLogoLightURL ?? '')
166-
document.getElementById('sponsor-logo')?.setAttribute('src', this.coreConfig.sponsorLogoLightURL ?? '')
167-
document.getElementById('built-on-logo')?.setAttribute('src', this.coreConfig.builtOnLogoLightURL ?? '')
168-
document.getElementById('crypto-logo')?.setAttribute('src', this.coreConfig.cryptoLogoLightURL ?? '')
166+
document.getElementById('sponsor-logo')?.setAttribute('src', this.coreConfig.sponsorLogoLightURL)
167+
document.getElementById('built-on-logo')?.setAttribute('src', this.coreConfig.builtOnLogoLightURL)
168+
document.getElementById('crypto-logo')?.setAttribute('src', this.coreConfig.cryptoLogoLightURL)
169169
}
170170

171171
}

src/components/page/Footer.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
<div class="footer-left">
1212
<a v-if="builtOnURL" :href="builtOnURL">
13-
<img id="built-on-logo" alt="Built On Logo" :src="builtOnLogoURL ?? ''" class="footer-logo">
13+
<img id="built-on-logo" alt="Built On Logo" :src="builtOnLogoURL" class="footer-logo">
1414
</a>
15-
<img v-else id="built-on-logo" alt="Built On Logo" :src="builtOnLogoURL ?? ''" class="footer-logo">
15+
<img v-else id="built-on-logo" alt="Built On Logo" :src="builtOnLogoURL" class="footer-logo">
1616

1717
<div class="footer-text">
1818
<div v-if="isSmallScreen" class="footer-text-item">
@@ -42,9 +42,9 @@
4242

4343
<template v-if="isSmallScreen">
4444
<a v-if="sponsorURL" :href="sponsorURL" class="footer-logo">
45-
<img id="sponsor-logo" alt="Sponsor Logo" :src="sponsorLogoURL ?? ''">
45+
<img id="sponsor-logo" alt="Sponsor Logo" :src="sponsorLogoURL">
4646
</a>
47-
<img v-else class="footer-logo" id="sponsor-logo" alt="Sponsor Logo" :src="sponsorLogoURL ?? ''">
47+
<img v-else class="footer-logo" id="sponsor-logo" alt="Sponsor Logo" :src="sponsorLogoURL">
4848
</template>
4949
</div>
5050

src/components/page/header/ProductLogo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- --------------------------------------------------------------------------------------------------------------- -->
66

77
<template>
8-
<router-link v-if="isXLargeScreen && productLogoURL !== null" :to="routeManager.makeRouteToMainDashboard()">
8+
<router-link v-if="isXLargeScreen" :to="routeManager.makeRouteToMainDashboard()">
99
<img alt="Product Logo" :src="productLogoURL"/>
1010
</router-link>
1111
<router-link v-else-if="productMiniLogoURL !== null" :to="routeManager.makeRouteToMainDashboard()">

src/config/ConfigUtils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ export function fetchURL(obj: any, key: string): string | null {
5656
const s = fetchString(obj, key)
5757
if (s !== null) {
5858
try {
59-
const url = new URL(s, window.location.origin)
60-
result = url.toString()
59+
result = localPathToURL(s)
6160
} catch {
6261
throw new TypeError('Expected ' + key + ' to be URL, got ' + obj)
6362
}
@@ -83,3 +82,7 @@ export function fetchObject(obj: any, key: string): object | null {
8382
}
8483
return result
8584
}
85+
86+
export function localPathToURL(path: string): string {
87+
return new URL(path, window.location.origin).toString()
88+
}

src/config/CoreConfig.ts

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22

33
import axios from "axios";
4-
import {fetchString, fetchURL} from "@/config/ConfigUtils";
4+
import {fetchString, fetchURL, localPathToURL} from "@/config/ConfigUtils";
55
import {inject} from "vue";
66
import {coreConfigKey} from "@/AppKeys";
77

@@ -41,31 +41,31 @@ export class CoreConfig {
4141
// The name of the product as shown in the short form of the footer tagline
4242
public readonly productName: string,
4343
// The URL of the product logo (light theme) located at the left of the top navigation bar
44-
public readonly productLogoLightURL: string | null,
44+
public readonly productLogoLightURL: string,
4545
// The URL of the product logo (dark theme) located at the left of the top navigation bar
46-
public readonly productLogoDarkURL: string | null,
46+
public readonly productLogoDarkURL: string,
4747
// The URL of the reduced product logo (light theme) located at the left of the top navigation bar
4848
public readonly productMiniLogoLightURL: string | null,
4949
// The URL of the reduced product logo (dark theme) located at the left of the top navigation bar
5050
public readonly productMiniLogoDarkURL: string | null,
5151
// The prefix used in the document title
5252
public readonly documentTitlePrefix: string,
5353
// The description of the product as shown in the long form of the footer tagline
54-
public readonly productDescription: string | null,
54+
public readonly productDescription: string,
5555
// The content of meta tag: name="description"
5656
public readonly metaDescription: string | null,
5757
// The content of meta tag: property="og:url"
5858
public readonly metaURL: string | null,
5959
// The URL of the 'BUILT ON' logo (light theme) located at the left of the footer
60-
public readonly builtOnLogoLightURL: string | null,
60+
public readonly builtOnLogoLightURL: string,
6161
// The URL of the 'BUILT ON' logo (dark theme) located at the left of the footer
62-
public readonly builtOnLogoDarkURL: string | null,
62+
public readonly builtOnLogoDarkURL: string,
6363
// The URL to which a click on the bottom-left 'BUILT ON' logo will navigate
6464
public readonly builtOnURL: string | null,
6565
// The URL of the sponsor logo (light theme) located at the right of the footer
66-
public readonly sponsorLogoLightURL: string | null,
66+
public readonly sponsorLogoLightURL: string,
6767
// The URL of the sponsor logo (dark theme) located at the right of the footer
68-
public readonly sponsorLogoDarkURL: string | null,
68+
public readonly sponsorLogoDarkURL: string,
6969
// The URL to which a click on the bottom-right sponsor logo will navigate
7070
public readonly sponsorURL: string | null,
7171
// The URL of the 'Terms of Use' page
@@ -88,33 +88,32 @@ export class CoreConfig {
8888
// The HTML content used as crypto unit symbol
8989
public readonly cryptoSymbol: string | null,
9090
// The URL of the crypto logo (light theme)
91-
public readonly cryptoLogoLightURL: string | null,
91+
public readonly cryptoLogoLightURL: string,
9292
// The URL of the crypto logo (dark theme)
93-
public readonly cryptoLogoDarkURL: string | null,
93+
public readonly cryptoLogoDarkURL: string,
9494
// The Wallect Connect Identifier
9595
public readonly walletConnectID: string | null,
9696
// The key for accessing Hgraph data
9797
public readonly hgraphKey: string | null
9898
) {
9999
}
100100

101-
102101
private static parse(obj: object): CoreConfig {
103102
return new CoreConfig(
104-
fetchString(obj, "productName") ?? "Hiero Mirror Node Explorer",
105-
fetchURL(obj, "productLogoLightURL"),
106-
fetchURL(obj, "productLogoDarkURL"),
103+
fetchString(obj, "productName") ?? "Hiero Explorer",
104+
fetchURL(obj, "productLogoLightURL") ?? localPathToURL("product-logo-light.png") ,
105+
fetchURL(obj, "productLogoDarkURL") ?? localPathToURL("product-logo-dark.png"),
107106
fetchURL(obj, "productMiniLogoLightURL"),
108107
fetchURL(obj, "productMiniLogoDarkURL"),
109108
fetchString(obj, "documentTitlePrefix") ?? "Hiero",
110-
fetchString(obj, "productDescription") ?? "Hiero Mirror Node Explorer",
109+
fetchString(obj, "productDescription") ?? "Hiero Explorer is a ledger explorer for the Hiero network.",
111110
fetchString(obj, "metaDescription"),
112111
fetchURL(obj, "metaURL"),
113-
fetchURL(obj, "builtOnLogoLightURL"),
114-
fetchURL(obj, "builtOnLogoDarkURL"),
112+
fetchURL(obj, "builtOnLogoLightURL") ?? localPathToURL("technology-logo-light.svg"),
113+
fetchURL(obj, "builtOnLogoDarkURL") ?? localPathToURL("technology-logo-dark.svg") ,
115114
fetchURL(obj, "builtOnURL"),
116-
fetchURL(obj, "sponsorLogoLightURL"),
117-
fetchURL(obj, "sponsorLogoDarkURL"),
115+
fetchURL(obj, "sponsorLogoLightURL") ?? localPathToURL("sponsor-logo-light.png"),
116+
fetchURL(obj, "sponsorLogoDarkURL") ?? localPathToURL("sponsor-logo-dark.png"),
118117
fetchURL(obj, "sponsorURL"),
119118
fetchURL(obj, "termsOfUseURL"),
120119
fetchString(obj, "estimatorNotice"),
@@ -125,8 +124,8 @@ export class CoreConfig {
125124
fetchURL(obj, "arweaveServerURL") ?? "https://arweave.net/",
126125
fetchString(obj, "cryptoName") ?? "HBAR",
127126
fetchString(obj, "cryptoSymbol"),
128-
fetchURL(obj, "cryptoLogoLightURL"),
129-
fetchURL(obj, "cryptoLogoDarkURL"),
127+
fetchURL(obj, "cryptoLogoLightURL") ?? localPathToURL("crypto-logo-light.svg"),
128+
fetchURL(obj, "cryptoLogoDarkURL") ?? localPathToURL("crypto-logo-dark.svg"),
130129
fetchString(obj, "walletConnectID"),
131130
fetchString(obj, "hgraphKey")
132131
)

tests/e2e/specs/LegalNotices.cy.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ describe('Hedera Explorer legal notices', () => {
77
it('Visits the terms of use notice', () => {
88
cy.visit('/testnet')
99
cy.url().should('include', '/testnet/dashboard')
10-
cy.get('[data-cy=termsOfUse]').click()
11-
// In dev context, core-config.termsOfUseURL parameter is not set and explorer falls to /dashboard back
12-
// May be we should hide termsOfUse element when parameter is not set ?
13-
// cy.url().should('include', '/terms-of-use.html')
14-
cy.url().should('include', '/testnet/dashboard')
10+
cy.get('[data-cy=termsOfUse]').should('not.exist')
1511
})
1612

1713
it('Visits the privacy policy notice', () => {

0 commit comments

Comments
 (0)