Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
PFieldGroup,
PFieldTitle,
PI,
PRadio,
PRadioGroup,
PBadge,
PSelectDropdown, PTextInput,
PToggleButton, screens,
Expand Down Expand Up @@ -151,12 +149,12 @@ const handleUpdateToggle = (action: string, value: boolean) => {

watch([
() => state.selectedActions, () => state.key, () => state.selectedAssetList, () => state.selectedTempAssetRadio, () => state.period,
], ([selectedActions, key, assetList, tempAsset, period]) => {
], ([selectedActions, key, assetList, period]) => {
emit('change-form', {
match_asset: selectedActions.match_asset ? {
key,
asset_types: assetList?.map((asset) => asset.name),
create_temporary_asset: tempAsset === 'CREATE',
// create_temporary_asset: tempAsset === 'CREATE',
Copy link

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] If the temporary asset functionality is no longer used, consider removing the commented-out assignment to reduce clutter.

Suggested change
// create_temporary_asset: tempAsset === 'CREATE',

Copilot uses AI. Check for mistakes.
} : undefined,
merge_asset_labels: selectedActions.merge_asset_labels ? {
period,
Expand Down Expand Up @@ -283,7 +281,8 @@ watch(() => storeState.isEventRuleEditMode, (isEditMode) => {
/>
</p-field-group>
</div>
<div class="field-group flex items-center">
<!-- TODO: used when adding temporary asset functionality -->
Copy link

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Review the commented HTML block regarding temporary asset functionality to ensure it does not impact the template readability; remove it if it is no longer necessary.

Copilot uses AI. Check for mistakes.
<!-- <div class="field-group flex items-center">
<p-field-title font-weight="regular"
class="field-title toggle-wrapper"
>
Expand Down Expand Up @@ -311,7 +310,7 @@ watch(() => storeState.isEventRuleEditMode, (isEditMode) => {
<span>{{ $t('ALERT_MANAGER.EVENT_RULE.TEMP_ASSET_DESC') }}</span>
</p>
</div>
</div>
</div> -->
</div>
<div v-if="action.name === 'merge_asset_labels'"
class="field-group flex items-center pt-3 pr-3 pl-3 merge-asset-wrapper"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ const state = reactive({
value: matchAssetValue.key,
});
}
result[type].push({
label: i18n.t('ALERT_MANAGER.EVENT_RULE.TEMP_ASSET'),
name: 'create_temporary_asset',
value: matchAssetValue.create_temporary_asset ? i18n.t('ALERT_MANAGER.CREATE') : i18n.t('ALERT_MANAGER.EVENT_RULE.DO_NOT_CREATE'),
});
// result[type].push({
// label: i18n.t('ALERT_MANAGER.EVENT_RULE.TEMP_ASSET'),
// name: 'create_temporary_asset',
// value: matchAssetValue.create_temporary_asset ? i18n.t('ALERT_MANAGER.CREATE') : i18n.t('ALERT_MANAGER.EVENT_RULE.DO_NOT_CREATE'),
// });
Comment on lines +111 to +115
Copy link

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] If temporary asset functionality is deprecated, consider permanently removing the commented-out push block to improve code clarity.

Suggested change
// result[type].push({
// label: i18n.t('ALERT_MANAGER.EVENT_RULE.TEMP_ASSET'),
// name: 'create_temporary_asset',
// value: matchAssetValue.create_temporary_asset ? i18n.t('ALERT_MANAGER.CREATE') : i18n.t('ALERT_MANAGER.EVENT_RULE.DO_NOT_CREATE'),
// });

Copilot uses AI. Check for mistakes.
} else if (actionKey === 'merge_asset_labels' && typeof actionValue === 'object') {
const matchAssetValue = actionValue as EventRuleActionsMergeAssetLabelsType;
if (matchAssetValue.period) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ const state = reactive({
}

if (state.actions) {
if (state.actions.match_asset?.create_temporary_asset) {
const matchAssetValid = state.actions.match_asset.asset_types.length > 0 && state.actions.match_asset.key !== '';
if (!matchAssetValid) return false;
}
// if (state.actions.match_asset?.create_temporary_asset) {
// const matchAssetValid = state.actions.match_asset.asset_types.length > 0 && state.actions.match_asset.key !== '';
// if (!matchAssetValid) return false;
// }
Comment on lines +106 to +109
Copy link

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider removing or clarifying the commented-out temporary asset validation code if it is no longer needed.

Suggested change
// if (state.actions.match_asset?.create_temporary_asset) {
// const matchAssetValid = state.actions.match_asset.asset_types.length > 0 && state.actions.match_asset.key !== '';
// if (!matchAssetValid) return false;
// }

Copilot uses AI. Check for mistakes.
if (state.actions.merge_asset_labels?.period !== undefined) {
return state.actions.merge_asset_labels?.period !== '';
}
Expand Down Expand Up @@ -202,7 +202,7 @@ const updateStateFromEventRuleInfo = () => {
state.conditionsPolicy = eventRuleInfo.conditions_policy;
}

state.conditions = eventRuleInfo.conditions.map((i) => {
state.conditions = eventRuleInfo.conditions?.map((i) => {
if (i.key.includes('additional_info')) {
return {
key: 'additional_info',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ onMounted(async () => {
class="notification-align notification-rules-content"
>
<p-text-input :value="rule.threshold"
:placeholder="$t('COST_EXPLORER.ANOMALY_DETECTION.NOTIFICATION_RULES.AMOUNT')"
type="number"
:disabled="!hasReadWriteAccess"
block
@update:value="handleUpdateNotificationRules('threshold', $event, index)"
Expand Down
2 changes: 1 addition & 1 deletion packages/language-pack/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,7 @@
},
"ANOMALY_DETECTION": {
"NOTIFICATION_RULES": {
"AMOUNT": "계정",
"AMOUNT": "임계값 입력",
"NOTIFY_LEVEL": "알림 레벨",
"SELECT_LEVEL": "레벨 선택",
"SELECT_UNIT": "단위 선택",
Expand Down
Loading