EntityService

You should to extend cmsService in your service to override the functions for the package that you want to override the default configuration for .

Example:

This example shows you if you add the data manually , what the options you need to override :

Extend the EntityService:

import { EntityService} from '@tradinos/cms-frontend-entity';
export class UserService extends CmsService<User> {
  constructor() {
    super();
}

Override the crudActions:

//enable only the create operation
override manualActions?: BaseCRUDActions | undefined = {
  create: () => true,
};

Override the tableActions:

//enable the edit and delete operations for table's column
override manualTableActionsFn: (
    item?: User | undefined
  ) => Partial<BaseTableColumnAction>[] = (item: User | undefined) => [
    {
      key: CmsActionEnum.update,
      label: 'update',
      icon: 'pi pi-pencil',
    },
    {
      key: CmsActionEnum.delete,
      label: 'delete',
      icon: 'pi pi-trash',
      severity: 'danger',
      visible: item?.id != 1,
    },
];

Override the filtering in table or pagination:

Override the response's form:

Override exportFile:

Last updated