diff --git a/frontend/src/AppBuilder/CodeEditor/PreviewBox.jsx b/frontend/src/AppBuilder/CodeEditor/PreviewBox.jsx index bc8411752a..3ca9261a4b 100644 --- a/frontend/src/AppBuilder/CodeEditor/PreviewBox.jsx +++ b/frontend/src/AppBuilder/CodeEditor/PreviewBox.jsx @@ -96,7 +96,7 @@ export const PreviewBox = ({ const [largeDataset, setLargeDataset] = useState(false); const globals = useStore((state) => state.getAllExposedValues().constants || {}, shallow); const secrets = useStore((state) => state.getSecrets(), shallow); - const globalServerConstantsRegex = /.*\{\{.*globals\.server\..*\}\}.*/; + const globalServerConstantsRegex = /^\{\{.*globals\.server.*\}\}$/; const getPreviewContent = (content, type) => { if (content === undefined || content === null) return currentValue; diff --git a/frontend/src/AppBuilder/_stores/slices/codeHinterSlice.js b/frontend/src/AppBuilder/_stores/slices/codeHinterSlice.js index 5933a727f1..7f73632524 100644 --- a/frontend/src/AppBuilder/_stores/slices/codeHinterSlice.js +++ b/frontend/src/AppBuilder/_stores/slices/codeHinterSlice.js @@ -40,10 +40,16 @@ export const createCodeHinterSlice = (set, get) => ({ const isServerSideGlobalEnabled = !!get()?.license?.featureAccess?.serverSideGlobal; const serverHints = []; const hints = get().getSuggestions(); + console.log('isServerSideGlobalEnabled', isServerSideGlobalEnabled, 'isInsideQueryManager', isInsideQueryManager); if (isInsideQueryManager && isServerSideGlobalEnabled) { + serverHints.push({ hint: 'globals.server', type: 'Object' }); hints?.appHints?.forEach((appHint) => { if (appHint?.hint?.startsWith('globals.currentUser')) { const key = appHint?.hint?.replace('globals.currentUser', 'globals.server.currentUser'); + console.log({ + hint: key, + type: appHint?.type, + }); serverHints.push({ hint: key, type: appHint?.type,