Skip to content

Commit f028e3c

Browse files
committed
Merge branch 'development'
2 parents b56e657 + 0080a71 commit f028e3c

File tree

11 files changed

+238
-117
lines changed

11 files changed

+238
-117
lines changed

.github/workflows/pr.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ on:
1515
jobs:
1616
tests:
1717
uses: ./.github/workflows/tests.yml
18+
secrets: inherit
1819

1920
formatCheck:
2021
name: Checks Source Code Formatting
2122
runs-on: ubuntu-20.04
2223
steps:
2324
- name: Checkout Repository
24-
uses: actions/checkout@v3.2.0
25+
uses: actions/checkout@v3
2526

2627
- uses: Ortus-Solutions/[email protected]
2728
with:

.github/workflows/release.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ jobs:
5858

5959
- name: Build ${{ env.MODULE_ID }}
6060
run: |
61+
npm install -g markdownlint-cli
62+
markdownlint changelog.md --fix
6163
box install commandbox-docbox
6264
box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }}
6365
@@ -87,9 +89,33 @@ jobs:
8789
.artifacts/**/*
8890
changelog.md
8991
92+
- name: Upload Binaries to S3
93+
uses: jakejarvis/s3-sync-action@master
94+
with:
95+
args: --acl public-read
96+
env:
97+
AWS_S3_BUCKET: "downloads.ortussolutions.com"
98+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
99+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
100+
SOURCE_DIR: ".artifacts/${{ env.MODULE_ID }}"
101+
DEST_DIR: "ortussolutions/coldbox-modules/${{ env.MODULE_ID }}"
102+
103+
- name: Upload API Docs to S3
104+
uses: jakejarvis/s3-sync-action@master
105+
with:
106+
args: --acl public-read
107+
env:
108+
AWS_S3_BUCKET: "apidocs.ortussolutions.com"
109+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
110+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
111+
SOURCE_DIR: ".tmp/apidocs"
112+
DEST_DIR: "coldbox-modules/${{ env.MODULE_ID }}/${{ env.VERSION }}"
113+
90114
- name: Publish To ForgeBox
91115
run: |
92-
cd .tmp/${{ env.MODULE_ID }} && box forgebox publish --force
116+
cd .tmp/${{ env.MODULE_ID }}
117+
cat box.json
118+
box forgebox publish --force
93119
94120
- name: Create Github Release
95121
uses: taiki-e/[email protected]

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
coldboxVersion: [ "^6.0.0" ]
2323
experimental: [ false ]
2424
include:
25+
- cfengine: "adobe@2023"
26+
coldboxVersion: "^6.0.0"
27+
experimental: true
2528
- coldboxVersion: "be"
2629
cfengine: "lucee@5"
2730
experimental: true

box.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name":"ColdBox Validation",
33
"author":"Ortus Solutions <[email protected]>",
4-
"version":"4.2.0",
4+
"version":"4.3.0",
55
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbvalidation/@build.version@/[email protected]@.zip",
66
"slug":"cbvalidation",
77
"type":"modules",

changelog.md

Lines changed: 111 additions & 113 deletions
Large diffs are not rendered by default.

models/validators/DiscreteValidator.cfc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,25 @@ component extends="BaseValidator" accessors="true" singleton {
5555
return true;
5656
}
5757

58+
// check data element value and return error if it is not simple value.
59+
if ( !isSimpleValue( arguments.targetValue ) ) {
60+
var args = {
61+
message : "The '#arguments.field#' value is not a Simple value",
62+
field : arguments.field,
63+
validationType : getName(),
64+
rejectedValue : ( isSimpleValue( arguments.targetValue ) ? arguments.targetValue : "" ),
65+
validationData : arguments.validationData
66+
};
67+
var error = validationResult
68+
.newError( argumentCollection = args )
69+
.setErrorMetadata( {
70+
"operation" : operation,
71+
"operationValue" : operationValue
72+
} );
73+
validationResult.addError( error );
74+
return false;
75+
}
76+
5877
var r = false;
5978
if ( !isNull( arguments.targetValue ) ) {
6079
switch ( operation ) {

models/validators/InListValidator.cfc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ component extends="BaseValidator" accessors="true" singleton {
3636
return true;
3737
}
3838

39+
// check data element value and return error if it is not simple value.
40+
if ( !isSimpleValue( arguments.targetValue ) ) {
41+
var args = {
42+
message : "The '#arguments.field#' value is not a Simple value",
43+
field : arguments.field,
44+
validationType : getName(),
45+
rejectedValue : ( isSimpleValue( arguments.targetValue ) ? arguments.targetValue : "" ),
46+
validationData : arguments.validationData
47+
};
48+
var error = validationResult
49+
.newError( argumentCollection = args )
50+
.setErrorMetadata( { "inlist" : arguments.validationData } );
51+
validationResult.addError( error );
52+
return false;
53+
}
54+
3955
// Now check
4056
if ( listFindNoCase( arguments.validationData, arguments.targetValue ) ) {
4157
return true;

readme.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
[![cbvalidation CI](https://github.com/coldbox-modules/cbvalidation/actions/workflows/snapshot.yml/badge.svg)](https://github.com/coldbox-modules/cbvalidation/actions/workflows/snapshot.yml)
1+
<p align="center">
2+
<img src="https://www.ortussolutions.com/__media/coldbox-185-logo.png">
3+
<br>
4+
<img src="https://www.ortussolutions.com/__media/wirebox-185.png" height="125">
5+
<img src="https://www.ortussolutions.com/__media/cachebox-185.png" height="125" >
6+
<img src="https://www.ortussolutions.com/__media/logbox-185.png" height="125">
7+
</p>
8+
9+
<p align="center">
10+
Copyright Since 2005 ColdBox Platform by Luis Majano and Ortus Solutions, Corp
11+
<br>
12+
<a href="https://www.coldbox.org">www.coldbox.org</a> |
13+
<a href="https://www.ortussolutions.com">www.ortussolutions.com</a>
14+
</p>
15+
16+
----
217

318
# WELCOME TO THE COLDBOX VALIDATION MODULE
419

[email protected]

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name":"cbvalidation-adobe@2023",
3+
"app":{
4+
"serverHomeDirectory":".engine/adobe2023",
5+
"cfengine":"[email protected]"
6+
},
7+
"web":{
8+
"http":{
9+
"port":"60299"
10+
},
11+
"rewrites":{
12+
"enable":"true"
13+
},
14+
"webroot": "test-harness",
15+
"aliases":{
16+
"/moduleroot/cbvalidation":"../"
17+
}
18+
},
19+
"jvm":{
20+
"heapSize":"1024"
21+
},
22+
"openBrowser":"false",
23+
"cfconfig": {
24+
"file" : ".cfconfig.json"
25+
},
26+
"scripts" : {
27+
"onServerInstall":"cfpm install zip,debugger"
28+
}
29+
}

test-harness/tests/specs/validators/DiscreteValidatorTest.cfc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ component extends="coldbox.system.testing.BaseModelTest" model="cbvalidation.mod
4747
assertEquals( false, r );
4848
r = model.validate( result, this, "test", 4, "gte:4" );
4949
assertEquals( true, r );
50+
51+
// Validation check - if simple value
52+
r = model.validate( result, this, "test", [], "gte:1" );
53+
assertEquals( false, r );
5054
}
5155

5256
}

0 commit comments

Comments
 (0)