Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

Commit

Permalink
fix(vm): update spare volumes selector (#1106)
Browse files Browse the repository at this point in the history
PR Close #1100
  • Loading branch information
tamazlykar authored Jun 22, 2018
1 parent 76379ed commit cb6ed54
Show file tree
Hide file tree
Showing 14 changed files with 118 additions and 125 deletions.
16 changes: 8 additions & 8 deletions src/app/reducers/accounts/redux/accounts.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class AccountsEffects {
@Effect()
disableAccount$: Observable<Action> = this.actions$
.ofType(accountActions.DISABLE_ACCOUNT)
.switchMap((action: accountActions.DisableAccountRequest) => {
.mergeMap((action: accountActions.DisableAccountRequest) => {
return this.accountService.disableAccount(action.payload)
.map(updatedAccount => new accountActions.UpdateAccount(updatedAccount))
.catch((error: Error) => {
Expand All @@ -58,7 +58,7 @@ export class AccountsEffects {
@Effect()
enableAccount$: Observable<Action> = this.actions$
.ofType(accountActions.ENABLE_ACCOUNT)
.switchMap((action: accountActions.EnableAccountRequest) => {
.mergeMap((action: accountActions.EnableAccountRequest) => {
return this.accountService.enableAccount(action.payload)
.map(updatedAccount => new accountActions.UpdateAccount(updatedAccount))
.catch((error: Error) => {
Expand All @@ -69,7 +69,7 @@ export class AccountsEffects {
@Effect()
deleteAccount$: Observable<Action> = this.actions$
.ofType(accountActions.DELETE_ACCOUNT)
.switchMap((action: accountActions.DeleteAccountRequest) => {
.mergeMap((action: accountActions.DeleteAccountRequest) => {
return this.accountService.removeAccount(action.payload)
.map(() => new accountActions.DeleteSuccess(action.payload))
.catch((error: Error) => {
Expand All @@ -81,7 +81,7 @@ export class AccountsEffects {
@Effect()
createAccount$: Observable<Action> = this.actions$
.ofType(accountActions.CREATE_ACCOUNT)
.switchMap((action: accountActions.CreateAccount) => {
.mergeMap((action: accountActions.CreateAccount) => {
return this.accountService.create(action.payload)
.map(createdAccount => new accountActions.CreateSuccess(createdAccount))
.catch((error: Error) => {
Expand Down Expand Up @@ -127,7 +127,7 @@ export class AccountsEffects {
@Effect()
userDelete$: Observable<Action> = this.actions$
.ofType(accountActions.ACCOUNT_USER_DELETE)
.switchMap((action: accountActions.AccountUserDelete) =>
.mergeMap((action: accountActions.AccountUserDelete) =>
this.userService.removeUser(action.payload)
.map(() => new accountActions.AccountUserDeleteSuccess(action.payload))
.catch(error => Observable.of(new accountActions.AccountUpdateError(error))));
Expand All @@ -142,7 +142,7 @@ export class AccountsEffects {
@Effect()
userCreate$: Observable<Action> = this.actions$
.ofType(accountActions.ACCOUNT_USER_CREATE)
.switchMap((action: accountActions.AccountUserCreate) =>
.mergeMap((action: accountActions.AccountUserCreate) =>
this.userService.createUser(action.payload)
.map((user) => new accountActions.AccountUserCreateSuccess(user))
.catch(error => Observable.of(new accountActions.AccountUpdateError(error))));
Expand All @@ -158,7 +158,7 @@ export class AccountsEffects {
@Effect()
userUpdate$: Observable<Action> = this.actions$
.ofType(accountActions.ACCOUNT_USER_UPDATE)
.switchMap((action: accountActions.AccountUserUpdate) =>
.mergeMap((action: accountActions.AccountUserUpdate) =>
this.userService.updateUser(action.payload)
.map((user) => new accountActions.AccountUserUpdateSuccess(user))
.catch(error => Observable.of(new accountActions.AccountUpdateError(error))));
Expand All @@ -173,7 +173,7 @@ export class AccountsEffects {
@Effect()
userGenerateKeys$: Observable<Action> = this.actions$
.ofType(accountActions.ACCOUNT_USER_GENERATE_KEYS)
.switchMap((action: accountActions.AccountUserGenerateKey) =>
.mergeMap((action: accountActions.AccountUserGenerateKey) =>
this.userService.registerKeys(action.payload.id)
.map(res => new accountActions.AccountLoadUserKeysSuccess({
user: action.payload,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class ConfigurationEffects {
@Effect()
updateConfiguration$: Observable<Action> = this.actions$
.ofType(configurationActions.UPDATE_CONFIGURATIONS_REQUEST)
.switchMap((action: configurationActions.UpdateConfigurationRequest) => {
.mergeMap((action: configurationActions.UpdateConfigurationRequest) => {
return this.configurationService.updateConfiguration(
action.payload.configuration,
action.payload.account)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Injectable } from '@angular/core';
import {
Actions,
Effect
} from '@ngrx/effects';
import { Actions, Effect } from '@ngrx/effects';
import { Observable } from 'rxjs/Observable';
import * as resourceLimitActions from './resource-limits.actions';
import { Action } from '@ngrx/store';
Expand All @@ -27,7 +24,7 @@ export class ResourceLimitsEffects {
@Effect()
updateResourceLimits$: Observable<Action> = this.actions$
.ofType(resourceLimitActions.UPDATE_RESOURCE_LIMITS_REQUEST)
.switchMap((action: resourceLimitActions.UpdateResourceLimitsRequest) => {
.mergeMap((action: resourceLimitActions.UpdateResourceLimitsRequest) => {
const observes = action.payload.limits.map(limit =>
this.resourceLimitService.updateResourceLimit(limit, action.payload.account));
return Observable.forkJoin(observes)
Expand Down
8 changes: 4 additions & 4 deletions src/app/reducers/security-groups/redux/sg.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class SecurityGroupEffects {
@Effect()
createSecurityGroup$: Observable<Action> = this.actions$
.ofType(securityGroup.CREATE_SECURITY_GROUP)
.switchMap((action: securityGroup.CreateSecurityGroup) => {
.mergeMap((action: securityGroup.CreateSecurityGroup) => {
return this.createSecurityGroup(action.payload)
.map(sg => new securityGroup.CreateSecurityGroupSuccess(sg))
.catch(error => Observable.of(new securityGroup.CreateSecurityGroupError(error)));
Expand All @@ -54,7 +54,7 @@ export class SecurityGroupEffects {
@Effect()
deleteSecurityGroup$: Observable<Action> = this.actions$
.ofType(securityGroup.DELETE_SECURITY_GROUP)
.switchMap((action: securityGroup.DeleteSecurityGroup) => {
.mergeMap((action: securityGroup.DeleteSecurityGroup) => {
return this.onDeleteConfirmation(action.payload)
.map(() => new securityGroup.DeleteSecurityGroupSuccess(action.payload))
.catch(error => Observable.of(new securityGroup.DeleteSecurityGroupError(error)));
Expand All @@ -73,7 +73,7 @@ export class SecurityGroupEffects {
return vmGroup;
})
.filter((group: SecurityGroup) => !!group)
.switchMap((group: SecurityGroup) => {
.mergeMap((group: SecurityGroup) => {
return this.deleteSecurityGroup(group)
.map(() => new securityGroup.DeleteSecurityGroupSuccess(group));
});
Expand All @@ -99,7 +99,7 @@ export class SecurityGroupEffects {
@Effect()
convertSecurityGroup$: Observable<Action> = this.actions$
.ofType(securityGroup.CONVERT_SECURITY_GROUP)
.switchMap((action: securityGroup.ConvertSecurityGroup) => {
.mergeMap((action: securityGroup.ConvertSecurityGroup) => {
return this.dialogService.confirm({ message: 'DIALOG_MESSAGES.SECURITY_GROUPS.CONFIRM_CONVERT' })
.onErrorResumeNext()
.filter(res => Boolean(res))
Expand Down
8 changes: 4 additions & 4 deletions src/app/reducers/snapshots/redux/snapshot.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class SnapshotEffects {
@Effect()
addSnapshot$: Observable<Action> = this.actions$
.ofType(snapshotActions.ADD_SNAPSHOT)
.flatMap((action: snapshotActions.AddSnapshot) => {
.mergeMap((action: snapshotActions.AddSnapshot) => {
return this.dialog.open(SnapshotCreationComponent, {
data: action.payload
})
Expand Down Expand Up @@ -74,7 +74,7 @@ export class SnapshotEffects {
@Effect()
deleteSnapshot$: Observable<Action> = this.actions$
.ofType(snapshotActions.DELETE_SNAPSHOT)
.flatMap((action: snapshotActions.DeleteSnapshot) => {
.mergeMap((action: snapshotActions.DeleteSnapshot) => {
const notificationId = this.jobsNotificationService.add(
'JOB_NOTIFICATIONS.SNAPSHOT.DELETION_IN_PROGRESS');
return this.snapshotService.remove(action.payload.id)
Expand All @@ -97,7 +97,7 @@ export class SnapshotEffects {
@Effect()
deleteSnapshots$: Observable<Action> = this.actions$
.ofType(snapshotActions.DELETE_SNAPSHOTS)
.flatMap((action: snapshotActions.DeleteSnapshots) => action.payload
.mergeMap((action: snapshotActions.DeleteSnapshots) => action.payload
.map((snapshot: Snapshot) => new snapshotActions.DeleteSnapshot(snapshot)));

@Effect()
Expand All @@ -107,7 +107,7 @@ export class SnapshotEffects {
this.store.select(fromVolumes.selectEntities),
this.store.select(fromVMs.selectEntities)
)
.flatMap(([action, volumes, vms]: [
.mergeMap(([action, volumes, vms]: [
snapshotActions.RevertVolumeToSnapshot, Dictionary<Volume>, Dictionary<VirtualMachine>
]) => {
const vmId = Object.entries(volumes)
Expand Down
4 changes: 2 additions & 2 deletions src/app/reducers/ssh-keys/redux/ssh-key.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class SshKeyEffects {
@Effect()
removeSshKeyPair$: Observable<Action> = this.actions$
.ofType(sshKey.SSH_KEY_PAIR_REMOVE)
.switchMap((action: sshKey.RemoveSshKeyPair) => {
.mergeMap((action: sshKey.RemoveSshKeyPair) => {
return this.dialogService.confirm({ message: 'SSH_KEYS.REMOVE_THIS_KEY' })
.onErrorResumeNext()
.filter(res => !!res)
Expand Down Expand Up @@ -60,7 +60,7 @@ export class SshKeyEffects {
@Effect()
createSshKeyPair$: Observable<Action> = this.actions$
.ofType(sshKey.SSH_KEY_PAIR_CREATE)
.switchMap((action: sshKey.CreateSshKeyPair) => {
.mergeMap((action: sshKey.CreateSshKeyPair) => {
return (action.payload.publicKey
? this.sshKeyService.register(action.payload)
: this.sshKeyService.create(action.payload))
Expand Down
8 changes: 4 additions & 4 deletions src/app/reducers/templates/redux/template.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class TemplateEffects {
@Effect()
removeTemplate$: Observable<Action> = this.actions$
.ofType(template.TEMPLATE_REMOVE)
.switchMap((action: template.RemoveTemplate) => {
.mergeMap((action: template.RemoveTemplate) => {
return (action.payload.resourceType === TemplateResourceType.iso.toUpperCase()
? this.isoService.remove(action.payload)
: this.templateService.remove(action.payload))
Expand Down Expand Up @@ -96,7 +96,7 @@ export class TemplateEffects {
@Effect()
createTemplate$: Observable<Action> = this.actions$
.ofType(template.TEMPLATE_CREATE)
.switchMap((action: template.CreateTemplate) => {
.mergeMap((action: template.CreateTemplate) => {
return (action.payload.entity === TemplateResourceType.iso
? this.isoService.register(action.payload)
: action.payload.snapshotId
Expand Down Expand Up @@ -124,7 +124,7 @@ export class TemplateEffects {
@Effect()
setTemplateGroup$: Observable<Action> = this.actions$
.ofType(template.SET_TEMPLATE_GROUP)
.switchMap((action: template.SetTemplateGroup) => this.templateTagService.setGroup(
.mergeMap((action: template.SetTemplateGroup) => this.templateTagService.setGroup(
action.payload.template,
action.payload.templateGroup
)
Expand All @@ -134,7 +134,7 @@ export class TemplateEffects {
@Effect()
resetTemplateGroup$: Observable<Action> = this.actions$
.ofType(template.RESET_TEMPLATE_GROUP)
.switchMap((action: template.ResetTemplateGroup) =>
.mergeMap((action: template.ResetTemplateGroup) =>
this.templateTagService.resetGroup(action.payload)
.map(temp => new template.ResetTemplateGroupSuccess(action.payload))
.catch(error => Observable.of(new template.SetTemplateGroupError(error))));
Expand Down
Loading

0 comments on commit cb6ed54

Please sign in to comment.