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 @@ -58,16 +58,18 @@ const handleClose = async (neverShowPopup?: boolean): Promise<void> => {
@confirm="handleClose"
>
<template #body>
<h1 class="notice-popup-title">
{{ props.item ? props.item.title : '' }}
</h1>
<div class="notice-popup-info">
<span class="notice-popup-author">{{ iso8601Formatter(item.updated_at, userStore.state.timezone) }} · {{ item.writer }}</span>
<div class="pr-2">
<h1 class="notice-popup-title">
{{ props.item ? props.item.title : '' }}
</h1>
<div class="notice-popup-info">
<span class="notice-popup-author">{{ iso8601Formatter(item.updated_at, userStore.state.timezone) }} · {{ item.writer }}</span>
</div>
<p-divider class="!my-4" />
<text-editor-viewer :contents="editorContents"
:contents-type="contentsType"
/>
</div>
<p-divider class="!my-4" />
<text-editor-viewer :contents="editorContents"
:contents-type="contentsType"
/>
</template>
<template #footer-extra>
<p-button style-type="tertiary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@ const handleUpdateAdjustment = (adjustmentId: string, selected: AdjustmentType)
/>
<p-text-input v-model="item.name"
:placeholder="$t('COST_EXPLORER.ADVANCED_SETTINGS.TITLE')"
:invalid="!item.name"
block
/>
<p-select-dropdown :menu="providerMenuItems"
:selected="item.provider"
use-fixed-menu-style
:placeholder="$t('COST_EXPLORER.ADVANCED_SETTINGS.PROVIDER')"
:invalid="!item.provider"
@update:selected="handleUpdateProvider(item.id, $event)"
>
<template #dropdown-button="dropdownItem">
Expand Down Expand Up @@ -180,11 +182,13 @@ const handleUpdateAdjustment = (adjustmentId: string, selected: AdjustmentType)
<p-select-dropdown :menu="adjustmentMenuItems"
:selected="item.adjustment"
use-fixed-menu-style
:invalid="!item.adjustment"
@update:selected="handleUpdateAdjustment(item.id, $event)"
/>
<p-text-input v-model="item.amount"
type="number"
:placeholder="$t('COST_EXPLORER.ADVANCED_SETTINGS.AMOUNT')"
:invalid="!item.amount"
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

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

This flags 0 as invalid but doesn’t account for negative or non-numeric values. Update to :invalid="Number(item.amount) <= 0" to match the positive-only requirement.

Suggested change
:invalid="!item.amount"
:invalid="Number(item.amount) <= 0"

Copilot uses AI. Check for mistakes.
class="w-auto"
>
<template #input-left>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type { KeyItemSet } from '@cloudforet/mirinae/types/controls/search/query

import { i18n } from '@/translations';

import { useAppContextStore } from '@/store/app-context/app-context-store';
import { CURRENCY_SYMBOL } from '@/store/display/constant';
import type { Currency } from '@/store/display/type';

Expand All @@ -34,6 +35,7 @@ import { useCostReportPageStore } from '@/services/cost-explorer/stores/cost-rep

const costReportPageStore = useCostReportPageStore();
const costReportPageState = costReportPageStore.state;
const appContextStore = useAppContextStore();

const state = reactive({
currency: computed(() => costReportPageState.costReportConfig?.currency || 'KRW' as Currency),
Expand Down Expand Up @@ -80,10 +82,14 @@ const tableState = reactive({
workspace_name: makeDistinctValueHandler('cost_analysis.CostReport', 'workspace_name', 'string', [{ k: 'status', v: 'SUCCESS', o: 'eq' }]),
},
});
const isAdminMode = computed<boolean>(() => appContextStore.getters.isAdminMode);


const costReportListApiQueryHelper = new ApiQueryHelper()
.setSort('issue_date', true);
.setSort('issue_date', true)
.setFilters([
{ k: 'status', v: isAdminMode.value ? ['DONE', 'ADJUSTING'] : ['DONE'], o: '' },
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

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

The filter object uses an empty operator (o: ''), which may not apply the intended filter. Consider using a valid operator like 'in' for array values.

Suggested change
{ k: 'status', v: isAdminMode.value ? ['DONE', 'ADJUSTING'] : ['DONE'], o: '' },
{ k: 'status', v: isAdminMode.value ? ['DONE', 'ADJUSTING'] : ['DONE'], o: 'in' },

Copilot uses AI. Check for mistakes.
]);
Comment on lines +89 to +92
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

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

The filters are applied once at initialization, so changes in isAdminMode won’t update the query at runtime. Consider watching isAdminMode and updating the query helper dynamically.

Suggested change
.setSort('issue_date', true)
.setFilters([
{ k: 'status', v: isAdminMode.value ? ['DONE', 'ADJUSTING'] : ['DONE'], o: '' },
]);
.setSort('issue_date', true);
const updateFilters = () => {
costReportListApiQueryHelper.setFilters([
{ k: 'status', v: isAdminMode.value ? ['DONE', 'ADJUSTING'] : ['DONE'], o: '' },
]);
};
updateFilters();
watch(isAdminMode, () => {
updateFilters();
});

Copilot uses AI. Check for mistakes.
const queryTagHelper = useQueryTags({ keyItemSets: tableState.keyItemSets });
const { queryTags } = queryTagHelper;

Expand Down Expand Up @@ -274,7 +280,9 @@ watch(() => costReportPageState.activeTab, (activeTab) => {
<span class="currency-text">{{ item.currency }}</span>
</template>
<template #col-extra-format="{item}">
<div class="float-right">
<div v-if="item.status === 'DONE'"
class="float-right"
>
<p-button style-type="tertiary"
icon-left="ic_link"
size="sm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const useAdvancedSettingsPageStore = defineStore('page-advanced-settings'
isAdjustmentPolicyValid: (state) => state.adjustmentPolicyList
.every((item) => (item.isAllWorkspaceSelected || !!item.workspaceMenuItems?.length) && !!state.adjustmentListMap[item.id]?.length),
isAdjustmentValid: (state) => Object.values(state.adjustmentListMap)
.every((item) => item.every((adjustment) => adjustment.name && adjustment.provider && adjustment.adjustment && !!adjustment.amount)),
.every((item) => item.every((adjustment) => adjustment.name && adjustment.provider && adjustment.adjustment && !!adjustment.amount && Number(adjustment.amount) > 0)),
},
actions: {
setLoading(state: AdvancedSettingsPageStore['loading']) {
Expand Down
Loading