Skip to content

Commit

Permalink
fix: Query instance failure caused by missing prepared statement obj (a…
Browse files Browse the repository at this point in the history
…ppsmithorg#36493)

## Description

Query instance was breaking because of missing prepared statement obj in
the action configuration.

PR caused this issue: appsmithorg#36407

Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/11007670447>
> Commit: 420801e
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11007670447&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Tue, 24 Sep 2024 07:04:23 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Enhanced logic for displaying warnings related to prepared statements,
improving user experience by streamlining checks.

- **Bug Fixes**
- Resolved issues with warning display for prepared statements, ensuring
accurate notifications based on user actions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
albinAppsmith authored and Shivam-z committed Sep 26, 2024
1 parent 076bd3d commit d02875b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions app/client/src/pages/Editor/QueryEditor/QueryResponseTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,14 @@ const QueryResponseTab = (props: Props) => {
hintMessages = actionResponse.messages;
}

const { pluginSpecifiedTemplates } =
currentActionConfig.actionConfiguration;
const { actionConfiguration } = currentActionConfig;
const hasPluginSpecifiedTemplates =
actionConfiguration?.pluginSpecifiedTemplates?.[0]?.value === true;
// oracle have different key for prepared statements
const hasPreparedStatement =
actionConfiguration?.formData?.preparedStatement?.data === true;

if (
error &&
pluginSpecifiedTemplates &&
pluginSpecifiedTemplates.length > 0 &&
pluginSpecifiedTemplates[0].value === true
) {
if (error && (hasPluginSpecifiedTemplates || hasPreparedStatement)) {
showPreparedStatementWarning = true;
}
}
Expand Down

0 comments on commit d02875b

Please sign in to comment.