import { ModelConfig } from "../.types";
import { pageActions, PAGE_SIZE } from "./_common";

export const WorkflowNodeType: ModelConfig =
{
  metadata: {
    nameKeys: ["id"],
    pageActions,
  },
  table: {
    toolbar: {
      searchBar: {
        fields: ["id"],
        containsFields: ["label", "type"],
        placeholder: "Search by label or type",
      },
      actions: [
        {action: 'REFRESH', desc: 'Refresh'},
        {action: 'SETTING', desc: 'Setting'},
      ],
    },
    header: {
      filter: [],
      sorter: ["id"],
    },
    fields: ["*","!createdAt"],
    rowSelection: {
      actions: [
        {action: 'INSERT', desc: 'Insert'},
        {action: 'DELETE', desc: 'Delete'},
      ],
    },
    rowActions: {
      visibleNum: 2,
      actions: [
        {
          action: "EDIT",
          desc: "Edit",
        },
        {action: "DELETE", desc: 'Delete'}
      ],
    },
    params: {
      pageSize: PAGE_SIZE,
    },
  },
  form: {
    fields: ["*","!creator","!createdAt","!updatedAt"],
    reaction: {
      id: {
        toggle: [],
        defaultProps: {
          hidden: true,
        },
      },
    },
  },
  show: {
    fields: ["*","!createdAt"],
  },
}
;
