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

fix(snapshot-hourly-schedule): Show localized message when error for … #803

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/reducers/volumes/redux/volumes.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ export class VolumesEffects {
'JOB_NOTIFICATIONS.SNAPSHOT.DELETION_IN_PROGRESS');
return this.snapshotService.remove(action.payload.snapshot.id)
.map(() => {
let newSnapshots = action.payload.volume.snapshots.filter(
const newSnapshots = action.payload.volume.snapshots.filter(
_ => _.id !== action.payload.snapshot.id);
let newVolume = Object.assign({}, action.payload.volume, {snapshots: newSnapshots});
const newVolume = Object.assign({}, action.payload.volume, {snapshots: newSnapshots});
this.jobsNotificationService.finish({
id: notificationId,
message: 'JOB_NOTIFICATIONS.SNAPSHOT.DELETION_DONE'
Expand Down
4 changes: 4 additions & 0 deletions src/app/shared/services/error.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export class ErrorService {
{
regex: /Value greater than max allowed length (\d+) for param: volumeName/,
translation: 'ERRORS.VOLUME.NAME_TOO_LONG'
},
{
regex: /maxSnaps exceeds limit: (\d+) for interval type: hourly/,
translation: 'ERRORS.SNAPSHOT_POLICIES.HOURLY_TURN_OFF'
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class RecurringSnapshotsComponent implements OnInit {
})
}

private onError(error: any): void {
private onError(error): void {
this.dialogService.alert({
message: {
translationToken: error.message,
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
"UNABLE_TO_FIND_PRIMARY_STORAGE": "Unable to find suitable primary storage when creating volume {{val1}}",
"VOLUME_BUSY": "There is other active snapshot tasks on the instance to which the volume is attached, please try again later",
"VOLUME_LIMIT_EXCEEDED": "Volume limit has been exceeded. You need to delete some of your volumes to create a new one."
},
"SNAPSHOT_POLICIES": {
"HOURLY_TURN_OFF": "Hourly schedule is turned off"
}
},
"JOB_NOTIFICATIONS": {
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
"UNABLE_TO_FIND_PRIMARY_STORAGE": "Не удалось найти подходящее основное хранилище при создании диска {{val1}}",
"VOLUME_BUSY": "На виртуальной машине, к которой прикреплен этот диск, уже выполняется другое действие над снимками. Повторите попытку позже.",
"VOLUME_LIMIT_EXCEEDED": "Лимит дисков превышен. Для создания новых дисков вам нужно удалить какие-либо из ранее созданных дисков."
},
"SNAPSHOT_POLICIES": {
"HOURLY_TURN_OFF": "Почасовое расписание отключено"
}
},
"JOB_NOTIFICATIONS": {
Expand Down