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 @@ -21,5 +21,4 @@ export interface BudgetCreateParameters {
project_id?: string;
service_account_id?: string;
budget_manager_id?: string;
budget_year?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { ResourceGroupType } from '@/api-clients/_common/schema/type';
import type {
BudgetNotification,
BudgetPlannedLimit,
BudgetState,
BudgetTimeUnit,
} from '@/api-clients/cost-analysis/budget/schema/type';

Expand All @@ -29,7 +30,7 @@ export interface BudgetModel {
domain_id: string;
created_at: string;
updated_at: string;
budget_year: string;
notified_month: string;
utilization_rate: number;
state: BudgetState;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type BudgetTimeUnit = 'MONTHLY' | 'TOTAL';
export type BudgetState = 'ACTIVE' | 'SCHEDULED' | 'EXPIRED';
type BudgetNotificationUnit = 'PERCENT';
type BudgetNotificationState = 'ENABLED' | 'DISABLED';

Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/common/modules/user/UserSelectDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const props = withDefaults(defineProps<{
excludedSelectedIds?: string[];
size?: 'sm'|'md';
pageSize?: number;
showDeleteAllButton?: boolean;
}>(), {
selectedId: undefined,
selectedIds: undefined,
Expand All @@ -75,6 +76,7 @@ const props = withDefaults(defineProps<{
excludedSelectedIds: undefined,
size: 'md',
pageSize: 10,
showDeleteAllButton: true,
});

const emit = defineEmits<{(event: 'update:selected-id', value?: string): void;
Expand Down Expand Up @@ -273,7 +275,7 @@ watch([() => props.selectedId, () => props.selectedIds], ([newUserId, newUserIds
<p-select-dropdown class="user-select-dropdown"
show-select-marker
is-filterable
show-delete-all-button
:show-delete-all-button="props.showDeleteAllButton"
:selected="state.selectedItems"
:handler="menuItemsHandler()"
:selection-label="props.selectionLabel"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PButtonModal } from '@cloudforet/mirinae';

import ErrorHandler from '@/common/composables/error/errorHandler';

import { useBudgetDetailPageStore } from '../stores/budget-detail-page-store';
import { useBudgetDetailPageStore } from '@/services/cost-explorer/stores/budget-detail-page-store';

interface Props {
visible: boolean;
Expand All @@ -29,7 +29,7 @@ const setNotification = async () => {
...budgetPageState.budgetData?.notification,
state: !props.budgetOnOffValue ? 'ENABLED' : 'DISABLED',
},
});
}, 'budgetAlert');
} catch (error) {
ErrorHandler.handleError(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { ServiceAccountModel } from '@/api-clients/identity/service-account
import ErrorHandler from '@/common/composables/error/errorHandler';
import UserSelectDropdown from '@/common/modules/user/UserSelectDropdown.vue';

import { useBudgetCreatePageStore } from '../stores/budget-create-page-store';
import { useBudgetCreatePageStore } from '@/services/cost-explorer/stores/budget-create-page-store';

const budgetCreatePageStore = useBudgetCreatePageStore();
const budgetCreatePageState = budgetCreatePageStore.state;
Expand Down Expand Up @@ -53,6 +53,7 @@ watch(() => budgetCreatePageState.scope.serviceAccount, async () => {
show-user-list
:show-user-group-list="false"
:selected-id="budgetCreatePageState.budgetManager"
:show-delete-all-button="false"
@update:selected-id="handleSelectId"
@formatted-selected-ids="handleFormatBudgetManager"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useAllReferenceStore } from '@/store/reference/all-reference-store';

import ErrorHandler from '@/common/composables/error/errorHandler';

import { useBudgetCreatePageStore } from '../stores/budget-create-page-store';
import { useBudgetCreatePageStore } from '@/services/cost-explorer/stores/budget-create-page-store';

const allReferenceStore = useAllReferenceStore();
const budgetCreatePageStore = useBudgetCreatePageStore();
Expand All @@ -39,7 +39,6 @@ const state = reactive({
serviceAccountList: [] as string[],
existingServiceAccountIds: [],
refinedServiceAccountList: computed<SelectDropdownMenuItem[]>(() => state.serviceAccountList
.filter((serviceAccountId) => state.existingServiceAccountIds?.length > 0 && !state.existingServiceAccountIds.includes(serviceAccountId))
.map((serviceAccountId) => ({
name: serviceAccountId,
label: serviceAccount.value[serviceAccountId].label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import type { ProjectReferenceMap } from '@/store/reference/project-reference-st
import ErrorHandler from '@/common/composables/error/errorHandler';
import ProjectSelectDropdown from '@/common/modules/project/ProjectSelectDropdown.vue';

import { useBudgetCreatePageStore } from '../stores/budget-create-page-store';
import BudgetCreateManagerSelect from './BudgetCreateManagerSelect.vue';
import BudgetCreateScopeSelect from './BudgetCreateScopeSelect.vue';
import BudgetCreateManagerSelect from '@/services/cost-explorer/components/BudgetCreateManagerSelect.vue';
import BudgetCreateScopeSelect from '@/services/cost-explorer/components/BudgetCreateScopeSelect.vue';
import { useBudgetCreatePageStore } from '@/services/cost-explorer/stores/budget-create-page-store';


const budgetCreatePageStore = useBudgetCreatePageStore();
Expand Down Expand Up @@ -149,22 +149,6 @@ watch(() => budgetCreatePageState.project, async () => {
watchEffect(async () => {
await fetchBudget();
});

watch([
() => state.budgetList,
() => budgetCreatePageState.project,
() => budgetCreatePageState.scope.serviceAccount,
() => budgetCreatePageState.scope.type,
], () => {
const filteredList = state.budgetList.filter((result) => {
if (budgetCreatePageState.scope.type === 'project') {
return result.project_id === budgetCreatePageState.project && !result.service_account_id;
}
return result.project_id === budgetCreatePageState.project
&& result.service_account_id === budgetCreatePageState.scope.serviceAccount;
});
budgetCreatePageState.alreadyExistingBudgetYear = filteredList.map((result) => result.budget_year);
}, { deep: true, immediate: true });
</script>

<template>
Expand Down
Loading
Loading