Address copilot reviews

This commit is contained in:
Fabricio Duarte 2026-07-01 17:25:32 -03:00
parent 2b4600af06
commit 14a9f8b8dc
9 changed files with 14 additions and 19 deletions

View File

@ -60,7 +60,7 @@ public class QuotaCreditsCmd extends BaseCmd {
@ACL
@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class,
description = "ID of the Project for which qQuota credits will be added. Can not be specified with '" + ApiConstants.ACCOUNT_ID + "'.")
description = "ID of the Project for which Quota credits will be added. Can not be specified with '" + ApiConstants.ACCOUNT_ID + "'.")
private Long projectId;
@Parameter(name = ApiConstants.VALUE, type = CommandType.DOUBLE, required = true, description = "Amount of credits to be added (in case of a positive value) or subtracted (in case of a negative value).")

View File

@ -766,7 +766,7 @@ public class QuotaResponseBuilderImpl implements QuotaResponseBuilder {
return;
}
if (enforceQuota && account.getState() == Account.State.ENABLED && _quotaManager.isLockable(account)) {
if (Boolean.TRUE.equals(enforceQuota) && account.getState() == Account.State.ENABLED && _quotaManager.isLockable(account)) {
logger.info("Locking Account [{}] due to negative balance.", accountName);
_accountMgr.lockAccount(accountName, domainId, accountId);
}

View File

@ -677,13 +677,13 @@
<template v-if="text">
<template v-if="!text.startsWith('PrjAcct-')">
<router-link
v-if="$route.path.startsWith('/quotasummary') && $router.resolve(`${$route.path}/${record.accountid}`) !== '404'"
v-if="$route.path.startsWith('/quotasummary') && $router.resolve(`${$route.path}/${record.accountid}`).matched[0].redirect !== '/exception/404'"
:to="{ path: `${$route.path}/${record.accountid}` }">{{ text }}</router-link>
<span v-else>{{ text }}</span>
</template>
<template v-else>
<router-link
v-if="$route.path.startsWith('/quotasummary') && $router.resolve(`${$route.path}/${record.accountid}`) !== '404'"
v-if="$route.path.startsWith('/quotasummary') && $router.resolve(`${$route.path}/${record.accountid}`).matched[0].redirect !== '/exception/404'"
:to="{ path: `${$route.path}/${record.accountid}` }">{{ (record.projectname || record.account).concat(' (').concat($t('label.project')).concat(')') }}</router-link>
<span v-else>{{ text }}</span>
</template>

View File

@ -34,7 +34,7 @@ export function exportDataToCsv ({ data = null, keys = null, headers = null, col
if (typeof item[key] === 'string' && item[key].includes(columnDelimiter)) {
dataParsed += `"${item[key]}"`
} else if (dateFormat && item[key] instanceof dayjs) {
} else if (dateFormat && dayjs.isDayjs(item[key])) {
dataParsed += `"${item[key].format(dateFormat)}"`
} else {
dataParsed += item[key]

View File

@ -1118,7 +1118,9 @@ export default {
if (this.apiName === 'quotaTariffList' && !('quotaTariffCreate' in store.getters.apis || 'quotaTariffUpdate' in store.getters.apis)) {
const index = this.columns.findIndex(col => col.dataIndex === 'hasActivationRule')
this.columns.splice(index, 1)
if (index >= 0) {
this.columns.splice(index, 1)
}
}
this.loading = true

View File

@ -94,16 +94,12 @@ export default {
},
created () {
this.initForm()
console.log(store.getters.project)
console.log(store.getters.userInfo)
},
methods: {
initForm () {
this.formRef = ref()
this.form = reactive({})
this.rules = reactive({
domainid: [{ required: true, message: this.$t('message.action.quota.credit.add.error.domainidrequired') }],
accountid: [{ required: true, message: this.$t('message.action.quota.credit.add.error.accountrequired') }],
value: [{ required: true, message: this.$t('message.action.quota.credit.add.error.valuerequired') }]
})
},
@ -142,7 +138,6 @@ export default {
this.$emit('close-action')
},
fetchOwnerOptions (OwnerOptions) {
console.log(OwnerOptions)
this.owner = {}
if (OwnerOptions.selectedAccountType === 'Account') {
if (!OwnerOptions.selectedAccount) {

View File

@ -121,8 +121,8 @@ export default {
async getQuotaBalance () {
const params = {
accountid: this.$route.params?.id,
startDate: this.startDate,
endDate: this.endDate
startdate: this.startDate,
enddate: this.endDate
}
return await getAPI('quotaBalance', params)

View File

@ -132,7 +132,7 @@ export default {
}
return await getAPI('quotaCreditsList', params)
.then(json => json.quotacreditslistresponse.credit || {})
.then(json => json.quotacreditslistresponse.credit || [])
.catch(error => { error && this.$notification.info({ message: this.$t('message.request.no.data') }) })
},
exportDataToCsv () {

View File

@ -99,7 +99,6 @@
class="w-100"
style="margin: 5px 0 10px 0px"
show-search
v-model="selectedType"
@change="handleSelectedTypeChange">
<a-select-option
v-for="quotaType of getQuotaTypesFiltered()"
@ -133,7 +132,7 @@
<span v-if="!text">
-
</span>
<span v-if="!text === '<untraceable>' || !record.resourceid">
<span v-if="text === '<untraceable>' || !record.resourceid">
{{ text }}
</span>
<a v-else @click="handleSelectedResourceChange(record.resourceid)">
@ -160,7 +159,6 @@
class="w-100"
style="margin: 5px 0 10px 0px"
show-search
v-model="selectedResource"
@change="handleSelectedResourceChange"
:disabled="getResources().length == 0">
<a-select-option
@ -339,7 +337,7 @@ export default {
{
title: this.$t('label.quota.consumed'),
dataIndex: 'quotaconsumed',
sorter: (a, b) => a.quotaused - b.quotaused
sorter: (a, b) => a.quotaconsumed - b.quotaconsumed
}
]
}
@ -554,7 +552,7 @@ export default {
pushDateToLabelsIfNotPresent (lineChartLabels, date) {
const hasDate = lineChartLabels.some(d => {
const diff = Math.abs(new Date(date) - new Date(d).getTime())
return diff < 5 * 1000 // Do not push the label if there is already one within 5 minutes
return diff < 5 * 1000 * 60 // Do not push the label if there is already one within 5 minutes
})
if (!hasDate) {
lineChartLabels.push(date)