-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(demo): added public form in demo mode (#1673)
Co-authored-by: Sebastian <sebastian.leidig@gmail.com>
- Loading branch information
1 parent
db457c4
commit 3be7ace
Showing
4 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/app/features/public-form/demo-public-form-generator.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Injectable } from "@angular/core"; | ||
import { DemoDataGenerator } from "../../core/demo-data/demo-data-generator"; | ||
import { PublicFormConfig } from "./public-form-config"; | ||
|
||
@Injectable() | ||
export class DemoPublicFormGeneratorService extends DemoDataGenerator<PublicFormConfig> { | ||
static provider() { | ||
return [ | ||
{ | ||
provide: DemoPublicFormGeneratorService, | ||
useClass: DemoPublicFormGeneratorService, | ||
}, | ||
]; | ||
} | ||
|
||
protected generateEntities(): PublicFormConfig[] { | ||
const form = new PublicFormConfig("test"); | ||
form.title = $localize`Example form`; | ||
form.description = $localize`This is a form that can be shared as a link or embedded in a website. It can be filled by users without having an account. For example you can let participants self-register their details and just review the records within Aam Digital.`; | ||
form.entity = "Child"; | ||
form.prefilled = { status: "new" }; | ||
form.columns = [["name", "phone", "gender", "dateOfBirth", "center"]]; | ||
return [form]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters