Complete Fix view work (#2272)

* Fix views

* Make view sorts and view filters functional

* Complete Company table view fix

* Fix model creation

* Start fixing board

* Complete work
This commit is contained in:
Charles Bochet
2023-10-29 16:29:00 +01:00
committed by GitHub
parent 685d342170
commit 9bab28912d
118 changed files with 1806 additions and 1413 deletions

View File

@ -6,7 +6,7 @@
"labelPlural": "Companies",
"targetTableName": "company",
"description": "A company",
"icon": "business",
"icon": "IconBuildingSkyscraper",
"fields": [
{
"type": "text",
@ -16,7 +16,7 @@
"value": "name"
},
"description": "Name of the company",
"icon": null,
"icon": "IconBuildingSkyscraper",
"isNullable": false
},
{
@ -27,7 +27,7 @@
"value": "domainName"
},
"description": "Domain name of the company",
"icon": "url",
"icon": "IconLink",
"isNullable": true
},
{
@ -38,7 +38,7 @@
"value": "address"
},
"description": "Address of the company",
"icon": "location",
"icon": "IconMap",
"isNullable": true
},
{
@ -49,7 +49,7 @@
"value": "employees"
},
"description": "Number of employees",
"icon": "people",
"icon": "IconUsers",
"isNullable": true
}
]

View File

@ -1,113 +0,0 @@
{
"nameSingular": "personV2",
"namePlural": "peopleV2",
"labelSingular": "Person",
"labelPlural": "People",
"targetTableName": "person",
"description": "A person",
"icon": "people",
"fields": [
{
"type": "text",
"name": "firstName",
"label": "First Name",
"targetColumnMap": {
"value": "firstName"
},
"description": "First Name of the person",
"icon": null,
"isNullable": true
},
{
"type": "text",
"name": "lastName",
"label": "Last Name",
"targetColumnMap": {
"value": "lastName"
},
"description": "Last Name of the person",
"icon": null,
"isNullable": true
},
{
"type": "text",
"name": "email",
"label": "Email",
"targetColumnMap": {
"value": "email"
},
"description": "Email of the person",
"icon": null,
"isNullable": true
},
{
"type": "phone",
"name": "phone",
"label": "Phone",
"targetColumnMap": {
"value": "phone"
},
"description": "phone of the company",
"icon": null,
"isNullable": true
},
{
"type": "text",
"name": "city",
"label": "City",
"targetColumnMap": {
"value": "city"
},
"description": "City of the person",
"icon": null,
"isNullable": true
},
{
"type": "text",
"name": "jobTitle",
"label": "Job Title",
"targetColumnMap": {
"value": "jobTitle"
},
"description": "Job title of the person",
"icon": null,
"isNullable": true
},
{
"type": "url",
"name": "linkedinUrl",
"label": "Linkedin URL",
"targetColumnMap": {
"text": "Linkedin URL",
"link": "linkedinUrl"
},
"description": "Linkedin URL of the person",
"icon": "url",
"isNullable": true
},
{
"type": "url",
"name": "xUrl",
"label": "X URL",
"targetColumnMap": {
"text": "X URL",
"link": "xUrl"
},
"description": "X URL of the person",
"icon": "url",
"isNullable": true
},
{
"type": "url",
"name": "avatarUrl",
"label": "Avatar URL",
"targetColumnMap": {
"text": "Avatar URL",
"link": "avatarUrl"
},
"description": "Avatar URL of the person",
"icon": "url",
"isNullable": true
}
]
}

View File

@ -1,11 +1,13 @@
import companyObject from './companies/companies.metadata.json';
import personObject from './people/people.metadata.json';
import viewObject from './views/views.metadata.json';
import viewFieldObject from './view-fields/view-fields.metadata.json';
import viewFilterObject from './view-filters/view-filters.metadata.json';
import viewSortObject from './view-sorts/view-sorts.metadata.json';
export const standardObjectsMetadata = {
companyV2: companyObject,
personV2: personObject,
viewV2: viewObject,
viewFieldV2: viewFieldObject,
viewFilterV2: viewFilterObject,
viewSortV2: viewSortObject,
};

View File

@ -5,7 +5,7 @@
"labelPlural": "View Fields",
"targetTableName": "viewField",
"description": "(System) View Fields",
"icon": "arrows-sort",
"icon": "IconColumns3",
"fields": [
{
"type": "text",

View File

@ -0,0 +1,66 @@
{
"nameSingular": "viewFilterV2",
"namePlural": "viewFiltersV2",
"labelSingular": "View Filter",
"labelPlural": "View Filters",
"targetTableName": "viewFilter",
"description": "(System) View Filters",
"icon": "IconFilterBolt",
"fields": [
{
"type": "text",
"name": "fieldId",
"label": "Field Id",
"targetColumnMap": {
"value": "fieldId"
},
"description": "View Filter target field",
"icon": null,
"isNullable": false
},
{
"type": "text",
"name": "viewId",
"label": "View Id",
"targetColumnMap": {
"value": "viewId"
},
"description": "View Filter related view",
"icon": null,
"isNullable": false
},
{
"type": "text",
"name": "operand",
"label": "Operand",
"targetColumnMap": {
"value": "operand"
},
"description": "View Filter operand",
"icon": null,
"isNullable": false
},
{
"type": "text",
"name": "value",
"label": "Value",
"targetColumnMap": {
"value": "value"
},
"description": "View Filter value",
"icon": null,
"isNullable": false
},
{
"type": "text",
"name": "displayValue",
"label": "Display Value",
"targetColumnMap": {
"value": "displayValue"
},
"description": "View Filter Display Value",
"icon": null,
"isNullable": false
}
]
}

View File

@ -0,0 +1,44 @@
{
"nameSingular": "viewSortV2",
"namePlural": "viewSortsV2",
"labelSingular": "View Sort",
"labelPlural": "View Sorts",
"targetTableName": "viewSort",
"description": "(System) View Sorts",
"icon": "IconArrowsSort",
"fields": [
{
"type": "text",
"name": "fieldId",
"label": "Field Id",
"targetColumnMap": {
"value": "fieldId"
},
"description": "View Sort target field",
"icon": null,
"isNullable": false
},
{
"type": "text",
"name": "viewId",
"label": "View Id",
"targetColumnMap": {
"value": "viewId"
},
"description": "View Sort related view",
"icon": null,
"isNullable": false
},
{
"type": "text",
"name": "direction",
"label": "Direction",
"targetColumnMap": {
"value": "direction"
},
"description": "View Sort direction",
"icon": null,
"isNullable": false
}
]
}

View File

@ -5,7 +5,7 @@
"labelPlural": "Views",
"targetTableName": "view",
"description": "(System) Views",
"icon": "layout-collage",
"icon": "IconLayoutCollage",
"fields": [
{
"type": "text",

View File

@ -1,59 +0,0 @@
import { TenantMigrationTableAction } from 'src/metadata/tenant-migration/tenant-migration.entity';
export const addPeopleTable: TenantMigrationTableAction[] = [
{
name: 'people',
action: 'create',
},
{
name: 'people',
action: 'alter',
columns: [
{
name: 'firstName',
type: 'varchar',
action: 'create',
},
{
name: 'lastName',
type: 'varchar',
action: 'create',
},
{
name: 'email',
type: 'varchar',
action: 'create',
},
{
name: 'phone',
type: 'varchar',
action: 'create',
},
{
name: 'city',
type: 'varchar',
action: 'create',
},
{
name: 'jobTitle',
type: 'varchar',
action: 'create',
},
{
name: 'linkedinUrl',
type: 'varchar',
action: 'create',
},
{
name: 'xUrl',
type: 'varchar',
action: 'create',
},
{
name: 'avatarUrl',
type: 'varchar',
action: 'create',
},
],
},
];

View File

@ -0,0 +1,39 @@
import { TenantMigrationTableAction } from 'src/metadata/tenant-migration/tenant-migration.entity';
export const addViewFilterTable: TenantMigrationTableAction[] = [
{
name: 'viewFilter',
action: 'create',
},
{
name: 'viewFilter',
action: 'alter',
columns: [
{
name: 'fieldId',
type: 'varchar',
action: 'create',
},
{
name: 'viewId',
type: 'varchar',
action: 'create',
},
{
name: 'operand',
type: 'varchar',
action: 'create',
},
{
name: 'value',
type: 'varchar',
action: 'create',
},
{
name: 'displayValue',
type: 'varchar',
action: 'create',
},
],
},
];

View File

@ -0,0 +1,29 @@
import { TenantMigrationTableAction } from 'src/metadata/tenant-migration/tenant-migration.entity';
export const addViewSortTable: TenantMigrationTableAction[] = [
{
name: 'viewSort',
action: 'create',
},
{
name: 'viewSort',
action: 'alter',
columns: [
{
name: 'fieldId',
type: 'varchar',
action: 'create',
},
{
name: 'viewId',
type: 'varchar',
action: 'create',
},
{
name: 'direction',
type: 'varchar',
action: 'create',
},
],
},
];

View File

@ -1,12 +1,14 @@
import { addCompanyTable } from './migrations/1697618009-addCompanyTable';
import { addPeopleTable } from './migrations/1697618010-addPeopleTable';
import { addViewTable } from './migrations/1697618011-addViewTable';
import { addViewFieldTable } from './migrations/1697618012-addViewFieldTable';
import { addViewFilterTable } from './migrations/1697618013-addViewFilterTable';
import { addViewSortTable } from './migrations/1697618014-addViewSortTable';
// TODO: read the folder and return all migrations
export const standardMigrations = {
'1697618009-addCompanyTable': addCompanyTable,
'1697618010-addPeopleTable': addPeopleTable,
'1697618011-addViewTable': addViewTable,
'1697618012-addViewFieldTable': addViewFieldTable,
'1697618013-addViewFilterTable': addViewFilterTable,
'1697618014-addViewSortTable': addViewSortTable,
};