mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-17 21:00:45 +00:00
Merge branch 'main' into feature/CE-878-make-the-operations-dashboard
This commit is contained in:
@ -354,8 +354,7 @@ const CommandMenu = ({metaData}: Props) =>
|
|||||||
<Grid container columnSpacing={5} rowSpacing={1}>
|
<Grid container columnSpacing={5} rowSpacing={1}>
|
||||||
<Grid item xs={6} className={classes.item}><span className={classes.keyboardKey}>n</span>Create a New Record</Grid>
|
<Grid item xs={6} className={classes.item}><span className={classes.keyboardKey}>n</span>Create a New Record</Grid>
|
||||||
<Grid item xs={6} className={classes.item}><span className={classes.keyboardKey}>r</span>Refresh the Query</Grid>
|
<Grid item xs={6} className={classes.item}><span className={classes.keyboardKey}>r</span>Refresh the Query</Grid>
|
||||||
<Grid item xs={6} className={classes.item}><span className={classes.keyboardKey}>c</span>Open the Columns Panel</Grid>
|
<Grid item xs={6} className={classes.item}><span className={classes.keyboardKey}>f</span>Open the Filter Builder (Advanced mode only)</Grid>
|
||||||
<Grid item xs={6} className={classes.item}><span className={classes.keyboardKey}>f</span>Open the Filter Panel</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Typography variant="h6" pt={3}>Record View</Typography>
|
<Typography variant="h6" pt={3}>Record View</Typography>
|
||||||
|
@ -39,65 +39,79 @@ ChartJS.register(
|
|||||||
Legend
|
Legend
|
||||||
);
|
);
|
||||||
|
|
||||||
export const options = {
|
export const makeOptions = (data: DefaultChartData) =>
|
||||||
maintainAspectRatio: false,
|
{
|
||||||
responsive: true,
|
return({
|
||||||
animation: {
|
maintainAspectRatio: false,
|
||||||
duration: 0
|
responsive: true,
|
||||||
},
|
animation: {
|
||||||
elements: {
|
duration: 0
|
||||||
bar: {
|
},
|
||||||
borderRadius: 4
|
elements: {
|
||||||
}
|
bar: {
|
||||||
},
|
borderRadius: 4
|
||||||
plugins: {
|
}
|
||||||
tooltip: {
|
},
|
||||||
// todo - some configs around this
|
onHover: function (event: any, elements: any[], chart: any)
|
||||||
callbacks: {
|
{
|
||||||
title: function(context: any)
|
if(event.type == "mousemove" && elements.length > 0 && data.urls && data.urls.length > elements[0].index && data.urls[elements[0].index])
|
||||||
{
|
{
|
||||||
return ("");
|
chart.canvas.style.cursor = "pointer";
|
||||||
},
|
}
|
||||||
label: function(context: any)
|
else
|
||||||
{
|
{
|
||||||
if(context.dataset.label.startsWith(context.label))
|
chart.canvas.style.cursor = "default";
|
||||||
{
|
}
|
||||||
return `${context.label}: ${context.formattedValue}`;
|
},
|
||||||
}
|
plugins: {
|
||||||
else
|
tooltip: {
|
||||||
|
// todo - some configs around this
|
||||||
|
callbacks: {
|
||||||
|
title: function(context: any)
|
||||||
{
|
{
|
||||||
return ("");
|
return ("");
|
||||||
|
},
|
||||||
|
label: function(context: any)
|
||||||
|
{
|
||||||
|
if(context.dataset.label.startsWith(context.label))
|
||||||
|
{
|
||||||
|
return `${context.label}: ${context.formattedValue}`;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
position: "bottom",
|
||||||
|
labels: {
|
||||||
|
usePointStyle: true,
|
||||||
|
pointStyle: "circle",
|
||||||
|
boxHeight: 6,
|
||||||
|
boxWidth: 6,
|
||||||
|
padding: 12,
|
||||||
|
font: {
|
||||||
|
size: 14
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
legend: {
|
scales: {
|
||||||
position: "bottom",
|
x: {
|
||||||
labels: {
|
stacked: true,
|
||||||
usePointStyle: true,
|
grid: {display: false},
|
||||||
pointStyle: "circle",
|
ticks: {autoSkip: false, maxRotation: 90}
|
||||||
boxHeight: 6,
|
},
|
||||||
boxWidth: 6,
|
y: {
|
||||||
padding: 12,
|
stacked: true,
|
||||||
font: {
|
position: "right",
|
||||||
size: 14
|
ticks: {precision: 0}
|
||||||
}
|
},
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
x: {
|
|
||||||
stacked: true,
|
|
||||||
grid: {display: false},
|
|
||||||
ticks: {autoSkip: false, maxRotation: 90}
|
|
||||||
},
|
},
|
||||||
y: {
|
});
|
||||||
stacked: true,
|
}
|
||||||
position: "right",
|
|
||||||
ticks: {precision: 0}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
interface Props
|
interface Props
|
||||||
{
|
{
|
||||||
@ -151,7 +165,7 @@ function StackedBarChart({data, chartSubheaderData}: Props): JSX.Element
|
|||||||
<Box>
|
<Box>
|
||||||
{chartSubheaderData && (<ChartSubheaderWithData chartSubheaderData={chartSubheaderData} />)}
|
{chartSubheaderData && (<ChartSubheaderWithData chartSubheaderData={chartSubheaderData} />)}
|
||||||
<Box width="100%" height="300px">
|
<Box width="100%" height="300px">
|
||||||
<Bar data={data} options={options} getElementsAtEvent={handleClick} />
|
<Bar data={data} options={makeOptions(data)} getElementsAtEvent={handleClick} />
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
) : <Skeleton sx={{marginLeft: "20px", marginRight: "20px", height: "200px"}} />;
|
) : <Skeleton sx={{marginLeft: "20px", marginRight: "20px", height: "200px"}} />;
|
||||||
|
@ -70,7 +70,7 @@ function PieChart({description, chartData, chartSubheaderData}: Props): JSX.Elem
|
|||||||
chartData.dataset.backgroundColors = chartColors;
|
chartData.dataset.backgroundColors = chartColors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const {data, options} = configs(chartData?.labels || [], chartData?.dataset || {});
|
const {data, options} = configs(chartData?.labels || [], chartData?.dataset || {}, chartData?.dataset?.urls);
|
||||||
|
|
||||||
useEffect(() =>
|
useEffect(() =>
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@ import colors from "qqq/assets/theme/base/colors";
|
|||||||
|
|
||||||
const {gradients, dark} = colors;
|
const {gradients, dark} = colors;
|
||||||
|
|
||||||
function configs(labels: any, datasets: any)
|
function configs(labels: any, datasets: any, urls: string[] | undefined)
|
||||||
{
|
{
|
||||||
const backgroundColors = [];
|
const backgroundColors = [];
|
||||||
|
|
||||||
@ -66,6 +66,17 @@ function configs(labels: any, datasets: any)
|
|||||||
options: {
|
options: {
|
||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
responsive: true,
|
responsive: true,
|
||||||
|
onHover: function (event: any, elements: any[], chart: any)
|
||||||
|
{
|
||||||
|
if(event.type == "mousemove" && elements.length > 0 && urls && urls.length > elements[0].index && urls[elements[0].index])
|
||||||
|
{
|
||||||
|
chart.canvas.style.cursor = "pointer";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
chart.canvas.style.cursor = "default";
|
||||||
|
}
|
||||||
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
callbacks: {
|
callbacks: {
|
||||||
|
@ -610,11 +610,14 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
updateTable("'r' keyboard event");
|
updateTable("'r' keyboard event");
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
// disable until we add a ... ref down to let us programmatically open Columns button
|
||||||
else if (! e.metaKey && e.key === "c")
|
else if (! e.metaKey && e.key === "c")
|
||||||
{
|
{
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
gridApiRef.current.showPreferences(GridPreferencePanelsValue.columns)
|
gridApiRef.current.showPreferences(GridPreferencePanelsValue.columns)
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
else if (! e.metaKey && e.key === "f")
|
else if (! e.metaKey && e.key === "f")
|
||||||
{
|
{
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
Reference in New Issue
Block a user