From caaae7ae74b41ac8b074ae90834cfa67dcb25d44 Mon Sep 17 00:00:00 2001 From: gsmithun4 Date: Wed, 20 Nov 2024 14:56:57 +0530 Subject: [PATCH 1/5] bump version --- .version | 2 +- frontend/.version | 2 +- server/.version | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.version b/.version index 99ba0ddace..09ce5a7d5a 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -3.0.2-ce-lts +3.0.3-ce-lts diff --git a/frontend/.version b/frontend/.version index 99ba0ddace..09ce5a7d5a 100644 --- a/frontend/.version +++ b/frontend/.version @@ -1 +1 @@ -3.0.2-ce-lts +3.0.3-ce-lts diff --git a/server/.version b/server/.version index 99ba0ddace..09ce5a7d5a 100644 --- a/server/.version +++ b/server/.version @@ -1 +1 @@ -3.0.2-ce-lts +3.0.3-ce-lts From d29d0c730e23f4c1bb0b615104482101188f5fe5 Mon Sep 17 00:00:00 2001 From: Rohan Lahori <64496391+rohanlahori@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:58:58 +0530 Subject: [PATCH 2/5] Local data source discontinued changes (#11344) * basic setup changes * minor changes * minor ui fix * remove parameter check and minor refactoring * bugfix * variable changes * css changes * removed consoles * removed consoles * pr review changes * documentation link changes * minor css changes --- frontend/assets/images/icons/info-icon.svg | 5 ++ .../Components/QueryManagerBody.jsx | 29 +++++++++- .../NotificationBanner/NotificationBanner.jsx | 49 +++++++++++++++++ .../_components/NotificationBanner/index.js | 1 + .../NotificationBanner/resources/styles.scss | 55 +++++++++++++++++++ 5 files changed, 136 insertions(+), 3 deletions(-) create mode 100644 frontend/assets/images/icons/info-icon.svg create mode 100644 frontend/src/_components/NotificationBanner/NotificationBanner.jsx create mode 100644 frontend/src/_components/NotificationBanner/index.js create mode 100644 frontend/src/_components/NotificationBanner/resources/styles.scss diff --git a/frontend/assets/images/icons/info-icon.svg b/frontend/assets/images/icons/info-icon.svg new file mode 100644 index 0000000000..66528cbddb --- /dev/null +++ b/frontend/assets/images/icons/info-icon.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/AppBuilder/QueryManager/Components/QueryManagerBody.jsx b/frontend/src/AppBuilder/QueryManager/Components/QueryManagerBody.jsx index 2a7be4a37d..c891ba4c95 100644 --- a/frontend/src/AppBuilder/QueryManager/Components/QueryManagerBody.jsx +++ b/frontend/src/AppBuilder/QueryManager/Components/QueryManagerBody.jsx @@ -19,6 +19,7 @@ import { DATA_SOURCE_TYPE } from '@/_helpers/constants'; import { canDeleteDataSource, canReadDataSource, canUpdateDataSource } from '@/_helpers'; import useStore from '@/AppBuilder/_stores/store'; import { EventManager } from '@/AppBuilder/RightSideBar/Inspector/EventManager'; +import NotificationBanner from '@/_components/NotificationBanner'; export const QueryManagerBody = ({ darkMode, options, setOptions, activeTab }) => { const { t } = useTranslation(); @@ -30,6 +31,7 @@ export const QueryManagerBody = ({ darkMode, options, setOptions, activeTab }) = const selectedDataSource = useStore((state) => state.queryPanel.selectedDataSource); const changeDataQuery = useStore((state) => state.dataQuery.changeDataQuery); const updateDataQuery = useStore((state) => state.dataQuery.updateDataQuery); + const [showLocalDataSourceDeprecationBanner, setshowLocalDataSourceDeprecationBanner] = useState(false); const [dataSourceMeta, setDataSourceMeta] = useState(null); /* - Added the below line to cause re-rendering when the query is switched @@ -280,7 +282,7 @@ export const QueryManagerBody = ({ darkMode, options, setOptions, activeTab }) = return ( <>
- {selectedQuery && ( + {selectedQuery && !showLocalDataSourceDeprecationBanner && ( ); }; + useEffect(() => { + const staticDataSources = ['runjs', 'runpy', 'tooljetdb']; + // added specific check for rest api - as it is a part of both : default and global data sources + const showDeprecationBanner = + selectedDataSource == null && + selectedQuery && + !staticDataSources.includes(selectedDataSource?.kind) && + (selectedDataSource?.kind !== 'restapi' || selectedDataSource?.type !== 'default'); + + if (showDeprecationBanner) { + setshowLocalDataSourceDeprecationBanner(true); + } else { + setshowLocalDataSourceDeprecationBanner(false); + } + }, [selectedDataSource, selectedQuery]); // if (selectedQueryId !== selectedQuery?.id) return; const hasPermissions = @@ -318,7 +335,6 @@ export const QueryManagerBody = ({ darkMode, options, setOptions, activeTab }) = canReadDataSource(selectedQuery?.data_source_id) || canDeleteDataSource() : true; - return (
{selectedDataSource === null || !selectedQuery ? ( - renderDataSourcesList() + showLocalDataSourceDeprecationBanner ? ( + <> + + {renderChangeDataSource()} + + ) : ( + renderDataSourcesList() + ) ) : ( <> {selectedQuery?.data_source_id && activeTab === 1 && renderChangeDataSource()} diff --git a/frontend/src/_components/NotificationBanner/NotificationBanner.jsx b/frontend/src/_components/NotificationBanner/NotificationBanner.jsx new file mode 100644 index 0000000000..8b61b37f1d --- /dev/null +++ b/frontend/src/_components/NotificationBanner/NotificationBanner.jsx @@ -0,0 +1,49 @@ +import React from 'react'; +import { Alert } from '@/_ui/Alert/Alert'; +import './resources/styles.scss'; + +const DEFAULT_CONFIG = { + docsLink: ' https://docs.tooljet.com/docs/data-sources/local-data-sources-migration', +}; + +const DEFAULT_MESSAGES = { + prefix: 'This query is connected to a local data source which has been', + highlightedText: 'discontinued', + middle: 'Please create a global data source connection to reconnect your query.', + suffix: 'to know more.', + linkText: 'Read documentation', +}; + +const NotificationBanner = ({ + docsLink, + customMessage, + darkMode = false, + highlightedText = DEFAULT_MESSAGES.highlightedText, + highlightedClassName = 'highlighted-text', + enhanceDisabledVisibility = false, +}) => { + const currentDocsLink = docsLink || DEFAULT_CONFIG.docsLink; + + const bannerMessage = customMessage || ( + <> + {DEFAULT_MESSAGES.prefix} {highlightedText}.{' '} + {DEFAULT_MESSAGES.middle}{' '} + + {DEFAULT_MESSAGES.linkText} + {' '} + {DEFAULT_MESSAGES.suffix} + + ); + + return ( +
+ +
{bannerMessage}
+
+
+ ); +}; + +export default NotificationBanner; + +// To Do later: Expand this component properly to make it generic notification component diff --git a/frontend/src/_components/NotificationBanner/index.js b/frontend/src/_components/NotificationBanner/index.js new file mode 100644 index 0000000000..e762ccced6 --- /dev/null +++ b/frontend/src/_components/NotificationBanner/index.js @@ -0,0 +1 @@ +export { default } from './NotificationBanner'; diff --git a/frontend/src/_components/NotificationBanner/resources/styles.scss b/frontend/src/_components/NotificationBanner/resources/styles.scss new file mode 100644 index 0000000000..7c8d644933 --- /dev/null +++ b/frontend/src/_components/NotificationBanner/resources/styles.scss @@ -0,0 +1,55 @@ +.notification-banner { + display: flex; + padding: var(--3, 6px) var(--6, 12px); + flex-direction: column; + justify-content: center; + align-items: flex-start; + gap: 32px; + flex: 1 0 0; + border-radius: var(--3, 6px); + background: var(--background-warning-weak, #FAEFE7); + border: none !important; + outline: none !important; + opacity: 1; + + img { + margin-top: -5px !important; + } +} + +@media screen and (min-width: 1200px) { + .notification-banner { + justify-content: center !important; + align-items: center !important; + } + + &>div { + justify-content: center !important; + } + +} + +.notification-content { + color: var(--text-default, #1B1F24); + font-family: "IBM Plex Sans"; + font-size: 11px; + font-style: normal; + font-weight: 400; + line-height: 16px; + + &.disabled { + font-weight: 700 !important; + opacity: 1 !important; + } +} + +.highlighted-text { + font-weight: 600 !important; + font-style: bold; +} + +.documentation-link { + font-weight: 400 !important; + color: var(--primary, #3E63DD) !important; + text-decoration-line: underline !important; +} \ No newline at end of file From be7d461816ba0a57116cbdeef51df26a933f5730 Mon Sep 17 00:00:00 2001 From: Rohan Lahori <64496391+rohanlahori@users.noreply.github.com> Date: Thu, 21 Nov 2024 12:26:22 +0530 Subject: [PATCH 3/5] CE Subpath pending issues (#11352) * subpath fix * subpath fix * minor fix * minor fix * ee-cherrypicked --- .../OrganizationManager/CreateOrganization.jsx | 2 +- server/src/helpers/utils.helper.ts | 10 ++++++++++ server/src/main.ts | 11 ++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/frontend/src/_components/OrganizationManager/CreateOrganization.jsx b/frontend/src/_components/OrganizationManager/CreateOrganization.jsx index 82bd046ae1..ef256014dd 100644 --- a/frontend/src/_components/OrganizationManager/CreateOrganization.jsx +++ b/frontend/src/_components/OrganizationManager/CreateOrganization.jsx @@ -148,9 +148,9 @@ export const CreateOrganization = ({ showCreateOrg, setShowCreateOrg }) => { setSlug({ value: defaultValue, error: '' }); const checkWorkspaceUniqueness = async () => { + sluginput.current.value = defaultValue; try { await organizationService.checkWorkspaceUniqueness(null, defaultValue); - sluginput.current.value = defaultValue; } catch (errResponse) { let error = { status: false, diff --git a/server/src/helpers/utils.helper.ts b/server/src/helpers/utils.helper.ts index 72c64c0c37..41dde11284 100644 --- a/server/src/helpers/utils.helper.ts +++ b/server/src/helpers/utils.helper.ts @@ -424,3 +424,13 @@ export function mergeDeep(target, source, seen = new WeakMap()) { return target; } +export const getSubpath = () => { + const subpath = process.env.SUB_PATH || ''; + // Ensure subpath starts and ends with slashes + if (subpath) { + if (!subpath.startsWith('/') || !subpath.endsWith('/')) { + throw new Error('SUB_PATH must start and end with a slash'); + } + } + return subpath; +}; \ No newline at end of file diff --git a/server/src/main.ts b/server/src/main.ts index 0efcbbfd18..f7a129ff86 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -13,6 +13,7 @@ import { bootstrap as globalAgentBootstrap } from 'global-agent'; import { join } from 'path'; import * as helmet from 'helmet'; import * as express from 'express'; +import { getSubpath } from '@helpers/utils.helper'; const fs = require('fs'); @@ -100,7 +101,15 @@ function setSecurityHeaders(app, configService) { app.use((req, res, next) => { res.setHeader('Permissions-Policy', 'geolocation=(self), camera=(), microphone=()'); - res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate'); + + const subpath = getSubpath(); + const path = req.path.replace(subpath, subpath ? '/' : ''); + if (path.startsWith('/api/')) { + res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate'); + } else { + res.setHeader('Cache-Control', 'public, max-age=31536000, immutable'); + } + return next(); }); } From 3f681c1bdee8a327f9d4d26434a82242c7a2e640 Mon Sep 17 00:00:00 2001 From: Rudhra Deep Biswas <98055396+rudeUltra@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:06:33 +0530 Subject: [PATCH 4/5] Integration and Workspace Constants Page UI Fixes (#11377) * ui fixes ws constants and integration page * ws const css --- frontend/src/ManageOrgConstants/ConstantFormStyle.scss | 2 +- frontend/src/ManageOrgConstants/ConstantTable.jsx | 6 +++--- frontend/src/ManageOrgConstants/ManageOrgConstants.jsx | 2 +- frontend/src/_styles/theme.scss | 7 ++++++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/frontend/src/ManageOrgConstants/ConstantFormStyle.scss b/frontend/src/ManageOrgConstants/ConstantFormStyle.scss index 2984295cfa..3390b70e8a 100644 --- a/frontend/src/ManageOrgConstants/ConstantFormStyle.scss +++ b/frontend/src/ManageOrgConstants/ConstantFormStyle.scss @@ -51,7 +51,7 @@ border: 1px solid #e9ece; box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); overflow: hidden; - width: 920px; + // width: 920px; //Add it for EE height: 620px; padding: 20px; border-radius: 4px; diff --git a/frontend/src/ManageOrgConstants/ConstantTable.jsx b/frontend/src/ManageOrgConstants/ConstantTable.jsx index 38039a12d3..cf78cb598b 100644 --- a/frontend/src/ManageOrgConstants/ConstantTable.jsx +++ b/frontend/src/ManageOrgConstants/ConstantTable.jsx @@ -90,7 +90,7 @@ const ConstantTable = ({ {constants.map((constant) => ( - + - + {canUpdateDeleteConstant && ( - +
{
-
+
diff --git a/frontend/src/_styles/theme.scss b/frontend/src/_styles/theme.scss index 1b145788b4..07895c1392 100644 --- a/frontend/src/_styles/theme.scss +++ b/frontend/src/_styles/theme.scss @@ -7864,7 +7864,7 @@ tbody { .marketplace-page-sidebar { height: calc(100vh - 64px); - max-width: 288px; + max-width: 272px; background-color: var(--page-default); border-right: 1px solid var(--slate5) !important; display: grid !important; @@ -12830,6 +12830,11 @@ color: var(--text-default); padding: 16px; padding-top: 0px; padding-bottom: 0px; + + .p-3-constants{ + padding: 1rem !important; + padding-left: 0px !important; + } } .card-footer { From 1f73c11289378f76d942553636a969d744afde1a Mon Sep 17 00:00:00 2001 From: gsmithun4 Date: Thu, 21 Nov 2024 20:14:08 +0530 Subject: [PATCH 5/5] bump version --- .version | 2 +- frontend/.version | 2 +- server/.version | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.version b/.version index 09ce5a7d5a..2ae831adb3 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -3.0.3-ce-lts +3.0.4-ce-lts diff --git a/frontend/.version b/frontend/.version index 09ce5a7d5a..2ae831adb3 100644 --- a/frontend/.version +++ b/frontend/.version @@ -1 +1 @@ -3.0.3-ce-lts +3.0.4-ce-lts diff --git a/server/.version b/server/.version index 09ce5a7d5a..2ae831adb3 100644 --- a/server/.version +++ b/server/.version @@ -1 +1 @@ -3.0.3-ce-lts +3.0.4-ce-lts