setting.helpText || "")}>
diff --git a/app/client/src/pages/Settings/FormGroup/Group.test.tsx b/app/client/src/pages/Settings/FormGroup/Group.test.tsx
index ed9206d3a7..97d4d7d81c 100644
--- a/app/client/src/pages/Settings/FormGroup/Group.test.tsx
+++ b/app/client/src/pages/Settings/FormGroup/Group.test.tsx
@@ -40,8 +40,23 @@ function getElements() {
const text = screen.queryAllByTestId("admin-settings-group-text");
const button = screen.queryAllByTestId("admin-settings-group-button");
const group = screen.queryAllByTestId("admin-settings-group");
+ const tagInput = screen.queryAllByTestId("admin-settings-tag-input");
+ const accordion = screen.queryAllByTestId("admin-settings-accordion");
+ const uneditableField = screen.queryAllByTestId(
+ "admin-settings-uneditable-field",
+ );
- return { textInput, toggle, link, text, button, group };
+ return {
+ textInput,
+ toggle,
+ link,
+ text,
+ button,
+ group,
+ tagInput,
+ accordion,
+ uneditableField,
+ };
}
describe("Group", () => {
@@ -59,72 +74,225 @@ describe("Group", () => {
it("is rendered for text input", () => {
settings[0].controlType = SettingTypes.TEXTINPUT;
renderComponent();
- const { button, group, link, text, textInput, toggle } = getElements();
+ const {
+ accordion,
+ button,
+ group,
+ link,
+ tagInput,
+ text,
+ textInput,
+ toggle,
+ uneditableField,
+ } = getElements();
expect(textInput).toHaveLength(1);
expect(toggle).toHaveLength(0);
expect(link).toHaveLength(0);
expect(text).toHaveLength(0);
expect(button).toHaveLength(0);
expect(group).toHaveLength(0);
+ expect(uneditableField).toHaveLength(0);
+ expect(tagInput).toHaveLength(0);
+ expect(accordion).toHaveLength(0);
});
it("is rendered for toggle", () => {
settings[0].controlType = SettingTypes.TOGGLE;
renderComponent();
- const { button, group, link, text, textInput, toggle } = getElements();
+ const {
+ accordion,
+ button,
+ group,
+ link,
+ tagInput,
+ text,
+ textInput,
+ toggle,
+ uneditableField,
+ } = getElements();
expect(textInput).toHaveLength(0);
expect(toggle).toHaveLength(1);
expect(link).toHaveLength(0);
expect(text).toHaveLength(0);
expect(button).toHaveLength(0);
expect(group).toHaveLength(0);
+ expect(uneditableField).toHaveLength(0);
+ expect(tagInput).toHaveLength(0);
+ expect(accordion).toHaveLength(0);
});
it("is rendered for link", () => {
settings[0].controlType = SettingTypes.LINK;
renderComponent();
- const { button, group, link, text, textInput, toggle } = getElements();
+ const {
+ accordion,
+ button,
+ group,
+ link,
+ tagInput,
+ text,
+ textInput,
+ toggle,
+ uneditableField,
+ } = getElements();
expect(textInput).toHaveLength(0);
expect(toggle).toHaveLength(0);
expect(link).toHaveLength(1);
expect(text).toHaveLength(0);
expect(button).toHaveLength(0);
expect(group).toHaveLength(0);
+ expect(uneditableField).toHaveLength(0);
+ expect(tagInput).toHaveLength(0);
+ expect(accordion).toHaveLength(0);
});
it("is rendered for text", () => {
settings[0].controlType = SettingTypes.TEXT;
renderComponent();
- const { button, group, link, text, textInput, toggle } = getElements();
+ const {
+ accordion,
+ button,
+ group,
+ link,
+ tagInput,
+ text,
+ textInput,
+ toggle,
+ uneditableField,
+ } = getElements();
expect(textInput).toHaveLength(0);
expect(toggle).toHaveLength(0);
expect(link).toHaveLength(0);
expect(text).toHaveLength(1);
expect(button).toHaveLength(0);
expect(group).toHaveLength(0);
+ expect(uneditableField).toHaveLength(0);
+ expect(tagInput).toHaveLength(0);
+ expect(accordion).toHaveLength(0);
});
it("is rendered for button", () => {
settings[0].controlType = SettingTypes.BUTTON;
renderComponent();
- const { button, group, link, text, textInput, toggle } = getElements();
+ const {
+ accordion,
+ button,
+ group,
+ link,
+ tagInput,
+ text,
+ textInput,
+ toggle,
+ uneditableField,
+ } = getElements();
expect(textInput).toHaveLength(0);
expect(toggle).toHaveLength(0);
expect(link).toHaveLength(0);
expect(text).toHaveLength(0);
expect(button).toHaveLength(1);
expect(group).toHaveLength(0);
+ expect(uneditableField).toHaveLength(0);
+ expect(tagInput).toHaveLength(0);
+ expect(accordion).toHaveLength(0);
});
it("is rendered for group", () => {
settings[0].controlType = SettingTypes.GROUP;
renderComponent();
- const { button, group, link, text, textInput, toggle } = getElements();
+ const {
+ accordion,
+ button,
+ group,
+ link,
+ tagInput,
+ text,
+ textInput,
+ toggle,
+ uneditableField,
+ } = getElements();
expect(textInput).toHaveLength(0);
expect(toggle).toHaveLength(0);
expect(link).toHaveLength(0);
expect(text).toHaveLength(0);
expect(button).toHaveLength(0);
expect(group).toHaveLength(1);
+ expect(uneditableField).toHaveLength(0);
+ expect(tagInput).toHaveLength(0);
+ expect(accordion).toHaveLength(0);
+ });
+
+ it("is rendered for uneditable field", () => {
+ settings[0].controlType = SettingTypes.UNEDITABLEFIELD;
+ renderComponent();
+ const {
+ accordion,
+ button,
+ group,
+ link,
+ tagInput,
+ text,
+ textInput,
+ toggle,
+ uneditableField,
+ } = getElements();
+ expect(textInput).toHaveLength(0);
+ expect(toggle).toHaveLength(0);
+ expect(link).toHaveLength(0);
+ expect(text).toHaveLength(0);
+ expect(button).toHaveLength(0);
+ expect(group).toHaveLength(0);
+ expect(uneditableField).toHaveLength(1);
+ expect(tagInput).toHaveLength(0);
+ expect(accordion).toHaveLength(0);
+ });
+
+ it("is rendered for tag input", () => {
+ settings[0].controlType = SettingTypes.TAGINPUT;
+ renderComponent();
+ const {
+ accordion,
+ button,
+ group,
+ link,
+ tagInput,
+ text,
+ textInput,
+ toggle,
+ uneditableField,
+ } = getElements();
+ expect(textInput).toHaveLength(0);
+ expect(toggle).toHaveLength(0);
+ expect(link).toHaveLength(0);
+ expect(text).toHaveLength(0);
+ expect(button).toHaveLength(0);
+ expect(group).toHaveLength(0);
+ expect(uneditableField).toHaveLength(0);
+ expect(tagInput).toHaveLength(1);
+ expect(accordion).toHaveLength(0);
+ });
+
+ it("is rendered for accordion", () => {
+ settings[0].controlType = SettingTypes.ACCORDION;
+ renderComponent();
+ const {
+ accordion,
+ button,
+ group,
+ link,
+ tagInput,
+ text,
+ textInput,
+ toggle,
+ uneditableField,
+ } = getElements();
+ expect(textInput).toHaveLength(0);
+ expect(toggle).toHaveLength(0);
+ expect(link).toHaveLength(0);
+ expect(text).toHaveLength(0);
+ expect(button).toHaveLength(0);
+ expect(group).toHaveLength(0);
+ expect(uneditableField).toHaveLength(0);
+ expect(tagInput).toHaveLength(0);
+ expect(accordion).toHaveLength(1);
});
});
diff --git a/app/client/src/pages/Settings/FormGroup/Toggle.tsx b/app/client/src/pages/Settings/FormGroup/Toggle.tsx
index 87bdd0d9ac..c3de4b6da9 100644
--- a/app/client/src/pages/Settings/FormGroup/Toggle.tsx
+++ b/app/client/src/pages/Settings/FormGroup/Toggle.tsx
@@ -10,12 +10,13 @@ import { FormTextFieldProps } from "components/ads/formFields/TextField";
import Toggle from "components/ads/Toggle";
import { createMessage } from "@appsmith/constants/messages";
-const ToggleWrapper = styled.div``;
+const ToggleWrapper = styled.div`
+ display: flex;
+ margin-bottom: 8px;
+`;
const ToggleStatus = styled.span`
- position: relative;
- top: -10px;
- left: 68px;
+ margin-left: 64px;
`;
function FieldToggleWithToggleText(toggleText?: (value: boolean) => string) {
@@ -49,10 +50,6 @@ function FieldToggleWithToggleText(toggleText?: (value: boolean) => string) {
const StyledFieldToggleGroup = styled.div`
margin-bottom: 8px;
-
- & .slider {
- margin-top: 10px;
- }
`;
export function ToggleComponent({ setting }: SettingComponentProps) {
diff --git a/app/client/src/pages/Settings/FormGroup/group.tsx b/app/client/src/pages/Settings/FormGroup/group.tsx
index 313f755d61..00d660d530 100644
--- a/app/client/src/pages/Settings/FormGroup/group.tsx
+++ b/app/client/src/pages/Settings/FormGroup/group.tsx
@@ -178,7 +178,7 @@ export default function Group({
return (
>) {
}
}
-const RESTART_POLL_TIMEOUT = 60000;
+const RESTART_POLL_TIMEOUT = 2 * 60 * 1000;
const RESTART_POLL_INTERVAL = 2000;
function* RestartServerPoll() {