Skip to content

Commit 801bd51

Browse files
MB-48720: show full list of Analytics storage path during cluster/node..
configuration stage. Analytics storage paths may already be set as array before user gets to UI. Change-Id: I5e16c67c1c994094985e2ada80dae5647b524dd6 Reviewed-on: http://review.couchbase.org/c/ns_server/+/163307 Well-Formed: Restriction Checker Well-Formed: Build Bot <[email protected]> Tested-by: Pavel Blagodov <[email protected]> Reviewed-by: Pavel Blagodov <[email protected]>
1 parent 661106e commit 801bd51

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

priv/public/ui/app/mn.wizard.component.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {MnWizardService} from './mn.wizard.service.js';
1212
import {MnLifeCycleHooksToStream} from './mn.core.js';
1313
import {MnPoolsService} from './mn.pools.service.js';
1414
import {MnAdminService} from "./mn.admin.service.js";
15-
import {first} from '/ui/web_modules/rxjs/operators.js';
15+
import {first, combineLatest} from '/ui/web_modules/rxjs/operators.js';
1616
import {FormGroup, FormControl} from '/ui/web_modules/@angular/forms.js';
1717
import {Component, ChangeDetectionStrategy} from '/ui/web_modules/@angular/core.js';
1818

@@ -68,7 +68,9 @@ class MnWizardComponent extends MnLifeCycleHooksToStream {
6868
newClusterConfig.get("services").addControl("field", servicesToGroup(services, null));
6969
});
7070

71-
mnPoolsService.stream.isEnterprise.pipe(first())
71+
let isEnterpriseStream = mnPoolsService.stream.isEnterprise.pipe(first());
72+
73+
isEnterpriseStream
7274
.subscribe(function (isEnterprise) {
7375
var storageMode = isEnterprise ? "plasma" : "forestdb";
7476
newClusterConfig.get("storageMode").setValue(storageMode);
@@ -81,12 +83,26 @@ class MnWizardComponent extends MnLifeCycleHooksToStream {
8183
mnWizardService.initialValues.storageMode = storageMode;
8284
});
8385

84-
mnWizardService.stream.initHddStorage.pipe(first())
85-
.subscribe(function (initHdd) {
86-
newClusterConfig.get("clusterStorage.storage").patchValue(initHdd);
87-
joinCluster.get("clusterStorage.storage").patchValue(initHdd);
86+
mnWizardService.stream.initHddStorage
87+
.pipe(first(),
88+
combineLatest(isEnterpriseStream))
89+
.subscribe(function ([initHdd, isEnterprise]) {
90+
setStorageConfigValues(newClusterConfig, initHdd, isEnterprise);
91+
setStorageConfigValues(joinCluster, initHdd, isEnterprise);
8892

8993
mnWizardService.initialValues.clusterStorage = initHdd;
9094
});
95+
96+
function setStorageConfigValues(config, initHdd, isEnterprise) {
97+
if (isEnterprise) {
98+
initHdd.cbas_path.forEach((dir, index) => {
99+
config.get('clusterStorage.storage.cbas_path')
100+
.setControl(index, new FormControl(null), {
101+
emitEvent: false
102+
});
103+
});
104+
}
105+
config.get("clusterStorage.storage").patchValue(initHdd);
106+
}
91107
}
92108
}

0 commit comments

Comments
 (0)