File

lib/common/explorer/entity/explorer-column.entity.ts

Description

The entity stores the metadata of the field (columns in the database table) and stores the display configuration in lists and detailed pages

Index

Properties

Properties

description
Type : LocalizedStringEntity[]
Decorators :
@ManyToMany(undefined, {cascade: true})
@JoinTable()
id
Type : string
Decorators :
@Index({unique: true})
@PrimaryColumn('varchar')
multiple
Type : boolean
Decorators :
@Index()
@Column('boolean', {default: false})
name
Type : LocalizedStringEntity[]
Decorators :
@ManyToMany(undefined, {cascade: true})
@JoinTable()
named
Type : boolean
Decorators :
@Index()
@Column('boolean', {default: false})
objectEnabled
Type : boolean
Decorators :
@Index()
@Column('boolean', {name: 'object_enabled', default: true})
objectPriority
Type : number
Decorators :
@Index()
@Column('int', {name: 'object_priority', default: 0, unsigned: true})
objectRenderer
Type : ExplorerColumnRendererEntity
Decorators :
@Index()
@ManyToOne(undefined, t => t.code)
objectRendererParams
Type : object
Decorators :
@Column('simple-json', {transformer: SimpleJsonTransformer, name: 'object_renderer_params', nullable: true, default: undefined})
objectVisibility
Type : boolean
Decorators :
@Index()
@Column('boolean', {name: 'object_visibility', default: true})
primary
Type : boolean
Decorators :
@Index()
@Column('boolean', {default: false})
property
Type : string
Decorators :
@Index()
@Column('varchar', {nullable: false})
referencedEntityName
Type : string
Decorators :
@Index()
@Column('varchar', {name: 'referenced_entity_name', nullable: true})
referencedTableName
Type : string
Decorators :
@Index()
@Column('varchar', {name: 'referenced_table_name', nullable: true})
sectionEnabled
Type : boolean
Decorators :
@Index()
@Column('boolean', {name: 'section_enabled', default: true})
sectionPriority
Type : number
Decorators :
@Index()
@Column('int', {name: 'section_priority', default: 0, unsigned: true})
sectionRenderer
Type : ExplorerColumnRendererEntity
Decorators :
@Index()
@ManyToOne(undefined, t => t.code)
sectionRendererParams
Type : object
Decorators :
@Column('simple-json', {transformer: SimpleJsonTransformer, name: 'section_renderer_params', nullable: true, default: undefined})
sectionVisibility
Type : boolean
Decorators :
@Index()
@Column('boolean', {name: 'section_visibility', default: true})
tab
Type : ExplorerTabEntity
Decorators :
@ManyToOne(undefined, t => t.id)
target
Type : ExplorerTargetEntity
Decorators :
@ManyToOne(undefined, t => t.target)
type
Type : string
Decorators :
@Column('text', {nullable: false})
unique
Type : boolean
Decorators :
@Index()
@Column('boolean', {default: false})
virtual
Type : boolean
Decorators :
@Index()
@Column('boolean', {default: false})
/*
 * Copyright 2023 Alexander Kiriliuk
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

import {
  Column,
  Entity,
  Index,
  JoinTable,
  ManyToMany,
  ManyToOne,
  PrimaryColumn,
} from "typeorm";
import { ExplorerTargetEntity } from "./explorer-target.entity";
import { ExplorerColumn } from "../explorer.types";
import { LocalizedStringEntity } from "../../../shared/modules/locale/entity/localized-string.entity";
import { ExplorerColumnRendererEntity } from "./explorer-column-renderer.entity";
import { SimpleJsonTransformer } from "../../../shared/transformers/simple-json.transformer";
import { ExplorerTabEntity } from "./explorer-tab.entity";

/**
 * The entity stores the metadata of the field (columns in the database table)
 * and stores the display configuration in lists and detailed pages
 */
@Entity("explorer_columns")
export class ExplorerColumnEntity implements ExplorerColumn {
  @Index({ unique: true })
  @PrimaryColumn("varchar")
  id: string;

  @Index()
  @Column("varchar", { nullable: false })
  property: string;

  @ManyToMany(() => LocalizedStringEntity, { cascade: true })
  @JoinTable()
  name: LocalizedStringEntity[];

  @ManyToMany(() => LocalizedStringEntity, { cascade: true })
  @JoinTable()
  description: LocalizedStringEntity[];

  @ManyToOne(() => ExplorerTargetEntity, (t) => t.target)
  target: ExplorerTargetEntity;

  @Column("text", { nullable: false })
  type: string;

  @Index()
  @Column("boolean", { default: false })
  virtual: boolean;

  @Index()
  @Column("boolean", { default: false })
  primary: boolean;

  @Index()
  @Column("boolean", { default: false })
  unique: boolean;

  @Index()
  @Column("boolean", { default: false })
  multiple: boolean;

  @Index()
  @Column("boolean", { default: false })
  named: boolean;

  @Index()
  @Column("varchar", { name: "referenced_entity_name", nullable: true })
  referencedEntityName: string;

  @Index()
  @Column("varchar", { name: "referenced_table_name", nullable: true })
  referencedTableName: string;

  @Index()
  @Column("int", { name: "section_priority", default: 0, unsigned: true })
  sectionPriority: number;

  @Index()
  @Column("int", { name: "object_priority", default: 0, unsigned: true })
  objectPriority: number;

  @Index()
  @Column("boolean", { name: "section_enabled", default: true })
  sectionEnabled: boolean;

  @Index()
  @Column("boolean", { name: "object_enabled", default: true })
  objectEnabled: boolean;

  @Index()
  @Column("boolean", { name: "section_visibility", default: true })
  sectionVisibility: boolean;

  @Index()
  @Column("boolean", { name: "object_visibility", default: true })
  objectVisibility: boolean;

  @Index()
  @ManyToOne(() => ExplorerColumnRendererEntity, (t) => t.code)
  sectionRenderer: ExplorerColumnRendererEntity;

  @Index()
  @ManyToOne(() => ExplorerColumnRendererEntity, (t) => t.code)
  objectRenderer: ExplorerColumnRendererEntity;

  @Column("simple-json", {
    transformer: SimpleJsonTransformer,
    name: "section_renderer_params",
    nullable: true,
    default: null,
  })
  sectionRendererParams: object;

  @Column("simple-json", {
    transformer: SimpleJsonTransformer,
    name: "object_renderer_params",
    nullable: true,
    default: null,
  })
  objectRendererParams: object;

  @ManyToOne(() => ExplorerTabEntity, (t) => t.id)
  tab: ExplorerTabEntity;
}

results matching ""

    No results matching ""