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

Rule enable/disable needs to update ETag in redux store #1086

Merged
merged 1 commit into from
Sep 5, 2018
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
6 changes: 3 additions & 3 deletions src/components/pages/rules/flyouts/ruleStatus/ruleStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class RuleStatus extends Component {
this.subscription = Observable.from(requestPropList)
.flatMap((rule) =>
TelemetryService.updateRule(rule.id, toEditRuleRequestModel(rule))
.map(() => rule)
.map(updatedRule => ({...rule, eTag: updatedRule.eTag}))
)
.subscribe(
updatedRule => {
Expand Down Expand Up @@ -95,8 +95,8 @@ export class RuleStatus extends Component {
</ToggleBtn>
</div>
{
rules.map((rule) => (
<RuleSummary rule={rule} isPending={isPending} completedSuccessfully={completedSuccessfully} t={t} />
rules.map((rule, idx) => (
<RuleSummary key={idx} rule={rule} isPending={isPending} completedSuccessfully={completedSuccessfully} t={t} />
))
}

Expand Down
2 changes: 2 additions & 0 deletions src/services/models/telemetryModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export const toMessagesModel = (response = {}) => getItems(response)
}));

export const toEditRuleRequestModel = ({
id,
name,
description,
groupId,
Expand All @@ -140,6 +141,7 @@ export const toEditRuleRequestModel = ({
Value: condition.value
}));
return {
Id: id,
Name: name,
Description: description,
GroupId: groupId,
Expand Down