Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

P2 807 variation picker validation #1142

Merged
merged 23 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a453363
first steps
increddibelly Mar 30, 2021
bc19f27
added comment
increddibelly Mar 30, 2021
a91b104
make the VariationPicker validation verify that a block is selected
increddibelly Apr 2, 2021
5ad724e
removed unused imports
increddibelly Apr 2, 2021
6b3f96a
Merge remote-tracking branch 'origin/develop' into P2-807-VariationPi…
increddibelly Apr 6, 2021
f947f2e
simplified parent / child relation in validation
increddibelly Apr 6, 2021
6b9e27c
Updated tests for BlockInstruction.
hansjovis Apr 8, 2021
539a51b
Merge remote-tracking branch 'origin/develop' into P2-807-VariationPi…
hansjovis Apr 8, 2021
7b17aeb
cleanup unit test
increddibelly Apr 8, 2021
14cfa8e
fixed variationpicker validation naming
increddibelly Apr 9, 2021
5b27fa9
Merge remote-tracking branch 'origin/develop' into P2-807-VariationPi…
increddibelly Apr 9, 2021
adf1c54
Don't pass the default value of an optional parameter
johannadevos Apr 12, 2021
c916123
Improve CS
johannadevos Apr 12, 2021
1ad79e6
allow variationpickers to be recommended blocks
increddibelly Apr 9, 2021
b067b89
Expand documentation
increddibelly Apr 12, 2021
ffd6e9e
Merge remote-tracking branch 'origin/develop' into P2-807-VariationPi…
increddibelly Apr 12, 2021
b4fe30c
simplified validation by passing the presence parameter
increddibelly Apr 12, 2021
4ffbe6e
remove unused import
increddibelly Apr 13, 2021
6e08cd3
Merge remote-tracking branch 'origin/develop' into P2-807-VariationPi…
increddibelly Apr 13, 2021
bdd1360
updated validation to explicitly mention unpicked variations
increddibelly Apr 13, 2021
4634389
fix typo
increddibelly Apr 13, 2021
e0501ad
Merge remote-tracking branch 'origin/develop' into P2-807-VariationPi…
hansjovis Apr 13, 2021
a76a4f6
Used backticks instead of quotation marks in test.
hansjovis Apr 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
allow variationpickers to be recommended blocks
  • Loading branch information
increddibelly committed Apr 12, 2021
commit 1ad79e61ac2e78ce9bc5d305147affd88bd385d3
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ export enum BlockValidation {

/** This block is not completely valid, but should not prevent the Schema to be output either. */
OK = 200,
/** This block has recommended attributes, but these attributes are missing or empty. */
MissingRecommendedAttribute = 201,
/** This block is defined to recommend a particular inner block, but that block doesn't exist. */
MissingRecommendedBlock = 201,
MissingRecommendedBlock = 202,

/** INVALID RESULTS (300+): Will prevent Schema output.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ export class BlockValidationResult {
* @constructor
*/
static MissingAttribute( blockInstance: BlockInstance, name?: string, blockPresence?: BlockPresence ) {
const blockValidation: BlockValidation = ( blockPresence === BlockPresence.Required )
? BlockValidation.MissingAttribute : BlockValidation.MissingRecommendedAttribute;

return new BlockValidationResult(
blockInstance.clientId,
name || blockInstance.name,
BlockValidation.MissingAttribute,
blockValidation,
blockPresence || BlockPresence.Unknown,
);
}
Expand Down