-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: List should record
val
, not text
, in passport and calculate …
…total units by development type when applicable (#3263)
- Loading branch information
1 parent
17a35c6
commit 5929a12
Showing
12 changed files
with
660 additions
and
184 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
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
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
51 changes: 51 additions & 0 deletions
51
editor.planx.uk/src/@planx/components/List/schemas/GenericUnitsTest.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,51 @@ | ||
import { Schema } from "@planx/components/List/model"; | ||
|
||
export const GenericUnitsTest: Schema = { | ||
type: "Unit", | ||
fields: [ | ||
// fn = "development" triggers summary stat and options set "val" | ||
{ | ||
type: "question", | ||
data: { | ||
title: "What development does this unit result from?", | ||
fn: "development", | ||
options: [ | ||
{ id: "newBuild", data: { text: "New build", val: "newBuild" } }, | ||
{ | ||
id: "changeOfUseFrom", | ||
data: { | ||
text: "Change of use of existing single home", | ||
val: "changeOfUseFrom", | ||
}, | ||
}, | ||
{ | ||
id: "changeOfUseTo", | ||
data: { text: "Change of use to a home", val: "changeOfUseTo" }, | ||
}, | ||
], | ||
}, | ||
}, | ||
// options set "text" only | ||
{ | ||
type: "question", | ||
data: { | ||
title: "Is this unit built on garden land?", | ||
fn: "garden", | ||
options: [ | ||
{ id: "true", data: { text: "Yes" } }, | ||
{ id: "false", data: { text: "No" } }, | ||
], | ||
}, | ||
}, | ||
// fn = "identicalUnits" triggers summary stat | ||
{ | ||
type: "number", | ||
data: { | ||
title: "How many identical units does the description above apply to?", | ||
fn: "identicalUnits", | ||
allowNegatives: false, | ||
}, | ||
}, | ||
], | ||
min: 1, | ||
} as const; |
Oops, something went wrong.