File tree Expand file tree Collapse file tree
workspaces/adoption-insights/plugins/adoption-insights-backend/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -207,7 +207,6 @@ export abstract class BaseDatabaseAdapter implements EventDatabase {
207207 const db = this . db ;
208208 const query = db ( 'events' )
209209 . select (
210- db . raw ( `context->>'routeRef' AS entityref` ) ,
211210 db . raw ( 'CAST(COUNT(*) as INTEGER) AS count' ) ,
212211 db . raw ( this . getLastUsedDate ( ) ) ,
213212 db . raw ( `COALESCE(attributes->>'kind', '') AS kind` ) ,
@@ -219,7 +218,7 @@ export abstract class BaseDatabaseAdapter implements EventDatabase {
219218 plugin_id : 'techdocs' ,
220219 } )
221220 . whereBetween ( 'created_at' , [ start_date , end_date ] )
222- . groupByRaw ( `entityref, name, kind, namespace` )
221+ . groupByRaw ( `name, kind, namespace` )
223222 . limit ( Number ( limit ) || 3 ) ;
224223
225224 return query . then ( data => this . getResponseData ( data , 'last_used' ) ) ;
Original file line number Diff line number Diff line change @@ -41,6 +41,13 @@ interface EntityRefCount {
4141 count : string ;
4242 last_used : string ;
4343}
44+ interface TechDocsCount {
45+ kind : string ;
46+ name : string ;
47+ namespace : string ;
48+ count : string ;
49+ last_used : string ;
50+ }
4451
4552interface CatalogEntityCount {
4653 plugin_id : string ;
@@ -64,6 +71,6 @@ export type DailyUsers = ResponseWithGrouping<DailyUser[]>;
6471export type TotalUsers = ResponseData < TotalUser [ ] > ;
6572export type TopSearches = ResponseData < DateCount [ ] > ;
6673export type TopPluginCount = ResponseWithGrouping < PluginCount [ ] > ;
67- export type TopTechDocsCount = ResponseData < EntityRefCount [ ] > ;
74+ export type TopTechDocsCount = ResponseData < TechDocsCount [ ] > ;
6875export type TopTemplatesCount = ResponseData < EntityRefCount [ ] > ;
6976export type TopCatalogEntitiesCount = ResponseData < CatalogEntityCount [ ] > ;
You can’t perform that action at this time.
0 commit comments