@meddleware/dashboard-ui 0.1.99 → 0.1.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/package.json +3 -3
- package/src/components/NetworkSelector.vue +2 -2
- package/src/network.ts +19 -21
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); version
|
|
|
5
5
|
[Semantic Versioning](https://semver.org/). Before 0.2.0, breaking changes ship as patch releases.
|
|
6
6
|
Releases before 0.1.85 are recorded in the git history only.
|
|
7
7
|
|
|
8
|
+
## [0.1.100] - 2026-11-13
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- The network selector reads each network's availability from the deployment records (`networkAvailability` over the Access Gate and Sealed Storage records): a network without records for every hosted product is listed disabled as "Mainnet (not available yet)" (plain, naming no product), and one that has them is selectable. Testnet follows the same rule as mainnet.
|
|
13
|
+
- Takes `@meddleware/ui` ^0.1.43 and `@meddleware/frontend-config` ^0.0.9; the embedded tools are unchanged (access-gate-ui 0.1.49, sealed-storage-ui 0.0.49, token-issuance-ui 0.0.47, treasury-ui 0.0.28, walrus-storage-ui 0.1.70).
|
|
14
|
+
|
|
15
|
+
### Internal
|
|
16
|
+
|
|
17
|
+
- Tests: both states of the selector (not available yet; selectable) with the records mocked, for testnet and mainnet.
|
|
18
|
+
|
|
8
19
|
## [0.1.99] - 2026-11-12
|
|
9
20
|
|
|
10
21
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meddleware/dashboard-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.100",
|
|
4
4
|
"homepage": "https://docs.meddleware.co.uk/",
|
|
5
5
|
"description": "The Meddleware dashboard: the treasury, Walrus storage, sealed storage, access gates and token issuance in one place, with one wallet connection for all five tools. Vue 3 single-page app.",
|
|
6
6
|
"author": "Meddleware <dev@meddleware.co.uk>",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@meddleware/sealed-storage-ui": "^0.0.49",
|
|
50
50
|
"@meddleware/token-issuance-ui": "^0.0.47",
|
|
51
51
|
"@meddleware/treasury-ui": "^0.0.28",
|
|
52
|
-
"@meddleware/ui": "^0.1.
|
|
52
|
+
"@meddleware/ui": "^0.1.43",
|
|
53
53
|
"@meddleware/wallet-adapter": "^0.0.23",
|
|
54
54
|
"@meddleware/walrus-storage-ui": "^0.1.70",
|
|
55
55
|
"@meddleware/web-utils": "^0.0.4",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@lhci/cli": "^0.16.0",
|
|
62
|
-
"@meddleware/frontend-config": "^0.0.
|
|
62
|
+
"@meddleware/frontend-config": "^0.0.9",
|
|
63
63
|
"@playwright/test": "~1.64.1",
|
|
64
64
|
"@types/node": "~26.6.5",
|
|
65
65
|
"@vitejs/plugin-vue": "^6.0.10",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
// Network selector for the dashboard sidebar. Reads and writes the shared useNetwork() singleton so every embedded tool view reacts to the
|
|
3
3
|
// chosen network immediately. Mainnet is selectable only when the deployment records say it is live (`src/network.ts`); until then it is
|
|
4
|
-
// listed, disabled
|
|
4
|
+
// listed, disabled and marked "not available yet".
|
|
5
5
|
import { ref, watch } from 'vue'
|
|
6
6
|
import { UiFormField, UiSelect, UiTextField } from '@meddleware/ui'
|
|
7
7
|
import { useNetwork, type MwNetwork } from '@meddleware/wallet-adapter'
|
|
@@ -32,7 +32,7 @@ const options = networkOptions()
|
|
|
32
32
|
<UiFormField id="ns-select" label="Network">
|
|
33
33
|
<template #default="{ attrs }">
|
|
34
34
|
<UiSelect :id="attrs.id" :model-value="network" @change="onNetworkChange">
|
|
35
|
-
<option v-for="o in options" :key="o.value" :value="o.value" :disabled="o.disabled"
|
|
35
|
+
<option v-for="o in options" :key="o.value" :value="o.value" :disabled="o.disabled">{{ o.label }}</option>
|
|
36
36
|
</UiSelect>
|
|
37
37
|
</template>
|
|
38
38
|
</UiFormField>
|
package/src/network.ts
CHANGED
|
@@ -16,40 +16,38 @@ export const AVAILABILITY = networkAvailability({
|
|
|
16
16
|
'sealed storage': Object.keys(SEAL_POLICIES_DEPLOYMENTS),
|
|
17
17
|
})
|
|
18
18
|
|
|
19
|
-
export interface
|
|
20
|
-
/**
|
|
19
|
+
export interface NetworkChoice {
|
|
20
|
+
/** The network can be selected. */
|
|
21
21
|
readonly open: boolean
|
|
22
|
-
/** The option's text. */
|
|
22
|
+
/** The option's text: the network's name, and "not available yet" while its records are missing. */
|
|
23
23
|
readonly label: string
|
|
24
|
-
/** The option's tooltip: what is missing, or that mainnet is coming. Absent when mainnet is open. */
|
|
25
|
-
readonly title?: string
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
const NAMES = { testnet: 'Testnet', mainnet: 'Mainnet' } as const
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* How a network's option reads for its availability: selectable once every hosted product has a record there, otherwise listed with
|
|
30
|
+
* "not available yet" (plain: a reader cannot act on which product is missing, so the text names none; D117).
|
|
31
|
+
*/
|
|
32
|
+
export function networkChoice(network: keyof typeof NAMES, availability: NetworkAvailability): NetworkChoice {
|
|
33
|
+
return availability.status === 'live'
|
|
34
|
+
? { open: true, label: NAMES[network] }
|
|
35
|
+
: { open: false, label: `${NAMES[network]} (not available yet)` }
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
export interface NetworkOption {
|
|
41
39
|
readonly value: MwNetwork
|
|
42
40
|
readonly label: string
|
|
43
41
|
readonly disabled: boolean
|
|
44
|
-
readonly title?: string
|
|
45
42
|
}
|
|
46
43
|
|
|
47
|
-
/** The options of the network selector: testnet and
|
|
48
|
-
export function networkOptions(
|
|
49
|
-
const
|
|
44
|
+
/** The options of the network selector: testnet and mainnet as the records allow, localnet always (a developer's own node). */
|
|
45
|
+
export function networkOptions(availability: Pick<typeof AVAILABILITY, 'testnet' | 'mainnet'> = AVAILABILITY): NetworkOption[] {
|
|
46
|
+
const testnet = networkChoice('testnet', availability.testnet)
|
|
47
|
+
const mainnet = networkChoice('mainnet', availability.mainnet)
|
|
50
48
|
return [
|
|
51
|
-
{ value: 'testnet', label:
|
|
52
|
-
{ value: 'mainnet', label:
|
|
49
|
+
{ value: 'testnet', label: testnet.label, disabled: !testnet.open },
|
|
50
|
+
{ value: 'mainnet', label: mainnet.label, disabled: !mainnet.open },
|
|
53
51
|
{ value: 'localnet', label: 'Localnet', disabled: false },
|
|
54
52
|
]
|
|
55
53
|
}
|