add form layouts
This commit is contained in:
parent
b1b458aba3
commit
1d9838dc25
@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
- logic backend components
|
- logic backend components
|
||||||
- forms now have multiple notification
|
- forms now have multiple notification
|
||||||
|
- layout for forms
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|||||||
@ -8,4 +8,7 @@ export class DesignInput {
|
|||||||
|
|
||||||
@Field({ nullable: true })
|
@Field({ nullable: true })
|
||||||
readonly font?: string
|
readonly font?: string
|
||||||
|
|
||||||
|
@Field({ nullable: true })
|
||||||
|
readonly layout?: string
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,8 +10,12 @@ export class DesignModel {
|
|||||||
@Field({ nullable: true })
|
@Field({ nullable: true })
|
||||||
readonly font?: string
|
readonly font?: string
|
||||||
|
|
||||||
|
@Field({ nullable: true })
|
||||||
|
readonly layout?: string
|
||||||
|
|
||||||
constructor(partial: Partial<DesignEmbedded>) {
|
constructor(partial: Partial<DesignEmbedded>) {
|
||||||
this.colors = new ColorsModel(partial.colors)
|
this.colors = new ColorsModel(partial.colors)
|
||||||
this.font = partial.font
|
this.font = partial.font
|
||||||
|
this.layout = partial.layout
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,4 +13,7 @@ export class FormCreateInput {
|
|||||||
|
|
||||||
@Field({ nullable: true })
|
@Field({ nullable: true })
|
||||||
readonly isLive: boolean
|
readonly isLive: boolean
|
||||||
|
|
||||||
|
@Field({ nullable: true })
|
||||||
|
readonly layout: string
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,4 +7,7 @@ export class DesignEmbedded {
|
|||||||
|
|
||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
font?: string
|
font?: string
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
layout?: string
|
||||||
}
|
}
|
||||||
|
|||||||
14
src/migrations/1621078163528-layout.ts
Normal file
14
src/migrations/1621078163528-layout.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { MigrationInterface, QueryRunner } from "typeorm"
|
||||||
|
|
||||||
|
export class layout1621078163528 implements MigrationInterface {
|
||||||
|
name = 'layout1621078163528'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE "form" ADD "designLayout" character varying`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE "form" DROP COLUMN "designLayout"`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -20,6 +20,7 @@ export class FormCreateService {
|
|||||||
form.isLive = Boolean(input.isLive)
|
form.isLive = Boolean(input.isLive)
|
||||||
form.showFooter = Boolean(input.showFooter)
|
form.showFooter = Boolean(input.showFooter)
|
||||||
form.language = input.language || 'en'
|
form.language = input.language || 'en'
|
||||||
|
form.design.layout = input.layout
|
||||||
|
|
||||||
form.admin = admin
|
form.admin = admin
|
||||||
|
|
||||||
|
|||||||
@ -150,6 +150,10 @@ export class FormUpdateService {
|
|||||||
form.design.font = input.design.font
|
form.design.font = input.design.font
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (input.design.layout !== undefined) {
|
||||||
|
form.design.layout = input.design.layout
|
||||||
|
}
|
||||||
|
|
||||||
if (input.design.colors !== undefined) {
|
if (input.design.colors !== undefined) {
|
||||||
if (input.design.colors.answer !== undefined) {
|
if (input.design.colors.answer !== undefined) {
|
||||||
form.design.colors.answer = input.design.colors.answer
|
form.design.colors.answer = input.design.colors.answer
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user