PromucFlow_constructor/app/client/test/factories/Actions/Postgres.ts
Hetu Nandu 97b374c1ef
chore: Introduce action isDirty map (#39872)
## Description

The server now adds a isDirty map in the action object to signify if any
aspect of the action is not saved (is dirty)

This is needed for the EE change
https://github.com/appsmithorg/appsmith-ee/pull/6713


https://www.notion.so/appsmith/Implement-save-button-for-AI-Query-1b9fe271b0e2808285dcc797ad281141?pvs=4

## Automation

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

### 🔍 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/14029254723>
> Commit: 4321d95d427a1dfd07aedecd3731390ed0a4688e
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14029254723&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Datasource`
> Spec:
> <hr>Mon, 24 Mar 2025 07:51:29 UTC
<!-- end of auto-generated comment: Cypress test results  -->


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


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

## Summary by CodeRabbit

- **New Features**
- Added a capability that improves how the app retrieves a specific
action from a collection based on unique identifiers, ensuring smoother
interaction.
- Enhanced state management in actions by introducing a new property to
track the update status of schema generation, supporting more robust
workflow handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-03-24 14:08:43 +05:30

51 lines
1.3 KiB
TypeScript

import * as Factory from "factory.ts";
import { PaginationType, type QueryAction } from "entities/Action";
import { PluginPackageName, PluginType } from "entities/Plugin";
import { PluginIDs } from "test/factories/MockPluginsState";
const pageId = "0123456789abcdef00000000";
export const PostgresFactory = Factory.Sync.makeFactory<QueryAction>({
cacheResponse: "",
id: "query_id",
baseId: "query_base_id",
workspaceId: "workspaceId",
applicationId: "applicationId",
pluginType: PluginType.DB,
pluginId: PluginIDs[PluginPackageName.POSTGRES],
name: Factory.each((i) => `Query${i + 1}`),
datasource: {
id: "PostgresDatasourceID",
name: "ExampleDatabase",
pluginId: PluginIDs[PluginPackageName.POSTGRES],
},
pageId: pageId,
actionConfiguration: {
timeoutInMillisecond: 10000,
paginationType: PaginationType.NONE,
body: "select * from public.users limit 10",
pluginSpecifiedTemplates: [
{
key: "preparedStatement",
value: false,
},
],
},
executeOnLoad: true,
dynamicBindingPathList: [],
isValid: true,
invalids: [],
messages: [],
jsonPathKeys: [],
confirmBeforeExecute: false,
userPermissions: [
"read:actions",
"delete:actions",
"execute:actions",
"manage:actions",
],
isDirtyMap: {
SCHEMA_GENERATION: false,
},
});