Skip to content

Commit

Permalink
Dv 14890 rules fix (#9)
Browse files Browse the repository at this point in the history
* New rules(p1Flow and inputSchema) issue fix

* Update rules.json

* Recommendation message for node color change

---------

Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
msingh-developer and actions-user authored Nov 18, 2024
1 parent a7bbf24 commit ac578b4
Show file tree
Hide file tree
Showing 9 changed files with 290 additions and 282 deletions.
10 changes: 5 additions & 5 deletions docs/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"name": "@ping-identity/dvlint-base-rule-pack",
"description": "Collection of base rules used to lint DaVinci flows.",
"version": "1.0.5",
"version": "1.0.6",
"rules": [
{
"id": "dv-rule-annotations-001",
Expand Down Expand Up @@ -150,7 +150,7 @@
"description": "All success/error JSON nodes should proper colors",
"message": "Incorrect node color [%] - %",
"type": "best-practice",
"recommendation": "The [%] - % is not using the correct color. To ensure consistency, use the recommended color: [%].",
"recommendation": "The <%> is not using the correct color. To ensure consistency, use the recommended color: [%].",
"code": "dv-bp-node-002"
},
"dv-bp-node-003": {
Expand Down Expand Up @@ -201,7 +201,7 @@
"description": "Incorrect ending nodes for PingOne flow.",
"message": "Incorrect ending nodes for PingOne flow.",
"type": "error",
"recommendation": "This PingOne-enabled flow is missing an appropriate ending node. These flows should conclude with either a 'Return a Success Response' node or a 'Return an Error Response' node.",
"recommendation": "This PingOne-enabled flow is missing appropriate ending nodes. These flows should conclude with either a 'Return Success Response (Redirect Flows)' node or a 'Return Error Response (Redirect Flows)' node of the PingOne Authentication connector.",
"code": "dv-er-pingOneFlow-001"
}
},
Expand All @@ -227,8 +227,8 @@
"code": "dv-er-subflow-002"
},
"dv-er-subflow-003": {
"description": "Missing Input schema values.",
"message": "Input Schema values '%' for '%' subflow is not configured in main flow.",
"description": "Missing Input schema values",
"message": "Input Schema values for '%' subflow is not configured.",
"type": "error",
"recommendation": "The input schema values for the '%' subflow are not currently configured. Configure the schema in the subflow.",
"code": "dv-er-subflow-003"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ping-identity/dvlint-base-rule-pack",
"version": "1.0.5",
"version": "1.0.6",
"description": "Collection of base rules used to lint DaVinci flows.",
"main": "RulePack.js",
"scripts": {
Expand Down Expand Up @@ -37,4 +37,4 @@
"dependencies": {
"@ping-identity/dvlint": "^1.0.3"
}
}
}
4 changes: 2 additions & 2 deletions rules/dv-rule-node-001/NodeRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class NodeRule extends LintRule {
description: "All success/error JSON nodes should proper colors",
message: "Incorrect node color [%] - %",
type: "best-practice",
recommendation: "The [%] - % is not using the correct color. To ensure consistency, use the recommended color: [%].",
recommendation: "The <%> is not using the correct color. To ensure consistency, use the recommended color: [%].",
});
this.addCode("dv-bp-node-003", {
description: "All nodes should have a description",
Expand Down Expand Up @@ -95,7 +95,7 @@ class NodeRule extends LintRule {
data.properties?.backgroundColor?.value.toLowerCase(),
`${data.name} (${data.id}) - ${data.capabilityName}`,
],
recommendationArgs: [backgroundColor[connectorCapability], `${data.name} (${data.id}) - ${data.capabilityName}`],
recommendationArgs: [`${data.name} (${data.id}) - ${data.capabilityName}`, backgroundColor[connectorCapability]],
nodeId: data.id,
});
}
Expand Down
4 changes: 2 additions & 2 deletions rules/dv-rule-pingOneFlow-001/PingOneFlowRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PingOneFlowRule extends LintRule {
description: "Incorrect ending nodes for PingOne flow.",
message: "Incorrect ending nodes for PingOne flow.",
type: "error",
recommendation: "This PingOne-enabled flow is missing an appropriate ending node. These flows should conclude with either a 'Return a Success Response' node or a 'Return an Error Response' node."
recommendation: "This PingOne-enabled flow is missing appropriate ending nodes. These flows should conclude with either a 'Return Success Response (Redirect Flows)' node or a 'Return Error Response (Redirect Flows)' node of the PingOne Authentication connector."
});
}

Expand All @@ -22,7 +22,7 @@ class PingOneFlowRule extends LintRule {

// Incorrect ending nodes for PingOne flow
if (targetFlow?.settings?.pingOneFlow) {
const endNodesCapability = ['createErrorResponse', 'createSuccessResponse'];
const endNodesCapability = ['returnSuccessResponseRedirect', 'returnErrorResponseRedirect'];
const endNodesData = targetFlow.graphData.elements.nodes?.filter(node => endNodesCapability.includes(node.data.capabilityName)) || [];
const nodeIdMap = endNodesData.map(node => node.data.id);
const nodeSourceMap = targetFlow.graphData.elements.edges?.map(edge => edge.data.source) || [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"code": "dv-er-pingOneFlow-001",
"message": "Incorrect ending nodes for PingOne flow.",
"type": "error",
"recommendation": "This PingOne-enabled flow is missing an appropriate ending node. These flows should conclude with either a 'Return a Success Response' node or a 'Return an Error Response' node."
"recommendation": "This PingOne-enabled flow is missing appropriate ending nodes. These flows should conclude with either a 'Return Success Response (Redirect Flows)' node or a 'Return Error Response (Redirect Flows)' node of the PingOne Authentication connector."
}
],
"rulesApplied": [
Expand All @@ -34,7 +34,7 @@
"code": "dv-er-pingOneFlow-001",
"message": "Incorrect ending nodes for PingOne flow.",
"type": "error",
"recommendation": "This PingOne-enabled flow is missing an appropriate ending node. These flows should conclude with either a 'Return a Success Response' node or a 'Return an Error Response' node."
"recommendation": "This PingOne-enabled flow is missing appropriate ending nodes. These flows should conclude with either a 'Return Success Response (Redirect Flows)' node or a 'Return Error Response (Redirect Flows)' node of the PingOne Authentication connector."
}
]
}
Expand Down
Loading

0 comments on commit ac578b4

Please sign in to comment.