mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
refactor(ui): move settings keys in the API response to a namespace
This commit is contained in:
@@ -24,7 +24,7 @@ class BaseLabel extends Component {
|
||||
isStaticColorLabel(name) {
|
||||
const { alertStore } = this.props;
|
||||
|
||||
return alertStore.staticColorLabels.values.includes(name);
|
||||
return alertStore.settings.values.staticColorLabels.includes(name);
|
||||
}
|
||||
|
||||
getColorClass(name, value) {
|
||||
|
||||
@@ -117,13 +117,13 @@ class AlertStore {
|
||||
{ name: "API response info" }
|
||||
);
|
||||
|
||||
staticColorLabels = observable(
|
||||
settings = observable(
|
||||
{
|
||||
values: []
|
||||
values: { staticColorLabels: [] }
|
||||
},
|
||||
{},
|
||||
{
|
||||
name: "List of labels with static color"
|
||||
name: "Global settings"
|
||||
}
|
||||
);
|
||||
|
||||
@@ -247,8 +247,9 @@ class AlertStore {
|
||||
}
|
||||
}
|
||||
|
||||
if (!equal(this.staticColorLabels, result.staticColorLabels)) {
|
||||
this.staticColorLabels.values = result.staticColorLabels;
|
||||
// settings exported via API
|
||||
if (!equal(this.settings, result.settings)) {
|
||||
this.settings.values = result.settings;
|
||||
}
|
||||
|
||||
this.status.setIdle();
|
||||
|
||||
Reference in New Issue
Block a user