Fixing categoryId being inconsistent following refactoring of names, breaking functionnality

This commit is contained in:
Landry JUGE 2025-12-03 16:12:39 +01:00
parent 77f821f65b
commit 2cdf59a87e
5 changed files with 9 additions and 9 deletions

View File

@ -529,8 +529,8 @@ public class ApiConstants {
public static final String SENT_BYTES = "sentbytes";
public static final String SERIAL = "serial";
public static final String SERVICE_IP = "serviceip";
public static final String SERVICE_OFFERING_CATEGORY_ID = "serviceofferingcategoryid";
public static final String SERVICE_OFFERING_CATEGORY_NAME = "serviceofferingcategoryname";
public static final String SERVICE_OFFERING_CATEGORY_ID = "categoryid";
public static final String SERVICE_OFFERING_CATEGORY_NAME = "categoryname";
public static final String SERVICE_OFFERING_ID = "serviceofferingid";
public static final String SERVICE_OFFERING_NAME = "serviceofferingname";
public static final String SESSIONKEY = "sessionkey";

View File

@ -296,7 +296,7 @@ public class CreateServiceOfferingCmd extends BaseCmd {
required = false,
description = "the ID of the service offering category to associate with this offering",
since = "4.23")
private Long serviceOfferingCategoryId;
private Long categoryId;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
@ -570,8 +570,8 @@ public class CreateServiceOfferingCmd extends BaseCmd {
return Boolean.TRUE.equals(gpuDisplay);
}
public Long getServiceOfferingCategoryId() {
return serviceOfferingCategoryId;
public Long getCategoryId() {
return categoryId;
}
/////////////////////////////////////////////////////

View File

@ -3470,7 +3470,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
}
// validate optional category id
final Long serviceOfferingCategoryId = cmd.getServiceOfferingCategoryId();
final Long serviceOfferingCategoryId = cmd.getCategoryId();
if (serviceOfferingCategoryId != null && _serviceOfferingCategoryDao.findById(serviceOfferingCategoryId) == null) {
throw new InvalidParameterValueException("Please specify a valid service offering category id");
}

View File

@ -41,7 +41,7 @@ export default {
filters: ['active', 'inactive'],
columns: ['name', 'displaytext', 'state', 'cpunumber', 'cpuspeed', 'memory', 'gpu', 'category', 'domain', 'zone', 'order'],
details: () => {
var fields = ['name', 'id', 'displaytext', 'offerha', 'provisioningtype', 'storagetype', 'iscustomized', 'iscustomizediops', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'hosttags', 'tags', 'storageaccessgroups', 'storagetags', 'domain', 'zone', 'created', 'dynamicscalingenabled', 'diskofferingstrictness', 'encryptroot', 'purgeresources', 'leaseduration', 'gpucardid', 'gpucardname', 'vgpuprofileid', 'vgpuprofilename', 'gpucount', 'gpudisplay', 'leaseexpiryaction', 'externaldetails', 'categoryid', 'category']
var fields = ['name', 'id', 'displaytext', 'offerha', 'provisioningtype', 'storagetype', 'iscustomized', 'iscustomizediops', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'hosttags', 'tags', 'storageaccessgroups', 'storagetags', 'domain', 'zone', 'created', 'dynamicscalingenabled', 'diskofferingstrictness', 'encryptroot', 'purgeresources', 'leaseduration', 'gpucardid', 'gpucardname', 'vgpuprofileid', 'vgpuprofilename', 'gpucount', 'gpudisplay', 'leaseexpiryaction', 'externaldetails', 'category']
if (store.getters.apis.createServiceOffering &&
store.getters.apis.createServiceOffering.params.filter(x => x.name === 'storagepolicy').length > 0) {
fields.splice(6, 0, 'vspherestoragepolicy')

View File

@ -2308,9 +2308,9 @@ export default {
pageSize: 10
}
if (categoryId && categoryId !== '-1') {
params.serviceofferingcategoryid = categoryId
params.categoryid = categoryId
} else {
params.serviceofferingcategoryid = null
params.categoryid = null
}
this.handleSearchFilter('serviceOfferings', params)
},