Skip to content

Commit 4119048

Browse files
committed
update banner
1 parent d78b1f3 commit 4119048

6 files changed

Lines changed: 144 additions & 131 deletions

File tree

src/app/App.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ const TableMenu: React.FC = () => {
255255
<Typography fontSize="inherit" sx={{ }}>
256256
<CloudQueueIcon fontSize="inherit" /> Database
257257
</Typography>
258-
} component="dialog" />
258+
} />
259259
</MenuItem>
260260
<MenuItem onClick={(e) => {}}>
261261
<DataLoadingChatDialog buttonElement={<Typography fontSize="inherit" sx={{ }}>
@@ -915,6 +915,24 @@ export const AppFC: FC<AppFCProps> = function AppFC(appProps) {
915915
}
916916
]);
917917

918+
let footer = <Box sx={{ zIndex: 0, position: 'absolute', bottom: 0, left: 0, right: 0, color: 'text.secondary', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
919+
<Button size="small" color="inherit"
920+
sx={{ textTransform: 'none'}}
921+
target="_blank" rel="noopener noreferrer"
922+
href="https://www.microsoft.com/en-us/privacy/privacystatement">Privacy & Cookies</Button>
923+
<Divider orientation="vertical" variant="middle" flexItem sx={{ mx: 1 }} />
924+
<Button size="small" color="inherit"
925+
sx={{ textTransform: 'none'}}
926+
target="_blank" rel="noopener noreferrer"
927+
href="Microsoft Azure Website Terms of Use">Terms of Use</Button>
928+
<Divider orientation="vertical" variant="middle" flexItem sx={{ mx: 1 }} />
929+
<Button size="small" color="inherit"
930+
sx={{ textTransform: 'none'}}
931+
target="_blank" rel="noopener noreferrer"
932+
href="https://github.com/microsoft/data-formulator/issues">Contact Us</Button>
933+
<Typography sx={{ display: 'inline', fontSize: '12px', ml: 1 }}>@ {new Date().getFullYear()}</Typography>
934+
</Box>
935+
918936
let app =
919937
<Box sx={{
920938
position: 'absolute',

src/app/dfSlice.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ const initialState: DataFormulatorState = {
159159

160160
serverConfig: {
161161
DISABLE_DISPLAY_KEYS: false,
162-
DISABLE_DATABASE: false,
162+
DISABLE_DATABASE: true, // disable database by default
163163
DISABLE_FILE_UPLOAD: false,
164164
PROJECT_FRONT_PAGE: false,
165165
},

src/app/utils.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,17 @@ export const assembleVegaChart = (
240240
encodingObj["type"] = "nominal";
241241
} else if (fieldMetadata.type == "string" && (fieldMetadata.semanticType == "Decade" || fieldMetadata.semanticType == "Year")) {
242242
encodingObj["type"] = "nominal";
243+
} else if (fieldMetadata.semanticType == 'YearMonth') {
244+
let sampleValues = workingTable.map(r => r[field.name]).slice(0, 10);
245+
// Check if values are in yyyy-mm format (temporal) or yyyy-Aug/yyyy-Q1 format (nominal)
246+
let isNumericMonth = sampleValues.some(val => {
247+
if (val && typeof val === 'string') {
248+
// Match yyyy-mm format (e.g., 2023-01, 2023-12)
249+
return /^\d{4}-\d{2}$/.test(val.trim());
250+
}
251+
return false;
252+
});
253+
encodingObj["type"] = isNumericMonth ? "temporal" : "nominal";
243254
} else {
244255
encodingObj["type"] = "temporal";
245256
}

src/views/About.tsx

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,6 @@ export const About: FC<{}> = function About({ }) {
7171
setCurrentFeature((prev) => (prev === features.length - 1 ? 0 : prev + 1));
7272
};
7373

74-
const handleScreenshotPrevious = () => {
75-
setCurrentScreenshot((prev) => (prev === 0 ? screenshots.length - 1 : prev - 1));
76-
};
77-
78-
const handleScreenshotNext = () => {
79-
setCurrentScreenshot((prev) => (prev === screenshots.length - 1 ? 0 : prev + 1));
80-
};
81-
8274
// Preload adjacent carousel items for smoother transitions
8375
useEffect(() => {
8476
const preloadMedia = (index: number) => {
@@ -475,28 +467,31 @@ export const About: FC<{}> = function About({ }) {
475467
</ul>
476468
</Typography>
477469
<Typography variant="caption" sx={{ mt: 4,color: 'text.secondary', fontWeight: 300, letterSpacing: '0.02em' }}>
478-
Research Prototype @ Microsoft Research
470+
Research Prototype from Microsoft Research
479471
</Typography>
480472
</Box>
481473
</Box>
482474
</Box>
483475

484476
{/* Footer */}
485-
<Button
486-
size="small"
487-
color="inherit"
488-
sx={{
489-
position: "absolute",
490-
color:'darkgray',
491-
bottom: 8,
492-
left: 16,
493-
textTransform: 'none'
494-
}}
495-
target="_blank"
496-
rel="noopener noreferrer"
497-
href="https://www.microsoft.com/en-us/privacy/privacystatement"
498-
>
499-
Privacy & Cookies
500-
</Button>
477+
<Box sx={{ color: 'text.secondary', display: 'flex',
478+
backgroundColor: 'rgba(255, 255, 255, 0.89)',
479+
alignItems: 'center', justifyContent: 'center' }}>
480+
<Button size="small" color="inherit"
481+
sx={{ textTransform: 'none'}}
482+
target="_blank" rel="noopener noreferrer"
483+
href="https://www.microsoft.com/en-us/privacy/privacystatement">Privacy & Cookies</Button>
484+
<Divider orientation="vertical" variant="middle" flexItem sx={{ mx: 1 }} />
485+
<Button size="small" color="inherit"
486+
sx={{ textTransform: 'none'}}
487+
target="_blank" rel="noopener noreferrer"
488+
href="https://www.microsoft.com/en-us/legal/intellectualproperty/copyright">Terms of Use</Button>
489+
<Divider orientation="vertical" variant="middle" flexItem sx={{ mx: 1 }} />
490+
<Button size="small" color="inherit"
491+
sx={{ textTransform: 'none'}}
492+
target="_blank" rel="noopener noreferrer"
493+
href="https://github.com/microsoft/data-formulator/issues">Contact Us</Button>
494+
<Typography sx={{ display: 'inline', fontSize: '12px', ml: 1 }}> @ {new Date().getFullYear()}</Typography>
495+
</Box>
501496
</Box>)
502497
}

src/views/DBTableManager.tsx

Lines changed: 69 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,9 @@ export class TableStatisticsView extends React.Component<TableStatisticsViewProp
223223

224224
export const DBTableSelectionDialog: React.FC<{
225225
buttonElement: any,
226-
component: 'dialog' | 'box',
227226
sx?: SxProps
228227
}> = function DBTableSelectionDialog({
229228
buttonElement,
230-
component,
231229
sx,
232230
}) {
233231

@@ -261,7 +259,7 @@ export const DBTableSelectionDialog: React.FC<{
261259
}
262260

263261
useEffect(() => {
264-
//fetchTables();
262+
if (serverConfig.DISABLE_DATABASE) return;
265263
fetchDataLoaders();
266264
}, []);
267265

@@ -275,6 +273,7 @@ export const DBTableSelectionDialog: React.FC<{
275273

276274
// Fetch list of tables
277275
const fetchTables = async () => {
276+
if (serverConfig.DISABLE_DATABASE) return;
278277
try {
279278
const response = await fetch(getUrls().LIST_TABLES);
280279
const data = await response.json();
@@ -939,98 +938,75 @@ export const DBTableSelectionDialog: React.FC<{
939938
{tableView}
940939
</Box>
941940

942-
if (component === 'dialog') {
943-
return (
944-
<>
945-
<Tooltip
946-
title={serverConfig.DISABLE_DATABASE ? (
947-
<Typography sx={{ fontSize: '11px' }}>
948-
Install Data Formulator locally to use database. <br />
949-
Link: <Link
950-
href="https://github.com/microsoft/data-formulator"
951-
target="_blank"
952-
rel="noopener noreferrer"
953-
sx={{ color: 'inherit', textDecoration: 'underline' }}
954-
onClick={(e) => e.stopPropagation()}
955-
>
956-
https://github.com/microsoft/data-formulator
957-
</Link>
958-
</Typography>
959-
) : ""}
960-
placement="top"
961-
>
962-
<span style={{cursor: serverConfig.DISABLE_DATABASE ? 'help' : 'pointer'}}>
963-
<Button variant="text" sx={{fontSize: "inherit", gap: 1}} disabled={serverConfig.DISABLE_DATABASE} onClick={() => {
964-
setTableDialogOpen(true);
965-
}}>
966-
{buttonElement}
967-
</Button>
968-
</span>
969-
</Tooltip>
970-
<Dialog
971-
key="db-table-selection-dialog"
972-
onClose={() => {setTableDialogOpen(false)}}
973-
open={tableDialogOpen}
974-
sx={{ '& .MuiDialog-paper': { maxWidth: '100%', maxHeight: 800, minWidth: 800 } }}
975-
>
976-
<DialogTitle sx={{display: "flex" }} >
977-
Database
978-
<IconButton
979-
sx={{marginLeft: "auto"}}
980-
edge="start"
981-
size="small"
982-
color="inherit"
983-
aria-label="close"
984-
onClick={() => setTableDialogOpen(false)}
941+
return (
942+
<>
943+
<Tooltip
944+
title={serverConfig.DISABLE_DATABASE ? (
945+
<Typography sx={{ fontSize: '11px' }}>
946+
Install Data Formulator locally to use database. <br />
947+
Link: <Link
948+
href="https://github.com/microsoft/data-formulator"
949+
target="_blank"
950+
rel="noopener noreferrer"
951+
sx={{ color: 'inherit', textDecoration: 'underline' }}
952+
onClick={(e) => e.stopPropagation()}
985953
>
986-
<CloseIcon fontSize="inherit"/>
987-
</IconButton>
988-
</DialogTitle>
989-
<DialogContent sx={{p: 1, position: "relative"}}>
990-
{mainContent}
991-
{isUploading && (
992-
<Box sx={{
993-
position: 'absolute',
994-
top: 0,
995-
left: 0,
996-
width: '100%',
997-
height: '100%',
998-
display: 'flex',
999-
alignItems: 'center',
1000-
justifyContent: 'center',
1001-
backgroundColor: 'rgba(255, 255, 255, 0.7)',
1002-
zIndex: 1000
1003-
}}>
1004-
<CircularProgress size={60} thickness={5} />
1005-
</Box>
1006-
)}
1007-
</DialogContent>
1008-
</Dialog>
1009-
</>
1010-
);
1011-
} else {
1012-
return (
1013-
<Box sx={{...sx}}>
1014-
{mainContent}
1015-
{isUploading && (
1016-
<Box sx={{
1017-
position: 'absolute',
1018-
top: 0,
1019-
left: 0,
1020-
width: '100%',
1021-
height: '100%',
1022-
display: 'flex',
1023-
alignItems: 'center',
1024-
justifyContent: 'center',
1025-
backgroundColor: 'rgba(255, 255, 255, 0.7)',
1026-
zIndex: 1000
954+
https://github.com/microsoft/data-formulator
955+
</Link>
956+
</Typography>
957+
) : ""}
958+
placement="top"
959+
>
960+
<span style={{cursor: serverConfig.DISABLE_DATABASE ? 'help' : 'pointer'}}>
961+
<Button variant="text" sx={{fontSize: "inherit", gap: 1}} disabled={serverConfig.DISABLE_DATABASE} onClick={() => {
962+
setTableDialogOpen(true);
1027963
}}>
1028-
<CircularProgress size={60} thickness={5} />
1029-
</Box>
1030-
)}
1031-
</Box>
1032-
);
1033-
}
964+
{buttonElement}
965+
</Button>
966+
</span>
967+
</Tooltip>
968+
<Dialog
969+
key="db-table-selection-dialog"
970+
onClose={() => {setTableDialogOpen(false)}}
971+
open={tableDialogOpen}
972+
sx={{ '& .MuiDialog-paper': { maxWidth: '100%', maxHeight: 800, minWidth: 800 } }}
973+
>
974+
<DialogTitle sx={{display: "flex" }} >
975+
Database
976+
<IconButton
977+
sx={{marginLeft: "auto"}}
978+
edge="start"
979+
size="small"
980+
color="inherit"
981+
aria-label="close"
982+
onClick={() => setTableDialogOpen(false)}
983+
>
984+
<CloseIcon fontSize="inherit"/>
985+
</IconButton>
986+
</DialogTitle>
987+
<DialogContent sx={{p: 1, position: "relative"}}>
988+
{mainContent}
989+
{isUploading && (
990+
<Box sx={{
991+
position: 'absolute',
992+
top: 0,
993+
left: 0,
994+
width: '100%',
995+
height: '100%',
996+
display: 'flex',
997+
alignItems: 'center',
998+
justifyContent: 'center',
999+
backgroundColor: 'rgba(255, 255, 255, 0.7)',
1000+
zIndex: 1000
1001+
}}>
1002+
<CircularProgress size={60} thickness={5} />
1003+
</Box>
1004+
)}
1005+
</DialogContent>
1006+
</Dialog>
1007+
</>
1008+
);
1009+
10341010
}
10351011

10361012
export const DataLoaderForm: React.FC<{

src/views/DataFormulator.tsx

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,26 @@ export const DataFormulatorFC = ({ }) => {
257257
Totals (7 entries) 5 5 5 15
258258
`
259259

260+
let footer = <Box sx={{ color: 'text.secondary', display: 'flex',
261+
backgroundColor: 'rgba(255, 255, 255, 0.89)',
262+
alignItems: 'center', justifyContent: 'center' }}>
263+
<Button size="small" color="inherit"
264+
sx={{ textTransform: 'none'}}
265+
target="_blank" rel="noopener noreferrer"
266+
href="https://www.microsoft.com/en-us/privacy/privacystatement">Privacy & Cookies</Button>
267+
<Divider orientation="vertical" variant="middle" flexItem sx={{ mx: 1 }} />
268+
<Button size="small" color="inherit"
269+
sx={{ textTransform: 'none'}}
270+
target="_blank" rel="noopener noreferrer"
271+
href="https://www.microsoft.com/en-us/legal/intellectualproperty/copyright">Terms of Use</Button>
272+
<Divider orientation="vertical" variant="middle" flexItem sx={{ mx: 1 }} />
273+
<Button size="small" color="inherit"
274+
sx={{ textTransform: 'none'}}
275+
target="_blank" rel="noopener noreferrer"
276+
href="https://github.com/microsoft/data-formulator/issues">Contact Us</Button>
277+
<Typography sx={{ display: 'inline', fontSize: '12px', ml: 1 }}> @ {new Date().getFullYear()}</Typography>
278+
</Box>
279+
260280
let dataUploadRequestBox = <Box sx={{
261281
margin: '4px 4px 4px 8px',
262282
width: 'calc(100vw - 16px)', overflow: 'auto', display: 'flex', flexDirection: 'column', height: '100%',
@@ -297,7 +317,7 @@ Totals (7 entries) 5 5 5 15
297317
<Box component="span" sx={{ mx: 2, color: 'text.disabled', fontSize: '0.8em' }}></Box>
298318
<TableCopyDialogV2 buttonElement={<><ContentPasteIcon sx={{ mr: 1, verticalAlign: 'middle' }} />clipboard</>} disabled={false} />
299319
<Box component="span" sx={{ mx: 2, color: 'text.disabled', fontSize: '0.8em' }}></Box>
300-
<DBTableSelectionDialog buttonElement={<><CloudQueueIcon sx={{ mr: 1, verticalAlign: 'middle' }} />Database</>} component="dialog" />
320+
<DBTableSelectionDialog buttonElement={<><CloudQueueIcon sx={{ mr: 1, verticalAlign: 'middle' }} />Database</>} />
301321
{/* <br /> */}
302322
{/* <Typography sx={{ml: 10, fontSize: 14, color: 'darkgray', transform: 'translateY(-12px)'}}>(csv, tsv, xlsx, json or database)</Typography> */}
303323
<Typography variant="body1" color="text.secondary" sx={{ mt: 2, width: '100%' }}>
@@ -345,12 +365,9 @@ Totals (7 entries) 5 5 5 15
345365
</Box>
346366
</Box>
347367
</Box>
348-
<Button size="small" color="inherit"
349-
sx={{position: "absolute", color:'darkgray', bottom: 8, left: 16, textTransform: 'none'}}
350-
target="_blank" rel="noopener noreferrer"
351-
href="https://www.microsoft.com/en-us/privacy/privacystatement">Privacy & Cookies</Button>
368+
{footer}
352369
</Box>;
353-
370+
354371
return (
355372
<Box sx={{ display: 'block', width: "100%", height: 'calc(100% - 54px)', position: 'relative' }}>
356373
<DndProvider backend={HTML5Backend}>
@@ -376,13 +393,9 @@ Totals (7 entries) 5 5 5 15
376393
<Typography variant="h4" sx={{mt: 3, fontSize: 28, letterSpacing: '0.02em'}}>
377394
First, let's <ModelSelectionButton />
378395
</Typography>
379-
<Typography color="text.primary" variant="body1" sx={{mt: 2}}>Specify an AI endpoint to run {toolName}.</Typography>
380396
<Typography color="text.secondary" variant="body1" sx={{mt: 2, width: 600}}>💡 Models with strong code generation capabilities (e.g., gpt-5, claude-sonnet-4-5) provide best experience with Data Formulator.</Typography>
381397
</Box>
382-
<Button size="small" color="inherit"
383-
sx={{position: "absolute", color:'darkgray', bottom: 0, right: 0, textTransform: 'none'}}
384-
target="_blank" rel="noopener noreferrer"
385-
href="https://www.microsoft.com/en-us/privacy/privacystatement">Privacy & Cookies</Button>
398+
{footer}
386399
</Box>
387400
)}
388401
</DndProvider>

0 commit comments

Comments
 (0)