Skip to content

Commit

Permalink
Fix volume store CLI option name in Create wizard (#260)
Browse files Browse the repository at this point in the history
Fix volume store CLI option name in Create wizard (#251)
  • Loading branch information
cristianfalcone authored and jak-atx committed Dec 19, 2017
1 parent b21ffec commit 10863aa
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ export class CreateVchWizardComponent implements OnInit {

// Storage ---------------------------------------------------------------------------------------------------------

if (payload.storageCapacity.volumeStores.length) {
processedPayload.storage['volume_stores'] = payload.storageCapacity.volumeStores.map(vol => {
if (payload.storageCapacity.volumeStore.length) {
processedPayload.storage['volume_stores'] = payload.storageCapacity.volumeStore.map(vol => {
return {
datastore: vol.volDatastore + (vol.volFileFolder || ''),
label: vol.dockerVolName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('StorageCapacityComponent', () => {

component.onCommit().subscribe( r => {
expect(r.storageCapacity.fileFolder).toBe(expectedFolderName);
expect(r.storageCapacity.volumeStores[0].volFileFolder).toBe(expectedFolderName);
expect(r.storageCapacity.volumeStore[0].volFileFolder).toBe(expectedFolderName);
});

// should not add an extra slash
Expand All @@ -126,7 +126,7 @@ describe('StorageCapacityComponent', () => {

component.onCommit().subscribe( r => {
expect(r.storageCapacity.fileFolder).toBe(expectedFolderName);
expect(r.storageCapacity.volumeStores[0].volFileFolder).toBe(expectedFolderName);
expect(r.storageCapacity.volumeStore[0].volFileFolder).toBe(expectedFolderName);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ export class StorageCapacityComponent implements OnInit {
results['baseImageSizeUnit'] = this.form.get('baseImageSizeUnit').value;

// filter ones with empty datastore
results['volumeStores'] = this.form.get('volumeStores').value
results['volumeStore'] = this.form.get('volumeStores').value
.filter(vol => vol['volDatastore']);

results['volumeStores'].forEach(vol => {
results['volumeStore'].forEach(vol => {
// if volume file folder doesn't start with '/', prepend the value with '/'
if (vol['volFileFolder'].length && vol['volFileFolder'].charAt(0) !== '/') {
vol['volFileFolder'] = '/' + vol['volFileFolder'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('SummaryComponent', () => {
storageCapacity: {
imageStore: 'datastore',
baseImageSizeUnit: 'GiB',
volumeStores: []
volumeStore: []
},
networks: {
containerNetworks: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ export class SummaryComponent implements OnInit {

// transform each volume store entry

const volumeStoresRef = results['storageCapacity']['volumeStores'];
results['storageCapacity']['volumeStores'] =
const volumeStoresRef = results['storageCapacity']['volumeStore'];
results['storageCapacity']['volumeStore'] =
volumeStoresRef.map(volStoreObj => {
return `${volStoreObj['volDatastore']}${volStoreObj['volFileFolder']}:${volStoreObj['dockerVolName']}`;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@
</clr-stack-content>
</clr-stack-block>
<!-- volume datastores -->
<div *ngIf="payload?.storageCapacity?.hasOwnProperty('volumeStores')">
<clr-stack-block *ngFor="let volStore of payload.storageCapacity.volumeStores; let i = index">
<div *ngIf="payload?.storageCapacity?.hasOwnProperty('volumeStore')">
<clr-stack-block *ngFor="let volStore of payload.storageCapacity.volumeStore; let i = index">
<clr-stack-label>Volume datastore {{ i + 1 }}</clr-stack-label>
<clr-stack-content>
{{ volStore.volDatastore }}{{ volStore.volFileFolder }}
Expand Down

0 comments on commit 10863aa

Please sign in to comment.