mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 11:25:17 +00:00
[content-manager] types for metrics service (#19014)
This commit is contained in:
parent
748e479a5d
commit
a8709d897e
@ -64,7 +64,10 @@ describe('metrics', () => {
|
||||
global.strapi = { telemetry: { send } } as any;
|
||||
metricsService = metricsServiceLoader({ strapi });
|
||||
const [containsRelationalFields, displayedFields, displayedRelationalFields] = expectedResult;
|
||||
await metricsService.sendDidConfigureListView(contentType, { layouts: { list } });
|
||||
await metricsService.sendDidConfigureListView(
|
||||
contentType as any,
|
||||
{ layouts: { list } } as any
|
||||
);
|
||||
|
||||
expect(send).toHaveBeenCalledTimes(1);
|
||||
expect(send).toHaveBeenCalledWith('didConfigureListView', {
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
import { intersection, prop } from 'lodash/fp';
|
||||
import { relations } from '@strapi/utils';
|
||||
import { LoadedStrapi as Strapi, Schema } from '@strapi/types';
|
||||
import type { Configuration } from '../../../shared/contracts/content-types';
|
||||
|
||||
const { getRelationalFields } = relations;
|
||||
|
||||
export default ({ strapi }: any) => {
|
||||
const sendDidConfigureListView = async (contentType: any, configuration: any) => {
|
||||
export default ({ strapi }: { strapi: Strapi }) => {
|
||||
const sendDidConfigureListView = async (
|
||||
contentType: Schema.ContentType,
|
||||
configuration: Configuration
|
||||
) => {
|
||||
const displayedFields = prop('length', configuration.layouts.list);
|
||||
const relationalFields = getRelationalFields(contentType);
|
||||
const displayedRelationalFields = intersection(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user