mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
new return type for dry configure dependency
This commit is contained in:
committed by
Aiden McClelland
parent
fdfb0ecbb9
commit
ded4c6a597
@@ -49,14 +49,23 @@ export class AppConfigPage {
|
|||||||
if (!this.hasConfig) return
|
if (!this.hasConfig) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.loadingText = 'Loading Config'
|
|
||||||
const { spec, config } = await this.embassyApi.getPackageConfig({ id: this.pkgId })
|
let oldConfig: object
|
||||||
let depConfig: object
|
let newConfig: object
|
||||||
|
let spec: ConfigSpec
|
||||||
if (this.rec) {
|
if (this.rec) {
|
||||||
this.loadingText = `Setting properties to accommodate ${this.rec.dependentTitle}`
|
this.loadingText = `Setting properties to accommodate ${this.rec.dependentTitle}`
|
||||||
depConfig = await this.embassyApi.dryConfigureDependency({ 'dependency-id': this.pkgId, 'dependent-id': this.rec.dependentId })
|
const { 'old-config': oc, 'new-config': nc, spec: s } = await this.embassyApi.dryConfigureDependency({ 'dependency-id': this.pkgId, 'dependent-id': this.rec.dependentId })
|
||||||
|
oldConfig = oc
|
||||||
|
newConfig = nc
|
||||||
|
spec = s
|
||||||
|
} else {
|
||||||
|
this.loadingText = 'Loading Config'
|
||||||
|
const { config: oc, spec: s } = await this.embassyApi.getPackageConfig({ id: this.pkgId })
|
||||||
|
oldConfig = oc
|
||||||
|
spec = s
|
||||||
}
|
}
|
||||||
this.setConfig(spec, config, depConfig)
|
this.setConfig(spec, oldConfig, newConfig)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.loadingError = getErrorMessage(e)
|
this.loadingError = getErrorMessage(e)
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -182,7 +182,11 @@ export module RR {
|
|||||||
export type DeleteRecoveredPackageRes = WithRevision<null>
|
export type DeleteRecoveredPackageRes = WithRevision<null>
|
||||||
|
|
||||||
export type DryConfigureDependencyReq = { 'dependency-id': string, 'dependent-id': string } // package.dependency.configure.dry
|
export type DryConfigureDependencyReq = { 'dependency-id': string, 'dependent-id': string } // package.dependency.configure.dry
|
||||||
export type DryConfigureDependencyRes = object
|
export type DryConfigureDependencyRes = {
|
||||||
|
'old-config': object
|
||||||
|
'new-config': object
|
||||||
|
spec: ConfigSpec
|
||||||
|
}
|
||||||
|
|
||||||
// marketplace
|
// marketplace
|
||||||
|
|
||||||
|
|||||||
@@ -542,28 +542,32 @@ export class MockApiService extends ApiService {
|
|||||||
async dryConfigureDependency (params: RR.DryConfigureDependencyReq): Promise<RR.DryConfigureDependencyRes> {
|
async dryConfigureDependency (params: RR.DryConfigureDependencyReq): Promise<RR.DryConfigureDependencyRes> {
|
||||||
await pauseFor(2000)
|
await pauseFor(2000)
|
||||||
return {
|
return {
|
||||||
testnet: true,
|
'old-config': Mock.PackageConfig.config,
|
||||||
// objectList: [],
|
spec: Mock.PackageConfig.spec,
|
||||||
// unionList: [],
|
'new-config': {
|
||||||
randomEnum: 'option2',
|
testnet: true,
|
||||||
favoriteNumber: 9,
|
// objectList: [],
|
||||||
secondaryNumbers: [2, 3, 5, 6],
|
// unionList: [],
|
||||||
rpcsettings: {
|
randomEnum: 'option2',
|
||||||
laws: {
|
favoriteNumber: 9,
|
||||||
law1: 'The 1st law',
|
secondaryNumbers: [2, 3, 5, 6],
|
||||||
law2: 'The 2nd law',
|
rpcsettings: {
|
||||||
|
laws: {
|
||||||
|
law1: 'The 1st law',
|
||||||
|
law2: 'The 2nd law',
|
||||||
|
},
|
||||||
|
rpcpass: null,
|
||||||
|
rpcuser: '123',
|
||||||
|
rulemakers: [],
|
||||||
},
|
},
|
||||||
rpcpass: null,
|
advanced: {
|
||||||
rpcuser: '123',
|
notifications: ['call', 'text'],
|
||||||
rulemakers: [],
|
},
|
||||||
|
// bitcoinNode: undefined,
|
||||||
|
port: 22,
|
||||||
|
// rpcallowip: undefined,
|
||||||
|
// rpcauth: ['matt: 8273gr8qwoidm1uid91jeh8y23gdio1kskmwejkdnm'],
|
||||||
},
|
},
|
||||||
advanced: {
|
|
||||||
notifications: ['call', 'text'],
|
|
||||||
},
|
|
||||||
// bitcoinNode: undefined,
|
|
||||||
port: 22,
|
|
||||||
// rpcallowip: undefined,
|
|
||||||
// rpcauth: ['matt: 8273gr8qwoidm1uid91jeh8y23gdio1kskmwejkdnm'],
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user