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
|
||||
- forms now have multiple notification
|
||||
- layout for forms
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
@ -8,4 +8,7 @@ export class DesignInput {
|
||||
|
||||
@Field({ nullable: true })
|
||||
readonly font?: string
|
||||
|
||||
@Field({ nullable: true })
|
||||
readonly layout?: string
|
||||
}
|
||||
|
||||
@ -10,8 +10,12 @@ export class DesignModel {
|
||||
@Field({ nullable: true })
|
||||
readonly font?: string
|
||||
|
||||
@Field({ nullable: true })
|
||||
readonly layout?: string
|
||||
|
||||
constructor(partial: Partial<DesignEmbedded>) {
|
||||
this.colors = new ColorsModel(partial.colors)
|
||||
this.font = partial.font
|
||||
this.layout = partial.layout
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,4 +13,7 @@ export class FormCreateInput {
|
||||
|
||||
@Field({ nullable: true })
|
||||
readonly isLive: boolean
|
||||
|
||||
@Field({ nullable: true })
|
||||
readonly layout: string
|
||||
}
|
||||
|
||||
@ -7,4 +7,7 @@ export class DesignEmbedded {
|
||||
|
||||
@Column({ nullable: true })
|
||||
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.showFooter = Boolean(input.showFooter)
|
||||
form.language = input.language || 'en'
|
||||
form.design.layout = input.layout
|
||||
|
||||
form.admin = admin
|
||||
|
||||
|
||||
@ -150,6 +150,10 @@ export class FormUpdateService {
|
||||
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.answer !== undefined) {
|
||||
form.design.colors.answer = input.design.colors.answer
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user