diff --git a/app/client/cypress.env.json b/app/client/cypress.env.json index 3d66c50a8c..c70d650cf7 100644 --- a/app/client/cypress.env.json +++ b/app/client/cypress.env.json @@ -1,4 +1,5 @@ { "MySQL":1, - "Mongo":1 + "Mongo":1, + "Edition": 0 } \ No newline at end of file diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/AdminSettings/Admin_settings_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/AdminSettings/Admin_settings_spec.js index eb2d4ace6f..fdfc72da0a 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/AdminSettings/Admin_settings_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/AdminSettings/Admin_settings_spec.js @@ -1,4 +1,8 @@ const AdminsSettingsLocators = require("../../../../locators/AdminsSettingsLocators.json"); +const { + GITHUB_SIGNUP_SETUP_DOC, + GOOGLE_SIGNUP_SETUP_DOC, +} = require("../../../../../src/constants/ThirdPartyConstants"); describe("Admin settings page", function() { beforeEach(() => { @@ -63,10 +67,50 @@ describe("Admin settings page", function() { cy.url().should("contain", "/settings/version"); }); - it("should test that setting page back button redirects to home page", () => { - cy.get(AdminsSettingsLocators.backButton).should("be.visible"); - cy.get(AdminsSettingsLocators.backButton).click(); - cy.url().should("contain", "/applications"); + it("should test that authentication page redirects", () => { + cy.visit("/settings/general"); + cy.get(AdminsSettingsLocators.authenticationTab).click(); + cy.url().should("contain", "/settings/authentication"); + cy.get(AdminsSettingsLocators.googleButton).click(); + cy.url().should("contain", "/settings/authentication/google-auth"); + cy.get(AdminsSettingsLocators.authenticationTab).click(); + cy.url().should("contain", "/settings/authentication"); + cy.get(AdminsSettingsLocators.githubButton).click(); + cy.url().should("contain", "/settings/authentication/github-auth"); + cy.get(AdminsSettingsLocators.authenticationTab).click(); + cy.url().should("contain", "/settings/authentication"); + cy.get(AdminsSettingsLocators.formloginButton).click(); + cy.url().should("contain", "/settings/authentication/form-login"); + }); + + it("should test that configure link redirects to google signup setup doc", () => { + cy.visit("/settings/general"); + cy.get(AdminsSettingsLocators.authenticationTab).click(); + cy.url().should("contain", "/settings/authentication"); + cy.get(AdminsSettingsLocators.googleButton).click(); + cy.url().should("contain", "/settings/authentication/google-auth"); + cy.get(AdminsSettingsLocators.readMoreLink).within(() => { + cy.get("a") + .should("have.attr", "target", "_blank") + .invoke("removeAttr", "target") + .click(); + cy.url().should("contain", GOOGLE_SIGNUP_SETUP_DOC); + }); + }); + + it("should test that configure link redirects to github signup setup doc", () => { + cy.visit("/settings/general"); + cy.get(AdminsSettingsLocators.authenticationTab).click(); + cy.url().should("contain", "/settings/authentication"); + cy.get(AdminsSettingsLocators.githubButton).click(); + cy.url().should("contain", "/settings/authentication/github-auth"); + cy.get(AdminsSettingsLocators.readMoreLink).within(() => { + cy.get("a") + .should("have.attr", "target", "_blank") + .invoke("removeAttr", "target") + .click(); + cy.url().should("contain", GITHUB_SIGNUP_SETUP_DOC); + }); }); it("should test save and clear buttons disabled state", () => { @@ -159,4 +203,71 @@ describe("Admin settings page", function() { cy.get(AdminsSettingsLocators.restartNotice).should("not.exist"); cy.wait(3000); }); + + it("should test that breadcrumbs work properly", () => { + // checking settings default page + cy.visit("/settings/general"); + cy.get(AdminsSettingsLocators.breadcrumbList) + .children() + .within(() => { + cy.get(AdminsSettingsLocators.breadcrumbItem).should( + "have.length", + "2", + ); + cy.get(AdminsSettingsLocators.breadcrumbItem) + .eq(0) + .contains("Homepage") + .should("have.attr", "href") + .and("eq", "/applications"); + cy.get(AdminsSettingsLocators.breadcrumbItem) + .eq(1) + .contains("General") + .should("not.have.attr", "href"); + }); + + // checking settings category page + cy.visit("/settings/authentication"); + cy.get(AdminsSettingsLocators.breadcrumbList) + .children() + .within(() => { + cy.get(AdminsSettingsLocators.breadcrumbItem).should( + "have.length", + "2", + ); + cy.get(AdminsSettingsLocators.breadcrumbItem) + .eq(0) + .contains("Homepage") + .should("have.attr", "href") + .and("eq", "/applications"); + cy.get(AdminsSettingsLocators.breadcrumbItem) + .eq(1) + .contains("Authentication") + .should("not.have.attr", "href"); + }); + + // checking settings subcategory page + cy.visit("/settings/authentication/google-auth"); + cy.get(AdminsSettingsLocators.breadcrumbList) + .children() + .within(() => { + cy.get(AdminsSettingsLocators.breadcrumbItem).should( + "have.length", + "3", + ); + cy.get(AdminsSettingsLocators.breadcrumbItem) + .eq(0) + .contains("Homepage") + .should("have.attr", "href") + .and("eq", "/applications"); + cy.get(AdminsSettingsLocators.breadcrumbItem) + .eq(1) + .contains("Authentication") + .should("have.attr", "href") + .and("eq", "/settings/authentication"); + cy.get(AdminsSettingsLocators.breadcrumbItem) + .eq(2) + .contains("Google Authentication") + .should("not.have.attr", "href"); + }); + }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/EnterpriseTests/AdminSettings/Admin_settings_spec.js b/app/client/cypress/integration/Smoke_TestSuite/EnterpriseTests/AdminSettings/Admin_settings_spec.js new file mode 100644 index 0000000000..8f15450fe9 --- /dev/null +++ b/app/client/cypress/integration/Smoke_TestSuite/EnterpriseTests/AdminSettings/Admin_settings_spec.js @@ -0,0 +1,31 @@ +const AdminsSettingsLocators = require("../../../../locators/AdminsSettingsLocators.json"); +const EnterpriseAdminSettingsLocators = require("../../../../locators/EnterpriseAdminSettingsLocators.json"); + +describe("Admin settings page", function() { + beforeEach(() => { + cy.intercept("GET", "/api/v1/admin/env", { + body: { responseMeta: { status: 200, success: true }, data: {} }, + }).as("getEnvVariables"); + cy.intercept("PUT", "/api/v1/admin/env", { + body: { responseMeta: { status: 200, success: true }, data: {} }, + }).as("postEnvVariables"); + }); + + it("should test that settings page is redirected to default tab", () => { + cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); + cy.visit("/applications"); + cy.wait(3000); + cy.visit("/settings"); + cy.url().should("contain", "/settings/general"); + }); + + it("should test that authentication page shows upgrade button for SSO", () => { + cy.visit("/settings/general"); + cy.get(AdminsSettingsLocators.authenticationTab).click(); + cy.url().should("contain", "/settings/authentication"); + cy.get(EnterpriseAdminSettingsLocators.upgradeButton).each(($el) => { + cy.wrap($el).should("be.visible"); + cy.wrap($el).should("contain", "UPGRADE"); + }); + }); +}); diff --git a/app/client/cypress/locators/AdminsSettingsLocators.json b/app/client/cypress/locators/AdminsSettingsLocators.json index 6d97914ca1..64445555ab 100644 --- a/app/client/cypress/locators/AdminsSettingsLocators.json +++ b/app/client/cypress/locators/AdminsSettingsLocators.json @@ -5,6 +5,10 @@ "authenticationTab": ".t--settings-category-authentication", "emailTab": ".t--settings-category-email", "googleMapsTab": ".t--settings-category-google-maps", + "googleButton": ".t--settings-sub-category-google-auth", + "githubButton": ".t--settings-sub-category-github-auth", + "formloginButton": ".t--settings-sub-category-form-login", + "readMoreLink": ".t--read-more-link", "versionTab": ".t--settings-category-version", "backButton": ".t--admin-settings-back-button", "saveButton": ".t--admin-settings-save-button", @@ -12,5 +16,7 @@ "textInput": ".t--admin-settings-text-input input", "instanceName": ".t--admin-settings-APPSMITH_INSTANCE_NAME input", "fromAddress": ".t--admin-settings-APPSMITH_MAIL_FROM input", - "restartNotice": ".t--admin-settings-restart-notice" + "restartNotice": ".t--admin-settings-restart-notice", + "breadcrumbList": ".t--breadcrumb-list", + "breadcrumbItem": ".t--breadcrumb-item" } \ No newline at end of file diff --git a/app/client/cypress/locators/EnterpriseAdminSettingsLocators.json b/app/client/cypress/locators/EnterpriseAdminSettingsLocators.json new file mode 100644 index 0000000000..18478b2e93 --- /dev/null +++ b/app/client/cypress/locators/EnterpriseAdminSettingsLocators.json @@ -0,0 +1,3 @@ +{ + "upgradeButton": ".t--settings-sub-category-upgrade" +} \ No newline at end of file diff --git a/app/client/cypress/support/index.js b/app/client/cypress/support/index.js index f0b478d006..adff447749 100644 --- a/app/client/cypress/support/index.js +++ b/app/client/cypress/support/index.js @@ -23,7 +23,7 @@ let appId; // Import commands.js using ES2015 syntax: import "./commands"; import { initLocalstorage } from "./commands"; -import * as MESSAGES from "../../../client/src/constants/messages"; +import * as MESSAGES from "../../../client/src/ce/constants/messages.ts"; Cypress.on("uncaught:exception", (err, runnable) => { // returning false here prevents Cypress from diff --git a/app/client/src/api/ApiUtils.test.ts b/app/client/src/api/ApiUtils.test.ts index 498fcbb00d..53d6539270 100644 --- a/app/client/src/api/ApiUtils.test.ts +++ b/app/client/src/api/ApiUtils.test.ts @@ -10,7 +10,7 @@ import { createMessage, ERROR_0, SERVER_API_TIMEOUT_ERROR, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { ERROR_CODES } from "@appsmith/constants/ApiConstants"; describe("axios api interceptors", () => { diff --git a/app/client/src/api/ApiUtils.ts b/app/client/src/api/ApiUtils.ts index 8b09ff2edc..a27a4dffbe 100644 --- a/app/client/src/api/ApiUtils.ts +++ b/app/client/src/api/ApiUtils.ts @@ -3,7 +3,7 @@ import { ERROR_0, ERROR_500, SERVER_API_TIMEOUT_ERROR, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import axios, { AxiosRequestConfig, AxiosResponse } from "axios"; import { API_STATUS_CODES, diff --git a/app/client/src/assets/images/lock-password-line.svg b/app/client/src/assets/images/lock-password-line.svg new file mode 100644 index 0000000000..c38c9c87c3 --- /dev/null +++ b/app/client/src/assets/images/lock-password-line.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/client/src/assets/images/oidc.svg b/app/client/src/assets/images/oidc.svg new file mode 100644 index 0000000000..198adac728 --- /dev/null +++ b/app/client/src/assets/images/oidc.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/app/client/src/assets/images/saml.svg b/app/client/src/assets/images/saml.svg new file mode 100644 index 0000000000..0ec5b11b96 --- /dev/null +++ b/app/client/src/assets/images/saml.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/app/client/src/ce/constants/forms.ts b/app/client/src/ce/constants/forms.ts new file mode 100644 index 0000000000..b62651ffd4 --- /dev/null +++ b/app/client/src/ce/constants/forms.ts @@ -0,0 +1 @@ +export * from "constants/forms"; diff --git a/app/client/src/constants/messages.test.ts b/app/client/src/ce/constants/messages.test.ts similarity index 100% rename from app/client/src/constants/messages.test.ts rename to app/client/src/ce/constants/messages.test.ts diff --git a/app/client/src/constants/messages.ts b/app/client/src/ce/constants/messages.ts similarity index 99% rename from app/client/src/constants/messages.ts rename to app/client/src/ce/constants/messages.ts index f9b7f23205..79ada0d4e2 100644 --- a/app/client/src/constants/messages.ts +++ b/app/client/src/ce/constants/messages.ts @@ -269,6 +269,9 @@ export const EDIT_DATASOURCE_MESSAGE = () => "Edit Datasource to access authentication settings"; export const OAUTH_ERROR = () => "OAuth Error"; export const OAUTH_2_0 = () => "OAuth 2.0"; +export const ADD = () => "ADD"; +export const UPGRADE = () => "UPGRADE"; +export const EDIT = () => "EDIT"; export const ERROR_EVAL_ERROR_GENERIC = () => `Unexpected error occurred while evaluating the application`; @@ -937,6 +940,13 @@ export const GENERATE_APPLICATION_DESCRIPTION = () => export const DELETE_ORG_SUCCESSFUL = () => "Organization deleted successfully"; +export const UPGRADE_TO_EE = (authLabel: string) => + `Hello, I would like to upgrade and start using ${authLabel} authentication.`; +export const ADMIN_AUTH_SETTINGS_TITLE = () => "Select Authentication Method"; +export const ADMIN_AUTH_SETTINGS_SUBTITLE = () => + "Select a protocol you want to authenticate users with"; +export const DANGER_ZONE = () => "Danger Zone"; + // Guided tour // -- STEPS --- export const STEP_ONE_TITLE = () => diff --git a/app/client/src/ce/pages/AdminSettings/BreadcrumbCategories.tsx b/app/client/src/ce/pages/AdminSettings/BreadcrumbCategories.tsx new file mode 100644 index 0000000000..fcb2d3b17c --- /dev/null +++ b/app/client/src/ce/pages/AdminSettings/BreadcrumbCategories.tsx @@ -0,0 +1,57 @@ +import { + APPLICATIONS_URL, + getAdminSettingsCategoryUrl, +} from "constants/routes"; +import { SettingCategories } from "@appsmith/pages/AdminSettings/config/types"; + +export const BreadcrumbCategories = { + HOMEPAGE: { + href: APPLICATIONS_URL, + text: "Homepage", + }, + [SettingCategories.GENERAL]: { + href: getAdminSettingsCategoryUrl(SettingCategories.GENERAL), + text: "General", + }, + [SettingCategories.EMAIL]: { + href: getAdminSettingsCategoryUrl(SettingCategories.EMAIL), + text: "Email", + }, + [SettingCategories.GOOGLE_MAPS]: { + href: getAdminSettingsCategoryUrl(SettingCategories.GOOGLE_MAPS), + text: "Google Maps", + }, + [SettingCategories.VERSION]: { + href: getAdminSettingsCategoryUrl(SettingCategories.VERSION), + text: "Version", + }, + [SettingCategories.ADVANCED]: { + href: getAdminSettingsCategoryUrl(SettingCategories.ADVANCED), + text: "Advanced", + }, + [SettingCategories.AUTHENTICATION]: { + href: getAdminSettingsCategoryUrl(SettingCategories.AUTHENTICATION), + text: "Authentication", + }, + [SettingCategories.FORM_AUTH]: { + href: getAdminSettingsCategoryUrl( + SettingCategories.AUTHENTICATION, + SettingCategories.FORM_AUTH, + ), + text: "Form Login", + }, + [SettingCategories.GOOGLE_AUTH]: { + href: getAdminSettingsCategoryUrl( + SettingCategories.AUTHENTICATION, + SettingCategories.GOOGLE_AUTH, + ), + text: "Google Authentication", + }, + [SettingCategories.GITHUB_AUTH]: { + href: getAdminSettingsCategoryUrl( + SettingCategories.AUTHENTICATION, + SettingCategories.GITHUB_AUTH, + ), + text: "Github Authentication", + }, +}; diff --git a/app/client/src/ce/pages/AdminSettings/config/authentication/AuthPage.tsx b/app/client/src/ce/pages/AdminSettings/config/authentication/AuthPage.tsx new file mode 100644 index 0000000000..dff8b87222 --- /dev/null +++ b/app/client/src/ce/pages/AdminSettings/config/authentication/AuthPage.tsx @@ -0,0 +1,228 @@ +import React, { useEffect } from "react"; +import { useHistory } from "react-router-dom"; +import { SettingCategories } from "../types"; +import styled from "styled-components"; +import Button, { Category } from "components/ads/Button"; +import { + ADD, + ADMIN_AUTH_SETTINGS_SUBTITLE, + ADMIN_AUTH_SETTINGS_TITLE, + createMessage, + EDIT, + UPGRADE, + UPGRADE_TO_EE, +} from "@appsmith/constants/messages"; +import { getAdminSettingsCategoryUrl } from "constants/routes"; +import Icon, { IconSize } from "components/ads/Icon"; +import { Callout, CalloutType } from "components/ads/CalloutV2"; +import SettingsBreadcrumbs from "pages/Settings/SettingsBreadcrumbs"; +import { getAppsmithConfigs } from "@appsmith/configs"; +import { getCurrentUser } from "selectors/usersSelectors"; +import { useSelector } from "react-redux"; +import { bootIntercom } from "utils/helpers"; +import { Colors } from "constants/Colors"; + +const { intercomAppID } = getAppsmithConfigs(); + +const Wrapper = styled.div` + flex-basis: calc(100% - ${(props) => props.theme.homePage.leftPane.width}px); + margin-left: 112px; + padding-top: 40px; + height: calc(100vh - ${(props) => props.theme.homePage.header}px); + overflow: auto; +`; + +const SettingsFormWrapper = styled.div``; + +const SettingsHeader = styled.h2` + font-size: 24px; + font-weight: 500; + text-transform: capitalize; + margin-bottom: 0; +`; + +const SettingsSubHeader = styled.div` + font-size: 14px; + margin-bottom: 0; +`; + +const MethodCard = styled.div` + display: flex; + align-items: center; + margin: 32px 0; +`; + +const Image = styled.img` + width: 32px; + height: 32px; + margin-right: 8px; + background: #f0f0f0; + object-fit: cover; + border-radius: 50%; + padding: 5px; + align-self: baseline; +`; + +const MethodDetailsWrapper = styled.div` + color: #2e3d49; + width: 492px; + margin-right: 60px; +`; + +const MethodTitle = styled.div` + font-weight: 500; + font-size: 16px; + display: flex; + align-items: center; + margin: 0 0 4px; +`; + +const MethodDets = styled.div` + font-size: 12px; + line-height: 16px; +`; + +export type calloutType = "LINK" | "OTHER"; + +export type banner = { + actionLabel: string; + title: string; + type: CalloutType; +}; + +export type AuthMethodType = { + id: string; + category?: string; + label: string; + subText?: string; + image?: any; + needsUpgrade?: boolean; + type: calloutType; + isConnected?: boolean; + calloutBanner?: banner; +}; + +const EditButton = styled.div` + display: flex; + align-items: center; + cursor: pointer; +`; + +const AddButton = styled(Button)` + height: 30px; + padding: 8px 16px; +`; + +const ButtonTitle = styled.span` + margin-right: 2px; + font-size: 11px; +`; + +const Label = styled.span<{ enterprise?: boolean }>` + display: inline; + ${(props) => + props.enterprise + ? ` + border: 1px solid ${Colors.COD_GRAY}; + color: ${Colors.COD_GRAY}; + background: #fff; + ` + : ` + color: #03B365; + background: #E5F6EC; + `}; + padding: 0px 4px; + font-size: 12px; +`; + +export function AuthPage({ authMethods }: { authMethods: AuthMethodType[] }) { + const history = useHistory(); + const user = useSelector(getCurrentUser); + + useEffect(() => { + bootIntercom(user); + }, [user?.email]); + + const triggerIntercom = (authLabel: string) => { + if (intercomAppID && window.Intercom) { + window.Intercom( + "showNewMessage", + createMessage(UPGRADE_TO_EE, authLabel), + ); + } + }; + + return ( + + + + + {createMessage(ADMIN_AUTH_SETTINGS_TITLE)} + + + {createMessage(ADMIN_AUTH_SETTINGS_SUBTITLE)} + + {authMethods && + authMethods.map((method) => { + return ( + + {method.label} + + + {method.label}  + {method.isConnected && } + {method.needsUpgrade && ( + + )} + + {method.subText} + {method.calloutBanner && ( + + )} + + {method.isConnected ? ( + + history.push( + getAdminSettingsCategoryUrl( + SettingCategories.AUTHENTICATION, + method.category, + ), + ) + } + > + {createMessage(EDIT)} + + + ) : ( + + !method.needsUpgrade + ? history.push( + getAdminSettingsCategoryUrl( + SettingCategories.AUTHENTICATION, + method.category, + ), + ) + : triggerIntercom(method.label) + } + text={createMessage(!!method.needsUpgrade ? UPGRADE : ADD)} + /> + )} + + ); + })} + + + ); +} diff --git a/app/client/src/ce/pages/AdminSettings/config/authentication/index.tsx b/app/client/src/ce/pages/AdminSettings/config/authentication/index.tsx new file mode 100644 index 0000000000..53ebf2c542 --- /dev/null +++ b/app/client/src/ce/pages/AdminSettings/config/authentication/index.tsx @@ -0,0 +1,209 @@ +import React from "react"; +import { + GOOGLE_SIGNUP_SETUP_DOC, + GITHUB_SIGNUP_SETUP_DOC, +} from "constants/ThirdPartyConstants"; +import { + SettingCategories, + SettingTypes, + SettingSubtype, + AdminConfigType, +} from "@appsmith/pages/AdminSettings/config/types"; + +import { AuthPage, AuthMethodType } from "./AuthPage"; +import Google from "assets/images/Google.png"; +import SamlSso from "assets/images/saml.svg"; +import OIDC from "assets/images/oidc.svg"; +import Github from "assets/images/Github.png"; +import Lock from "assets/images/lock-password-line.svg"; +import { getAppsmithConfigs } from "@appsmith/configs"; +const { + disableLoginForm, + enableGithubOAuth, + enableGoogleOAuth, +} = getAppsmithConfigs(); +const Form_Auth: AdminConfigType = { + type: SettingCategories.FORM_AUTH, + controlType: SettingTypes.GROUP, + title: "Form Login", + subText: "Enable your organization to sign in with Appsmith Form.", + canSave: true, + settings: [ + { + id: "APPSMITH_FORM_LOGIN_DISABLED", + category: SettingCategories.FORM_AUTH, + subCategory: "form login", + controlType: SettingTypes.TOGGLE, + label: "Form Login Option", + toggleText: (value: boolean) => { + if (value) { + return "Enable form login/signup"; + } else { + return " Disable form login/signup"; + } + }, + }, + { + id: "APPSMITH_SIGNUP_DISABLED", + category: SettingCategories.FORM_AUTH, + subCategory: "form signup", + controlType: SettingTypes.TOGGLE, + label: "Signup", + toggleText: (value: boolean) => { + if (value) { + return "Allow invited users to signup"; + } else { + return " Allow all users to signup"; + } + }, + }, + ], +}; + +const Google_Auth: AdminConfigType = { + type: SettingCategories.GOOGLE_AUTH, + controlType: SettingTypes.GROUP, + title: "Google Authentication", + subText: "Enable your organization to sign in with Google (OAuth).", + canSave: true, + settings: [ + { + id: "APPSMITH_OAUTH2_GOOGLE_READ_MORE", + category: SettingCategories.GOOGLE_AUTH, + subCategory: "google signup", + controlType: SettingTypes.LINK, + label: "How to configure?", + url: GOOGLE_SIGNUP_SETUP_DOC, + }, + { + id: "APPSMITH_OAUTH2_GOOGLE_CLIENT_ID", + category: SettingCategories.GOOGLE_AUTH, + subCategory: "google signup", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "Client ID", + }, + { + id: "APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET", + category: SettingCategories.GOOGLE_AUTH, + subCategory: "google signup", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "Client Secret", + }, + { + id: "APPSMITH_SIGNUP_ALLOWED_DOMAINS", + category: SettingCategories.GOOGLE_AUTH, + subCategory: "google signup", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "Allowed Domains", + placeholder: "domain1.com, domain2.com", + }, + ], +}; + +const Github_Auth: AdminConfigType = { + type: SettingCategories.GITHUB_AUTH, + controlType: SettingTypes.GROUP, + title: "Github Authentication", + subText: + "Enable your organization to sign in with Github SAML single sign-on (SSO).", + canSave: true, + settings: [ + { + id: "APPSMITH_OAUTH2_GITHUB_READ_MORE", + category: SettingCategories.GITHUB_AUTH, + subCategory: "github signup", + controlType: SettingTypes.LINK, + label: "How to configure?", + url: GITHUB_SIGNUP_SETUP_DOC, + }, + { + id: "APPSMITH_OAUTH2_GITHUB_CLIENT_ID", + category: SettingCategories.GITHUB_AUTH, + subCategory: "github signup", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "Client ID", + }, + { + id: "APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET", + category: SettingCategories.GITHUB_AUTH, + subCategory: "github signup", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "Client Secret", + }, + ], +}; + +export const Form_Auth_Callout: AuthMethodType = { + id: "APPSMITH_FORM_LOGIN_AUTH", + category: SettingCategories.FORM_AUTH, + label: "Form Login", + subText: "Enable your organization to sign in with Appsmith Form.", + image: Lock, + type: "LINK", + isConnected: !disableLoginForm, +}; + +export const Google_Auth_Callout: AuthMethodType = { + id: "APPSMITH_GOOGLE_AUTH", + category: SettingCategories.GOOGLE_AUTH, + label: "Google", + subText: "Enable your organization to sign in with Google (OAuth).", + image: Google, + type: "LINK", + isConnected: enableGoogleOAuth, +}; + +export const Github_Auth_Callout: AuthMethodType = { + id: "APPSMITH_GITHUB_AUTH", + category: SettingCategories.GITHUB_AUTH, + label: "Github", + subText: + "Enable your organization to sign in with Github SAML single sign-on (SSO).", + image: Github, + type: "LINK", + isConnected: enableGithubOAuth, +}; + +export const Saml_Auth_Callout: AuthMethodType = { + id: "APPSMITH_SAML_AUTH", + label: "SAML 2.0", + subText: `Enable your organization to sign in with your preferred SAML2 compliant provider.`, + image: SamlSso, + needsUpgrade: true, + type: "OTHER", +}; + +export const Oidc_Auth_Callout: AuthMethodType = { + id: "APPSMITH_OIDC_AUTH", + label: "OIDC", + subText: `Enable your organization to sign in with Open ID Connect.`, + image: OIDC, + needsUpgrade: true, + type: "OTHER", +}; + +const AuthMethods = [ + Oidc_Auth_Callout, + Saml_Auth_Callout, + Google_Auth_Callout, + Github_Auth_Callout, + Form_Auth_Callout, +]; + +function AuthMain() { + return ; +} + +export const config: AdminConfigType = { + type: SettingCategories.AUTHENTICATION, + controlType: SettingTypes.PAGE, + title: "Authentication", + canSave: false, + children: [Form_Auth, Google_Auth, Github_Auth], + component: AuthMain, +}; diff --git a/app/client/src/ce/pages/AdminSettings/config/types.ts b/app/client/src/ce/pages/AdminSettings/config/types.ts new file mode 100644 index 0000000000..1868b97769 --- /dev/null +++ b/app/client/src/ce/pages/AdminSettings/config/types.ts @@ -0,0 +1,77 @@ +import React from "react"; +import { ReduxAction } from "constants/ReduxActionConstants"; +import { Dispatch } from "react"; + +export enum SettingTypes { + TEXTINPUT = "TEXTINPUT", + TOGGLE = "TOGGLE", + LINK = "LINK", + BUTTON = "BUTTON", + GROUP = "GROUP", + TEXT = "TEXT", + PAGE = "PAGE", +} + +export enum SettingSubtype { + EMAIL = "email", + TEXT = "text", + NUMBER = "number", + PASSWORD = "password", +} + +export interface Setting { + id: string; + category?: string; + controlType: SettingTypes; + controlSubType?: SettingSubtype; + helpText?: string; + label?: string; + name?: string; + placeholder?: string; + validate?: (value: string, setting?: Setting) => string | void; + url?: string; + children?: any; + subCategory?: string; + value?: string; + text?: string; + action?: ( + dispatch: Dispatch>, + settings?: Record, + ) => void; + sortOrder?: number; + subText?: string; + toggleText?: (value: boolean) => string; + isVisible?: (values: Record) => boolean; + isHidden?: boolean; + isDisabled?: (values: Record) => boolean; +} + +export interface Category { + title: string; + slug: string; + subText?: string; + children?: Category[]; +} + +export const SettingCategories = { + GENERAL: "general", + EMAIL: "email", + GOOGLE_MAPS: "google-maps", + VERSION: "version", + ADVANCED: "advanced", + AUTHENTICATION: "authentication", + FORM_AUTH: "form-login", + GOOGLE_AUTH: "google-auth", + GITHUB_AUTH: "github-auth", +}; + +export type AdminConfigType = { + type: string; + controlType: SettingTypes; + title: string; + subText?: string; + settings?: Setting[]; + component?: React.ElementType; + children?: AdminConfigType[]; + canSave: boolean; +}; diff --git a/app/client/src/ce/pages/UserAuth/Login.tsx b/app/client/src/ce/pages/UserAuth/Login.tsx index 9406384c2f..660d2b25da 100644 --- a/app/client/src/ce/pages/UserAuth/Login.tsx +++ b/app/client/src/ce/pages/UserAuth/Login.tsx @@ -23,7 +23,7 @@ import { LOGIN_PAGE_INVALID_CREDS_FORGOT_PASSWORD_LINK, NEW_TO_APPSMITH, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import FormMessage from "components/ads/formFields/FormMessage"; import FormGroup from "components/ads/formFields/FormGroup"; import FormTextField from "components/ads/formFields/TextField"; diff --git a/app/client/src/ce/pages/UserAuth/SignUp.tsx b/app/client/src/ce/pages/UserAuth/SignUp.tsx index f9d028fffc..53cc3ca0dd 100644 --- a/app/client/src/ce/pages/UserAuth/SignUp.tsx +++ b/app/client/src/ce/pages/UserAuth/SignUp.tsx @@ -28,7 +28,7 @@ import { SIGNUP_PAGE_SUBMIT_BUTTON_TEXT, ALREADY_HAVE_AN_ACCOUNT, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import FormMessage from "components/ads/formFields/FormMessage"; import FormGroup from "components/ads/formFields/FormGroup"; import FormTextField from "components/ads/formFields/TextField"; diff --git a/app/client/src/comments/AppComments/AppCommentThreads.tsx b/app/client/src/comments/AppComments/AppCommentThreads.tsx index c2b14ac2b4..4252b76ece 100644 --- a/app/client/src/comments/AppComments/AppCommentThreads.tsx +++ b/app/client/src/comments/AppComments/AppCommentThreads.tsx @@ -23,7 +23,10 @@ import { setShouldShowResolvedComments } from "actions/commentActions"; import { useSelectCommentThreadUsingQuery } from "../inlineComments/Comments"; import { Toaster } from "components/ads/Toast"; import { Variant } from "components/ads/common"; -import { COMMENT_HAS_BEEN_DELETED, createMessage } from "constants/messages"; +import { + COMMENT_HAS_BEEN_DELETED, + createMessage, +} from "@appsmith/constants/messages"; const Container = styled.div` display: flex; diff --git a/app/client/src/comments/AppComments/AppCommentsHeader.tsx b/app/client/src/comments/AppComments/AppCommentsHeader.tsx index 728ef0d96c..c803193a17 100644 --- a/app/client/src/comments/AppComments/AppCommentsHeader.tsx +++ b/app/client/src/comments/AppComments/AppCommentsHeader.tsx @@ -1,7 +1,7 @@ import React from "react"; import styled from "styled-components"; import { getTypographyByKey } from "constants/DefaultTheme"; -import { COMMENTS, createMessage } from "constants/messages"; +import { COMMENTS, createMessage } from "@appsmith/constants/messages"; import AppCommentsFilterPopover from "./AppCommentsFilterPopover"; diff --git a/app/client/src/comments/AppComments/AppCommentsPlaceholder.tsx b/app/client/src/comments/AppComments/AppCommentsPlaceholder.tsx index 589dec8247..1fbb6e4c93 100644 --- a/app/client/src/comments/AppComments/AppCommentsPlaceholder.tsx +++ b/app/client/src/comments/AppComments/AppCommentsPlaceholder.tsx @@ -3,7 +3,7 @@ import styled from "styled-components"; import { NO_COMMENTS_CLICK_ON_CANVAS_TO_ADD, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import Icon, { IconSize } from "components/ads/Icon"; const Container = styled.div` diff --git a/app/client/src/comments/CommentCard/CommentCard.tsx b/app/client/src/comments/CommentCard/CommentCard.tsx index 248b42b2b3..7feae44788 100644 --- a/app/client/src/comments/CommentCard/CommentCard.tsx +++ b/app/client/src/comments/CommentCard/CommentCard.tsx @@ -48,7 +48,10 @@ import { import { useDispatch, useSelector } from "react-redux"; import { commentThreadsSelector } from "selectors/commentsSelectors"; import { getCurrentUser } from "selectors/usersSelectors"; -import { createMessage, LINK_COPIED_SUCCESSFULLY } from "constants/messages"; +import { + createMessage, + LINK_COPIED_SUCCESSFULLY, +} from "@appsmith/constants/messages"; import { Variant } from "components/ads/common"; import TourTooltipWrapper from "components/ads/tour/TourTooltipWrapper"; import { TourType } from "entities/Tour"; diff --git a/app/client/src/comments/CommentCard/CommentContextMenu.tsx b/app/client/src/comments/CommentCard/CommentContextMenu.tsx index e844b4f81b..7a82f9f48f 100644 --- a/app/client/src/comments/CommentCard/CommentContextMenu.tsx +++ b/app/client/src/comments/CommentCard/CommentContextMenu.tsx @@ -10,7 +10,7 @@ import { createMessage, EDIT_COMMENT, MORE_OPTIONS, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { noop } from "lodash"; import "@blueprintjs/popover2/lib/css/blueprint-popover2.css"; diff --git a/app/client/src/comments/CommentCard/ResolveCommentButton.tsx b/app/client/src/comments/CommentCard/ResolveCommentButton.tsx index 3e15b00b2a..661abcb090 100644 --- a/app/client/src/comments/CommentCard/ResolveCommentButton.tsx +++ b/app/client/src/comments/CommentCard/ResolveCommentButton.tsx @@ -7,7 +7,7 @@ import { createMessage, RESOLVE_THREAD, RESOLVED_THREAD, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Colors } from "constants/Colors"; const Container = styled.div` diff --git a/app/client/src/comments/CommentThread/ScrollToLatest.tsx b/app/client/src/comments/CommentThread/ScrollToLatest.tsx index 8727e18b05..7704643e40 100644 --- a/app/client/src/comments/CommentThread/ScrollToLatest.tsx +++ b/app/client/src/comments/CommentThread/ScrollToLatest.tsx @@ -3,7 +3,7 @@ import { Theme } from "constants/DefaultTheme"; import React from "react"; import styled, { withTheme } from "styled-components"; import { getTypographyByKey } from "constants/DefaultTheme"; -import { VIEW_LATEST, createMessage } from "constants/messages"; +import { VIEW_LATEST, createMessage } from "@appsmith/constants/messages"; const Container = styled.div` position: absolute; diff --git a/app/client/src/comments/CommentsShowcaseCarousel/ProfileForm.tsx b/app/client/src/comments/CommentsShowcaseCarousel/ProfileForm.tsx index 46246101d9..8f0f852c88 100644 --- a/app/client/src/comments/CommentsShowcaseCarousel/ProfileForm.tsx +++ b/app/client/src/comments/CommentsShowcaseCarousel/ProfileForm.tsx @@ -7,7 +7,11 @@ import FormTextField from "components/ads/formFields/TextField"; import UserProfileImagePicker from "components/ads/UserProfileImagePicker"; -import { createMessage, DISPLAY_NAME, EMAIL_ADDRESS } from "constants/messages"; +import { + createMessage, + DISPLAY_NAME, + EMAIL_ADDRESS, +} from "@appsmith/constants/messages"; import styled from "styled-components"; import { isEmail, isEmptyString } from "utils/formhelpers"; diff --git a/app/client/src/comments/inlineComments/AddCommentInput.tsx b/app/client/src/comments/inlineComments/AddCommentInput.tsx index 02cdac3329..89b8a50bab 100644 --- a/app/client/src/comments/inlineComments/AddCommentInput.tsx +++ b/app/client/src/comments/inlineComments/AddCommentInput.tsx @@ -26,7 +26,7 @@ import { CANCEL, POST, INVALID_EMAIL, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { setShowAppInviteUsersDialog } from "actions/applicationActions"; import { useDispatch, useSelector } from "react-redux"; diff --git a/app/client/src/components/ads/Breadcrumbs.tsx b/app/client/src/components/ads/Breadcrumbs.tsx new file mode 100644 index 0000000000..e15bbd98b9 --- /dev/null +++ b/app/client/src/components/ads/Breadcrumbs.tsx @@ -0,0 +1,117 @@ +import React, { ReactNode } from "react"; +import { Link, useLocation } from "react-router-dom"; +import styled from "styled-components"; +import Icon from "./Icon"; +import { Colors } from "constants/Colors"; + +export interface BreadcrumbsProps { + items: { + href: string; + text: string; + }[]; +} +export interface BreadcrumbProps { + children: ReactNode; +} + +export const StyledBreadcrumbList = styled.ol` + list-style: none; + display: flex; + align-items: center; + font-size: 16px; + color: #716e6e; + margin-bottom: 23px; + + .breadcrumb-separator { + color: #716e6e; + margin: auto 6px; + user-select: none; + } + + .t--breadcrumb-item { + &.active { + color: ${Colors.COD_GRAY}; + font-size: 20px; + } + } +`; + +function BreadcrumbSeparator({ children, ...props }: { children: ReactNode }) { + return ( +
  • + {children} +
  • + ); +} + +function BreadcrumbItem({ children, ...props }: { children: ReactNode }) { + return ( +
  • + {children} +
  • + ); +} + +function BreadcrumbList(props: BreadcrumbProps) { + let children = React.Children.toArray(props.children); + + children = children.map((child, index) => ( + {child} + )); + + const lastIndex = children.length - 1; + + const childrenNew = children.reduce((acc: ReactNode[], child, index) => { + const notLast = index < lastIndex; + + if (notLast) { + acc.push( + child, + + + , + ); + } else { + acc.push(child); + } + return acc; + }, []); + + return ( + + {childrenNew} + + ); +} + +function Breadcrumbs(props: BreadcrumbsProps) { + const { pathname } = useLocation(); + return ( + + {props.items.map(({ href, text }) => + href === pathname ? ( + + {text} + + ) : ( + + {text} + + ), + )} + + ); +} + +export default Breadcrumbs; diff --git a/app/client/src/components/ads/CalloutV2.tsx b/app/client/src/components/ads/CalloutV2.tsx new file mode 100644 index 0000000000..d76273f811 --- /dev/null +++ b/app/client/src/components/ads/CalloutV2.tsx @@ -0,0 +1,93 @@ +import styled from "styled-components"; +import React from "react"; +import { ReduxAction } from "constants/ReduxActionConstants"; +import { Dispatch } from "react"; +import { useDispatch } from "react-redux"; +import Icon, { IconSize } from "../../components/ads/Icon"; +import { Colors } from "constants/Colors"; + +export type CalloutType = "Warning" | "Info"; + +export const Wrapper = styled.div<{ type?: CalloutType }>` + display: flex; + align-items: center; + width: 100%; + padding: 8px 16px; + ${(props) => + props.type !== "Warning" + ? `border-left: 5px solid ${Colors.CURIOUS_BLUE}; + color: #00407d; + background: ${Colors.PALE_BLUE};` + : `color: #c91818; background: ${Colors.FAIR_PINK}; + `} + margin: 16px 0; + + .warning-icon { + margin-right: 16px; + } + + h4 { + font-style: normal; + font-weight: normal; + font-size: 12px; + line-height: 16px; + } + a { + font-style: normal; + font-weight: 600; + font-size: 11px; + line-height: 13px; + display: flex; + align-items: center; + text-align: center; + letter-spacing: 0.4px; + text-transform: uppercase; + text-decoration: none; + margin: 5px 0; + ${(props) => + props.type !== "Warning" ? `color: #00407d;` : `color: #c91818;`} +`; + +export function Callout(props: { + type: CalloutType; + title: string; + actionLabel?: string; + action?: ( + dispatch: Dispatch>, + settings?: Record, + ) => void; + url?: string; +}) { + const dispatch = useDispatch(); + const linkProps: Record any)> = {}; + + if (props.url) { + linkProps.href = props.url; + linkProps.target = "_blank"; + } else if (props.action) { + linkProps.onClick = () => { + if (props.action) { + props.action(dispatch); + } + }; + } + + return ( + + {props.type === "Warning" && ( + + )} + + + ); +} diff --git a/app/client/src/components/ads/DisplayImageUpload.tsx b/app/client/src/components/ads/DisplayImageUpload.tsx index 6e72e1d2ba..4099640071 100644 --- a/app/client/src/components/ads/DisplayImageUpload.tsx +++ b/app/client/src/components/ads/DisplayImageUpload.tsx @@ -8,7 +8,7 @@ import { getTypographyByKey } from "constants/DefaultTheme"; import styled from "styled-components"; import ImageEditor from "@uppy/image-editor"; -import { REMOVE, createMessage } from "constants/messages"; +import { REMOVE, createMessage } from "@appsmith/constants/messages"; import "@uppy/core/dist/style.css"; import "@uppy/dashboard/dist/style.css"; diff --git a/app/client/src/components/ads/EditableTextWrapper.tsx b/app/client/src/components/ads/EditableTextWrapper.tsx index 5fe58511fd..a4cd97b015 100644 --- a/app/client/src/components/ads/EditableTextWrapper.tsx +++ b/app/client/src/components/ads/EditableTextWrapper.tsx @@ -7,7 +7,7 @@ import { Toaster } from "./Toast"; import { createMessage, ERROR_EMPTY_APPLICATION_NAME, -} from "constants/messages"; +} from "@appsmith/constants/messages"; type EditableTextWrapperProps = EditableTextProps & { variant: "UNDERLINE" | "ICON"; diff --git a/app/client/src/components/ads/EmojiPicker.tsx b/app/client/src/components/ads/EmojiPicker.tsx index 29516c0f23..94baa2d472 100644 --- a/app/client/src/components/ads/EmojiPicker.tsx +++ b/app/client/src/components/ads/EmojiPicker.tsx @@ -8,7 +8,11 @@ import { Theme } from "constants/DefaultTheme"; import "@blueprintjs/popover2/lib/css/blueprint-popover2.css"; import "emoji-mart/css/emoji-mart.css"; import Tooltip from "components/ads/Tooltip"; -import { ADD_REACTION, createMessage, EMOJI } from "constants/messages"; +import { + ADD_REACTION, + createMessage, + EMOJI, +} from "@appsmith/constants/messages"; import { Colors } from "constants/Colors"; const StyledIcon = styled(Icon)<{ diff --git a/app/client/src/components/ads/FilePicker.tsx b/app/client/src/components/ads/FilePicker.tsx index 4fc19b396c..888c0e4bee 100644 --- a/app/client/src/components/ads/FilePicker.tsx +++ b/app/client/src/components/ads/FilePicker.tsx @@ -13,7 +13,7 @@ import { createMessage, ERROR_FILE_TOO_LARGE, REMOVE_FILE_TOOL_TIP, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import TooltipComponent from "components/ads/Tooltip"; import { Position } from "@blueprintjs/core/lib/esm/common/position"; import Icon, { IconSize } from "./Icon"; diff --git a/app/client/src/components/ads/FilePickerV2.tsx b/app/client/src/components/ads/FilePickerV2.tsx index 093a7564d0..4fd2ed0e9c 100644 --- a/app/client/src/components/ads/FilePickerV2.tsx +++ b/app/client/src/components/ads/FilePickerV2.tsx @@ -12,7 +12,7 @@ import { createMessage, ERROR_FILE_TOO_LARGE, REMOVE_FILE_TOOL_TIP, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import TooltipComponent from "components/ads/Tooltip"; import { Position } from "@blueprintjs/core/lib/esm/common/position"; import Icon, { IconSize } from "./Icon"; diff --git a/app/client/src/components/ads/Icon.tsx b/app/client/src/components/ads/Icon.tsx index 5652023aa9..a9a888247e 100644 --- a/app/client/src/components/ads/Icon.tsx +++ b/app/client/src/components/ads/Icon.tsx @@ -128,6 +128,7 @@ import ShareForwardIcon from "remixicon-react/ShareForwardFillIcon"; import Trash from "remixicon-react/DeleteBinLineIcon"; import UpArrow from "remixicon-react/ArrowUpSFillIcon"; import WarningIcon from "remixicon-react/ErrorWarningFillIcon"; +import WarningLineIcon from "remixicon-react/ErrorWarningLineIcon"; import EditUnderlineIcon from "remixicon-react/EditLineIcon"; import LogoutIcon from "remixicon-react/LogoutBoxRLineIcon"; import ShareLineIcon from "remixicon-react/ShareLineIcon"; @@ -309,6 +310,7 @@ export const IconCollection = [ "view-less", "wand", "warning", + "warning-line", "warning-triangle", "workspace", "git-branch", @@ -721,6 +723,9 @@ const Icon = forwardRef( case "warning": returnIcon = ; break; + case "warning-line": + returnIcon = ; + break; case "warning-triangle": returnIcon = ; break; diff --git a/app/client/src/components/ads/MentionsInput.tsx b/app/client/src/components/ads/MentionsInput.tsx index 0b427b4b19..2a37c86a6c 100644 --- a/app/client/src/components/ads/MentionsInput.tsx +++ b/app/client/src/components/ads/MentionsInput.tsx @@ -13,7 +13,7 @@ import { EntryComponentProps } from "@draft-js-plugins/mention/lib/MentionSugges import Icon from "components/ads/Icon"; -import { INVITE_A_NEW_USER, createMessage } from "constants/messages"; +import { INVITE_A_NEW_USER, createMessage } from "@appsmith/constants/messages"; import { USER_PHOTO_URL } from "constants/userConstants"; import scrollIntoView from "scroll-into-view-if-needed"; diff --git a/app/client/src/components/ads/ShowcaseCarousel.tsx b/app/client/src/components/ads/ShowcaseCarousel.tsx index 0b649e91e0..a5dcbf4730 100644 --- a/app/client/src/components/ads/ShowcaseCarousel.tsx +++ b/app/client/src/components/ads/ShowcaseCarousel.tsx @@ -2,7 +2,7 @@ import React, { useState, useCallback, useEffect } from "react"; import Button, { Category, Size } from "components/ads/Button"; import styled from "styled-components"; -import { createMessage, NEXT, BACK, SKIP } from "constants/messages"; +import { createMessage, NEXT, BACK, SKIP } from "@appsmith/constants/messages"; import { useTransition, animated } from "react-spring"; import Icon from "./Icon"; diff --git a/app/client/src/components/ads/SnippetButton.tsx b/app/client/src/components/ads/SnippetButton.tsx index 4d0ca6fe3f..6db6f56265 100644 --- a/app/client/src/components/ads/SnippetButton.tsx +++ b/app/client/src/components/ads/SnippetButton.tsx @@ -1,6 +1,6 @@ import Button from "components/ads/Button"; import styled from "constants/DefaultTheme"; -import { createMessage, SNIPPET_TOOLTIP } from "constants/messages"; +import { createMessage, SNIPPET_TOOLTIP } from "@appsmith/constants/messages"; import { ENTITY_TYPE } from "entities/DataTree/dataTreeFactory"; import React from "react"; import { useDispatch } from "react-redux"; diff --git a/app/client/src/components/ads/TagInputComponent.tsx b/app/client/src/components/ads/TagInputComponent.tsx index 70490783fe..8dae2ee12d 100644 --- a/app/client/src/components/ads/TagInputComponent.tsx +++ b/app/client/src/components/ads/TagInputComponent.tsx @@ -5,7 +5,7 @@ import { Intent } from "constants/DefaultTheme"; import { createMessage, INVITE_USERS_VALIDATION_EMAIL_LIST, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { isEmail } from "utils/formhelpers"; import { Colors } from "constants/Colors"; const TagInputWrapper = styled.div<{ intent?: Intent }>` diff --git a/app/client/src/components/ads/TextInput.tsx b/app/client/src/components/ads/TextInput.tsx index d7417c7c78..8255be1b3f 100644 --- a/app/client/src/components/ads/TextInput.tsx +++ b/app/client/src/components/ads/TextInput.tsx @@ -15,7 +15,7 @@ import { ERROR_MESSAGE_NAME_EMPTY, createMessage, FORM_VALIDATION_INVALID_EMAIL, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { isEmail } from "utils/formhelpers"; import Icon, { IconCollection, IconName, IconSize } from "./Icon"; import { AsyncControllableInput } from "@blueprintjs/core/lib/esm/components/forms/asyncControllableInput"; diff --git a/app/client/src/components/ads/formFields/FormGroup.tsx b/app/client/src/components/ads/formFields/FormGroup.tsx index f27dca7791..b5b63d542e 100644 --- a/app/client/src/components/ads/formFields/FormGroup.tsx +++ b/app/client/src/components/ads/formFields/FormGroup.tsx @@ -8,7 +8,7 @@ const StyledFormGroup = styled(FormGroup)` & { width: ${(props) => (props.fill ? "100%" : "auto")}; &.${Classes.FORM_GROUP} { - margin: 0 0 ${(props) => props.theme.spaces[5]}px; + margin: 0 0 ${(props) => props.theme.spaces[11]}px; } &.${Classes.FORM_GROUP} .${Classes.FORM_HELPER_TEXT} { font-size: ${(props) => props.theme.fontSizes[3]}px; diff --git a/app/client/src/components/ads/formFields/TextField.tsx b/app/client/src/components/ads/formFields/TextField.tsx index a618785c18..9541004e5f 100644 --- a/app/client/src/components/ads/formFields/TextField.tsx +++ b/app/client/src/components/ads/formFields/TextField.tsx @@ -19,9 +19,11 @@ const renderComponent = ( return ( <> - {!componentProps.hideErrorMessage && ( - - )} + {!componentProps.hideErrorMessage && + showError && + componentProps.meta.error && ( + + )} ); }; diff --git a/app/client/src/components/designSystems/appsmith/help/HelpModal.tsx b/app/client/src/components/designSystems/appsmith/help/HelpModal.tsx index a23ca5cffa..3e74baddf4 100644 --- a/app/client/src/components/designSystems/appsmith/help/HelpModal.tsx +++ b/app/client/src/components/designSystems/appsmith/help/HelpModal.tsx @@ -20,7 +20,10 @@ import { User } from "constants/userConstants"; import { bootIntercom } from "utils/helpers"; import TooltipComponent from "components/ads/Tooltip"; import { Position } from "@blueprintjs/core"; -import { createMessage, HELP_RESOURCE_TOOLTIP } from "constants/messages"; +import { + createMessage, + HELP_RESOURCE_TOOLTIP, +} from "@appsmith/constants/messages"; import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants"; const { algolia } = getAppsmithConfigs(); diff --git a/app/client/src/components/editorComponents/ActionCreator/index.tsx b/app/client/src/components/editorComponents/ActionCreator/index.tsx index bafdfa046d..7450d7369d 100644 --- a/app/client/src/components/editorComponents/ActionCreator/index.tsx +++ b/app/client/src/components/editorComponents/ActionCreator/index.tsx @@ -61,7 +61,7 @@ import { STOP_WATCH_GEO_LOCATION, STORE_VALUE, WATCH_GEO_LOCATION, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { toggleShowGlobalSearchModal } from "actions/globalSearchActions"; import { filterCategories, SEARCH_CATEGORY_ID } from "../GlobalSearch/utils"; import { ActionDataState } from "reducers/entityReducers/actionsReducer"; diff --git a/app/client/src/components/editorComponents/ActionNameEditor.tsx b/app/client/src/components/editorComponents/ActionNameEditor.tsx index eb13d0ba3f..291ce3980f 100644 --- a/app/client/src/components/editorComponents/ActionNameEditor.tsx +++ b/app/client/src/components/editorComponents/ActionNameEditor.tsx @@ -16,7 +16,10 @@ import { Classes } from "@blueprintjs/core"; import { getAction, getPlugin } from "selectors/entitiesSelector"; import { Plugin } from "api/PluginApi"; import NameEditorComponent from "components/utils/NameEditorComponent"; -import { ACTION_NAME_PLACEHOLDER, createMessage } from "constants/messages"; +import { + ACTION_NAME_PLACEHOLDER, + createMessage, +} from "@appsmith/constants/messages"; const ApiNameWrapper = styled.div<{ page?: string }>` min-width: 50%; diff --git a/app/client/src/components/editorComponents/ActionRightPane/Connections.tsx b/app/client/src/components/editorComponents/ActionRightPane/Connections.tsx index 0abfa3e968..4e661da82a 100644 --- a/app/client/src/components/editorComponents/ActionRightPane/Connections.tsx +++ b/app/client/src/components/editorComponents/ActionRightPane/Connections.tsx @@ -14,7 +14,7 @@ import { NO_INCOMING_ENTITIES, NO_OUTGOING_ENTITIES, OUTGOING_ENTITIES, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Connection } from "../Debugger/EntityDependecies"; const ConnectionType = styled.span` diff --git a/app/client/src/components/editorComponents/ActionRightPane/SuggestedWidgets.tsx b/app/client/src/components/editorComponents/ActionRightPane/SuggestedWidgets.tsx index e832f1f606..e97ff09c98 100644 --- a/app/client/src/components/editorComponents/ActionRightPane/SuggestedWidgets.tsx +++ b/app/client/src/components/editorComponents/ActionRightPane/SuggestedWidgets.tsx @@ -12,7 +12,7 @@ import { createMessage, SUGGESTED_WIDGETS, SUGGESTED_WIDGET_TOOLTIP, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { SuggestedWidget } from "api/ActionAPI"; import { useSelector } from "store"; diff --git a/app/client/src/components/editorComponents/ActionRightPane/index.tsx b/app/client/src/components/editorComponents/ActionRightPane/index.tsx index baae274c65..d645fb0471 100644 --- a/app/client/src/components/editorComponents/ActionRightPane/index.tsx +++ b/app/client/src/components/editorComponents/ActionRightPane/index.tsx @@ -25,7 +25,7 @@ import { BACK_TO_CANVAS, createMessage, NO_CONNECTIONS, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { SuggestedWidget, SuggestedWidget as SuggestedWidgetsType, diff --git a/app/client/src/components/editorComponents/ApiResponseView.tsx b/app/client/src/components/editorComponents/ApiResponseView.tsx index 8a1a8e1ff3..5f6716d94c 100644 --- a/app/client/src/components/editorComponents/ApiResponseView.tsx +++ b/app/client/src/components/editorComponents/ApiResponseView.tsx @@ -19,7 +19,7 @@ import { EMPTY_RESPONSE_FIRST_HALF, EMPTY_RESPONSE_LAST_HALF, INSPECT_ENTITY, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import Text, { TextType } from "components/ads/Text"; import { Text as BlueprintText } from "@blueprintjs/core"; import Icon from "components/ads/Icon"; diff --git a/app/client/src/components/editorComponents/Debugger/ContextualMenu.tsx b/app/client/src/components/editorComponents/Debugger/ContextualMenu.tsx index afda31ffeb..9815d43d27 100644 --- a/app/client/src/components/editorComponents/Debugger/ContextualMenu.tsx +++ b/app/client/src/components/editorComponents/Debugger/ContextualMenu.tsx @@ -23,7 +23,7 @@ import { DEBUGGER_OPEN_DOCUMENTATION, DEBUGGER_SEARCH_GOOGLE, DEBUGGER_SEARCH_SNIPPET, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import Icon, { IconName, IconSize } from "components/ads/Icon"; import { Classes } from "components/ads/common"; import { Colors } from "constants/Colors"; diff --git a/app/client/src/components/editorComponents/Debugger/DebuggerLogs.tsx b/app/client/src/components/editorComponents/Debugger/DebuggerLogs.tsx index b31276470e..ef5f5ca1cc 100644 --- a/app/client/src/components/editorComponents/Debugger/DebuggerLogs.tsx +++ b/app/client/src/components/editorComponents/Debugger/DebuggerLogs.tsx @@ -6,7 +6,7 @@ import FilterHeader from "./FilterHeader"; import { BlankState } from "./helpers"; import LogItem, { getLogItemProps } from "./LogItem"; import { usePagination, useFilteredLogs } from "./hooks/debuggerHooks"; -import { createMessage, NO_LOGS } from "constants/messages"; +import { createMessage, NO_LOGS } from "@appsmith/constants/messages"; import { useSelector } from "react-redux"; import { getCurrentUser } from "selectors/usersSelectors"; import { bootIntercom } from "utils/helpers"; diff --git a/app/client/src/components/editorComponents/Debugger/DebuggerMessage.tsx b/app/client/src/components/editorComponents/Debugger/DebuggerMessage.tsx index 63cde67cfa..6a66663961 100644 --- a/app/client/src/components/editorComponents/Debugger/DebuggerMessage.tsx +++ b/app/client/src/components/editorComponents/Debugger/DebuggerMessage.tsx @@ -1,4 +1,4 @@ -import { CLICK_ON, createMessage } from "constants/messages"; +import { CLICK_ON, createMessage } from "@appsmith/constants/messages"; import React from "react"; import styled from "styled-components"; import { DebugButton } from "./DebugCTA"; diff --git a/app/client/src/components/editorComponents/Debugger/DebuggerTabs.tsx b/app/client/src/components/editorComponents/Debugger/DebuggerTabs.tsx index 77bb462577..76c413bb30 100644 --- a/app/client/src/components/editorComponents/Debugger/DebuggerTabs.tsx +++ b/app/client/src/components/editorComponents/Debugger/DebuggerTabs.tsx @@ -12,7 +12,7 @@ import { DEBUGGER_ERRORS, DEBUGGER_LOGS, INSPECT_ENTITY, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { stopEventPropagation } from "utils/AppsmithUtils"; import { DEBUGGER_TAB_KEYS } from "./helpers"; import { Colors } from "constants/Colors"; diff --git a/app/client/src/components/editorComponents/Debugger/EntityDependecies.tsx b/app/client/src/components/editorComponents/Debugger/EntityDependecies.tsx index 0dde9f1d30..a8fd915bd6 100644 --- a/app/client/src/components/editorComponents/Debugger/EntityDependecies.tsx +++ b/app/client/src/components/editorComponents/Debugger/EntityDependecies.tsx @@ -14,7 +14,7 @@ import { NO_INCOMING_ENTITIES, NO_OUTGOING_ENTITIES, OUTGOING_ENTITIES, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { getDependenciesFromInverseDependencies } from "./helpers"; import { useSelectedEntity, useEntityLink } from "./hooks/debuggerHooks"; import AnalyticsUtil from "utils/AnalyticsUtil"; diff --git a/app/client/src/components/editorComponents/Debugger/Errors.tsx b/app/client/src/components/editorComponents/Debugger/Errors.tsx index 4140ec7acf..52c1d623f0 100644 --- a/app/client/src/components/editorComponents/Debugger/Errors.tsx +++ b/app/client/src/components/editorComponents/Debugger/Errors.tsx @@ -4,7 +4,7 @@ import styled from "styled-components"; import { getFilteredErrors } from "selectors/debuggerSelectors"; import LogItem, { getLogItemProps } from "./LogItem"; import { BlankState } from "./helpers"; -import { createMessage, NO_ERRORS } from "constants/messages"; +import { createMessage, NO_ERRORS } from "@appsmith/constants/messages"; import { getCurrentUser } from "selectors/usersSelectors"; import { bootIntercom } from "utils/helpers"; import { thinScrollbar } from "constants/DefaultTheme"; diff --git a/app/client/src/components/editorComponents/Debugger/FilterHeader.tsx b/app/client/src/components/editorComponents/Debugger/FilterHeader.tsx index 9af414f021..581f165342 100644 --- a/app/client/src/components/editorComponents/Debugger/FilterHeader.tsx +++ b/app/client/src/components/editorComponents/Debugger/FilterHeader.tsx @@ -10,7 +10,7 @@ import { clearLogs } from "actions/debuggerActions"; import { Classes } from "components/ads/common"; import TooltipComponent from "components/ads/Tooltip"; import { Position } from "@blueprintjs/core"; -import { CLEAR_LOG_TOOLTIP, createMessage } from "constants/messages"; +import { CLEAR_LOG_TOOLTIP, createMessage } from "@appsmith/constants/messages"; import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants"; import { Classes as BlueprintClasses } from "@blueprintjs/core"; diff --git a/app/client/src/components/editorComponents/Debugger/LogItem.tsx b/app/client/src/components/editorComponents/Debugger/LogItem.tsx index 237cd32f03..03d020698a 100644 --- a/app/client/src/components/editorComponents/Debugger/LogItem.tsx +++ b/app/client/src/components/editorComponents/Debugger/LogItem.tsx @@ -13,7 +13,10 @@ import { SeverityIcon } from "./helpers"; import Text, { TextType } from "components/ads/Text"; import { getTypographyByKey } from "constants/DefaultTheme"; import TooltipComponent from "components/ads/Tooltip"; -import { createMessage, TROUBLESHOOT_ISSUE } from "constants/messages"; +import { + createMessage, + TROUBLESHOOT_ISSUE, +} from "@appsmith/constants/messages"; import ContextualMenu from "./ContextualMenu"; const Wrapper = styled.div<{ collapsed: boolean }>` diff --git a/app/client/src/components/editorComponents/Debugger/helpers.tsx b/app/client/src/components/editorComponents/Debugger/helpers.tsx index fd34428f41..33b1bfdec2 100644 --- a/app/client/src/components/editorComponents/Debugger/helpers.tsx +++ b/app/client/src/components/editorComponents/Debugger/helpers.tsx @@ -2,7 +2,11 @@ import { Log, Severity } from "entities/AppsmithConsole"; import React from "react"; import styled from "styled-components"; import { getTypographyByKey } from "constants/DefaultTheme"; -import { createMessage, OPEN_THE_DEBUGGER, PRESS } from "constants/messages"; +import { + createMessage, + OPEN_THE_DEBUGGER, + PRESS, +} from "@appsmith/constants/messages"; import { DependencyMap } from "utils/DynamicBindingUtils"; import { matchBuilderPath, diff --git a/app/client/src/components/editorComponents/EntityNameComponent.tsx b/app/client/src/components/editorComponents/EntityNameComponent.tsx index e2e6654039..d179996643 100644 --- a/app/client/src/components/editorComponents/EntityNameComponent.tsx +++ b/app/client/src/components/editorComponents/EntityNameComponent.tsx @@ -8,7 +8,7 @@ import { VALID_FUNCTION_NAME_ERROR, UNIQUE_NAME_ERROR, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; const InputContainer = styled.div<{ focused: boolean; isValid: boolean }>` align-items: center; diff --git a/app/client/src/components/editorComponents/GlobalSearch/HelpBar.tsx b/app/client/src/components/editorComponents/GlobalSearch/HelpBar.tsx index beeca8b91c..5e1c6c9bce 100644 --- a/app/client/src/components/editorComponents/GlobalSearch/HelpBar.tsx +++ b/app/client/src/components/editorComponents/GlobalSearch/HelpBar.tsx @@ -4,7 +4,7 @@ import styled from "styled-components"; import { getTypographyByKey } from "constants/DefaultTheme"; import Text, { TextType } from "components/ads/Text"; import { toggleShowGlobalSearchModal } from "actions/globalSearchActions"; -import { HELPBAR_PLACEHOLDER } from "constants/messages"; +import { HELPBAR_PLACEHOLDER } from "@appsmith/constants/messages"; import AnalyticsUtil from "utils/AnalyticsUtil"; import { isMac } from "utils/helpers"; import { filterCategories, SEARCH_CATEGORY_ID } from "./utils"; diff --git a/app/client/src/components/editorComponents/GlobalSearch/ResultsNotFound.tsx b/app/client/src/components/editorComponents/GlobalSearch/ResultsNotFound.tsx index 5ce172c1b5..054be106e5 100644 --- a/app/client/src/components/editorComponents/GlobalSearch/ResultsNotFound.tsx +++ b/app/client/src/components/editorComponents/GlobalSearch/ResultsNotFound.tsx @@ -1,7 +1,7 @@ import React from "react"; import styled from "styled-components"; import NoSearchDataImage from "assets/images/no_search_data.png"; -import { NO_SEARCH_DATA_TEXT } from "constants/messages"; +import { NO_SEARCH_DATA_TEXT } from "@appsmith/constants/messages"; import { getTypographyByKey } from "constants/DefaultTheme"; import { ReactComponent as DiscordIcon } from "assets/icons/help/discord.svg"; import AnalyticsUtil from "utils/AnalyticsUtil"; diff --git a/app/client/src/components/editorComponents/GlobalSearch/SearchBox.tsx b/app/client/src/components/editorComponents/GlobalSearch/SearchBox.tsx index 2da3628d56..9227121e9d 100644 --- a/app/client/src/components/editorComponents/GlobalSearch/SearchBox.tsx +++ b/app/client/src/components/editorComponents/GlobalSearch/SearchBox.tsx @@ -13,7 +13,7 @@ import { OMNIBAR_PLACEHOLDER_DOC, OMNIBAR_PLACEHOLDER_NAV, OMNIBAR_PLACEHOLDER_SNIPPETS, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { isMenu, SearchCategory, SEARCH_CATEGORY_ID } from "./utils"; import { ReactComponent as CloseIcon } from "assets/icons/help/close_blue.svg"; import { ReactComponent as SearchIcon } from "assets/icons/ads/search.svg"; diff --git a/app/client/src/components/editorComponents/GlobalSearch/SnippetsDescription.tsx b/app/client/src/components/editorComponents/GlobalSearch/SnippetsDescription.tsx index 0779448091..ac143e33c5 100644 --- a/app/client/src/components/editorComponents/GlobalSearch/SnippetsDescription.tsx +++ b/app/client/src/components/editorComponents/GlobalSearch/SnippetsDescription.tsx @@ -35,7 +35,7 @@ import { SNIPPET_COPY, SNIPPET_EXECUTE, SNIPPET_INSERT, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { getExpectedValue } from "utils/validation/common"; import { Toaster } from "components/ads/Toast"; import { Variant } from "components/ads/common"; diff --git a/app/client/src/components/editorComponents/GlobalSearch/utils.tsx b/app/client/src/components/editorComponents/GlobalSearch/utils.tsx index 52f2132725..b883506796 100644 --- a/app/client/src/components/editorComponents/GlobalSearch/utils.tsx +++ b/app/client/src/components/editorComponents/GlobalSearch/utils.tsx @@ -5,7 +5,7 @@ import { DOC_DESCRIPTION, NAV_DESCRIPTION, SNIPPET_DESCRIPTION, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { ValidationTypes } from "constants/WidgetValidation"; import { Datasource } from "entities/Datasource"; import { useEffect, useState } from "react"; diff --git a/app/client/src/components/editorComponents/JSResponseView.tsx b/app/client/src/components/editorComponents/JSResponseView.tsx index dda7bbb10c..5299258ac8 100644 --- a/app/client/src/components/editorComponents/JSResponseView.tsx +++ b/app/client/src/components/editorComponents/JSResponseView.tsx @@ -13,7 +13,7 @@ import { PARSING_ERROR, EMPTY_RESPONSE_FIRST_HALF, EMPTY_RESPONSE_LAST_HALF, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { EditorTheme } from "./CodeEditor/EditorConfig"; import DebuggerLogs from "./Debugger/DebuggerLogs"; import ErrorLogs from "./Debugger/Errors"; diff --git a/app/client/src/components/editorComponents/LightningMenu/LightningMenuTrigger.tsx b/app/client/src/components/editorComponents/LightningMenu/LightningMenuTrigger.tsx index 5c7b39e57f..f96fb1215c 100644 --- a/app/client/src/components/editorComponents/LightningMenu/LightningMenuTrigger.tsx +++ b/app/client/src/components/editorComponents/LightningMenu/LightningMenuTrigger.tsx @@ -1,6 +1,9 @@ import React from "react"; import { IconProps } from "constants/IconConstants"; -import { createMessage, LIGHTNING_MENU_DATA_TOOLTIP } from "constants/messages"; +import { + createMessage, + LIGHTNING_MENU_DATA_TOOLTIP, +} from "@appsmith/constants/messages"; import { Theme, Skin } from "constants/DefaultTheme"; import styled from "styled-components"; import Icon, { IconSize } from "components/ads/Icon"; diff --git a/app/client/src/components/editorComponents/LightningMenu/helpers.tsx b/app/client/src/components/editorComponents/LightningMenu/helpers.tsx index 3a32318c54..c0a52ba02f 100644 --- a/app/client/src/components/editorComponents/LightningMenu/helpers.tsx +++ b/app/client/src/components/editorComponents/LightningMenu/helpers.tsx @@ -20,7 +20,7 @@ import { LIGHTNING_MENU_QUERY_CREATE_NEW, LIGHTNING_MENU_API_CREATE_NEW, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Skin } from "constants/DefaultTheme"; import { ReduxAction } from "constants/ReduxActionConstants"; diff --git a/app/client/src/components/utils/NameEditorComponent.tsx b/app/client/src/components/utils/NameEditorComponent.tsx index e8258d1473..545b2756ad 100644 --- a/app/client/src/components/utils/NameEditorComponent.tsx +++ b/app/client/src/components/utils/NameEditorComponent.tsx @@ -15,7 +15,7 @@ import { ACTION_INVALID_NAME_ERROR, ACTION_NAME_CONFLICT_ERROR, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; type NameEditorProps = { checkForGuidedTour?: boolean; diff --git a/app/client/src/constants/Colors.tsx b/app/client/src/constants/Colors.tsx index 82bc324c41..00bead750a 100644 --- a/app/client/src/constants/Colors.tsx +++ b/app/client/src/constants/Colors.tsx @@ -93,6 +93,8 @@ export const Colors = { DANUBE: "#6A86CE", FAIR_PINK: "#FFE9E9", OPAQ_BLUE: "rgba(106, 134, 206, 0.1)", + PALE_BLUE: "#E8F5FA", + CURIOUS_BLUE: "#1D9BD1", RATE_ACTIVE: "#FFCB45", MALIBU: "#7DBCFF", ALABASTER_ALT: "#FAFAFA", diff --git a/app/client/src/constants/DefaultTheme.tsx b/app/client/src/constants/DefaultTheme.tsx index 7564de4749..42fba97c8c 100644 --- a/app/client/src/constants/DefaultTheme.tsx +++ b/app/client/src/constants/DefaultTheme.tsx @@ -2905,6 +2905,9 @@ export const theme: Theme = { leftPadding: 16, rightMargin: 12, }, + main: { + marginLeft: 112, + }, search: { height: 68, paddingTop: 30, diff --git a/app/client/src/constants/routes.ts b/app/client/src/constants/routes.ts index a9c52e2fbb..8c382bdb49 100644 --- a/app/client/src/constants/routes.ts +++ b/app/client/src/constants/routes.ts @@ -428,7 +428,12 @@ export const getOnboardingCheckListUrl = ( export const ADMIN_SETTINGS_URL = "/settings"; export const ADMIN_SETTINGS_CATEGORY_DEFAULT_URL = "/settings/general"; -export const ADMIN_SETTINGS_CATEGORY_URL = "/settings/:category"; -export function getAdminSettingsCategoryUrl(category: string) { - return `${ADMIN_SETTINGS_URL}/${category}`; +export const ADMIN_SETTINGS_CATEGORY_URL = "/settings/:category/:subCategory?"; +export function getAdminSettingsCategoryUrl( + category: string, + subCategory?: string, +) { + return `${ADMIN_SETTINGS_URL}/${category}${ + subCategory ? "/" + subCategory : "" + }`; } diff --git a/app/client/src/constants/typography.ts b/app/client/src/constants/typography.ts index 8b45b52881..73039b16de 100644 --- a/app/client/src/constants/typography.ts +++ b/app/client/src/constants/typography.ts @@ -147,6 +147,13 @@ export const typography = { fontWeight: 600, lineHeight: 12, }, + dangerHeading: { + fontStyle: "normal", + fontWeight: 500, + fontSize: 24, + lineHeight: 28, + letterSpacing: -0.24, + }, }; export type TypographyKeys = keyof typeof typography; diff --git a/app/client/src/ee/constants/forms.ts b/app/client/src/ee/constants/forms.ts new file mode 100644 index 0000000000..dbf94bb527 --- /dev/null +++ b/app/client/src/ee/constants/forms.ts @@ -0,0 +1 @@ +export * from "ce/constants/forms"; diff --git a/app/client/src/ee/constants/messages.ts b/app/client/src/ee/constants/messages.ts new file mode 100644 index 0000000000..80dc42b768 --- /dev/null +++ b/app/client/src/ee/constants/messages.ts @@ -0,0 +1 @@ +export * from "ce/constants/messages"; diff --git a/app/client/src/ee/pages/AdminSettings/BreadcrumbCategories.tsx b/app/client/src/ee/pages/AdminSettings/BreadcrumbCategories.tsx new file mode 100644 index 0000000000..8f369495a2 --- /dev/null +++ b/app/client/src/ee/pages/AdminSettings/BreadcrumbCategories.tsx @@ -0,0 +1 @@ +export * from "ce/pages/AdminSettings/BreadcrumbCategories"; diff --git a/app/client/src/ee/pages/AdminSettings/config/authentication/AuthPage.tsx b/app/client/src/ee/pages/AdminSettings/config/authentication/AuthPage.tsx new file mode 100644 index 0000000000..f56138a660 --- /dev/null +++ b/app/client/src/ee/pages/AdminSettings/config/authentication/AuthPage.tsx @@ -0,0 +1 @@ +export * from "ce/pages/AdminSettings/config/authentication/AuthPage"; diff --git a/app/client/src/ee/pages/AdminSettings/config/authentication/index.tsx b/app/client/src/ee/pages/AdminSettings/config/authentication/index.tsx new file mode 100644 index 0000000000..0e12710158 --- /dev/null +++ b/app/client/src/ee/pages/AdminSettings/config/authentication/index.tsx @@ -0,0 +1 @@ +export * from "ce/pages/AdminSettings/config/authentication/index"; diff --git a/app/client/src/ee/pages/AdminSettings/config/types.ts b/app/client/src/ee/pages/AdminSettings/config/types.ts new file mode 100644 index 0000000000..bd79a4bdc4 --- /dev/null +++ b/app/client/src/ee/pages/AdminSettings/config/types.ts @@ -0,0 +1 @@ +export * from "ce/pages/AdminSettings/config/types"; diff --git a/app/client/src/notifications/Bell.tsx b/app/client/src/notifications/Bell.tsx index 58c4b04fd2..0d90da0f4b 100644 --- a/app/client/src/notifications/Bell.tsx +++ b/app/client/src/notifications/Bell.tsx @@ -21,7 +21,10 @@ import { isNotificationsListVisibleSelector, } from "selectors/notificationSelectors"; import TooltipComponent from "components/ads/Tooltip"; -import { createMessage, NOTIFICATIONS_TOOLTIP } from "constants/messages"; +import { + createMessage, + NOTIFICATIONS_TOOLTIP, +} from "@appsmith/constants/messages"; import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants"; import { Position } from "@blueprintjs/core"; diff --git a/app/client/src/notifications/NotificationsList.tsx b/app/client/src/notifications/NotificationsList.tsx index 8bda1aea87..620a04a807 100644 --- a/app/client/src/notifications/NotificationsList.tsx +++ b/app/client/src/notifications/NotificationsList.tsx @@ -19,7 +19,7 @@ import { COMMENTS, MARK_ALL_AS_READ, NO_NOTIFICATIONS_TO_SHOW, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import Button, { Category } from "components/ads/Button"; import { getTypographyByKey } from "constants/DefaultTheme"; diff --git a/app/client/src/pages/AppViewer/viewer/GetAppViewerHeaderCTA.tsx b/app/client/src/pages/AppViewer/viewer/GetAppViewerHeaderCTA.tsx index 683e51b92b..88d76dcf1a 100644 --- a/app/client/src/pages/AppViewer/viewer/GetAppViewerHeaderCTA.tsx +++ b/app/client/src/pages/AppViewer/viewer/GetAppViewerHeaderCTA.tsx @@ -1,7 +1,12 @@ import React from "react"; import { useDispatch } from "react-redux"; import styled from "styled-components"; -import { createMessage, EDIT_APP, FORK_APP, SIGN_IN } from "constants/messages"; +import { + createMessage, + EDIT_APP, + FORK_APP, + SIGN_IN, +} from "@appsmith/constants/messages"; import { ANONYMOUS_USERNAME } from "constants/userConstants"; import { getTypographyByKey } from "constants/DefaultTheme"; import Button, { IconPositions } from "components/ads/Button"; diff --git a/app/client/src/pages/Applications/ApplicationCard.tsx b/app/client/src/pages/Applications/ApplicationCard.tsx index 99e4b7b70e..09bff99d18 100644 --- a/app/client/src/pages/Applications/ApplicationCard.tsx +++ b/app/client/src/pages/Applications/ApplicationCard.tsx @@ -54,7 +54,7 @@ import { Toaster } from "components/ads/Toast"; import { Variant } from "components/ads/common"; import { getExportAppAPIRoute } from "@appsmith/constants/ApiConstants"; import { Colors } from "constants/Colors"; -import { CONNECTED_TO_GIT, createMessage } from "constants/messages"; +import { CONNECTED_TO_GIT, createMessage } from "@appsmith/constants/messages"; type NameWrapperProps = { hasReadPermission: boolean; diff --git a/app/client/src/pages/Applications/CreateApplicationForm.tsx b/app/client/src/pages/Applications/CreateApplicationForm.tsx index d49bfbc02b..68fbeab07c 100644 --- a/app/client/src/pages/Applications/CreateApplicationForm.tsx +++ b/app/client/src/pages/Applications/CreateApplicationForm.tsx @@ -6,7 +6,7 @@ import { createMessage, ERROR_MESSAGE_NAME_EMPTY, NAME_SPACE_ERROR, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { AppState } from "reducers"; import { CreateApplicationFormValues, diff --git a/app/client/src/pages/Applications/ImportApplicationModal.tsx b/app/client/src/pages/Applications/ImportApplicationModal.tsx index 79360004ee..a2f1d1ada3 100644 --- a/app/client/src/pages/Applications/ImportApplicationModal.tsx +++ b/app/client/src/pages/Applications/ImportApplicationModal.tsx @@ -9,7 +9,7 @@ import { useDispatch } from "react-redux"; import { importApplication } from "actions/applicationActions"; import { Toaster } from "components/ads/Toast"; import { Variant } from "components/ads/common"; -import { IMPORT_APPLICATION_MODAL_TITLE } from "constants/messages"; +import { IMPORT_APPLICATION_MODAL_TITLE } from "@appsmith/constants/messages"; import FilePickerV2 from "components/ads/FilePickerV2"; const ImportButton = styled(Button)<{ disabled?: boolean }>` diff --git a/app/client/src/pages/Applications/index.tsx b/app/client/src/pages/Applications/index.tsx index 8bc8aaf00d..fd84040843 100644 --- a/app/client/src/pages/Applications/index.tsx +++ b/app/client/src/pages/Applications/index.tsx @@ -86,7 +86,7 @@ import { SEARCH_APPS, WELCOME_TOUR, NO_APPS_FOUND, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { ReactComponent as NoAppsFoundIcon } from "assets/svg/no-apps-icon.svg"; import { howMuchTimeBeforeText } from "utils/helpers"; diff --git a/app/client/src/pages/Editor/APIEditor/ApiAuthentication.tsx b/app/client/src/pages/Editor/APIEditor/ApiAuthentication.tsx index b673292a2d..af8f66f31f 100644 --- a/app/client/src/pages/Editor/APIEditor/ApiAuthentication.tsx +++ b/app/client/src/pages/Editor/APIEditor/ApiAuthentication.tsx @@ -26,7 +26,7 @@ import { SAVE_DATASOURCE, SAVE_DATASOURCE_MESSAGE, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; interface ReduxStateProps { datasource: EmbeddedRestDatasource | Datasource; diff --git a/app/client/src/pages/Editor/APIEditor/Form.tsx b/app/client/src/pages/Editor/APIEditor/Form.tsx index 7d8d12df4a..2ce4d29b63 100644 --- a/app/client/src/pages/Editor/APIEditor/Form.tsx +++ b/app/client/src/pages/Editor/APIEditor/Form.tsx @@ -47,7 +47,7 @@ import { API_EDITOR_TAB_TITLES, createMessage, WIDGET_BIND_HELP, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import AnalyticsUtil from "utils/AnalyticsUtil"; import CloseEditor from "components/editorComponents/CloseEditor"; import { useParams } from "react-router"; diff --git a/app/client/src/pages/Editor/ConfirmRunModal.tsx b/app/client/src/pages/Editor/ConfirmRunModal.tsx index c462e8d456..b370b25855 100644 --- a/app/client/src/pages/Editor/ConfirmRunModal.tsx +++ b/app/client/src/pages/Editor/ConfirmRunModal.tsx @@ -13,7 +13,7 @@ import Button, { Category, Size } from "components/ads/Button"; import { createMessage, QUERY_CONFIRMATION_MODAL_MESSAGE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; type Props = { isModalOpen: boolean; diff --git a/app/client/src/pages/Editor/DataSourceEditor/NewActionButton.tsx b/app/client/src/pages/Editor/DataSourceEditor/NewActionButton.tsx index 9094d0716f..ca590e711e 100644 --- a/app/client/src/pages/Editor/DataSourceEditor/NewActionButton.tsx +++ b/app/client/src/pages/Editor/DataSourceEditor/NewActionButton.tsx @@ -4,7 +4,7 @@ import styled from "styled-components"; import Button from "components/ads/Button"; import { createNewApiName, createNewQueryName } from "utils/AppsmithUtils"; import { Toaster } from "components/ads/Toast"; -import { ERROR_ADD_API_INVALID_URL } from "constants/messages"; +import { ERROR_ADD_API_INVALID_URL } from "@appsmith/constants/messages"; import { Classes, Variant } from "components/ads/common"; import { DEFAULT_API_ACTION_CONFIG } from "constants/ApiEditorConstants"; import { createActionRequest } from "actions/pluginActionActions"; diff --git a/app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx b/app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx index e0d36ef6c2..da21c462fc 100644 --- a/app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx +++ b/app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx @@ -44,7 +44,7 @@ import { REST_API_AUTHORIZATION_APPSMITH_ERROR, REST_API_AUTHORIZATION_FAILED, REST_API_AUTHORIZATION_SUCCESSFUL, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import Collapsible from "./Collapsible"; import _ from "lodash"; import FormLabel from "components/editorComponents/FormLabel"; diff --git a/app/client/src/pages/Editor/EditorAppName/NavigationMenuData.ts b/app/client/src/pages/Editor/EditorAppName/NavigationMenuData.ts index b536efd5df..d21ee58a72 100644 --- a/app/client/src/pages/Editor/EditorAppName/NavigationMenuData.ts +++ b/app/client/src/pages/Editor/EditorAppName/NavigationMenuData.ts @@ -32,7 +32,7 @@ import { DEPLOY_MENU_OPTION, CONNECT_TO_GIT_OPTION, CURRENT_DEPLOY_PREVIEW_OPTION, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { getCurrentApplicationId } from "selectors/editorSelectors"; import { redoAction, undoAction } from "actions/pageActions"; import { redoShortCut, undoShortCut } from "utils/helpers"; diff --git a/app/client/src/pages/Editor/EditorHeader.tsx b/app/client/src/pages/Editor/EditorHeader.tsx index 9dc5202880..6407bd7d71 100644 --- a/app/client/src/pages/Editor/EditorHeader.tsx +++ b/app/client/src/pages/Editor/EditorHeader.tsx @@ -72,7 +72,7 @@ import { RENAME_APPLICATION_TOOLTIP, SHARE_BUTTON_TOOLTIP, SHARE_BUTTON_TOOLTIP_WITH_USER, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants"; import { ReactComponent as MenuIcon } from "assets/icons/header/hamburger.svg"; import { getExplorerPinned } from "selectors/explorerSelector"; diff --git a/app/client/src/pages/Editor/EditorSaveIndicator.tsx b/app/client/src/pages/Editor/EditorSaveIndicator.tsx index 89ebb72a55..b5157799f5 100644 --- a/app/client/src/pages/Editor/EditorSaveIndicator.tsx +++ b/app/client/src/pages/Editor/EditorSaveIndicator.tsx @@ -11,7 +11,7 @@ import { getIsPageSaving, getPageSavingError } from "selectors/editorSelectors"; import { createMessage, EDITOR_HEADER_SAVE_INDICATOR, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Colors } from "constants/Colors"; import Icon from "components/ads/Icon"; diff --git a/app/client/src/pages/Editor/EntityNotFoundPane.tsx b/app/client/src/pages/Editor/EntityNotFoundPane.tsx index 0994d8114f..fce51570e1 100644 --- a/app/client/src/pages/Editor/EntityNotFoundPane.tsx +++ b/app/client/src/pages/Editor/EntityNotFoundPane.tsx @@ -6,7 +6,7 @@ import { PAGE_NOT_FOUND_ERROR, INVALID_URL_ERROR, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { useHistory } from "react-router-dom"; const Wrapper = styled.div` diff --git a/app/client/src/pages/Editor/Explorer/Actions/ActionEntityContextMenu.tsx b/app/client/src/pages/Editor/Explorer/Actions/ActionEntityContextMenu.tsx index adea46cc29..880d1176ab 100644 --- a/app/client/src/pages/Editor/Explorer/Actions/ActionEntityContextMenu.tsx +++ b/app/client/src/pages/Editor/Explorer/Actions/ActionEntityContextMenu.tsx @@ -28,7 +28,7 @@ import { CONTEXT_NO_PAGE, CONTEXT_SHOW_BINDING, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; type EntityContextMenuProps = { id: string; diff --git a/app/client/src/pages/Editor/Explorer/ContextMenuTrigger.tsx b/app/client/src/pages/Editor/Explorer/ContextMenuTrigger.tsx index 201eaea56d..def6a3408a 100644 --- a/app/client/src/pages/Editor/Explorer/ContextMenuTrigger.tsx +++ b/app/client/src/pages/Editor/Explorer/ContextMenuTrigger.tsx @@ -6,7 +6,10 @@ import { EntityTogglesWrapper } from "./ExplorerStyledComponents"; import styled from "styled-components"; import { Colors } from "constants/Colors"; import TooltipComponent from "components/ads/Tooltip"; -import { createMessage, ENTITY_MORE_ACTIONS_TOOLTIP } from "constants/messages"; +import { + createMessage, + ENTITY_MORE_ACTIONS_TOOLTIP, +} from "@appsmith/constants/messages"; import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants"; import { Position } from "@blueprintjs/core"; diff --git a/app/client/src/pages/Editor/Explorer/Datasources.tsx b/app/client/src/pages/Editor/Explorer/Datasources.tsx index f3bec68e8d..4036abfe25 100644 --- a/app/client/src/pages/Editor/Explorer/Datasources.tsx +++ b/app/client/src/pages/Editor/Explorer/Datasources.tsx @@ -13,7 +13,10 @@ import Entity from "./Entity"; import history from "utils/history"; import { INTEGRATION_EDITOR_URL, INTEGRATION_TABS } from "constants/routes"; import EntityPlaceholder from "./Entity/Placeholder"; -import { createMessage, CREATE_DATASOURCE_TOOLTIP } from "constants/messages"; +import { + createMessage, + CREATE_DATASOURCE_TOOLTIP, +} from "@appsmith/constants/messages"; import styled from "styled-components"; import ArrowRightLineIcon from "remixicon-react/ArrowRightLineIcon"; import { Colors } from "constants/Colors"; diff --git a/app/client/src/pages/Editor/Explorer/Entity/EntityProperty.tsx b/app/client/src/pages/Editor/Explorer/Entity/EntityProperty.tsx index fc688757d4..4fbf7d446f 100644 --- a/app/client/src/pages/Editor/Explorer/Entity/EntityProperty.tsx +++ b/app/client/src/pages/Editor/Explorer/Entity/EntityProperty.tsx @@ -11,7 +11,7 @@ import { Colors } from "constants/Colors"; import { Skin } from "constants/DefaultTheme"; import { EntityClassNames } from "."; import TooltipComponent from "components/ads/Tooltip"; -import { COPY_ELEMENT, createMessage } from "constants/messages"; +import { COPY_ELEMENT, createMessage } from "@appsmith/constants/messages"; import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants"; import CollapseToggle from "./CollapseToggle"; import { ReactComponent as CopyIcon } from "assets/icons/menu/copy-snippet.svg"; diff --git a/app/client/src/pages/Editor/Explorer/Entity/Name.tsx b/app/client/src/pages/Editor/Explorer/Entity/Name.tsx index 7da7f51f19..2837fecc94 100644 --- a/app/client/src/pages/Editor/Explorer/Entity/Name.tsx +++ b/app/client/src/pages/Editor/Explorer/Entity/Name.tsx @@ -12,7 +12,7 @@ import { isEllipsisActive, removeSpecialChars } from "utils/helpers"; import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants"; import { ReactComponent as BetaIcon } from "assets/icons/menu/beta.svg"; import NameEditorComponent from "components/utils/NameEditorComponent"; -import { ENTITY_EXPLORER_ACTION_NAME_CONFLICT_ERROR } from "constants/messages"; +import { ENTITY_EXPLORER_ACTION_NAME_CONFLICT_ERROR } from "@appsmith/constants/messages"; export const searchHighlightSpanClassName = "token"; export const searchTokenizationDelimiter = "!!"; diff --git a/app/client/src/pages/Editor/Explorer/Files/index.tsx b/app/client/src/pages/Editor/Explorer/Files/index.tsx index ff29645b65..44acc1e7af 100644 --- a/app/client/src/pages/Editor/Explorer/Files/index.tsx +++ b/app/client/src/pages/Editor/Explorer/Files/index.tsx @@ -1,7 +1,10 @@ import React, { useCallback, useMemo } from "react"; import { useActiveAction } from "../hooks"; import { Entity } from "../Entity/index"; -import { createMessage, ADD_QUERY_JS_TOOLTIP } from "constants/messages"; +import { + createMessage, + ADD_QUERY_JS_TOOLTIP, +} from "@appsmith/constants/messages"; import { useDispatch, useSelector } from "react-redux"; import { getCurrentPageId } from "selectors/editorSelectors"; import { ExplorerActionEntity } from "../Actions/ActionEntity"; diff --git a/app/client/src/pages/Editor/Explorer/JSActions/JSActionContextMenu.tsx b/app/client/src/pages/Editor/Explorer/JSActions/JSActionContextMenu.tsx index 495a51e172..d6ba5d958a 100644 --- a/app/client/src/pages/Editor/Explorer/JSActions/JSActionContextMenu.tsx +++ b/app/client/src/pages/Editor/Explorer/JSActions/JSActionContextMenu.tsx @@ -22,7 +22,7 @@ import { CONTEXT_NO_PAGE, CONTEXT_SHOW_BINDING, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; type EntityContextMenuProps = { id: string; diff --git a/app/client/src/pages/Editor/Explorer/Pages/index.tsx b/app/client/src/pages/Editor/Explorer/Pages/index.tsx index ba835026ff..3aab29d2f2 100644 --- a/app/client/src/pages/Editor/Explorer/Pages/index.tsx +++ b/app/client/src/pages/Editor/Explorer/Pages/index.tsx @@ -19,7 +19,7 @@ import { createMessage, ADD_PAGE_TOOLTIP, PAGE_PROPERTIES_TOOLTIP, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Page } from "constants/ReduxActionConstants"; import { getNextEntityName } from "utils/AppsmithUtils"; import { extractCurrentDSL } from "utils/WidgetPropsUtils"; diff --git a/app/client/src/pages/Editor/Explorer/Widgets/WidgetGroup.tsx b/app/client/src/pages/Editor/Explorer/Widgets/WidgetGroup.tsx index 8cfa6b2d70..ad580a1425 100644 --- a/app/client/src/pages/Editor/Explorer/Widgets/WidgetGroup.tsx +++ b/app/client/src/pages/Editor/Explorer/Widgets/WidgetGroup.tsx @@ -4,7 +4,10 @@ import EntityPlaceholder from "../Entity/Placeholder"; import Entity from "../Entity"; import WidgetEntity from "./WidgetEntity"; import { getCurrentPageId } from "selectors/editorSelectors"; -import { ADD_WIDGET_TOOLTIP, createMessage } from "constants/messages"; +import { + ADD_WIDGET_TOOLTIP, + createMessage, +} from "@appsmith/constants/messages"; import { selectWidgetsForCurrentPage } from "selectors/entitiesSelector"; import { inGuidedTour } from "selectors/onboardingSelectors"; diff --git a/app/client/src/pages/Editor/FirstTimeUserOnboarding/Checklist.tsx b/app/client/src/pages/Editor/FirstTimeUserOnboarding/Checklist.tsx index 5b9ca5e012..a64d6242b8 100644 --- a/app/client/src/pages/Editor/FirstTimeUserOnboarding/Checklist.tsx +++ b/app/client/src/pages/Editor/FirstTimeUserOnboarding/Checklist.tsx @@ -51,7 +51,7 @@ import { ONBOARDING_CHECKLIST_FOOTER, ONBOARDING_CHECKLIST_BANNER_BUTTON, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Datasource } from "entities/Datasource"; import { ActionDataState } from "reducers/entityReducers/actionsReducer"; import { CanvasWidgetsReduxState } from "reducers/entityReducers/canvasWidgetsReducer"; diff --git a/app/client/src/pages/Editor/FirstTimeUserOnboarding/IntroductionModal.tsx b/app/client/src/pages/Editor/FirstTimeUserOnboarding/IntroductionModal.tsx index df556cfec2..34a03af071 100644 --- a/app/client/src/pages/Editor/FirstTimeUserOnboarding/IntroductionModal.tsx +++ b/app/client/src/pages/Editor/FirstTimeUserOnboarding/IntroductionModal.tsx @@ -13,7 +13,7 @@ import { CHOOSE_ACCESS_CONTROL_ROLES, ONBOARDING_INTRO_FOOTER, START_TUTORIAL, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { ReduxActionTypes } from "constants/ReduxActionConstants"; import React from "react"; import { useEffect } from "react"; diff --git a/app/client/src/pages/Editor/FirstTimeUserOnboarding/Statusbar.test.tsx b/app/client/src/pages/Editor/FirstTimeUserOnboarding/Statusbar.test.tsx index 41c04291f0..35b54a85b4 100644 --- a/app/client/src/pages/Editor/FirstTimeUserOnboarding/Statusbar.test.tsx +++ b/app/client/src/pages/Editor/FirstTimeUserOnboarding/Statusbar.test.tsx @@ -10,7 +10,7 @@ import { ONBOARDING_STATUS_STEPS_FOURTH, ONBOARDING_STATUS_STEPS_FIVETH, ONBOARDING_STATUS_STEPS_SIXTH, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { useIsWidgetActionConnectionPresent } from "pages/Editor/utils"; let container: any = null; diff --git a/app/client/src/pages/Editor/FirstTimeUserOnboarding/Statusbar.tsx b/app/client/src/pages/Editor/FirstTimeUserOnboarding/Statusbar.tsx index 109287307a..f70c3123d9 100644 --- a/app/client/src/pages/Editor/FirstTimeUserOnboarding/Statusbar.tsx +++ b/app/client/src/pages/Editor/FirstTimeUserOnboarding/Statusbar.tsx @@ -33,7 +33,7 @@ import { ONBOARDING_STATUS_GET_STARTED, createMessage, ONBOARDING_STATUS_STEPS_THIRD_ALT, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { getTypographyByKey } from "constants/DefaultTheme"; import { Colors } from "constants/Colors"; diff --git a/app/client/src/pages/Editor/FirstTimeUserOnboarding/Tasks.tsx b/app/client/src/pages/Editor/FirstTimeUserOnboarding/Tasks.tsx index 88f367860d..76315b2689 100644 --- a/app/client/src/pages/Editor/FirstTimeUserOnboarding/Tasks.tsx +++ b/app/client/src/pages/Editor/FirstTimeUserOnboarding/Tasks.tsx @@ -17,7 +17,7 @@ import { ONBOARDING_TASK_WIDGET_FOOTER_ACTION, ONBOARDING_TASK_FOOTER, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { ReduxActionTypes } from "constants/ReduxActionConstants"; import { INTEGRATION_EDITOR_URL, INTEGRATION_TABS } from "constants/routes"; import { ASSETS_CDN_URL } from "constants/ThirdPartyConstants"; diff --git a/app/client/src/pages/Editor/GeneratePage/components/ActionCards.tsx b/app/client/src/pages/Editor/GeneratePage/components/ActionCards.tsx index 9f48d846ff..88a78b0e58 100644 --- a/app/client/src/pages/Editor/GeneratePage/components/ActionCards.tsx +++ b/app/client/src/pages/Editor/GeneratePage/components/ActionCards.tsx @@ -9,11 +9,9 @@ import { ExplorerURLParams } from "../../Explorer/helpers"; import { GENERATE_PAGE_ACTION_SUBTITLE, GENERATE_PAGE_ACTION_TITLE, -} from "../../../../constants/messages"; -import { BUILD_FROM_SCRATCH_ACTION_TITLE, BUILD_FROM_SCRATCH_ACTION_SUBTITLE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import AnalyticsUtil from "utils/AnalyticsUtil"; import { useSelector } from "react-redux"; import { getCurrentApplicationId } from "selectors/editorSelectors"; diff --git a/app/client/src/pages/Editor/GeneratePage/components/CrudInfoModal.tsx b/app/client/src/pages/Editor/GeneratePage/components/CrudInfoModal.tsx index 661e2dbde3..658d836933 100644 --- a/app/client/src/pages/Editor/GeneratePage/components/CrudInfoModal.tsx +++ b/app/client/src/pages/Editor/GeneratePage/components/CrudInfoModal.tsx @@ -15,7 +15,7 @@ import { GEN_CRUD_INFO_DIALOG_SUBTITLE, GEN_CRUD_SUCCESS_MESSAGE, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { getTypographyByKey } from "constants/DefaultTheme"; import { getInfoImage, getInfoThumbnail } from "constants/ImagesURL"; import ProgressiveImage, { diff --git a/app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GeneratePageForm.tsx b/app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GeneratePageForm.tsx index 9b557e2e0f..6b5a1b0117 100644 --- a/app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GeneratePageForm.tsx +++ b/app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GeneratePageForm.tsx @@ -34,7 +34,7 @@ import { GENERATE_PAGE_FORM_TITLE, createMessage, GEN_CRUD_DATASOURCE_DROPDOWN_LABEL, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { GenerateCRUDEnabledPluginMap } from "api/PluginApi"; import { useDatasourceOptions, diff --git a/app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GoogleSheetForm.tsx b/app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GoogleSheetForm.tsx index 3df4bdd075..29b53568b4 100644 --- a/app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GoogleSheetForm.tsx +++ b/app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GoogleSheetForm.tsx @@ -27,7 +27,7 @@ import { GEN_CRUD_COLUMN_HEADER_TITLE, GEN_CRUD_NO_COLUMNS, GEN_CRUD_TABLE_HEADER_TOOLTIP_DESC, -} from "constants/messages"; +} from "@appsmith/constants/messages"; type Props = { googleSheetPluginId: string; diff --git a/app/client/src/pages/Editor/GlobalHotKeys.test.tsx b/app/client/src/pages/Editor/GlobalHotKeys.test.tsx index b512ddbb68..0b2242540a 100644 --- a/app/client/src/pages/Editor/GlobalHotKeys.test.tsx +++ b/app/client/src/pages/Editor/GlobalHotKeys.test.tsx @@ -25,7 +25,10 @@ import { MAIN_CONTAINER_WIDGET_ID } from "constants/WidgetConstants"; import { generateReactKey } from "utils/generators"; import { redoAction, undoAction } from "actions/pageActions"; import { StyledToastContainer } from "components/ads/Toast"; -import { createMessage, SAVE_HOTKEY_TOASTER_MESSAGE } from "constants/messages"; +import { + createMessage, + SAVE_HOTKEY_TOASTER_MESSAGE, +} from "@appsmith/constants/messages"; describe("Canvas Hot Keys", () => { const mockGetIsFetchingPage = jest.spyOn(utilities, "getIsFetchingPage"); diff --git a/app/client/src/pages/Editor/GlobalHotKeys.tsx b/app/client/src/pages/Editor/GlobalHotKeys.tsx index 1b6a974c22..ec938e0964 100644 --- a/app/client/src/pages/Editor/GlobalHotKeys.tsx +++ b/app/client/src/pages/Editor/GlobalHotKeys.tsx @@ -41,7 +41,10 @@ import { getAppMode } from "selectors/applicationSelectors"; import { APP_MODE } from "entities/App"; import { commentModeSelector } from "selectors/commentsSelectors"; -import { createMessage, SAVE_HOTKEY_TOASTER_MESSAGE } from "constants/messages"; +import { + createMessage, + SAVE_HOTKEY_TOASTER_MESSAGE, +} from "@appsmith/constants/messages"; import { setPreviewModeAction } from "actions/editorActions"; import { previewModeSelector } from "selectors/editorSelectors"; import { getExplorerPinned } from "selectors/explorerSelector"; diff --git a/app/client/src/pages/Editor/GuidedTour/DeviationModal.tsx b/app/client/src/pages/Editor/GuidedTour/DeviationModal.tsx index c995bdc0c0..094357ae58 100644 --- a/app/client/src/pages/Editor/GuidedTour/DeviationModal.tsx +++ b/app/client/src/pages/Editor/GuidedTour/DeviationModal.tsx @@ -10,7 +10,7 @@ import { createMessage, DEVIATION, END_CONFIRMATION, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import React from "react"; import { useDispatch } from "react-redux"; import { diff --git a/app/client/src/pages/Editor/GuidedTour/EndTour.tsx b/app/client/src/pages/Editor/GuidedTour/EndTour.tsx index f61657455b..607ab205ab 100644 --- a/app/client/src/pages/Editor/GuidedTour/EndTour.tsx +++ b/app/client/src/pages/Editor/GuidedTour/EndTour.tsx @@ -1,6 +1,6 @@ import { enableGuidedTour } from "actions/onboardingActions"; import { getTypographyByKey } from "constants/DefaultTheme"; -import { createMessage, END_TUTORIAL } from "constants/messages"; +import { createMessage, END_TUTORIAL } from "@appsmith/constants/messages"; import React from "react"; import { useDispatch } from "react-redux"; import styled from "styled-components"; diff --git a/app/client/src/pages/Editor/GuidedTour/Guide.tsx b/app/client/src/pages/Editor/GuidedTour/Guide.tsx index 470b37ea03..80c7ca33b5 100644 --- a/app/client/src/pages/Editor/GuidedTour/Guide.tsx +++ b/app/client/src/pages/Editor/GuidedTour/Guide.tsx @@ -31,7 +31,7 @@ import { PROCEED, PROCEED_TO_NEXT_STEP, TITLE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; const GuideWrapper = styled.div` margin-bottom: ${(props) => props.theme.spaces[4]}px; diff --git a/app/client/src/pages/Editor/GuidedTour/TourCompletionMessage.tsx b/app/client/src/pages/Editor/GuidedTour/TourCompletionMessage.tsx index e2ee14b291..ee7c9378de 100644 --- a/app/client/src/pages/Editor/GuidedTour/TourCompletionMessage.tsx +++ b/app/client/src/pages/Editor/GuidedTour/TourCompletionMessage.tsx @@ -21,7 +21,7 @@ import { RATING_DESCRIPTION, RATING_TEXT, RATING_TITLE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { getTypographyByKey } from "constants/DefaultTheme"; const Container = styled.div` diff --git a/app/client/src/pages/Editor/GuidedTour/constants.tsx b/app/client/src/pages/Editor/GuidedTour/constants.tsx index 960051c150..022f8e9834 100644 --- a/app/client/src/pages/Editor/GuidedTour/constants.tsx +++ b/app/client/src/pages/Editor/GuidedTour/constants.tsx @@ -38,7 +38,7 @@ import { STEP_THREE_SUCCESS_TEXT, STEP_THREE_TITLE, STEP_TWO_TITLE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { getTypographyByKey } from "constants/DefaultTheme"; export const Classes = { diff --git a/app/client/src/pages/Editor/HelpButton.tsx b/app/client/src/pages/Editor/HelpButton.tsx index d6da6b6be9..bc1fc38f7f 100644 --- a/app/client/src/pages/Editor/HelpButton.tsx +++ b/app/client/src/pages/Editor/HelpButton.tsx @@ -13,7 +13,10 @@ import { useSelector } from "react-redux"; import { bootIntercom } from "utils/helpers"; import { Colors } from "constants/Colors"; import TooltipComponent from "components/ads/Tooltip"; -import { createMessage, HELP_RESOURCE_TOOLTIP } from "constants/messages"; +import { + createMessage, + HELP_RESOURCE_TOOLTIP, +} from "@appsmith/constants/messages"; import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants"; import { useCallback } from "react"; import { useState } from "react"; diff --git a/app/client/src/pages/Editor/IntegrationEditor/ActiveDataSources.tsx b/app/client/src/pages/Editor/IntegrationEditor/ActiveDataSources.tsx index a54b64d888..d32bdeee79 100644 --- a/app/client/src/pages/Editor/IntegrationEditor/ActiveDataSources.tsx +++ b/app/client/src/pages/Editor/IntegrationEditor/ActiveDataSources.tsx @@ -13,7 +13,7 @@ import { EMPTY_ACTIVE_DATA_SOURCES, GENERATE_APPLICATION_TITLE, GENERATE_APPLICATION_DESCRIPTION, -} from "constants/messages"; +} from "@appsmith/constants/messages"; const QueryHomePage = styled.div` ${thinScrollbar}; diff --git a/app/client/src/pages/Editor/IntegrationEditor/UnsupportedPluginDialog.tsx b/app/client/src/pages/Editor/IntegrationEditor/UnsupportedPluginDialog.tsx index 04b773575d..9f8fdbc633 100644 --- a/app/client/src/pages/Editor/IntegrationEditor/UnsupportedPluginDialog.tsx +++ b/app/client/src/pages/Editor/IntegrationEditor/UnsupportedPluginDialog.tsx @@ -8,12 +8,12 @@ import Dialog from "components/ads/DialogComponent"; import Icon, { IconSize } from "components/ads/Icon"; import { IconProps } from "constants/IconConstants"; import Button, { Category, Size } from "components/ads/Button"; -import { UNSUPPORTED_PLUGIN_DIALOG_MAIN_HEADING } from "constants/messages"; +import { UNSUPPORTED_PLUGIN_DIALOG_MAIN_HEADING } from "@appsmith/constants/messages"; import AnalyticsUtil from "utils/AnalyticsUtil"; import { UNSUPPORTED_PLUGIN_DIALOG_TITLE, UNSUPPORTED_PLUGIN_DIALOG_SUBTITLE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; type Props = { isModalOpen: boolean; diff --git a/app/client/src/pages/Editor/JSEditor/JSObjectNameEditor.tsx b/app/client/src/pages/Editor/JSEditor/JSObjectNameEditor.tsx index e82d7b70a2..23ab591f58 100644 --- a/app/client/src/pages/Editor/JSEditor/JSObjectNameEditor.tsx +++ b/app/client/src/pages/Editor/JSEditor/JSObjectNameEditor.tsx @@ -15,7 +15,10 @@ import { Classes } from "@blueprintjs/core"; import { saveJSObjectName } from "actions/jsActionActions"; import { getJSCollection } from "selectors/entitiesSelector"; import NameEditorComponent from "components/utils/NameEditorComponent"; -import { ACTION_NAME_PLACEHOLDER, createMessage } from "constants/messages"; +import { + ACTION_NAME_PLACEHOLDER, + createMessage, +} from "@appsmith/constants/messages"; const JSObjectNameWrapper = styled.div<{ page?: string }>` min-width: 50%; diff --git a/app/client/src/pages/Editor/MultiSelectPropertyPane/index.tsx b/app/client/src/pages/Editor/MultiSelectPropertyPane/index.tsx index 8e1a813444..2711f6786d 100644 --- a/app/client/src/pages/Editor/MultiSelectPropertyPane/index.tsx +++ b/app/client/src/pages/Editor/MultiSelectPropertyPane/index.tsx @@ -3,7 +3,7 @@ import * as Sentry from "@sentry/react"; import { createMessage, MULTI_SELECT_PROPERTY_PANE_MESSAGE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { useSelector } from "react-redux"; import { getCanvasWidgets } from "selectors/entitiesSelector"; import { getSelectedWidgets } from "selectors/ui"; diff --git a/app/client/src/pages/Editor/PagesEditor/ContextMenu.tsx b/app/client/src/pages/Editor/PagesEditor/ContextMenu.tsx index 7df8bf3859..c5e52d9ac8 100644 --- a/app/client/src/pages/Editor/PagesEditor/ContextMenu.tsx +++ b/app/client/src/pages/Editor/PagesEditor/ContextMenu.tsx @@ -16,7 +16,7 @@ import { useSelector } from "react-redux"; import { getCurrentApplicationId } from "selectors/editorSelectors"; import { Colors } from "constants/Colors"; import TooltipComponent from "components/ads/Tooltip"; -import { createMessage, SETTINGS_TOOLTIP } from "constants/messages"; +import { createMessage, SETTINGS_TOOLTIP } from "@appsmith/constants/messages"; import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants"; import { Position } from "@blueprintjs/core"; diff --git a/app/client/src/pages/Editor/PagesEditor/EditName.tsx b/app/client/src/pages/Editor/PagesEditor/EditName.tsx index 15a0a490e1..4c5cc3e7a1 100644 --- a/app/client/src/pages/Editor/PagesEditor/EditName.tsx +++ b/app/client/src/pages/Editor/PagesEditor/EditName.tsx @@ -13,7 +13,7 @@ import { Page } from "constants/ReduxActionConstants"; import EditNameInput from "pages/Editor/Explorer/Entity/Name"; import { getCurrentApplicationId } from "selectors/editorSelectors"; import TooltipComponent from "components/ads/Tooltip"; -import { createMessage, GO_TO_PAGE } from "constants/messages"; +import { createMessage, GO_TO_PAGE } from "@appsmith/constants/messages"; import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants"; import { Position } from "@blueprintjs/core"; diff --git a/app/client/src/pages/Editor/PagesEditor/PageListItem.tsx b/app/client/src/pages/Editor/PagesEditor/PageListItem.tsx index b17bda4680..4ee99ff9c8 100644 --- a/app/client/src/pages/Editor/PagesEditor/PageListItem.tsx +++ b/app/client/src/pages/Editor/PagesEditor/PageListItem.tsx @@ -25,7 +25,7 @@ import { DEFAULT_PAGE_TOOLTIP, DELETE_TOOLTIP, HIDDEN_TOOLTIP, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants"; import { Position } from "@blueprintjs/core"; diff --git a/app/client/src/pages/Editor/QueryEditor/EditorJSONtoForm.tsx b/app/client/src/pages/Editor/QueryEditor/EditorJSONtoForm.tsx index 3d8f41da8b..a9805fe6f0 100644 --- a/app/client/src/pages/Editor/QueryEditor/EditorJSONtoForm.tsx +++ b/app/client/src/pages/Editor/QueryEditor/EditorJSONtoForm.tsx @@ -50,7 +50,7 @@ import { DOCUMENTATION, DOCUMENTATION_TOOLTIP, INSPECT_ENTITY, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { useParams } from "react-router"; import { AppState } from "reducers"; import { ExplorerURLParams } from "../Explorer/helpers"; diff --git a/app/client/src/pages/Editor/ReflowBetaCard.tsx b/app/client/src/pages/Editor/ReflowBetaCard.tsx index 32c8cfa2a9..b5fbc4aed2 100644 --- a/app/client/src/pages/Editor/ReflowBetaCard.tsx +++ b/app/client/src/pages/Editor/ReflowBetaCard.tsx @@ -23,7 +23,7 @@ import { REFLOW_INFO_CARD_CONTENT_2, REFLOW_INFO_CARD_HEADER, REFLOW_LEARN_MORE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { getCurrentUser } from "selectors/usersSelectors"; import { User } from "constants/userConstants"; diff --git a/app/client/src/pages/Editor/WidgetSidebar.tsx b/app/client/src/pages/Editor/WidgetSidebar.tsx index 4b6ea4d92d..323e45d764 100644 --- a/app/client/src/pages/Editor/WidgetSidebar.tsx +++ b/app/client/src/pages/Editor/WidgetSidebar.tsx @@ -8,7 +8,10 @@ import { debounce } from "lodash"; import produce from "immer"; import { useLocation } from "react-router"; -import { createMessage, WIDGET_SIDEBAR_CAPTION } from "constants/messages"; +import { + createMessage, + WIDGET_SIDEBAR_CAPTION, +} from "@appsmith/constants/messages"; import { matchBuilderPath } from "constants/routes"; import { AppState } from "reducers"; diff --git a/app/client/src/pages/Editor/gitSync/DisconnectGitModal.tsx b/app/client/src/pages/Editor/gitSync/DisconnectGitModal.tsx index 7f3a7a7d46..6b9dc5aeef 100644 --- a/app/client/src/pages/Editor/gitSync/DisconnectGitModal.tsx +++ b/app/client/src/pages/Editor/gitSync/DisconnectGitModal.tsx @@ -29,7 +29,7 @@ import { LEARN_MORE, NONE_REVERSIBLE_MESSAGE, TYPE_PROMO_CODE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import Link from "./components/Link"; import TextInput from "components/ads/TextInput"; import Button, { Category, Size } from "components/ads/Button"; diff --git a/app/client/src/pages/Editor/gitSync/QuickGitActions/index.tsx b/app/client/src/pages/Editor/gitSync/QuickGitActions/index.tsx index 914ddf44b1..39b2653a21 100644 --- a/app/client/src/pages/Editor/gitSync/QuickGitActions/index.tsx +++ b/app/client/src/pages/Editor/gitSync/QuickGitActions/index.tsx @@ -18,7 +18,7 @@ import { createMessage, GIT_SETTINGS, CONNECT_GIT_BETA, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import Tooltip from "components/ads/Tooltip"; import { Colors } from "constants/Colors"; diff --git a/app/client/src/pages/Editor/gitSync/RepoLimitExceededErrorModal.tsx b/app/client/src/pages/Editor/gitSync/RepoLimitExceededErrorModal.tsx index 1c9489b39f..80b989aae2 100644 --- a/app/client/src/pages/Editor/gitSync/RepoLimitExceededErrorModal.tsx +++ b/app/client/src/pages/Editor/gitSync/RepoLimitExceededErrorModal.tsx @@ -27,7 +27,7 @@ import { DISCONNECT_EXISTING_REPOSITORIES, DISCONNECT_EXISTING_REPOSITORIES_INFO, CONTACT_SALES_MESSAGE_ON_INTERCOM, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import Icon, { IconSize } from "components/ads/Icon"; import Link from "./components/Link"; import { get } from "lodash"; diff --git a/app/client/src/pages/Editor/gitSync/Tabs/Deploy.tsx b/app/client/src/pages/Editor/gitSync/Tabs/Deploy.tsx index 547a1c95ad..0d1d303e52 100644 --- a/app/client/src/pages/Editor/gitSync/Tabs/Deploy.tsx +++ b/app/client/src/pages/Editor/gitSync/Tabs/Deploy.tsx @@ -11,7 +11,7 @@ import { GIT_UPSTREAM_CHANGES, PULL_CHANGES, READ_DOCUMENTATION, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import styled, { useTheme } from "styled-components"; import TextInput from "components/ads/TextInput"; import Button, { Size } from "components/ads/Button"; diff --git a/app/client/src/pages/Editor/gitSync/Tabs/GitConnection.tsx b/app/client/src/pages/Editor/gitSync/Tabs/GitConnection.tsx index 817fe53499..5ffb9b49e3 100644 --- a/app/client/src/pages/Editor/gitSync/Tabs/GitConnection.tsx +++ b/app/client/src/pages/Editor/gitSync/Tabs/GitConnection.tsx @@ -15,7 +15,7 @@ import { REMOTE_URL_INPUT_PLACEHOLDER, CONNECTING_REPO, LEARN_MORE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import styled from "styled-components"; import TextInput from "components/ads/TextInput"; import UserGitProfileSettings from "../components/UserGitProfileSettings"; @@ -46,7 +46,7 @@ import { CONNECT_BTN_LABEL, PASTE_SSH_URL_INFO, GENERATE_KEY, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { getGlobalGitConfig, getIsFetchingGlobalGitConfig, diff --git a/app/client/src/pages/Editor/gitSync/Tabs/Merge.tsx b/app/client/src/pages/Editor/gitSync/Tabs/Merge.tsx index c574bf0278..d1f3c1c6b7 100644 --- a/app/client/src/pages/Editor/gitSync/Tabs/Merge.tsx +++ b/app/client/src/pages/Editor/gitSync/Tabs/Merge.tsx @@ -11,7 +11,7 @@ import { FETCH_GIT_STATUS, IS_MERGING, MERGED_SUCCESSFULLY, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { ReactComponent as LeftArrow } from "assets/icons/ads/arrow-left-1.svg"; import styled from "styled-components"; diff --git a/app/client/src/pages/Editor/gitSync/components/BranchList.tsx b/app/client/src/pages/Editor/gitSync/components/BranchList.tsx index 1a52c88c8c..db7f25724f 100644 --- a/app/client/src/pages/Editor/gitSync/components/BranchList.tsx +++ b/app/client/src/pages/Editor/gitSync/components/BranchList.tsx @@ -28,7 +28,7 @@ import { FIND_OR_CREATE_A_BRANCH, SWITCH_BRANCHES, SYNC_BRANCHES, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Branch } from "entities/GitSync"; import Button, { Category, Size } from "components/ads/Button"; diff --git a/app/client/src/pages/Editor/gitSync/components/ConflictInfo.tsx b/app/client/src/pages/Editor/gitSync/components/ConflictInfo.tsx index bab95e62c0..f23636eca3 100644 --- a/app/client/src/pages/Editor/gitSync/components/ConflictInfo.tsx +++ b/app/client/src/pages/Editor/gitSync/components/ConflictInfo.tsx @@ -8,7 +8,7 @@ import { GIT_CONFLICTING_INFO, LEARN_MORE, OPEN_REPO, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Theme } from "constants/DefaultTheme"; import Button, { Category, Size } from "components/ads/Button"; import { useSelector } from "store"; diff --git a/app/client/src/pages/Editor/gitSync/components/DeployPreview.tsx b/app/client/src/pages/Editor/gitSync/components/DeployPreview.tsx index 5afca96f50..898d3e4fdc 100644 --- a/app/client/src/pages/Editor/gitSync/components/DeployPreview.tsx +++ b/app/client/src/pages/Editor/gitSync/components/DeployPreview.tsx @@ -15,7 +15,7 @@ import { LATEST_DP_TITLE, LATEST_DP_SUBTITLE, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import Text, { TextType, Case } from "components/ads/Text"; import { Colors } from "constants/Colors"; import SuccessTick from "pages/common/SuccessTick"; diff --git a/app/client/src/pages/Editor/gitSync/components/DeployedKeyUI.tsx b/app/client/src/pages/Editor/gitSync/components/DeployedKeyUI.tsx index 5d16239efc..1632792309 100644 --- a/app/client/src/pages/Editor/gitSync/components/DeployedKeyUI.tsx +++ b/app/client/src/pages/Editor/gitSync/components/DeployedKeyUI.tsx @@ -3,7 +3,7 @@ import { createMessage, DEPLOY_KEY_USAGE_GUIDE_MESSAGE, LEARN_MORE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import React from "react"; import styled from "styled-components"; import Text, { TextType } from "components/ads/Text"; diff --git a/app/client/src/pages/Editor/gitSync/components/GitConnectError.tsx b/app/client/src/pages/Editor/gitSync/components/GitConnectError.tsx index e19d8d8c9e..02a48dfded 100644 --- a/app/client/src/pages/Editor/gitSync/components/GitConnectError.tsx +++ b/app/client/src/pages/Editor/gitSync/components/GitConnectError.tsx @@ -4,7 +4,10 @@ import { Classes } from "components/ads/common"; import Text, { Case, FontWeight, TextType } from "components/ads/Text"; import { Colors } from "constants/Colors"; import Icon, { IconSize } from "components/ads/Icon"; -import { createMessage, READ_DOCUMENTATION } from "constants/messages"; +import { + createMessage, + READ_DOCUMENTATION, +} from "@appsmith/constants/messages"; import { useSelector } from "store"; import { getConnectingErrorDocUrl, diff --git a/app/client/src/pages/Editor/gitSync/components/GitErrorPopup.tsx b/app/client/src/pages/Editor/gitSync/components/GitErrorPopup.tsx index e18f580467..7521548ee1 100644 --- a/app/client/src/pages/Editor/gitSync/components/GitErrorPopup.tsx +++ b/app/client/src/pages/Editor/gitSync/components/GitErrorPopup.tsx @@ -12,7 +12,7 @@ import Icon, { IconSize } from "components/ads/Icon"; import { createMessage, CONFLICTS_FOUND_WHILE_PULLING_CHANGES, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Space } from "./StyledComponents"; import { Colors } from "constants/Colors"; import { get } from "lodash"; diff --git a/app/client/src/pages/Editor/gitSync/components/UserGitProfileSettings/index.tsx b/app/client/src/pages/Editor/gitSync/components/UserGitProfileSettings/index.tsx index 192817028d..ebe997d52a 100644 --- a/app/client/src/pages/Editor/gitSync/components/UserGitProfileSettings/index.tsx +++ b/app/client/src/pages/Editor/gitSync/components/UserGitProfileSettings/index.tsx @@ -7,7 +7,7 @@ import { AUTHOR_EMAIL, FORM_VALIDATION_INVALID_EMAIL, AUTHOR_NAME_CANNOT_BE_EMPTY, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import styled from "styled-components"; import TextInput, { emailValidator } from "components/ads/TextInput"; import Checkbox from "components/ads/Checkbox"; diff --git a/app/client/src/pages/Editor/gitSync/constants.ts b/app/client/src/pages/Editor/gitSync/constants.ts index e88f70e1b9..afe8774d88 100644 --- a/app/client/src/pages/Editor/gitSync/constants.ts +++ b/app/client/src/pages/Editor/gitSync/constants.ts @@ -3,7 +3,7 @@ import { GIT_CONNECTION, DEPLOY, MERGE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; export enum MENU_ITEM { GIT_CONNECTION = "GIT_CONNECTION", diff --git a/app/client/src/pages/Settings/DisconnectService.tsx b/app/client/src/pages/Settings/DisconnectService.tsx new file mode 100644 index 0000000000..b023dce436 --- /dev/null +++ b/app/client/src/pages/Settings/DisconnectService.tsx @@ -0,0 +1,58 @@ +import React from "react"; +import styled from "styled-components"; +import { Variant } from "components/ads/common"; +import Button from "components/ads/Button"; +import { Callout } from "components/ads/CalloutV2"; +import { createMessage, DANGER_ZONE } from "@appsmith/constants/messages"; +import { Colors } from "constants/Colors"; +import { getTypographyByKey } from "constants/DefaultTheme"; + +export const Container = styled.div` + width: 100%; + padding: 16px 0; +`; + +export const DisconnectButton = styled(Button)` + display: inline-block; + padding: 10px 20px; + font-size: 13px; + height: 38px; + margin-top: 16px; + background: ${Colors.CRIMSON}; + border: 2px solid ${Colors.CRIMSON}; +`; + +export const Header = styled.h2` + ${(props) => getTypographyByKey(props, "dangerHeading")} + text-align: left; +`; + +export const HeaderDanger = styled(Header)` + color: ${Colors.CRIMSON}; +`; + +export const Info = styled.h3` + display: block; + ${(props) => getTypographyByKey(props, "p3")} + text-align: left; + margin: 8px 0; +`; + +export function DisconnectService(props: { + disconnect: () => void; + subHeader: string; + warning: string; +}) { + return ( + + {createMessage(DANGER_ZONE)} + {props.subHeader} + + + + ); +} diff --git a/app/client/src/pages/Settings/Main/Button.test.tsx b/app/client/src/pages/Settings/FormGroup/Button.test.tsx similarity index 96% rename from app/client/src/pages/Settings/Main/Button.test.tsx rename to app/client/src/pages/Settings/FormGroup/Button.test.tsx index 9025fcdcbd..6c6890c82f 100644 --- a/app/client/src/pages/Settings/Main/Button.test.tsx +++ b/app/client/src/pages/Settings/FormGroup/Button.test.tsx @@ -1,12 +1,13 @@ import { render, screen } from "test/testUtils"; import React from "react"; -import { SettingTypes } from "../SettingsConfig"; +import { SettingTypes } from "@appsmith/pages/AdminSettings/config/types"; import ButtonComponent from "./Button"; let container: any = null; const buttonClickHandler = jest.fn(); const buttonIsDisabled = jest.fn(); const setting = { + id: "SETTING_ID", text: "download", action: buttonClickHandler, category: "test", diff --git a/app/client/src/pages/Settings/Main/Button.tsx b/app/client/src/pages/Settings/FormGroup/Button.tsx similarity index 100% rename from app/client/src/pages/Settings/Main/Button.tsx rename to app/client/src/pages/Settings/FormGroup/Button.tsx diff --git a/app/client/src/pages/Settings/Main/Common.tsx b/app/client/src/pages/Settings/FormGroup/Common.tsx similarity index 93% rename from app/client/src/pages/Settings/Main/Common.tsx rename to app/client/src/pages/Settings/FormGroup/Common.tsx index 845424ec51..1630cc9d05 100644 --- a/app/client/src/pages/Settings/Main/Common.tsx +++ b/app/client/src/pages/Settings/FormGroup/Common.tsx @@ -1,10 +1,10 @@ import Tooltip from "components/ads/Tooltip"; -import { createMessage } from "constants/messages"; +import { createMessage } from "@appsmith/constants/messages"; import React from "react"; import styled from "styled-components"; import Icon, { IconSize } from "components/ads/Icon"; import { getTypographyByKey } from "constants/DefaultTheme"; -import { Setting } from "../SettingsConfig"; +import { Setting } from "@appsmith/pages/AdminSettings/config/types"; import { Colors } from "constants/Colors"; type FieldHelperProps = { @@ -18,7 +18,7 @@ const StyledIcon = styled(Icon)` `; export const StyledFormGroup = styled.div` - width: 357px; + width: 634px; margin-bottom: ${(props) => props.theme.spaces[11]}px; & span.bp3-popover-target { display: inline-block; diff --git a/app/client/src/pages/Settings/Main/Group.test.tsx b/app/client/src/pages/Settings/FormGroup/Group.test.tsx similarity index 96% rename from app/client/src/pages/Settings/Main/Group.test.tsx rename to app/client/src/pages/Settings/FormGroup/Group.test.tsx index 4ba4fa5498..ed9206d3a7 100644 --- a/app/client/src/pages/Settings/Main/Group.test.tsx +++ b/app/client/src/pages/Settings/FormGroup/Group.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from "test/testUtils"; import React from "react"; -import { SettingTypes } from "../SettingsConfig"; +import { SettingTypes } from "@appsmith/pages/AdminSettings/config/types"; import Group from "./group"; import { SETTINGS_FORM_NAME } from "constants/forms"; import { reduxForm } from "redux-form"; @@ -8,6 +8,7 @@ import { reduxForm } from "redux-form"; let container: any = null; const settings = [ { + id: "test", name: "test", label: "formGroup", helpText: "", @@ -19,7 +20,7 @@ const settings = [ function renderComponent() { function GroupComponent() { - return ; + return ; } const Parent = reduxForm({ validate: () => { diff --git a/app/client/src/pages/Settings/Main/Link.test.tsx b/app/client/src/pages/Settings/FormGroup/Link.test.tsx similarity index 95% rename from app/client/src/pages/Settings/Main/Link.test.tsx rename to app/client/src/pages/Settings/FormGroup/Link.test.tsx index 2066d7c06a..d63b2b2018 100644 --- a/app/client/src/pages/Settings/Main/Link.test.tsx +++ b/app/client/src/pages/Settings/FormGroup/Link.test.tsx @@ -1,11 +1,12 @@ import { render, screen } from "test/testUtils"; import React from "react"; -import { SettingTypes } from "../SettingsConfig"; +import { SettingTypes } from "@appsmith/pages/AdminSettings/config/types"; import Link from "./Link"; let container: any = null; const linkClickHandler = jest.fn(); const setting = { + id: "SETTING_ID", isHidden: false, label: "setting label", action: linkClickHandler, diff --git a/app/client/src/pages/Settings/Main/Link.tsx b/app/client/src/pages/Settings/FormGroup/Link.tsx similarity index 93% rename from app/client/src/pages/Settings/Main/Link.tsx rename to app/client/src/pages/Settings/FormGroup/Link.tsx index 34d962d058..28adcc04c2 100644 --- a/app/client/src/pages/Settings/Main/Link.tsx +++ b/app/client/src/pages/Settings/FormGroup/Link.tsx @@ -1,7 +1,7 @@ import { Icon } from "@blueprintjs/core"; import Text, { TextType } from "components/ads/Text"; import { Colors } from "constants/Colors"; -import { createMessage } from "constants/messages"; +import { createMessage } from "@appsmith/constants/messages"; import React from "react"; import { useDispatch } from "react-redux"; import styled from "styled-components"; @@ -61,7 +61,7 @@ export default function Link({ setting }: SettingComponentProps) { } return ( diff --git a/app/client/src/pages/Settings/Main/Text.test.tsx b/app/client/src/pages/Settings/FormGroup/Text.test.tsx similarity index 92% rename from app/client/src/pages/Settings/Main/Text.test.tsx rename to app/client/src/pages/Settings/FormGroup/Text.test.tsx index 1a05c49d96..c747cb1b0c 100644 --- a/app/client/src/pages/Settings/Main/Text.test.tsx +++ b/app/client/src/pages/Settings/FormGroup/Text.test.tsx @@ -1,11 +1,12 @@ import { render, screen } from "test/testUtils"; import React from "react"; -import { SettingTypes } from "../SettingsConfig"; +import { SettingTypes } from "@appsmith/pages/AdminSettings/config/types"; import TextComponent from "./Text"; let container: any = null; const buttonClickHandler = jest.fn(); const setting = { + id: "SETTING_ID", name: "textType", text: "download", action: buttonClickHandler, diff --git a/app/client/src/pages/Settings/Main/Text.tsx b/app/client/src/pages/Settings/FormGroup/Text.tsx similarity index 79% rename from app/client/src/pages/Settings/Main/Text.tsx rename to app/client/src/pages/Settings/FormGroup/Text.tsx index 7a2940dafc..48fb2053f5 100644 --- a/app/client/src/pages/Settings/Main/Text.tsx +++ b/app/client/src/pages/Settings/FormGroup/Text.tsx @@ -18,11 +18,13 @@ export default function TextComponent({ setting }: SettingComponentProps) { const value = setting.name && settingsConfig && settingsConfig[setting.name]; return ( - - - {value} - - + {value && ( + + + {value} + + + )} ); } diff --git a/app/client/src/pages/Settings/Main/TextInput.tsx b/app/client/src/pages/Settings/FormGroup/TextInput.tsx similarity index 90% rename from app/client/src/pages/Settings/Main/TextInput.tsx rename to app/client/src/pages/Settings/FormGroup/TextInput.tsx index 88bf85b42f..c468da8f91 100644 --- a/app/client/src/pages/Settings/Main/TextInput.tsx +++ b/app/client/src/pages/Settings/FormGroup/TextInput.tsx @@ -1,5 +1,5 @@ import FormTextField from "components/ads/formFields/TextField"; -import { createMessage } from "constants/messages"; +import { createMessage } from "@appsmith/constants/messages"; import React from "react"; import { FormGroup, SettingComponentProps } from "./Common"; diff --git a/app/client/src/pages/Settings/Main/Toggle.tsx b/app/client/src/pages/Settings/FormGroup/Toggle.tsx similarity index 93% rename from app/client/src/pages/Settings/Main/Toggle.tsx rename to app/client/src/pages/Settings/FormGroup/Toggle.tsx index 12e2c0554b..f67cc82d26 100644 --- a/app/client/src/pages/Settings/Main/Toggle.tsx +++ b/app/client/src/pages/Settings/FormGroup/Toggle.tsx @@ -8,13 +8,13 @@ import styled from "styled-components"; import { FormGroup, SettingComponentProps } from "./Common"; import { FormTextFieldProps } from "components/ads/formFields/TextField"; import Toggle from "components/ads/Toggle"; -import { createMessage } from "constants/messages"; +import { createMessage } from "@appsmith/constants/messages"; const ToggleWrapper = styled.div``; const ToggleStatus = styled.span` position: relative; - top: -5px; + top: -10px; left: 68px; `; @@ -52,10 +52,6 @@ const StyledFieldToggleGroup = styled.div` } `; -const Spacing = styled.div` - height: 20px; -`; - export function ToggleComponent({ setting }: SettingComponentProps) { return ( @@ -64,7 +60,6 @@ export function ToggleComponent({ setting }: SettingComponentProps) { component={FieldToggleWithToggleText(setting.toggleText)} name={setting.name} /> - ); diff --git a/app/client/src/pages/Settings/Main/common.test.tsx b/app/client/src/pages/Settings/FormGroup/common.test.tsx similarity index 95% rename from app/client/src/pages/Settings/Main/common.test.tsx rename to app/client/src/pages/Settings/FormGroup/common.test.tsx index 94a61be487..424a99f0c8 100644 --- a/app/client/src/pages/Settings/Main/common.test.tsx +++ b/app/client/src/pages/Settings/FormGroup/common.test.tsx @@ -1,10 +1,11 @@ import { render, screen } from "test/testUtils"; import React from "react"; -import { SettingTypes } from "../SettingsConfig"; +import { SettingTypes } from "@appsmith/pages/AdminSettings/config/types"; import { FormGroup } from "./Common"; let container: any = null; const setting = { + id: "SETTING_ID", label: "formGroup", helpText: "", subText: "", diff --git a/app/client/src/pages/Settings/Main/group.tsx b/app/client/src/pages/Settings/FormGroup/group.tsx similarity index 72% rename from app/client/src/pages/Settings/Main/group.tsx rename to app/client/src/pages/Settings/FormGroup/group.tsx index 7949a6d850..06c4db26a1 100644 --- a/app/client/src/pages/Settings/Main/group.tsx +++ b/app/client/src/pages/Settings/FormGroup/group.tsx @@ -1,8 +1,10 @@ import React from "react"; import styled from "styled-components"; -import { Setting, SettingTypes } from "../SettingsConfig"; +import { + Setting, + SettingTypes, +} from "@appsmith/pages/AdminSettings/config/types"; import { StyledLabel } from "./Common"; -import Link from "./Link"; import TextInput from "./TextInput"; import Toggle from "./Toggle"; import Text from "./Text"; @@ -10,12 +12,15 @@ import Button from "./Button"; import { getFormValues } from "redux-form"; import { SETTINGS_FORM_NAME } from "constants/forms"; import { useSelector } from "store"; -import { createMessage } from "constants/messages"; +import { createMessage } from "@appsmith/constants/messages"; +import { Callout } from "components/ads/CalloutV2"; type GroupProps = { name?: string; settings?: Setting[]; isHidden?: boolean; + category?: string; + subCategory?: string; }; const GroupWrapper = styled.div` @@ -37,11 +42,22 @@ const GroupBody = styled.div` & .hide { display: none; } + & .callout-link { + max-width: 634px; + > div { + margin-top: 0px; + } + } `; const formValuesSelector = getFormValues(SETTINGS_FORM_NAME); -export default function Group({ name, settings }: GroupProps) { +export default function Group({ + category, + name, + settings, + subCategory, +}: GroupProps) { const state = useSelector((state) => state); return ( @@ -50,8 +66,10 @@ export default function Group({ name, settings }: GroupProps) { {settings && settings.map((setting) => { if ( - setting.isVisible && - !setting.isVisible(formValuesSelector(state)) + (setting.isVisible && + !setting.isVisible(formValuesSelector(state))) || + (setting.category !== category && + setting.category !== subCategory) ) { return null; } @@ -79,11 +97,19 @@ export default function Group({ name, settings }: GroupProps) { case SettingTypes.LINK: return (
    - + setting.label || "")} + type="Info" + url={setting.url} + />
    ); case SettingTypes.TEXT: @@ -113,7 +139,12 @@ export default function Group({ name, settings }: GroupProps) { data-testid="admin-settings-group" key={setting.name} > - + ); } diff --git a/app/client/src/pages/Settings/LeftPane.tsx b/app/client/src/pages/Settings/LeftPane.tsx index 10b5eba741..e6f27bd42a 100644 --- a/app/client/src/pages/Settings/LeftPane.tsx +++ b/app/client/src/pages/Settings/LeftPane.tsx @@ -3,7 +3,8 @@ import { getAdminSettingsCategoryUrl } from "constants/routes"; import React from "react"; import { Link, useParams } from "react-router-dom"; import styled from "styled-components"; -import { SettingsFactory } from "./SettingsConfig"; +import AdminConfig from "./config"; +import { Category } from "@appsmith/pages/AdminSettings/config/types"; const Wrapper = styled.div` flex-basis: ${(props) => @@ -15,19 +16,22 @@ const Wrapper = styled.div` const HeaderContainer = styled.div``; const StyledHeader = styled.div` - font-size: 20px; - text-transform: capitalize; + font-size: 14px; + height: 20px; + line-height: 17px; + letter-spacing: -0.24px; + text-transform: uppercase; margin: 40px 16px 16px; color: ${Colors.MASALA}; `; const CategoryList = styled.ul` margin: 0; - padding: 0; + padding: 0 0 0 16px; list-style-type: none; `; -const Category = styled.li``; +const CategoryItem = styled.li``; const StyledLink = styled(Link)<{ $active: boolean }>` height: 38px; @@ -51,43 +55,68 @@ const StyledLink = styled(Link)<{ $active: boolean }>` `; function useSettingsCategory() { - return Array.from(SettingsFactory.categories) - .map((setting: string) => { - return { - label: setting.replace(/-/g, " "), - slug: setting, - }; - }) - .sort((a, b) => { - if (a.label == "general") return -1; - else if (b.label == "general") return 1; - if (a.label == "advanced") return 1; - else if (b.label == "advanced") return -1; - return a.label < b.label ? -1 : 1; - }); + return Array.from(AdminConfig.categories); +} + +function Categories({ + categories, + currentCategory, + currentSubCategory, + parentCategory, + showSubCategory, +}: { + categories?: Category[]; + parentCategory?: Category; + currentCategory: string; + currentSubCategory?: string; + showSubCategory?: boolean; +}) { + return ( + + {categories?.map((config) => ( + + + {config.title} + + {showSubCategory && ( + + )} + + ))} + + ); } export default function LeftPane() { const categories = useSettingsCategory(); - const { category } = useParams() as any; + const { category, subCategory } = useParams() as any; return ( Appsmith Admin - - {categories.map((config) => ( - - - {config.label} - - - ))} - + ); } diff --git a/app/client/src/pages/Settings/Main.tsx b/app/client/src/pages/Settings/Main.tsx index 2e43ea2dbd..276aa54d1d 100644 --- a/app/client/src/pages/Settings/Main.tsx +++ b/app/client/src/pages/Settings/Main.tsx @@ -1,230 +1,27 @@ -import React, { useCallback, useEffect } from "react"; -import { Icon } from "@blueprintjs/core"; -import { saveSettings } from "actions/settingsAction"; -import Button, { Category } from "components/ads/Button"; -import { SETTINGS_FORM_NAME } from "constants/forms"; -import { createMessage } from "constants/messages"; -import { ReduxActionTypes } from "constants/ReduxActionConstants"; -import { - APPLICATIONS_URL, - ADMIN_SETTINGS_CATEGORY_DEFAULT_URL, -} from "constants/routes"; -import _ from "lodash"; -import ProductUpdatesModal from "pages/Applications/ProductUpdatesModal"; -import { connect, useDispatch } from "react-redux"; -import { - Redirect, - RouteComponentProps, - useParams, - withRouter, -} from "react-router"; -import { AppState } from "reducers"; -import { formValueSelector, InjectedFormProps, reduxForm } from "redux-form"; -import { - getSettings, - getSettingsSavingState, - getShowReleaseNotes, -} from "selectors/settingsSelectors"; -import styled from "styled-components"; -import history from "utils/history"; -import Group from "./Main/group"; -import RestartBanner from "./RestartBanner"; -import { SettingsFactory, SettingTypes } from "./SettingsConfig"; +import AdminConfig from "./config"; +import { Redirect, useParams } from "react-router"; +import { SettingCategories } from "@appsmith/pages/AdminSettings/config/types"; +import { ADMIN_SETTINGS_CATEGORY_DEFAULT_URL } from "../../constants/routes"; +import React from "react"; +import SettingsForm from "./SettingsForm"; -const Wrapper = styled.div` - flex-basis: calc(100% - ${(props) => props.theme.homePage.leftPane.width}px); - padding-left: ${(props) => - props.theme.homePage.leftPane.rightMargin + - props.theme.homePage.leftPane.leftPadding}px; - padding-top: 40px; - height: calc(100vh - ${(props) => props.theme.homePage.header}px); - overflow: auto; -`; +const Main = () => { + const params = useParams() as any; + const { category, subCategory } = params; + const wrapperCategory = + AdminConfig.wrapperCategories[subCategory ?? category]; -const BackButton = styled.div` - display: inline-block; - cursor: pointer; -`; - -const BackButtonText = styled.span``; - -const SettingsFormWrapper = styled.div``; - -const SettingsButtonWrapper = styled.div` - position: fixed; - bottom: 0; - left: 0; - width: 100%; - height: ${(props) => props.theme.settings.footerHeight}px; - padding: ${(props) => props.theme.spaces[11]}px 0px 0px - ${(props) => - props.theme.spaces[6] + - props.theme.homePage.leftPane.leftPadding + - props.theme.homePage.leftPane.rightMargin + - props.theme.homePage.leftPane.width}px; - box-shadow: ${(props) => props.theme.settings.footerShadow}; - z-index: 2; - background-color: ${(props) => props.theme.colors.homepageBackground}; -`; - -const StyledButton = styled(Button)` - height: 24px; - display: inline-block; - margin-right: 16px; -`; - -const StyledSaveButton = styled(StyledButton)` - width: 128px; - height: 38px; - - & .cs-spinner { - top: 11px; - } -`; - -const StyledClearButton = styled(StyledButton)` - width: 68px; - height: 38px; -`; - -export const BottomSpace = styled.div` - height: ${(props) => props.theme.settings.footerHeight + 20}px; -`; - -export const SettingsHeader = styled.h2` - font-size: 24px; - font-weight: 500; - text-transform: capitalize; - margin-bottom: 0; -`; - -type MainProps = { - settings: Record; - settingsConfig: Record; - isSaving: boolean; - showReleaseNotes: boolean; -}; - -function getSettingLabel(name = "") { - return name.replace(/-/g, " "); -} - -function useSettings(category: string) { - return SettingsFactory.get(category); -} - -export function Main( - props: InjectedFormProps & RouteComponentProps & MainProps, -) { - const { category } = useParams() as any; - const settings = useSettings(category); - const dispatch = useDispatch(); - const isSavable = SettingsFactory.savableCategories.has(category); - const onBack = () => { - history.push(APPLICATIONS_URL); - }; - const onSave = () => { - dispatch(saveSettings(props.settings)); - }; - - const onClear = () => { - _.forEach(props.settingsConfig, (value, settingName) => { - const setting = SettingsFactory.settingsMap[settingName]; - if (setting && setting.controlType == SettingTypes.TOGGLE) { - props.settingsConfig[settingName] = - props.settingsConfig[settingName].toString() == "true"; - } - }); - props.initialize(props.settingsConfig); - }; - - useEffect(onClear, []); - - const onReleaseNotesClose = useCallback(() => { - dispatch({ - type: ReduxActionTypes.TOGGLE_RELEASE_NOTES, - payload: false, - }); - }, []); - - if (!SettingsFactory.categories.has(category)) { + if (!!wrapperCategory && !!wrapperCategory.component) { + const { component: WrapperCategoryComponent } = wrapperCategory; + return ; + } else if ( + !Object.values(SettingCategories).includes(category) || + (subCategory && !Object.values(SettingCategories).includes(subCategory)) + ) { return ; + } else { + return ; } - - return ( - - - -  Back - - - {getSettingLabel(category)} settings - - {isSavable && ( - - "Save & Restart")} - /> - "Reset")} - /> - - )} - - - {props.showReleaseNotes && ( - - )} - - - ); -} - -const validate = (values: Record) => { - const errors: any = {}; - _.filter(values, (value, name) => { - const message = SettingsFactory.validate(name, value); - if (message) { - errors[name] = message; - } - }); - return errors; }; -const selector = formValueSelector(SETTINGS_FORM_NAME); -export default withRouter( - connect((state: AppState) => { - const settingsConfig = getSettings(state); - const newProps: any = { - settings: {}, - settingsConfig, - isSaving: getSettingsSavingState(state), - showReleaseNotes: getShowReleaseNotes(state), - }; - _.forEach(SettingsFactory.settingsMap, (setting, name) => { - const fieldValue = selector(state, name); - - if (fieldValue !== settingsConfig[name]) { - newProps.settings[name] = fieldValue; - } - }); - return newProps; - }, null)( - reduxForm({ - validate, - form: SETTINGS_FORM_NAME, - touchOnBlur: true, - })(Main), - ), -); +export default Main; diff --git a/app/client/src/pages/Settings/RestartBanner.tsx b/app/client/src/pages/Settings/RestartBanner.tsx index 4150d833ad..c26bb8ac69 100644 --- a/app/client/src/pages/Settings/RestartBanner.tsx +++ b/app/client/src/pages/Settings/RestartBanner.tsx @@ -15,19 +15,20 @@ import { RESTART_BANNER_HEADER, RESTART_ERROR_BODY, RESTART_ERROR_HEADER, -} from "constants/messages"; +} from "@appsmith/constants/messages"; const HeaderContents = styled.div` display: flex; - justify-content: space-between; + justify-content: center; align-items: center; - padding-bottom: ${(props) => props.theme.spaces[7]}px; + padding-bottom: ${(props) => props.theme.spaces[3]}px; `; const Heading = styled.div` color: ${(props) => props.theme.colors.modal.headerText}; display: flex; justify-content: center; + align-items: baseline; font-weight: ${(props) => props.theme.typography.h1.fontWeight}; font-size: ${(props) => props.theme.typography.h1.fontSize}px; line-height: ${(props) => props.theme.typography.h1.lineHeight}px; @@ -35,11 +36,11 @@ const Heading = styled.div` `; const RestartMessage = styled.p` - transform: translate(0, -16px); + text-align: center; `; const StyledSpinner = styled.span` - transform: translate(16px, 1px); + margin-left: 10px; `; function Header() { diff --git a/app/client/src/pages/Settings/SaveSettings.tsx b/app/client/src/pages/Settings/SaveSettings.tsx new file mode 100644 index 0000000000..4ebf974f10 --- /dev/null +++ b/app/client/src/pages/Settings/SaveSettings.tsx @@ -0,0 +1,72 @@ +import Button, { Category } from "components/ads/Button"; +import { createMessage } from "@appsmith/constants/messages"; +import React from "react"; +import styled from "styled-components"; + +const StyledButton = styled(Button)` + height: 24px; + display: inline-block; + margin-right: 16px; +`; + +const StyledSaveButton = styled(StyledButton)` + width: 128px; + height: 38px; + + & .cs-spinner { + top: 11px; + } +`; + +const StyledClearButton = styled(StyledButton)` + width: 68px; + height: 38px; +`; + +const SettingsButtonWrapper = styled.div` + position: fixed; + bottom: 0; + left: 0; + width: 100%; + height: ${(props) => props.theme.settings.footerHeight}px; + padding: ${(props) => props.theme.spaces[11]}px 0px 0px + ${(props) => + props.theme.homePage.leftPane.leftPadding + + props.theme.homePage.leftPane.width + + props.theme.homePage.main.marginLeft - + props.theme.spaces[11]}px; + box-shadow: ${(props) => props.theme.settings.footerShadow}; + z-index: 2; + background-color: ${(props) => props.theme.colors.homepageBackground}; +`; + +const saveAdminSettings = (props: { + isSaving?: boolean; + onSave?: () => void; + onClear?: () => void; + settings: Record; + valid: boolean; +}) => { + return ( + + "Save & Restart")} + /> + "Reset")} + /> + + ); +}; +export default saveAdminSettings; diff --git a/app/client/src/pages/Settings/SettingsBreadcrumbs.tsx b/app/client/src/pages/Settings/SettingsBreadcrumbs.tsx new file mode 100644 index 0000000000..5618610511 --- /dev/null +++ b/app/client/src/pages/Settings/SettingsBreadcrumbs.tsx @@ -0,0 +1,26 @@ +import React from "react"; +import Breadcrumbs from "components/ads/Breadcrumbs"; +import { BreadcrumbCategories } from "@appsmith/pages/AdminSettings/BreadcrumbCategories"; + +export const getBreadcrumbList = (category: string, subCategory?: string) => { + const breadcrumbList = [ + BreadcrumbCategories.HOMEPAGE, + ...(subCategory + ? [BreadcrumbCategories[category], BreadcrumbCategories[subCategory]] + : [BreadcrumbCategories[category]]), + ]; + + return breadcrumbList; +}; + +function SettingsBreadcrumbs({ + category, + subCategory, +}: { + category: string; + subCategory?: string; +}) { + return ; +} + +export default SettingsBreadcrumbs; diff --git a/app/client/src/pages/Settings/SettingsConfig.ts b/app/client/src/pages/Settings/SettingsConfig.ts deleted file mode 100644 index da794ed81a..0000000000 --- a/app/client/src/pages/Settings/SettingsConfig.ts +++ /dev/null @@ -1,419 +0,0 @@ -import { apiRequestConfig } from "api/Api"; -import UserApi from "api/UserApi"; -import { ReduxAction, ReduxActionTypes } from "constants/ReduxActionConstants"; -import { - EMAIL_SETUP_DOC, - GITHUB_SIGNUP_SETUP_DOC, - GOOGLE_MAPS_SETUP_DOC, - GOOGLE_SIGNUP_SETUP_DOC, -} from "constants/ThirdPartyConstants"; -import { isNil, omitBy } from "lodash"; -import { Dispatch } from "react"; -import { isEmail } from "utils/formhelpers"; - -export enum SettingTypes { - TEXTINPUT = "TEXTINPUT", - TOGGLE = "TOGGLE", - LINK = "LINK", - BUTTON = "BUTTON", - GROUP = "GROUP", - TEXT = "TEXT", -} - -export enum SettingSubtype { - EMAIL = "email", - TEXT = "text", - NUMBER = "number", - PASSWORD = "password", -} - -export type Setting = { - category: string; - controlType: SettingTypes; - controlSubType?: SettingSubtype; - helpText?: string; - label?: string; - name?: string; - placeholder?: string; - validate?: (value: string, setting?: Setting) => string | void; - url?: string; - children?: any; - subCategory?: string; - value?: string; - text?: string; - action?: ( - dispatch?: Dispatch>, - settings?: Record, - ) => void; - sortOrder?: number; - subText?: string; - toggleText?: (value: boolean) => string; - isVisible?: (values: Record) => boolean; - isHidden?: boolean; - isDisabled?: (values: Record) => boolean; -}; - -export class SettingsFactory { - static settingsMap: Record = {}; - static settings: Setting[] = []; - static categories: Set = new Set(); - static savableCategories: Set = new Set(); - static sortOrder = 0; - static subCategoryMap: Record = {}; - - static register(name: string, options: Setting) { - SettingsFactory.categories.add(options.category); - SettingsFactory.settingsMap[name] = { - ...options, - sortOrder: ++SettingsFactory.sortOrder, - }; - if ( - options.controlType !== SettingTypes.GROUP && - options.controlType !== SettingTypes.LINK && - options.controlType !== SettingTypes.TEXT - ) { - SettingsFactory.savableCategories.add(options.category); - } - - if (options.subCategory) { - if ( - !SettingsFactory.subCategoryMap[ - `${options.category}.${options.subCategory}` - ] - ) { - SettingsFactory.subCategoryMap[ - `${options.category}.${options.subCategory}` - ] = { - name: options.subCategory, - category: options.category, - controlType: SettingTypes.GROUP, - children: [], - }; - SettingsFactory.settings.push( - SettingsFactory.subCategoryMap[ - `${options.category}.${options.subCategory}` - ], - ); - } - SettingsFactory.subCategoryMap[ - `${options.category}.${options.subCategory}` - ].children.push({ - name, - ...options, - }); - } else { - SettingsFactory.settings.push({ - name, - ...options, - }); - } - } - - static validate(name: string, value: string) { - const setting = SettingsFactory.settingsMap[name]; - if (setting?.validate) { - return setting.validate(value, setting); - } - - return ""; - } - - static get(category: string) { - SettingsFactory.settings.forEach((setting) => { - setting.isHidden = setting.category !== category; - }); - - return SettingsFactory.settings; - } -} - -//EMAIL -SettingsFactory.register("APPSMITH_MAIL_READ_MORE", { - category: "email", - controlType: SettingTypes.LINK, - label: "How to configure?", - url: EMAIL_SETUP_DOC, -}); - -SettingsFactory.register("APPSMITH_MAIL_HOST", { - category: "email", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "SMTP Host", - placeholder: "email-smtp.us-east-2.amazonaws.com", -}); - -SettingsFactory.register("APPSMITH_MAIL_PORT", { - category: "email", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.NUMBER, - placeholder: "25", - label: "SMTP Port", - validate: (value: string) => { - const port = parseInt(value); - if (value && (typeof port != "number" || port < 0 || port > 65535)) { - return "Please enter a valid port"; - } - }, -}); - -SettingsFactory.register("APPSMITH_MAIL_FROM", { - category: "email", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "From Address", - placeholder: "admin@appsmith.com", - validate: (value: string) => { - if (value && !isEmail(value)) { - return "Please enter a valid email id"; - } - }, - subText: - "You will need to verify your from email address to begin sending emails", -}); - -SettingsFactory.register("APPSMITH_MAIL_SMTP_TLS_ENABLED", { - category: "email", - controlType: SettingTypes.TOGGLE, - label: "TLS Protected Connection", -}); - -SettingsFactory.register("APPSMITH_MAIL_USERNAME", { - category: "email", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "SMTP Username", - isVisible: (values: Record) => { - return values && values["APPSMITH_MAIL_SMTP_TLS_ENABLED"]; - }, -}); - -SettingsFactory.register("APPSMITH_MAIL_PASSWORD", { - category: "email", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.PASSWORD, - label: "SMTP Password", - isVisible: (values: Record) => { - return values && values["APPSMITH_MAIL_SMTP_TLS_ENABLED"]; - }, -}); - -SettingsFactory.register("APPSMITH_MAIL_TEST_EMAIL", { - action: (dispatch, settings = {}) => { - dispatch && - dispatch({ - type: ReduxActionTypes.SEND_TEST_EMAIL, - payload: omitBy( - { - smtpHost: settings["APPSMITH_MAIL_HOST"], - smtpPort: settings["APPSMITH_MAIL_PORT"], - fromEmail: settings["APPSMITH_MAIL_FROM"], - username: settings["APPSMITH_MAIL_USERNAME"], - password: settings["APPSMITH_MAIL_PASSWORD"], - }, - isNil, - ), - }); - }, - category: "email", - controlType: SettingTypes.BUTTON, - isDisabled: (settings: Record) => { - return ( - !settings || - !settings["APPSMITH_MAIL_HOST"] || - !settings["APPSMITH_MAIL_FROM"] - ); - }, - text: "Send Test Email", -}); - -//General -SettingsFactory.register("APPSMITH_INSTANCE_NAME", { - category: "general", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "Instance Name", - placeholder: "appsmith/prod", -}); - -SettingsFactory.register("APPSMITH_ADMIN_EMAILS", { - category: "general", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.EMAIL, - label: "Admin Email", - subText: - "Emails of the users who can modify instance settings (Comma Separated)", - placeholder: "Jane@example.com", - validate: (value: string) => { - if ( - value && - !value - .split(",") - .reduce((prev, curr) => prev && isEmail(curr.trim()), true) - ) { - return "Please enter valid email id(s)"; - } - }, -}); - -SettingsFactory.register("APPSMITH_DOWNLOAD_DOCKER_COMPOSE_FILE", { - action: () => { - const { host, protocol } = window.location; - window.open( - `${protocol}//${host}${apiRequestConfig.baseURL}${UserApi.downloadConfigURL}`, - "_blank", - ); - }, - category: "general", - controlType: SettingTypes.BUTTON, - label: "Generated Docker Compose File", - text: "Download", -}); - -SettingsFactory.register("APPSMITH_DISABLE_TELEMETRY", { - category: "general", - controlType: SettingTypes.TOGGLE, - label: "Disable Sharing Anonymous Usage Data", - subText: "Share anonymous usage data to help improve the product", - toggleText: (value: boolean) => { - if (value) { - return "Don't share any data"; - } else { - return "Share data & make appsmith better!"; - } - }, -}); - -//goolge maps -SettingsFactory.register("APPSMITH_GOOGLE_MAPS_READ_MORE", { - category: "google-maps", - controlType: SettingTypes.LINK, - label: "How to configure?", - url: GOOGLE_MAPS_SETUP_DOC, -}); - -SettingsFactory.register("APPSMITH_GOOGLE_MAPS_API_KEY", { - category: "google-maps", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "Google Maps API Key", -}); - -//authentication -SettingsFactory.register("APPSMITH_SIGNUP_DISABLED", { - category: "authentication", - subCategory: "form signup", - controlType: SettingTypes.TOGGLE, - label: "Signup", - toggleText: (value: boolean) => { - if (value) { - return "Allow invited users to signup"; - } else { - return " Allow all users to signup"; - } - }, -}); - -SettingsFactory.register("APPSMITH_OAUTH2_GOOGLE_READ_MORE", { - category: "authentication", - subCategory: "google signup", - controlType: SettingTypes.LINK, - label: "How to configure?", - url: GOOGLE_SIGNUP_SETUP_DOC, -}); - -SettingsFactory.register("APPSMITH_OAUTH2_GOOGLE_CLIENT_ID", { - category: "authentication", - subCategory: "google signup", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "Client ID", -}); - -SettingsFactory.register("APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET", { - category: "authentication", - subCategory: "google signup", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "Client Secret", -}); - -SettingsFactory.register("APPSMITH_SIGNUP_ALLOWED_DOMAINS", { - category: "authentication", - subCategory: "google signup", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "Allowed Domains", - placeholder: "domain1.com, domain2.com", -}); - -SettingsFactory.register("APPSMITH_OAUTH2_GITHUB_READ_MORE", { - category: "authentication", - subCategory: "github signup", - controlType: SettingTypes.LINK, - label: "How to configure?", - url: GITHUB_SIGNUP_SETUP_DOC, -}); - -SettingsFactory.register("APPSMITH_OAUTH2_GITHUB_CLIENT_ID", { - category: "authentication", - subCategory: "github signup", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "Client ID", -}); - -SettingsFactory.register("APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET", { - category: "authentication", - subCategory: "github signup", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "Client Secret", -}); - -//version -SettingsFactory.register("APPSMITH_CURRENT_VERSION", { - category: "version", - controlType: SettingTypes.TEXT, - label: "Current version", -}); - -SettingsFactory.register("APPSMITH_VERSION_READ_MORE", { - action: (dispatch?: Dispatch>) => { - dispatch && - dispatch({ - type: ReduxActionTypes.TOGGLE_RELEASE_NOTES, - payload: true, - }); - }, - category: "version", - controlType: SettingTypes.LINK, - label: "Release Notes", -}); - -//Advanced -SettingsFactory.register("APPSMITH_MONGODB_URI", { - category: "advanced", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "MongoDB URI", - subText: - "Appsmith internally uses MongoDB. Change to an external MongoDb for Clustering", -}); - -SettingsFactory.register("APPSMITH_REDIS_URL", { - category: "advanced", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "Redis URL", - subText: - "Appsmith internally uses redis for session storage. Change this to an external redis for Clustering", -}); - -SettingsFactory.register("APPSMITH_CUSTOM_DOMAIN", { - category: "advanced", - controlType: SettingTypes.TEXTINPUT, - controlSubType: SettingSubtype.TEXT, - label: "Custom Domain", - subText: "Custom domain for your Appsmith instance", -}); diff --git a/app/client/src/pages/Settings/SettingsForm.tsx b/app/client/src/pages/Settings/SettingsForm.tsx new file mode 100644 index 0000000000..600bef9aba --- /dev/null +++ b/app/client/src/pages/Settings/SettingsForm.tsx @@ -0,0 +1,181 @@ +import React, { useCallback, useEffect } from "react"; +import { saveSettings } from "actions/settingsAction"; +import { SETTINGS_FORM_NAME } from "constants/forms"; +import { ReduxActionTypes } from "constants/ReduxActionConstants"; +import _ from "lodash"; +import ProductUpdatesModal from "pages/Applications/ProductUpdatesModal"; +import { connect, useDispatch } from "react-redux"; +import { RouteComponentProps, useParams, withRouter } from "react-router"; +import { AppState } from "reducers"; +import { formValueSelector, InjectedFormProps, reduxForm } from "redux-form"; +import { + getSettings, + getSettingsSavingState, + getShowReleaseNotes, +} from "selectors/settingsSelectors"; +import styled from "styled-components"; +import Group from "./FormGroup/group"; +import RestartBanner from "./RestartBanner"; +import AdminConfig from "./config"; +import SaveAdminSettings from "./SaveSettings"; +import { SettingTypes } from "@appsmith/pages/AdminSettings/config/types"; +import SettingsBreadcrumbs from "./SettingsBreadcrumbs"; + +const Wrapper = styled.div` + flex-basis: calc(100% - ${(props) => props.theme.homePage.leftPane.width}px); + margin-left: ${(props) => props.theme.homePage.main.marginLeft}px; + padding-top: 40px; + height: calc(100vh - ${(props) => props.theme.homePage.header}px); + overflow: auto; +`; + +const SettingsFormWrapper = styled.div``; + +export const BottomSpace = styled.div` + height: ${(props) => props.theme.settings.footerHeight + 20}px; +`; + +export const SettingsHeader = styled.h2` + font-size: 24px; + font-weight: 500; + text-transform: capitalize; + margin-bottom: 0; +`; + +export const SettingsSubHeader = styled.div` + font-size: 12px; +`; + +type FormProps = { + settings: Record; + settingsConfig: Record; + isSaving: boolean; + showReleaseNotes: boolean; +}; + +function getSettingLabel(name = "") { + return name.replace(/-/g, ""); +} + +function getSettingDetail(category: string, subCategory: string) { + return AdminConfig.getCategoryDetails(category, subCategory); +} + +function useSettings(category: string, subCategory?: string) { + return AdminConfig.get(subCategory ?? category); +} + +export function SettingsForm( + props: InjectedFormProps & RouteComponentProps & FormProps, +) { + const params = useParams() as any; + const { category, subCategory } = params; + const settings = useSettings(category, subCategory); + const details = getSettingDetail(category, subCategory); + const dispatch = useDispatch(); + const isSavable = AdminConfig.savableCategories.includes( + subCategory ?? category, + ); + + const onSave = () => { + dispatch(saveSettings(props.settings)); + }; + + const onClear = () => { + _.forEach(props.settingsConfig, (value, settingName) => { + const setting = AdminConfig.settingsMap[settingName]; + if (setting && setting.controlType == SettingTypes.TOGGLE) { + props.settingsConfig[settingName] = + props.settingsConfig[settingName].toString() == "true"; + + if ( + typeof props.settingsConfig["APPSMITH_SIGNUP_DISABLED"] === + "undefined" + ) { + props.settingsConfig["APPSMITH_SIGNUP_DISABLED"] = true; + } + } + }); + props.initialize(props.settingsConfig); + }; + + useEffect(onClear, []); + + const onReleaseNotesClose = useCallback(() => { + dispatch({ + type: ReduxActionTypes.TOGGLE_RELEASE_NOTES, + payload: false, + }); + }, []); + + return ( + + + + + {getSettingLabel(details?.title || (subCategory ?? category))} + + {details?.subText && ( + {details.subText} + )} + + {isSavable && ( + + )} + + + {props.showReleaseNotes && ( + + )} + + + ); +} + +const validate = (values: Record) => { + const errors: any = {}; + _.filter(values, (value, name) => { + const message = AdminConfig.validate(name, value); + if (message) { + errors[name] = message; + } + }); + return errors; +}; + +const selector = formValueSelector(SETTINGS_FORM_NAME); +export default withRouter( + connect((state: AppState) => { + const settingsConfig = getSettings(state); + const newProps: any = { + settings: {}, + settingsConfig, + isSaving: getSettingsSavingState(state), + showReleaseNotes: getShowReleaseNotes(state), + }; + _.forEach(AdminConfig.settingsMap, (setting, name) => { + const fieldValue = selector(state, name); + + if (fieldValue !== settingsConfig[name]) { + newProps.settings[name] = fieldValue; + } + }); + return newProps; + }, null)( + reduxForm({ + validate, + form: SETTINGS_FORM_NAME, + touchOnBlur: true, + })(SettingsForm), + ), +); diff --git a/app/client/src/pages/Settings/config/ConfigFactory.ts b/app/client/src/pages/Settings/config/ConfigFactory.ts new file mode 100644 index 0000000000..592f66bd32 --- /dev/null +++ b/app/client/src/pages/Settings/config/ConfigFactory.ts @@ -0,0 +1,88 @@ +import { + AdminConfigType, + Category, + Setting, + SettingTypes, +} from "@appsmith/pages/AdminSettings/config/types"; +export class ConfigFactory { + static settingsMap: Record = {}; + static settings: Setting[] = []; + static categories: Category[] = []; + static wrapperCategories: Record = {}; + static savableCategories: string[] = []; + + static registerSettings(config: AdminConfigType): void { + config?.settings?.forEach((item) => { + ConfigFactory.settingsMap[item.id] = { + ...item, + }; + ConfigFactory.settings.push({ + name: item.id, + ...item, + }); + }); + config?.children?.forEach((child) => ConfigFactory.registerSettings(child)); + } + + static getCategory(config: AdminConfigType): Category { + if (config.controlType === SettingTypes.PAGE) { + ConfigFactory.wrapperCategories[config.type] = config; + } + if (config.canSave) { + ConfigFactory.savableCategories.push(config.type); + } + + return { + title: config.title, + slug: config.type, + subText: config.subText, + children: config?.children?.map((child) => + ConfigFactory.getCategory(child), + ), + }; + } + + static registerCategory(config: AdminConfigType): void { + ConfigFactory.categories.push(ConfigFactory.getCategory(config)); + } + + static register(config: AdminConfigType) { + ConfigFactory.registerSettings(config); + ConfigFactory.registerCategory(config); + } + + static validate(name: string, value: string) { + const setting = ConfigFactory.settingsMap[name]; + if (setting?.validate) { + return setting.validate(value, setting); + } + + return ""; + } + + static get(category: string) { + ConfigFactory.settings.forEach((setting) => { + setting.isHidden = setting.category !== category; + }); + + return ConfigFactory.settings; + } + + static getCategoryDetails( + currentCategory: string, + currentSubCategory: string, + ) { + if ( + currentSubCategory && + ConfigFactory.wrapperCategories[currentCategory].children + ) { + return ConfigFactory.wrapperCategories[currentCategory].children?.find( + (category) => category.type === currentSubCategory, + ); + } else { + return ConfigFactory.categories.find( + (category) => category.slug === currentCategory, + ); + } + } +} diff --git a/app/client/src/pages/Settings/config/advanced.ts b/app/client/src/pages/Settings/config/advanced.ts new file mode 100644 index 0000000000..323c424785 --- /dev/null +++ b/app/client/src/pages/Settings/config/advanced.ts @@ -0,0 +1,40 @@ +import { + AdminConfigType, + SettingCategories, + SettingSubtype, + SettingTypes, +} from "@appsmith/pages/AdminSettings/config/types"; +export const config: AdminConfigType = { + type: SettingCategories.ADVANCED, + controlType: SettingTypes.GROUP, + title: "Advanced", + canSave: true, + settings: [ + { + id: "APPSMITH_MONGODB_URI", + category: "advanced", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "MongoDB URI", + subText: + "Appsmith internally uses MongoDB. Change to an external MongoDb for Clustering", + }, + { + id: "APPSMITH_REDIS_URL", + category: "advanced", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "Redis URL", + subText: + "Appsmith internally uses redis for session storage. Change this to an external redis for Clustering", + }, + { + id: "APPSMITH_CUSTOM_DOMAIN", + category: "advanced", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "Custom Domain", + subText: "Custom domain for your Appsmith instance", + }, + ], +}; diff --git a/app/client/src/pages/Settings/config/email.ts b/app/client/src/pages/Settings/config/email.ts new file mode 100644 index 0000000000..ff638f4028 --- /dev/null +++ b/app/client/src/pages/Settings/config/email.ts @@ -0,0 +1,122 @@ +import { EMAIL_SETUP_DOC } from "../../../constants/ThirdPartyConstants"; +import { isEmail } from "../../../utils/formhelpers"; +import { Dispatch } from "react"; +import { + ReduxAction, + ReduxActionTypes, +} from "../../../constants/ReduxActionConstants"; +import { isNil, omitBy } from "lodash"; +import { + AdminConfigType, + SettingCategories, + SettingSubtype, + SettingTypes, +} from "@appsmith/pages/AdminSettings/config/types"; + +export const config: AdminConfigType = { + type: SettingCategories.EMAIL, + controlType: SettingTypes.GROUP, + title: "Email", + canSave: true, + settings: [ + { + id: "APPSMITH_MAIL_READ_MORE", + category: "email", + controlType: SettingTypes.LINK, + label: "How to configure?", + url: EMAIL_SETUP_DOC, + }, + { + id: "APPSMITH_MAIL_HOST", + category: "email", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "SMTP Host", + placeholder: "email-smtp.us-east-2.amazonaws.com", + }, + { + id: "APPSMITH_MAIL_PORT", + category: "email", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.NUMBER, + placeholder: "25", + label: "SMTP Port", + validate: (value: string) => { + const port = parseInt(value); + if (value && (port < 0 || port > 65535)) { + return "Please enter a valid port"; + } + }, + }, + { + id: "APPSMITH_MAIL_FROM", + category: "email", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "From Address", + placeholder: "admin@appsmith.com", + validate: (value: string) => { + if (value && !isEmail(value)) { + return "Please enter a valid email id"; + } + }, + subText: + "You will need to verify your from email address to begin sending emails", + }, + { + id: "APPSMITH_MAIL_SMTP_TLS_ENABLED", + category: "email", + controlType: SettingTypes.TOGGLE, + label: "TLS Protected Connection", + }, + { + id: "APPSMITH_MAIL_USERNAME", + category: "email", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "SMTP Username", + isVisible: (values: Record) => { + return values && values["APPSMITH_MAIL_SMTP_TLS_ENABLED"]; + }, + }, + { + id: "APPSMITH_MAIL_PASSWORD", + category: "email", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.PASSWORD, + label: "SMTP Password", + isVisible: (values: Record) => { + return values && values["APPSMITH_MAIL_SMTP_TLS_ENABLED"]; + }, + }, + { + id: "APPSMITH_MAIL_TEST_EMAIL", + category: "email", + action: (dispatch: Dispatch>, settings: any = {}) => { + dispatch && + dispatch({ + type: ReduxActionTypes.SEND_TEST_EMAIL, + payload: omitBy( + { + smtpHost: settings["APPSMITH_MAIL_HOST"], + smtpPort: settings["APPSMITH_MAIL_PORT"], + fromEmail: settings["APPSMITH_MAIL_FROM"], + username: settings["APPSMITH_MAIL_USERNAME"], + password: settings["APPSMITH_MAIL_PASSWORD"], + }, + isNil, + ), + }); + }, + controlType: SettingTypes.BUTTON, + isDisabled: (settings: Record) => { + return ( + !settings || + !settings["APPSMITH_MAIL_HOST"] || + !settings["APPSMITH_MAIL_FROM"] + ); + }, + text: "Send Test Email", + }, + ], +}; diff --git a/app/client/src/pages/Settings/config/general.ts b/app/client/src/pages/Settings/config/general.ts new file mode 100644 index 0000000000..6138fe1ed1 --- /dev/null +++ b/app/client/src/pages/Settings/config/general.ts @@ -0,0 +1,74 @@ +import { isEmail } from "../../../utils/formhelpers"; +import { apiRequestConfig } from "../../../api/Api"; +import UserApi from "../../../api/UserApi"; +import { + AdminConfigType, + SettingCategories, + SettingSubtype, + SettingTypes, +} from "@appsmith/pages/AdminSettings/config/types"; + +export const config: AdminConfigType = { + type: SettingCategories.GENERAL, + controlType: SettingTypes.GROUP, + title: "General", + canSave: true, + settings: [ + { + id: "APPSMITH_INSTANCE_NAME", + category: "general", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "Instance Name", + placeholder: "appsmith/prod", + }, + { + id: "APPSMITH_ADMIN_EMAILS", + category: "general", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.EMAIL, + label: "Admin Email", + subText: + "Emails of the users who can modify instance settings (Comma Separated)", + placeholder: "Jane@example.com", + validate: (value: string) => { + if ( + value && + !value + .split(",") + .reduce((prev, curr) => prev && isEmail(curr.trim()), true) + ) { + return "Please enter valid email id(s)"; + } + }, + }, + { + id: "APPSMITH_DOWNLOAD_DOCKER_COMPOSE_FILE", + action: () => { + const { host, protocol } = window.location; + window.open( + `${protocol}//${host}${apiRequestConfig.baseURL}${UserApi.downloadConfigURL}`, + "_blank", + ); + }, + category: "general", + controlType: SettingTypes.BUTTON, + label: "Generated Docker Compose File", + text: "Download", + }, + { + id: "APPSMITH_DISABLE_TELEMETRY", + category: "general", + controlType: SettingTypes.TOGGLE, + label: "Disable Sharing Anonymous Usage Data", + subText: "Share anonymous usage data to help improve the product", + toggleText: (value: boolean) => { + if (value) { + return "Don't share any data"; + } else { + return "Share data & make appsmith better!"; + } + }, + }, + ], +} as AdminConfigType; diff --git a/app/client/src/pages/Settings/config/googleMaps.ts b/app/client/src/pages/Settings/config/googleMaps.ts new file mode 100644 index 0000000000..365bd5b532 --- /dev/null +++ b/app/client/src/pages/Settings/config/googleMaps.ts @@ -0,0 +1,30 @@ +import { GOOGLE_MAPS_SETUP_DOC } from "constants/ThirdPartyConstants"; +import { + AdminConfigType, + SettingCategories, + SettingSubtype, + SettingTypes, +} from "@appsmith/pages/AdminSettings/config/types"; + +export const config: AdminConfigType = { + type: SettingCategories.GOOGLE_MAPS, + controlType: SettingTypes.GROUP, + title: "Google Maps", + canSave: true, + settings: [ + { + id: "APPSMITH_GOOGLE_MAPS_READ_MORE", + category: "google-maps", + controlType: SettingTypes.LINK, + label: "How to configure?", + url: GOOGLE_MAPS_SETUP_DOC, + }, + { + id: "APPSMITH_GOOGLE_MAPS_API_KEY", + category: "google-maps", + controlType: SettingTypes.TEXTINPUT, + controlSubType: SettingSubtype.TEXT, + label: "Google Maps API Key", + }, + ], +}; diff --git a/app/client/src/pages/Settings/config/index.ts b/app/client/src/pages/Settings/config/index.ts new file mode 100644 index 0000000000..c26dc1a882 --- /dev/null +++ b/app/client/src/pages/Settings/config/index.ts @@ -0,0 +1,17 @@ +import { ConfigFactory } from "./ConfigFactory"; + +import { config as GeneralConfig } from "./general"; +import { config as EmailConfig } from "./email"; +import { config as MapsConfig } from "./googleMaps"; +import { config as VersionConfig } from "./version"; +import { config as AdvancedConfig } from "./advanced"; +import { config as Authentication } from "@appsmith/pages/AdminSettings/config/authentication"; + +ConfigFactory.register(GeneralConfig); +ConfigFactory.register(EmailConfig); +ConfigFactory.register(MapsConfig); +ConfigFactory.register(Authentication); +ConfigFactory.register(AdvancedConfig); +ConfigFactory.register(VersionConfig); + +export default ConfigFactory; diff --git a/app/client/src/pages/Settings/config/version.ts b/app/client/src/pages/Settings/config/version.ts new file mode 100644 index 0000000000..36d84ec6f0 --- /dev/null +++ b/app/client/src/pages/Settings/config/version.ts @@ -0,0 +1,35 @@ +import { Dispatch } from "react"; +import { ReduxAction, ReduxActionTypes } from "constants/ReduxActionConstants"; +import { + AdminConfigType, + SettingCategories, + SettingTypes, +} from "@appsmith/pages/AdminSettings/config/types"; + +export const config: AdminConfigType = { + type: SettingCategories.VERSION, + controlType: SettingTypes.GROUP, + title: "Version", + canSave: false, + settings: [ + { + id: "APPSMITH_CURRENT_VERSION", + category: "version", + controlType: SettingTypes.TEXT, + label: "Current version", + }, + { + id: "APPSMITH_VERSION_READ_MORE", + action: (dispatch?: Dispatch>) => { + dispatch && + dispatch({ + type: ReduxActionTypes.TOGGLE_RELEASE_NOTES, + payload: true, + }); + }, + category: "version", + controlType: SettingTypes.LINK, + label: "Release Notes", + }, + ], +}; diff --git a/app/client/src/pages/UserAuth/ForgotPassword.tsx b/app/client/src/pages/UserAuth/ForgotPassword.tsx index ad3758eb9e..0161b1b17c 100644 --- a/app/client/src/pages/UserAuth/ForgotPassword.tsx +++ b/app/client/src/pages/UserAuth/ForgotPassword.tsx @@ -21,7 +21,7 @@ import { FORGOT_PASSWORD_SUCCESS_TEXT, FORGOT_PASSWORD_PAGE_LOGIN_LINK, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { AUTH_LOGIN_URL } from "constants/routes"; import FormMessage from "components/ads/formFields/FormMessage"; import { FORGOT_PASSWORD_FORM_NAME } from "constants/forms"; diff --git a/app/client/src/pages/UserAuth/ResetPassword.tsx b/app/client/src/pages/UserAuth/ResetPassword.tsx index c1e3eb9bb3..7bc067f8cb 100644 --- a/app/client/src/pages/UserAuth/ResetPassword.tsx +++ b/app/client/src/pages/UserAuth/ResetPassword.tsx @@ -42,7 +42,7 @@ import { RESET_PASSWORD_RESET_SUCCESS, RESET_PASSWORD_RESET_SUCCESS_LOGIN_LINK, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; const validate = (values: ResetPasswordFormValues) => { const errors: ResetPasswordFormValues = {}; diff --git a/app/client/src/pages/UserAuth/StyledComponents.tsx b/app/client/src/pages/UserAuth/StyledComponents.tsx index 206145f190..8112212333 100644 --- a/app/client/src/pages/UserAuth/StyledComponents.tsx +++ b/app/client/src/pages/UserAuth/StyledComponents.tsx @@ -3,7 +3,6 @@ import { Link } from "react-router-dom"; import Form from "components/editorComponents/Form"; import { Card } from "@blueprintjs/core"; import { getTypographyByKey } from "constants/DefaultTheme"; -import { Classes } from "@blueprintjs/core"; export const AuthContainer = styled.section` position: absolute; @@ -14,10 +13,6 @@ export const AuthContainer = styled.section` flex-direction: column; align-items: center; overflow: auto; - - & .${Classes.FORM_GROUP} { - margin: 0 0 ${(props) => props.theme.spaces[2]}px; - } `; export const AuthCardContainer = styled.div` diff --git a/app/client/src/pages/UserProfile/General.tsx b/app/client/src/pages/UserProfile/General.tsx index 6522568da3..ce437caa9b 100644 --- a/app/client/src/pages/UserProfile/General.tsx +++ b/app/client/src/pages/UserProfile/General.tsx @@ -12,7 +12,7 @@ import { Variant } from "components/ads/common"; import { FORGOT_PASSWORD_SUCCESS_TEXT, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { logoutUser, updateUserDetails } from "actions/userActions"; import { AppState } from "reducers"; import UserProfileImagePicker from "components/ads/UserProfileImagePicker"; diff --git a/app/client/src/pages/UserProfile/GitConfig.tsx b/app/client/src/pages/UserProfile/GitConfig.tsx index 031d77e723..787d5c9f81 100644 --- a/app/client/src/pages/UserProfile/GitConfig.tsx +++ b/app/client/src/pages/UserProfile/GitConfig.tsx @@ -10,7 +10,7 @@ import { AUTHOR_EMAIL, AUTHOR_NAME, SUBMIT, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import Text, { TextType } from "components/ads/Text"; import { Classes } from "@blueprintjs/core"; import TextInput, { notEmptyValidator } from "components/ads/TextInput"; diff --git a/app/client/src/pages/common/PageNotFound.tsx b/app/client/src/pages/common/PageNotFound.tsx index 1ef010291a..37d42b1bd9 100644 --- a/app/client/src/pages/common/PageNotFound.tsx +++ b/app/client/src/pages/common/PageNotFound.tsx @@ -9,7 +9,7 @@ import { BACK_TO_HOMEPAGE, createMessage, PAGE_NOT_FOUND, -} from "constants/messages"; +} from "@appsmith/constants/messages"; const Wrapper = styled.div` text-align: center; diff --git a/app/client/src/pages/common/ProfileDropdown.tsx b/app/client/src/pages/common/ProfileDropdown.tsx index a93fa967f3..7288455081 100644 --- a/app/client/src/pages/common/ProfileDropdown.tsx +++ b/app/client/src/pages/common/ProfileDropdown.tsx @@ -20,7 +20,7 @@ import { ACCOUNT_TOOLTIP, createMessage, ADMIN_SETTINGS, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants"; import { useSelector } from "react-redux"; import { getCurrentUser } from "selectors/usersSelectors"; diff --git a/app/client/src/pages/common/UnsubscribeEmail.tsx b/app/client/src/pages/common/UnsubscribeEmail.tsx index bea7a6535c..8432ec21f7 100644 --- a/app/client/src/pages/common/UnsubscribeEmail.tsx +++ b/app/client/src/pages/common/UnsubscribeEmail.tsx @@ -11,7 +11,7 @@ import { UNSUBSCRIBE_EMAIL_MSG_2, UNSUBSCRIBE_EMAIL_CONFIRM_MSG, UNSUBSCRIBE_BUTTON_LABEL, -} from "constants/messages"; +} from "@appsmith/constants/messages"; const Wrapper = styled.div` height: calc(100vh - ${(props) => props.theme.headerHeight}); diff --git a/app/client/src/pages/common/datasourceAuth/OAuth.tsx b/app/client/src/pages/common/datasourceAuth/OAuth.tsx index 23389c41ae..5272b5f1ba 100644 --- a/app/client/src/pages/common/datasourceAuth/OAuth.tsx +++ b/app/client/src/pages/common/datasourceAuth/OAuth.tsx @@ -22,7 +22,7 @@ import { AppState } from "reducers"; import { OAUTH_AUTHORIZATION_APPSMITH_ERROR, OAUTH_AUTHORIZATION_FAILED, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Variant } from "components/ads/common"; import { Toaster } from "components/ads/Toast"; import AnalyticsUtil from "utils/AnalyticsUtil"; diff --git a/app/client/src/pages/organization/DeleteConfirmationModal.tsx b/app/client/src/pages/organization/DeleteConfirmationModal.tsx index a8e6d78cd9..1c6f79c80e 100644 --- a/app/client/src/pages/organization/DeleteConfirmationModal.tsx +++ b/app/client/src/pages/organization/DeleteConfirmationModal.tsx @@ -6,7 +6,7 @@ import { Variant } from "components/ads/common"; import { DELETE_CONFIRMATION_MODAL_TITLE, DELETE_CONFIRMATION_MODAL_SUBTITLE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import Dialog from "components/ads/DialogComponent"; import { Classes } from "@blueprintjs/core"; import { Colors } from "constants/Colors"; diff --git a/app/client/src/pages/organization/OrgInviteUsersForm.tsx b/app/client/src/pages/organization/OrgInviteUsersForm.tsx index 9f180560b0..5abdad618c 100644 --- a/app/client/src/pages/organization/OrgInviteUsersForm.tsx +++ b/app/client/src/pages/organization/OrgInviteUsersForm.tsx @@ -22,7 +22,7 @@ import { INVITE_USERS_VALIDATION_EMAILS_EMPTY, INVITE_USERS_VALIDATION_EMAIL_LIST, INVITE_USERS_VALIDATION_ROLE_EMPTY, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { isEmail } from "utils/formhelpers"; import { isPermitted, diff --git a/app/client/src/pages/setup/DataCollectionForm.tsx b/app/client/src/pages/setup/DataCollectionForm.tsx index dc9771e217..dceb270d31 100644 --- a/app/client/src/pages/setup/DataCollectionForm.tsx +++ b/app/client/src/pages/setup/DataCollectionForm.tsx @@ -21,7 +21,7 @@ import { WELCOME_FORM_DATA_COLLECTION_LABEL_DISABLE, WELCOME_FORM_DATA_COLLECTION_LABEL_ENABLE, WELCOME_FORM_DATA_COLLECTION_LINK, -} from "constants/messages"; +} from "@appsmith/constants/messages"; const DataCollectionFormWrapper = styled.div` width: 100%; diff --git a/app/client/src/pages/setup/DetailsForm.tsx b/app/client/src/pages/setup/DetailsForm.tsx index a701a5a690..1cc632aac7 100644 --- a/app/client/src/pages/setup/DetailsForm.tsx +++ b/app/client/src/pages/setup/DetailsForm.tsx @@ -20,7 +20,7 @@ import { WELCOME_FORM_ROLE, WELCOME_FORM_USE_CASE, WELCOME_FORM_HEADER, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import FormTextField from "components/ads/formFields/TextField"; import { DetailsFormValues } from "./SetupForm"; import { ButtonWrapper } from "pages/Applications/ForkModalStyles"; diff --git a/app/client/src/pages/setup/GetStarted.tsx b/app/client/src/pages/setup/GetStarted.tsx index 796c0ffc27..ca67e0736e 100644 --- a/app/client/src/pages/setup/GetStarted.tsx +++ b/app/client/src/pages/setup/GetStarted.tsx @@ -13,7 +13,7 @@ import { WELCOME_FORM_NON_SUPER_USER_ROLE_DROPDOWN, WELCOME_FORM_NON_SUPER_USER_USE_CASE, WELCOME_FORM_ROLE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import React from "react"; import { connect } from "react-redux"; import { AppState } from "reducers"; diff --git a/app/client/src/pages/setup/NewsletterForm.tsx b/app/client/src/pages/setup/NewsletterForm.tsx index 8626110a4f..140a86405b 100644 --- a/app/client/src/pages/setup/NewsletterForm.tsx +++ b/app/client/src/pages/setup/NewsletterForm.tsx @@ -19,7 +19,7 @@ import { WELCOME_FORM_NEWLETTER_HEADER, WELCOME_FORM_NEWLETTER_LABEL, WELCOME_FORM_SUBMIT_LABEL, -} from "constants/messages"; +} from "@appsmith/constants/messages"; export const StyledButton = styled(Button)` width: 201px; diff --git a/app/client/src/pages/setup/Welcome.tsx b/app/client/src/pages/setup/Welcome.tsx index 8c28ecb8a8..11dff7a65f 100644 --- a/app/client/src/pages/setup/Welcome.tsx +++ b/app/client/src/pages/setup/Welcome.tsx @@ -7,7 +7,7 @@ import { createMessage, WELCOME_BODY, WELCOME_HEADER, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import NonSuperUserForm, { SuperUserForm } from "./GetStarted"; const LandingPageWrapper = styled.div<{ hide: boolean }>` diff --git a/app/client/src/reducers/uiReducers/applicationsReducer.tsx b/app/client/src/reducers/uiReducers/applicationsReducer.tsx index 3b312430f9..addd08af77 100644 --- a/app/client/src/reducers/uiReducers/applicationsReducer.tsx +++ b/app/client/src/reducers/uiReducers/applicationsReducer.tsx @@ -10,7 +10,7 @@ import { Organization, OrgUser } from "constants/orgConstants"; import { createMessage, ERROR_MESSAGE_CREATE_APPLICATION, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { UpdateApplicationRequest } from "api/ApplicationApi"; import { CreateApplicationFormValues } from "pages/Applications/helpers"; import { AppLayoutConfig } from "reducers/entityReducers/pageListReducer"; diff --git a/app/client/src/sagas/ActionExecution/PluginActionSaga.ts b/app/client/src/sagas/ActionExecution/PluginActionSaga.ts index cd7717ed26..a3c3102575 100644 --- a/app/client/src/sagas/ActionExecution/PluginActionSaga.ts +++ b/app/client/src/sagas/ActionExecution/PluginActionSaga.ts @@ -51,7 +51,7 @@ import { ERROR_ACTION_EXECUTE_FAIL, ERROR_FAIL_ON_PAGE_LOAD_ACTIONS, ERROR_PLUGIN_ACTION_EXECUTE, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Variant } from "components/ads/common"; import { EventType, diff --git a/app/client/src/sagas/ActionExecution/errorUtils.ts b/app/client/src/sagas/ActionExecution/errorUtils.ts index 9b60bacb05..408c4cf0b6 100644 --- a/app/client/src/sagas/ActionExecution/errorUtils.ts +++ b/app/client/src/sagas/ActionExecution/errorUtils.ts @@ -6,7 +6,7 @@ import { createMessage, DEBUGGER_TRIGGER_ERROR, TRIGGER_ACTION_VALIDATION_ERROR, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { ENTITY_TYPE } from "entities/AppsmithConsole"; import { Toaster } from "components/ads/Toast"; import { Variant } from "components/ads/common"; diff --git a/app/client/src/sagas/ActionSagas.ts b/app/client/src/sagas/ActionSagas.ts index 8a307e317e..89e8bdc7e7 100644 --- a/app/client/src/sagas/ActionSagas.ts +++ b/app/client/src/sagas/ActionSagas.ts @@ -86,7 +86,7 @@ import { ERROR_ACTION_COPY_FAIL, ERROR_ACTION_MOVE_FAIL, ERROR_ACTION_RENAME_FAIL, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { merge, get } from "lodash"; import { getConfigInitialValues } from "components/formControls/utils"; import AppsmithConsole from "utils/AppsmithConsole"; diff --git a/app/client/src/sagas/ApiPaneSagas.ts b/app/client/src/sagas/ApiPaneSagas.ts index 9ede8b5fb4..d99adce331 100644 --- a/app/client/src/sagas/ApiPaneSagas.ts +++ b/app/client/src/sagas/ApiPaneSagas.ts @@ -56,7 +56,10 @@ import PerformanceTracker, { import { EventLocation } from "utils/AnalyticsUtil"; import { Variant } from "components/ads/common"; import { Toaster } from "components/ads/Toast"; -import { createMessage, ERROR_ACTION_RENAME_FAIL } from "constants/messages"; +import { + createMessage, + ERROR_ACTION_RENAME_FAIL, +} from "@appsmith/constants/messages"; import { getIndextoUpdate, parseUrlForQueryParams, diff --git a/app/client/src/sagas/ApplicationSagas.tsx b/app/client/src/sagas/ApplicationSagas.tsx index 432ed4644c..3d3f86b1fa 100644 --- a/app/client/src/sagas/ApplicationSagas.tsx +++ b/app/client/src/sagas/ApplicationSagas.tsx @@ -49,7 +49,7 @@ import { createMessage, DELETING_APPLICATION, DUPLICATING_APPLICATION, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Toaster } from "components/ads/Toast"; import { APP_MODE } from "entities/App"; import { Organization } from "constants/orgConstants"; diff --git a/app/client/src/sagas/CurlImportSagas.ts b/app/client/src/sagas/CurlImportSagas.ts index 3df1de7f6b..135444b4ac 100644 --- a/app/client/src/sagas/CurlImportSagas.ts +++ b/app/client/src/sagas/CurlImportSagas.ts @@ -8,7 +8,10 @@ import { validateResponse } from "sagas/ErrorSagas"; import CurlImportApi, { CurlImportRequest } from "api/ImportApi"; import { ApiResponse } from "api/ApiResponses"; import AnalyticsUtil from "utils/AnalyticsUtil"; -import { createMessage, CURL_IMPORT_SUCCESS } from "constants/messages"; +import { + createMessage, + CURL_IMPORT_SUCCESS, +} from "@appsmith/constants/messages"; import { getCurrentOrgId } from "selectors/organizationSelectors"; import transformCurlImport from "transformers/CurlImportTransformer"; import { API_EDITOR_ID_URL } from "constants/routes"; diff --git a/app/client/src/sagas/DatasourcesSagas.ts b/app/client/src/sagas/DatasourcesSagas.ts index f3f31b97d1..24a8eff1a9 100644 --- a/app/client/src/sagas/DatasourcesSagas.ts +++ b/app/client/src/sagas/DatasourcesSagas.ts @@ -73,7 +73,7 @@ import { OAUTH_AUTHORIZATION_APPSMITH_ERROR, OAUTH_AUTHORIZATION_FAILED, OAUTH_AUTHORIZATION_SUCCESSFUL, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import AppsmithConsole from "utils/AppsmithConsole"; import { ENTITY_TYPE } from "entities/AppsmithConsole"; import localStorage from "utils/localStorage"; diff --git a/app/client/src/sagas/DebuggerSagas.ts b/app/client/src/sagas/DebuggerSagas.ts index 0a14a0e5de..4b4efe2d82 100644 --- a/app/client/src/sagas/DebuggerSagas.ts +++ b/app/client/src/sagas/DebuggerSagas.ts @@ -41,7 +41,7 @@ import { ACTION_CONFIGURATION_UPDATED, createMessage, WIDGET_PROPERTIES_UPDATED, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import AppsmithConsole from "utils/AppsmithConsole"; import { getWidget } from "./selectors"; import AnalyticsUtil from "utils/AnalyticsUtil"; diff --git a/app/client/src/sagas/ErrorSagas.tsx b/app/client/src/sagas/ErrorSagas.tsx index 616d82ed85..5875ce3150 100644 --- a/app/client/src/sagas/ErrorSagas.tsx +++ b/app/client/src/sagas/ErrorSagas.tsx @@ -25,7 +25,7 @@ import { ERROR_0, DEFAULT_ERROR_MESSAGE, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import * as Sentry from "@sentry/react"; import { axiosConnectionAbortedCode } from "../api/ApiUtils"; diff --git a/app/client/src/sagas/EvaluationsSaga.ts b/app/client/src/sagas/EvaluationsSaga.ts index 0029be622d..b467d8657b 100644 --- a/app/client/src/sagas/EvaluationsSaga.ts +++ b/app/client/src/sagas/EvaluationsSaga.ts @@ -69,7 +69,7 @@ import { createMessage, SNIPPET_EXECUTION_FAILED, SNIPPET_EXECUTION_SUCCESS, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { validate } from "workers/validations"; import { diff } from "deep-diff"; import { REPLAY_DELAY } from "entities/Replay/replayUtils"; diff --git a/app/client/src/sagas/GitSyncSagas.ts b/app/client/src/sagas/GitSyncSagas.ts index 51ed2726d3..c909ad0a8a 100644 --- a/app/client/src/sagas/GitSyncSagas.ts +++ b/app/client/src/sagas/GitSyncSagas.ts @@ -48,7 +48,7 @@ import { fetchGitStatusSuccess } from "actions/gitSyncActions"; import { createMessage, GIT_USER_UPDATED_SUCCESSFULLY, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { GitApplicationMetadata } from "../api/ApplicationApi"; import history from "utils/history"; diff --git a/app/client/src/sagas/JSActionSagas.ts b/app/client/src/sagas/JSActionSagas.ts index 1696f36200..64c55cc3ce 100644 --- a/app/client/src/sagas/JSActionSagas.ts +++ b/app/client/src/sagas/JSActionSagas.ts @@ -48,7 +48,7 @@ import { JS_ACTION_MOVE_SUCCESS, ERROR_JS_ACTION_MOVE_FAIL, ERROR_JS_COLLECTION_RENAME_FAIL, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { validateResponse } from "./ErrorSagas"; import { DataTreeJSAction } from "entities/DataTree/dataTreeFactory"; import PageApi from "api/PageApi"; diff --git a/app/client/src/sagas/JSPaneSagas.ts b/app/client/src/sagas/JSPaneSagas.ts index e25202d54c..1a03a6ffd7 100644 --- a/app/client/src/sagas/JSPaneSagas.ts +++ b/app/client/src/sagas/JSPaneSagas.ts @@ -51,7 +51,7 @@ import { JS_FUNCTION_CREATE_SUCCESS, JS_FUNCTION_DELETE_SUCCESS, JS_FUNCTION_UPDATE_SUCCESS, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { validateResponse } from "./ErrorSagas"; import AppsmithConsole from "utils/AppsmithConsole"; import { ENTITY_TYPE, PLATFORM_ERROR } from "entities/AppsmithConsole"; diff --git a/app/client/src/sagas/OrgSagas.ts b/app/client/src/sagas/OrgSagas.ts index 675ceb51d2..4ad192c97d 100644 --- a/app/client/src/sagas/OrgSagas.ts +++ b/app/client/src/sagas/OrgSagas.ts @@ -34,7 +34,10 @@ import history from "utils/history"; import { APPLICATIONS_URL } from "constants/routes"; import { getAllApplications } from "actions/applicationActions"; import log from "loglevel"; -import { createMessage, DELETE_ORG_SUCCESSFUL } from "constants/messages"; +import { + createMessage, + DELETE_ORG_SUCCESSFUL, +} from "@appsmith/constants/messages"; export function* fetchRolesSaga() { try { diff --git a/app/client/src/sagas/PostEvaluationSagas.ts b/app/client/src/sagas/PostEvaluationSagas.ts index de7af2a0e7..317caad474 100644 --- a/app/client/src/sagas/PostEvaluationSagas.ts +++ b/app/client/src/sagas/PostEvaluationSagas.ts @@ -34,7 +34,7 @@ import { ERROR_EVAL_ERROR_GENERIC, JS_OBJECT_BODY_INVALID, VALUE_IS_INVALID, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import log from "loglevel"; import { AppState } from "reducers"; import { getAppMode } from "selectors/applicationSelectors"; diff --git a/app/client/src/sagas/ProvidersSaga.ts b/app/client/src/sagas/ProvidersSaga.ts index 9d5336751d..0d0a4835e8 100644 --- a/app/client/src/sagas/ProvidersSaga.ts +++ b/app/client/src/sagas/ProvidersSaga.ts @@ -34,7 +34,7 @@ import { import { ADD_API_TO_PAGE_SUCCESS_MESSAGE, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import AnalyticsUtil from "utils/AnalyticsUtil"; import { getCurrentOrgId } from "selectors/organizationSelectors"; import { Toaster } from "components/ads/Toast"; diff --git a/app/client/src/sagas/QueryPaneSagas.ts b/app/client/src/sagas/QueryPaneSagas.ts index 253a0374d5..d1a1a424c3 100644 --- a/app/client/src/sagas/QueryPaneSagas.ts +++ b/app/client/src/sagas/QueryPaneSagas.ts @@ -43,7 +43,10 @@ import { Variant } from "components/ads/common"; import { Toaster } from "components/ads/Toast"; import { Datasource } from "entities/Datasource"; import _ from "lodash"; -import { createMessage, ERROR_ACTION_RENAME_FAIL } from "constants/messages"; +import { + createMessage, + ERROR_ACTION_RENAME_FAIL, +} from "@appsmith/constants/messages"; import get from "lodash/get"; import { initFormEvaluations, diff --git a/app/client/src/sagas/SnipingModeSagas.ts b/app/client/src/sagas/SnipingModeSagas.ts index 677f0e47b9..5ab7676030 100644 --- a/app/client/src/sagas/SnipingModeSagas.ts +++ b/app/client/src/sagas/SnipingModeSagas.ts @@ -19,7 +19,7 @@ import AnalyticsUtil from "../utils/AnalyticsUtil"; import { SNIPING_NOT_SUPPORTED, SNIPING_SELECT_WIDGET_AGAIN, -} from "../constants/messages"; +} from "@appsmith/constants/messages"; import WidgetFactory from "utils/WidgetFactory"; diff --git a/app/client/src/sagas/SuperUserSagas.tsx b/app/client/src/sagas/SuperUserSagas.tsx index da46acfd01..6263af6483 100644 --- a/app/client/src/sagas/SuperUserSagas.tsx +++ b/app/client/src/sagas/SuperUserSagas.tsx @@ -20,7 +20,7 @@ import { TEST_EMAIL_FAILURE, TEST_EMAIL_SUCCESS, TEST_EMAIL_SUCCESS_TROUBLESHOOT, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { getCurrentUser } from "selectors/usersSelectors"; import { EMAIL_SETUP_DOC } from "constants/ThirdPartyConstants"; diff --git a/app/client/src/sagas/WebsocketSagas/handleAppLevelSocketEvents.tsx b/app/client/src/sagas/WebsocketSagas/handleAppLevelSocketEvents.tsx index 68b7ca10b6..413a50b382 100644 --- a/app/client/src/sagas/WebsocketSagas/handleAppLevelSocketEvents.tsx +++ b/app/client/src/sagas/WebsocketSagas/handleAppLevelSocketEvents.tsx @@ -16,7 +16,7 @@ import { Toaster } from "components/ads/Toast"; import { createMessage, INFO_VERSION_MISMATCH_FOUND_RELOAD_REQUEST, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { Variant } from "components/ads/common"; import React from "react"; import { getAppsmithConfigs } from "@appsmith/configs"; diff --git a/app/client/src/sagas/WidgetOperationSagas.tsx b/app/client/src/sagas/WidgetOperationSagas.tsx index 8f43c43e2d..9edf35a2e8 100644 --- a/app/client/src/sagas/WidgetOperationSagas.tsx +++ b/app/client/src/sagas/WidgetOperationSagas.tsx @@ -75,7 +75,7 @@ import { WIDGET_COPY, WIDGET_CUT, ERROR_WIDGET_COPY_NOT_ALLOWED, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { CopiedWidgetGroup, diff --git a/app/client/src/sagas/WidgetSelectionSagas.ts b/app/client/src/sagas/WidgetSelectionSagas.ts index a07e43fd17..17e82edaf3 100644 --- a/app/client/src/sagas/WidgetSelectionSagas.ts +++ b/app/client/src/sagas/WidgetSelectionSagas.ts @@ -19,7 +19,10 @@ import { silentAddSelectionsAction, } from "actions/widgetSelectionActions"; import { Toaster } from "components/ads/Toast"; -import { createMessage, SELECT_ALL_WIDGETS_MSG } from "constants/messages"; +import { + createMessage, + SELECT_ALL_WIDGETS_MSG, +} from "@appsmith/constants/messages"; import { Variant } from "components/ads/common"; import { getSelectedWidget, getSelectedWidgets } from "selectors/ui"; import { diff --git a/app/client/src/utils/AppsmithUtils.tsx b/app/client/src/utils/AppsmithUtils.tsx index b97435e417..5c8296211f 100644 --- a/app/client/src/utils/AppsmithUtils.tsx +++ b/app/client/src/utils/AppsmithUtils.tsx @@ -15,7 +15,7 @@ import { LogLevelDesc } from "loglevel"; import produce from "immer"; import { AppIconCollection, AppIconName } from "components/ads/AppIcon"; import { ERROR_CODES } from "@appsmith/constants/ApiConstants"; -import { createMessage, ERROR_500 } from "../constants/messages"; +import { createMessage, ERROR_500 } from "@appsmith/constants/messages"; import localStorage from "utils/localStorage"; import { APP_MODE } from "entities/App"; import { trimQueryString } from "./helpers"; diff --git a/app/client/src/utils/localStorage.tsx b/app/client/src/utils/localStorage.tsx index ed678f2e84..e155036083 100644 --- a/app/client/src/utils/localStorage.tsx +++ b/app/client/src/utils/localStorage.tsx @@ -6,7 +6,7 @@ import { LOCAL_STORAGE_NO_SPACE_LEFT_ON_DEVICE_MESSAGE, LOCAL_STORAGE_NOT_SUPPORTED_APP_MIGHT_NOT_WORK_AS_EXPECTED, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; class LocalStorageNotSupportedError extends Error { name: string; diff --git a/app/client/src/utils/replayHelpers.tsx b/app/client/src/utils/replayHelpers.tsx index b4b4ca5aa1..a99f91d9a7 100644 --- a/app/client/src/utils/replayHelpers.tsx +++ b/app/client/src/utils/replayHelpers.tsx @@ -17,7 +17,7 @@ import { BULK_WIDGET_ADDED, WIDGET_REMOVED, BULK_WIDGET_REMOVED, -} from "constants/messages"; +} from "@appsmith/constants/messages"; /** * get the text for toast diff --git a/app/client/src/utils/validation/common.ts b/app/client/src/utils/validation/common.ts index 2a1d2edc68..b7fe0250ef 100644 --- a/app/client/src/utils/validation/common.ts +++ b/app/client/src/utils/validation/common.ts @@ -1,4 +1,7 @@ -import { createMessage, FIELD_REQUIRED_ERROR } from "constants/messages"; +import { + createMessage, + FIELD_REQUIRED_ERROR, +} from "@appsmith/constants/messages"; import { ValidationConfig } from "constants/PropertyControlConstants"; import { ValidationTypes } from "constants/WidgetValidation"; import moment from "moment"; diff --git a/app/client/src/widgets/AudioWidget/component/index.tsx b/app/client/src/widgets/AudioWidget/component/index.tsx index f837bb995e..b08a9e8dbd 100644 --- a/app/client/src/widgets/AudioWidget/component/index.tsx +++ b/app/client/src/widgets/AudioWidget/component/index.tsx @@ -1,7 +1,7 @@ import ReactPlayer from "react-player"; import React, { Ref } from "react"; import styled from "styled-components"; -import { createMessage, ENTER_AUDIO_URL } from "constants/messages"; +import { createMessage, ENTER_AUDIO_URL } from "@appsmith/constants/messages"; export interface AudioComponentProps { url?: string; autoplay?: boolean; diff --git a/app/client/src/widgets/BaseInputWidget/component/index.tsx b/app/client/src/widgets/BaseInputWidget/component/index.tsx index d478c8f583..f156964f41 100644 --- a/app/client/src/widgets/BaseInputWidget/component/index.tsx +++ b/app/client/src/widgets/BaseInputWidget/component/index.tsx @@ -29,7 +29,7 @@ import _, { isNil } from "lodash"; import { createMessage, INPUT_WIDGET_DEFAULT_VALIDATION_ERROR, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { InputTypes } from "../constants"; // TODO(abhinav): All of the following imports should not be in widgets. diff --git a/app/client/src/widgets/ButtonWidget/component/index.tsx b/app/client/src/widgets/ButtonWidget/component/index.tsx index 2d9c9eea80..084e285627 100644 --- a/app/client/src/widgets/ButtonWidget/component/index.tsx +++ b/app/client/src/widgets/ButtonWidget/component/index.tsx @@ -18,7 +18,7 @@ import { GOOGLE_RECAPTCHA_KEY_ERROR, GOOGLE_RECAPTCHA_DOMAIN_ERROR, createMessage, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { ThemeProp, Variant } from "components/ads/common"; import { Toaster } from "components/ads/Toast"; diff --git a/app/client/src/widgets/CurrencyInputWidget/widget/index.tsx b/app/client/src/widgets/CurrencyInputWidget/widget/index.tsx index b492013c28..3146270558 100644 --- a/app/client/src/widgets/CurrencyInputWidget/widget/index.tsx +++ b/app/client/src/widgets/CurrencyInputWidget/widget/index.tsx @@ -9,7 +9,10 @@ import { ValidationTypes, ValidationResponse, } from "constants/WidgetValidation"; -import { createMessage, FIELD_REQUIRED_ERROR } from "constants/messages"; +import { + createMessage, + FIELD_REQUIRED_ERROR, +} from "@appsmith/constants/messages"; import { DerivedPropertiesMap } from "utils/WidgetFactory"; import { CurrencyDropdownOptions, diff --git a/app/client/src/widgets/DatePickerWidget/component/index.tsx b/app/client/src/widgets/DatePickerWidget/component/index.tsx index a051446802..20ba0d800f 100644 --- a/app/client/src/widgets/DatePickerWidget/component/index.tsx +++ b/app/client/src/widgets/DatePickerWidget/component/index.tsx @@ -19,7 +19,7 @@ import ErrorTooltip from "components/editorComponents/ErrorTooltip"; import { createMessage, DATE_WIDGET_DEFAULT_VALIDATION_ERROR, -} from "constants/messages"; +} from "@appsmith/constants/messages"; const StyledControlGroup = styled(ControlGroup)<{ isValid: boolean }>` &&& { diff --git a/app/client/src/widgets/DatePickerWidget2/component/index.tsx b/app/client/src/widgets/DatePickerWidget2/component/index.tsx index 8d8a34f743..c273f70fcb 100644 --- a/app/client/src/widgets/DatePickerWidget2/component/index.tsx +++ b/app/client/src/widgets/DatePickerWidget2/component/index.tsx @@ -18,7 +18,7 @@ import ErrorTooltip from "components/editorComponents/ErrorTooltip"; import { createMessage, DATE_WIDGET_DEFAULT_VALIDATION_ERROR, -} from "constants/messages"; +} from "@appsmith/constants/messages"; const StyledControlGroup = styled(ControlGroup)<{ isValid: boolean }>` &&& { diff --git a/app/client/src/widgets/InputWidget/component/index.tsx b/app/client/src/widgets/InputWidget/component/index.tsx index 8b95ecb99f..19a5f7e618 100644 --- a/app/client/src/widgets/InputWidget/component/index.tsx +++ b/app/client/src/widgets/InputWidget/component/index.tsx @@ -29,7 +29,7 @@ import _ from "lodash"; import { createMessage, INPUT_WIDGET_DEFAULT_VALIDATION_ERROR, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { InputType, InputTypes } from "../constants"; import CurrencyTypeDropdown, { diff --git a/app/client/src/widgets/InputWidget/widget/index.tsx b/app/client/src/widgets/InputWidget/widget/index.tsx index d734e5576b..22f9efc97f 100644 --- a/app/client/src/widgets/InputWidget/widget/index.tsx +++ b/app/client/src/widgets/InputWidget/widget/index.tsx @@ -16,7 +16,7 @@ import { createMessage, FIELD_REQUIRED_ERROR, INPUT_DEFAULT_TEXT_MAX_CHAR_ERROR, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { DerivedPropertiesMap } from "utils/WidgetFactory"; import { InputType, InputTypes } from "../constants"; import { GRID_DENSITY_MIGRATION_V1 } from "widgets/constants"; diff --git a/app/client/src/widgets/InputWidgetV2/widget/index.tsx b/app/client/src/widgets/InputWidgetV2/widget/index.tsx index bcc3f5562e..08add250a7 100644 --- a/app/client/src/widgets/InputWidgetV2/widget/index.tsx +++ b/app/client/src/widgets/InputWidgetV2/widget/index.tsx @@ -11,7 +11,7 @@ import { createMessage, FIELD_REQUIRED_ERROR, INPUT_DEFAULT_TEXT_MAX_CHAR_ERROR, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { DerivedPropertiesMap } from "utils/WidgetFactory"; import { GRID_DENSITY_MIGRATION_V1 } from "widgets/constants"; import { AutocompleteDataType } from "utils/autocomplete/TernServer"; diff --git a/app/client/src/widgets/PhoneInputWidget/widget/index.tsx b/app/client/src/widgets/PhoneInputWidget/widget/index.tsx index dd5024816f..6e4d3b73ca 100644 --- a/app/client/src/widgets/PhoneInputWidget/widget/index.tsx +++ b/app/client/src/widgets/PhoneInputWidget/widget/index.tsx @@ -7,7 +7,10 @@ import { ValidationTypes, ValidationResponse, } from "constants/WidgetValidation"; -import { createMessage, FIELD_REQUIRED_ERROR } from "constants/messages"; +import { + createMessage, + FIELD_REQUIRED_ERROR, +} from "@appsmith/constants/messages"; import { DerivedPropertiesMap } from "utils/WidgetFactory"; import { getCountryCode, diff --git a/app/client/src/widgets/TableWidget/component/TableFilterPaneContent.tsx b/app/client/src/widgets/TableWidget/component/TableFilterPaneContent.tsx index 0307352a7d..d777a1a183 100644 --- a/app/client/src/widgets/TableWidget/component/TableFilterPaneContent.tsx +++ b/app/client/src/widgets/TableWidget/component/TableFilterPaneContent.tsx @@ -14,7 +14,7 @@ import CascadeFields from "./CascadeFields"; import { createMessage, TABLE_FILTER_COLUMN_TYPE_CALLOUT, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { ControlIcons } from "icons/ControlIcons"; import Icon, { IconSize } from "components/ads/Icon"; diff --git a/app/client/src/widgets/TableWidget/widget/propertyConfig.ts b/app/client/src/widgets/TableWidget/widget/propertyConfig.ts index 327a2c54e7..c3f06ecf4d 100644 --- a/app/client/src/widgets/TableWidget/widget/propertyConfig.ts +++ b/app/client/src/widgets/TableWidget/widget/propertyConfig.ts @@ -22,7 +22,7 @@ import { import { createMessage, TABLE_WIDGET_TOTAL_RECORD_TOOLTIP, -} from "constants/messages"; +} from "@appsmith/constants/messages"; import { IconNames } from "@blueprintjs/icons"; const ICON_NAMES = Object.keys(IconNames).map( diff --git a/app/client/src/widgets/VideoWidget/component/index.tsx b/app/client/src/widgets/VideoWidget/component/index.tsx index 342651d51a..67170e5a87 100644 --- a/app/client/src/widgets/VideoWidget/component/index.tsx +++ b/app/client/src/widgets/VideoWidget/component/index.tsx @@ -1,7 +1,7 @@ import ReactPlayer from "react-player"; import React, { Ref } from "react"; import styled from "styled-components"; -import { createMessage, ENTER_VIDEO_URL } from "constants/messages"; +import { createMessage, ENTER_VIDEO_URL } from "@appsmith/constants/messages"; export interface VideoComponentProps { url?: string; autoplay?: boolean;