implemented entity field "name" for queue stats entity
This commit is contained in:
parent
2c2273d15b
commit
a9a80db4b7
@ -691,7 +691,7 @@ public class EntityQueryControllerTest extends AbstractControllerTest {
|
|||||||
new EntityKey(EntityKeyType.ENTITY_FIELD, "queueName"), EntityDataSortOrder.Direction.ASC
|
new EntityKey(EntityKeyType.ENTITY_FIELD, "queueName"), EntityDataSortOrder.Direction.ASC
|
||||||
);
|
);
|
||||||
EntityDataPageLink pageLink = new EntityDataPageLink(10, 0, null, sortOrder);
|
EntityDataPageLink pageLink = new EntityDataPageLink(10, 0, null, sortOrder);
|
||||||
List<EntityKey> entityFields = Arrays.asList(new EntityKey(EntityKeyType.ENTITY_FIELD, "queueName"),
|
List<EntityKey> entityFields = Arrays.asList(new EntityKey(EntityKeyType.ENTITY_FIELD, "name"), new EntityKey(EntityKeyType.ENTITY_FIELD, "queueName"),
|
||||||
new EntityKey(EntityKeyType.ENTITY_FIELD, "serviceId"));
|
new EntityKey(EntityKeyType.ENTITY_FIELD, "serviceId"));
|
||||||
|
|
||||||
EntityDataQuery query = new EntityDataQuery(entityTypeFilter, pageLink, entityFields, null, null);
|
EntityDataQuery query = new EntityDataQuery(entityTypeFilter, pageLink, entityFields, null, null);
|
||||||
@ -705,8 +705,12 @@ public class EntityQueryControllerTest extends AbstractControllerTest {
|
|||||||
Assert.assertTrue(data.hasNext());
|
Assert.assertTrue(data.hasNext());
|
||||||
Assert.assertEquals(10, data.getData().size());
|
Assert.assertEquals(10, data.getData().size());
|
||||||
data.getData().forEach(entityData -> {
|
data.getData().forEach(entityData -> {
|
||||||
assertThat(entityData.getLatest().get(EntityKeyType.ENTITY_FIELD).get("queueName")).asString().isNotBlank();
|
String queueName = entityData.getLatest().get(EntityKeyType.ENTITY_FIELD).get("queueName").getValue();
|
||||||
assertThat(entityData.getLatest().get(EntityKeyType.ENTITY_FIELD).get("serviceId")).asString().isNotBlank();
|
String serviceId = entityData.getLatest().get(EntityKeyType.ENTITY_FIELD).get("serviceId").getValue();
|
||||||
|
assertThat(queueName).isNotBlank();
|
||||||
|
assertThat(serviceId).isNotBlank();
|
||||||
|
assertThat(entityData.getLatest().get(EntityKeyType.ENTITY_FIELD).get("name").getValue()).isEqualTo(queueName + "_" + serviceId);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
EntityCountQuery countQuery = new EntityCountQuery(entityTypeFilter);
|
EntityCountQuery countQuery = new EntityCountQuery(entityTypeFilter);
|
||||||
|
|||||||
@ -89,10 +89,12 @@ public class EntityKeyMapping {
|
|||||||
public static final String OWNER_TYPE_SELECT_QUERY = "case when e.customer_id = '" + NULL_UUID + "' " +
|
public static final String OWNER_TYPE_SELECT_QUERY = "case when e.customer_id = '" + NULL_UUID + "' " +
|
||||||
"then 'TENANT' " +
|
"then 'TENANT' " +
|
||||||
"else 'CUSTOMER' end";
|
"else 'CUSTOMER' end";
|
||||||
|
public static final String QUEUE_STATS_NAME_QUERY = "concat(e.queue_name, '_', e.service_id)";
|
||||||
public static final Map<String, String> ownerPropertiesFunctions = Map.of(
|
public static final Map<String, String> ownerPropertiesFunctions = Map.of(
|
||||||
OWNER_NAME, OWNER_NAME_SELECT_QUERY,
|
OWNER_NAME, OWNER_NAME_SELECT_QUERY,
|
||||||
OWNER_TYPE, OWNER_TYPE_SELECT_QUERY
|
OWNER_TYPE, OWNER_TYPE_SELECT_QUERY
|
||||||
);
|
);
|
||||||
|
public static final Map<String, String> queueStatsPropertiesFunctions = Map.of(NAME, QUEUE_STATS_NAME_QUERY);
|
||||||
|
|
||||||
public static final List<String> typedEntityFields = Arrays.asList(CREATED_TIME, ENTITY_TYPE, NAME, TYPE, ADDITIONAL_INFO);
|
public static final List<String> typedEntityFields = Arrays.asList(CREATED_TIME, ENTITY_TYPE, NAME, TYPE, ADDITIONAL_INFO);
|
||||||
public static final List<String> widgetEntityFields = Arrays.asList(CREATED_TIME, ENTITY_TYPE, NAME);
|
public static final List<String> widgetEntityFields = Arrays.asList(CREATED_TIME, ENTITY_TYPE, NAME);
|
||||||
@ -166,6 +168,7 @@ public class EntityKeyMapping {
|
|||||||
propertiesFunctions.put(EntityType.ENTITY_VIEW, ownerPropertiesFunctions);
|
propertiesFunctions.put(EntityType.ENTITY_VIEW, ownerPropertiesFunctions);
|
||||||
propertiesFunctions.put(EntityType.USER, ownerPropertiesFunctions);
|
propertiesFunctions.put(EntityType.USER, ownerPropertiesFunctions);
|
||||||
propertiesFunctions.put(EntityType.DASHBOARD, ownerPropertiesFunctions);
|
propertiesFunctions.put(EntityType.DASHBOARD, ownerPropertiesFunctions);
|
||||||
|
propertiesFunctions.put(EntityType.QUEUE_STATS, queueStatsPropertiesFunctions);
|
||||||
|
|
||||||
Map<String, String> userEntityAliases = new HashMap<>();
|
Map<String, String> userEntityAliases = new HashMap<>();
|
||||||
userEntityAliases.put(TITLE, EMAIL);
|
userEntityAliases.put(TITLE, EMAIL);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user