From aefc427d5ce217b4edf7f32ccd88b17f2b2d926d Mon Sep 17 00:00:00 2001 From: Jane Date: Tue, 30 May 2023 14:38:16 +0800 Subject: [PATCH 1/2] update --- src/components/DeveloperIDE/Header/index.tsx | 6 +++--- src/components/DeveloperIDE/Support/index.tsx | 4 ++-- .../JSONMetricsView/TimeRangePick/index.tsx | 6 +++--- src/store/lib/w3bstream/schema/chainHeight.ts | 14 +++++++++----- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/components/DeveloperIDE/Header/index.tsx b/src/components/DeveloperIDE/Header/index.tsx index 949bf0ea..99153acb 100644 --- a/src/components/DeveloperIDE/Header/index.tsx +++ b/src/components/DeveloperIDE/Header/index.tsx @@ -52,9 +52,9 @@ const Header = observer(() => { cursor={'pointer'} > logo - - w3bstream Devnet - + + w3bstream Devnet {w3s.env.envs?.value?.w3bstreamVersion?.split('@')?.[1]?.split('_')?.[0]} + { { store.w3bstreamVersionGithubLink ? ( - {envs.value?.w3bstreamVersion} + {envs.value?.w3bstreamVersion?.split('@')[1]?.split('_')[0]} ) : ( - {envs.value?.w3bstreamVersion} + {envs.value?.w3bstreamVersion?.split('@')[1]?.split('_')[0]} ) } diff --git a/src/components/JSONMetricsView/TimeRangePick/index.tsx b/src/components/JSONMetricsView/TimeRangePick/index.tsx index c7f9f0c1..07839061 100644 --- a/src/components/JSONMetricsView/TimeRangePick/index.tsx +++ b/src/components/JSONMetricsView/TimeRangePick/index.tsx @@ -21,9 +21,9 @@ export const TimeRangePick = ({props, onChange}: TimeRangePick) => { onChange(v); }} > - - - + + + ); }; diff --git a/src/store/lib/w3bstream/schema/chainHeight.ts b/src/store/lib/w3bstream/schema/chainHeight.ts index ba5f6215..c837df8c 100644 --- a/src/store/lib/w3bstream/schema/chainHeight.ts +++ b/src/store/lib/w3bstream/schema/chainHeight.ts @@ -20,7 +20,7 @@ export const schema = { properties: { projectName: { $ref: '#/definitions/projects', title: 'Project Name' }, eventType: { type: 'string', title: 'Event Type', description: 'Please choose a unique name for the W3bstream event that should be triggered' }, - chainID: { type: 'number', title: 'Chain ID', description: 'The blockchain network that should be monitored' }, + chainID: { $ref: '#/definitions/blockChains', type: 'string', title: 'Chain ID', description: 'The blockchain network that should be monitored' }, height: { type: 'number', title: 'Height', description: 'The blockchain height at which the the W3bstream event should be triggered.' } }, required: ['projectName', 'eventType', 'chainID', 'height'] @@ -30,7 +30,8 @@ type SchemaType = FromSchema; //@ts-ignore schema.definitions = { - projects: definitions.projectName + projects: definitions.projectName, + blockChains: definitions.blockChains }; export default class ChainHeightModule { @@ -121,7 +122,10 @@ export default class ChainHeightModule { 'ui:submitButtonOptions': { norender: false, submitText: 'Submit' - } + }, + chainID: { + 'ui:widget': 'select' + }, }, afterSubmit: async (e) => { eventBus.emit('base.formModal.afterSubmit', e.formData); @@ -131,9 +135,9 @@ export default class ChainHeightModule { default: { projectName: '', eventType: 'DEFAULT', - chainID: 4690, + chainID: '4690', height: 0 - } + }, }) }); } From 9df5a1842d67c4bb3ae3fda06639d9f50f5baaf2 Mon Sep 17 00:00:00 2001 From: Jane Date: Tue, 30 May 2023 14:42:29 +0800 Subject: [PATCH 2/2] update --- src/components/DeveloperIDE/Support/index.tsx | 4 ++-- src/components/IDE/Monitor/ChainHeight/index.tsx | 5 ++--- src/store/lib/w3bstream/schema/chainHeight.ts | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/DeveloperIDE/Support/index.tsx b/src/components/DeveloperIDE/Support/index.tsx index 0d2a3a7b..c5329ee1 100644 --- a/src/components/DeveloperIDE/Support/index.tsx +++ b/src/components/DeveloperIDE/Support/index.tsx @@ -154,10 +154,10 @@ const Support = () => { { store.w3bstreamVersionGithubLink ? ( - {envs.value?.w3bstreamVersion?.split('@')[1]?.split('_')[0]} + {envs.value?.w3bstreamVersion?.split('@')?.[1]?.split('_')?.[0]} ) : ( - {envs.value?.w3bstreamVersion?.split('@')[1]?.split('_')[0]} + {envs.value?.w3bstreamVersion?.split('@')?.[1]?.split('_')?.[0]} ) } diff --git a/src/components/IDE/Monitor/ChainHeight/index.tsx b/src/components/IDE/Monitor/ChainHeight/index.tsx index 7a6cb939..8c3e3199 100644 --- a/src/components/IDE/Monitor/ChainHeight/index.tsx +++ b/src/components/IDE/Monitor/ChainHeight/index.tsx @@ -47,9 +47,8 @@ export const CreateChainHeightButton = observer(() => { {...defaultButtonStyle} onClick={async (e) => { if (w3s.config.form.formData.accountRole === 'DEVELOPER') { - w3s.chainHeight.form.value.set({ - projectName: w3s.project.curProject?.name - }); + // @ts-ignore + w3s.chainHeight.form.value.set({projectName: w3s.project.curProject?.name}); w3s.chainHeight.form.uiSchema.projectName = { 'ui:widget': 'hidden' }; diff --git a/src/store/lib/w3bstream/schema/chainHeight.ts b/src/store/lib/w3bstream/schema/chainHeight.ts index c837df8c..db8f81af 100644 --- a/src/store/lib/w3bstream/schema/chainHeight.ts +++ b/src/store/lib/w3bstream/schema/chainHeight.ts @@ -132,6 +132,7 @@ export default class ChainHeightModule { this.form.reset(); }, value: new JSONValue({ + // @ts-ignore default: { projectName: '', eventType: 'DEFAULT',