Minor bug fixes

This commit is contained in:
Shaurya Sharma 2025-04-04 01:23:58 +05:30
parent a0a1480594
commit 73f630668a
2 changed files with 7 additions and 1 deletions

View file

@ -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;

View file

@ -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,