Skip to content

Commit

Permalink
Merge branch 'release' into feat/state-inspector-context-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
hetunandu committed Feb 13, 2025
2 parents e7f7e47 + 261cf8b commit adaf576
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 34 deletions.
2 changes: 2 additions & 0 deletions app/client/src/ce/constants/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2627,3 +2627,5 @@ export const PREMIUM_DATASOURCES = {

export const DATASOURCE_SECURE_TEXT = () =>
`When connecting datasources, your passwords are AES-256 encrypted and we never store any of your data.`;

export const TABLE_LOADING_RECORDS = () => "loading records";
67 changes: 33 additions & 34 deletions app/client/src/sagas/ActionSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1060,10 +1060,6 @@ function* toggleActionExecuteOnLoadSaga(

function* handleMoveOrCopySaga(actionPayload: ReduxAction<Action>) {
const { baseId: baseActionId, pluginId, pluginType } = actionPayload.payload;
const isApi = pluginType === PluginType.API;
const isQuery = pluginType === PluginType.DB;
const isSaas = pluginType === PluginType.SAAS;
const isInternal = pluginType === PluginType.INTERNAL;
const { parentEntityId } = resolveParentEntityMetadata(actionPayload.payload);

if (!parentEntityId) return;
Expand All @@ -1073,37 +1069,40 @@ function* handleMoveOrCopySaga(actionPayload: ReduxAction<Action>) {
parentEntityId,
);

if (isApi) {
history.push(
apiEditorIdURL({
baseParentEntityId,
baseApiId: baseActionId,
}),
);
}

if (isQuery || isInternal) {
history.push(
queryEditorIdURL({
baseParentEntityId,
baseQueryId: baseActionId,
}),
);
}

if (isSaas) {
const plugin = shouldBeDefined<Plugin>(
yield select(getPlugin, pluginId),
`Plugin not found for pluginId - ${pluginId}`,
);
switch (pluginType) {
case PluginType.API: {
history.push(
apiEditorIdURL({
baseParentEntityId,
baseApiId: baseActionId,
}),
);
break;
}
case PluginType.SAAS: {
const plugin = shouldBeDefined<Plugin>(
yield select(getPlugin, pluginId),
`Plugin not found for pluginId - ${pluginId}`,
);

history.push(
saasEditorApiIdURL({
baseParentEntityId,
pluginPackageName: plugin.packageName,
baseApiId: baseActionId,
}),
);
history.push(
saasEditorApiIdURL({
baseParentEntityId,
pluginPackageName: plugin.packageName,
baseApiId: baseActionId,
}),
);
break;
}
default: {
history.push(
queryEditorIdURL({
baseParentEntityId,
baseQueryId: baseActionId,
}),
);
break;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import "@testing-library/jest-dom";
import { render, screen } from "@testing-library/react";
import { LoadingIndicator } from "./LoadingIndicator";

describe("LoadingIndicator", () => {
it("renders a spinner and loading text", () => {
render(<LoadingIndicator />);

// Check if the Flex container is rendered
const flexContainer = document.querySelector(".ads-v2-flex");

expect(flexContainer).toBeInTheDocument();

// Check if the spinner is rendered
const spinner = document.querySelector(".ads-v2-spinner");

expect(spinner).toBeInTheDocument();

// Check if the text is displayed correctly
const textElement = screen.getByText("loading records");

expect(textElement).toBeInTheDocument();
expect(textElement).toHaveClass("ads-v2-text");
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Flex, Spinner, Text } from "@appsmith/ads";
import { createMessage, TABLE_LOADING_RECORDS } from "ee/constants/messages";
import React from "react";

export const LoadingIndicator = () => (
<Flex
alignItems="center"
background="var(--ads-v2-color-white)"
borderTop="1px solid var(--wds-color-border-onaccent)"
bottom="0"
gap="spaces-3"
left="0"
padding="spaces-3"
position="sticky"
right="0"
>
<Spinner iconProps={{ color: "var(--ads-v2-color-gray-400)" }} size="md" />
<Text color="var(--ads-v2-color-gray-400)" kind="body-s">
{createMessage(TABLE_LOADING_RECORDS)}
</Text>
</Flex>
);

0 comments on commit adaf576

Please sign in to comment.