Skip to content

Commit a3b1d29

Browse files
committed
Merge branch 'develop' into feature-project-alert-manager
Signed-off-by: NaYeong,Kim <nayeongkim@megazone.com>
2 parents 9180681 + a20267b commit a3b1d29

File tree

6 files changed

+33
-13
lines changed

6 files changed

+33
-13
lines changed

apps/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web",
3-
"version": "2.0.0-dev302",
3+
"version": "2.0.0-dev306",
44
"private": true,
55
"description": "Cloudforet Console Web Application",
66
"author": "Cloudforet",

apps/web/src/common/modules/widgets/_components/WidgetFormDataTableCardAddForm.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ const assetFilterState = reactive({
155155
metricItems: computed<MenuItem[]>(() => assetFilterState.refinedLabelKeys.map((d) => ({ name: d.key, label: d.name }))),
156156
metricFilterItems: computed<MenuItem[]>(() => {
157157
const _refinedLabelKeys = cloneDeep(assetFilterState.refinedLabelKeys);
158-
const projectLabelInfoIndex = _refinedLabelKeys.find((d) => d.key === 'project_id');
159-
if (projectLabelInfoIndex) {
158+
const projectLabelInfoIndex = _refinedLabelKeys.findIndex((d) => d.key === 'project_id');
159+
if (projectLabelInfoIndex > -1) {
160160
_refinedLabelKeys.splice(projectLabelInfoIndex, 0, PROJECT_GROUP_LABEL_INFO);
161161
}
162162
return _refinedLabelKeys.map((d) => ({

apps/web/src/common/modules/widgets/_components/WidgetFormDataTableCardFilters.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
} from 'vue';
66
77
import {
8+
cloneDeep,
89
debounce,
910
isArray,
1011
isEmpty, unset,
@@ -47,6 +48,7 @@ import { useWidgetGenerateStore } from '@/common/modules/widgets/_store/widget-g
4748
import type { DataTableQueryFilterForDropdown } from '@/common/modules/widgets/types/widget-data-table-type';
4849
import type { DataTableSourceType, DataTableQueryFilter } from '@/common/modules/widgets/types/widget-model';
4950
51+
import { PROJECT_GROUP_LABEL_INFO } from '@/services/asset-inventory-v1/constants/asset-analysis-constant';
5052
import { GROUP_BY } from '@/services/cost-explorer/constants/cost-explorer-constant';
5153
5254
@@ -119,10 +121,15 @@ const state = reactive({
119121
const assetFilterState = reactive({
120122
refinedLabelKeys: computed(() => {
121123
const metricLabelsInfo = storeState.metrics[props.sourceId ?? ''].data.labels_info;
122-
return metricLabelsInfo ? metricLabelsInfo.filter((labelInfo) => {
124+
const _refinedLabelKeys = cloneDeep(metricLabelsInfo || []);
125+
const projectLabelInfoIndex = _refinedLabelKeys.findIndex((d) => d.key === 'project_id');
126+
if (projectLabelInfoIndex > -1) {
127+
_refinedLabelKeys.splice(projectLabelInfoIndex, 0, PROJECT_GROUP_LABEL_INFO);
128+
}
129+
return _refinedLabelKeys.filter((labelInfo) => {
123130
if (storeState.isAdminMode) return true;
124131
return labelInfo.key !== 'workspace_id';
125-
}) : [];
132+
});
126133
}),
127134
});
128135

apps/web/src/services/alert-manager/components/ServiceDetailTabsSettingsEventRuleFormCard.vue

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const state = reactive({
8181
{ name: EVENT_RULE_CONDITIONS_POLICY.ANY, label: i18n.t('ALERT_MANAGER.EVENT_RULE.SET_CONDITION') },
8282
]),
8383
selectedPolicyButton: EVENT_RULE_CONDITIONS_POLICY.ALWAYS as EventRuleConditionsPolicyType,
84-
conditionsPolicy: 'ALL' as EventRuleConditionsPolicyType,
84+
conditionsPolicy: EVENT_RULE_CONDITIONS_POLICY.ALL as EventRuleConditionsPolicyType,
8585
conditions: [] as EventRuleConditionsDataType[],
8686
stopProcessing: false,
8787
actions: undefined as EventRuleActionsType|undefined,
@@ -181,7 +181,7 @@ const {
181181
const initializeState = () => {
182182
setForm('name', '');
183183
state.selectedPolicyButton = EVENT_RULE_CONDITIONS_POLICY.ALWAYS;
184-
state.conditionsPolicy = 'ALL';
184+
state.conditionsPolicy = EVENT_RULE_CONDITIONS_POLICY.ALL;
185185
state.conditions = [{
186186
key: 'title',
187187
value: '',
@@ -198,8 +198,21 @@ const updateStateFromEventRuleInfo = () => {
198198
state.selectedPolicyButton = eventRuleInfo.conditions_policy === EVENT_RULE_CONDITIONS_POLICY.ALWAYS
199199
? EVENT_RULE_CONDITIONS_POLICY.ALWAYS
200200
: EVENT_RULE_CONDITIONS_POLICY.ANY;
201-
state.conditionsPolicy = eventRuleInfo.conditions_policy;
202-
state.conditions = eventRuleInfo.conditions || [{
201+
if (state.selectedPolicyButton !== EVENT_RULE_CONDITIONS_POLICY.ALWAYS) {
202+
state.conditionsPolicy = eventRuleInfo.conditions_policy;
203+
}
204+
205+
state.conditions = eventRuleInfo.conditions.map((i) => {
206+
if (i.key.includes('additional_info')) {
207+
return {
208+
key: 'additional_info',
209+
value: i.value,
210+
operator: i.operator,
211+
subKey: i.key.split('.')[1],
212+
};
213+
}
214+
return i;
215+
}) || [{
203216
key: 'title',
204217
value: '',
205218
operator: 'contain',

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cloudforet-console",
3-
"version": "2.0.0-dev302",
3+
"version": "2.0.0-dev306",
44
"private": true,
55
"workspaces": [
66
"apps/*",

0 commit comments

Comments
 (0)