mirror of https://github.com/buster-so/buster.git
popupdate
This commit is contained in:
parent
6d5f0c24ed
commit
9fa8c6a2d3
|
@ -8,10 +8,11 @@ export const SaveResetFilePopup: React.FC<{
|
|||
open: boolean;
|
||||
onReset: () => void;
|
||||
onSave: () => void;
|
||||
}> = React.memo(({ open, onReset, onSave }) => {
|
||||
isSaving: boolean;
|
||||
}> = React.memo(({ open, onReset, onSave, isSaving = false }) => {
|
||||
return (
|
||||
<PopupContainer show={open}>
|
||||
<SplitterContent onReset={onReset} onSave={onSave} />
|
||||
<SplitterContent onReset={onReset} onSave={onSave} isSaving={isSaving} />
|
||||
</PopupContainer>
|
||||
);
|
||||
});
|
||||
|
@ -19,7 +20,8 @@ export const SaveResetFilePopup: React.FC<{
|
|||
const SplitterContent: React.FC<{
|
||||
onReset: () => void;
|
||||
onSave: () => void;
|
||||
}> = React.memo(({ onReset, onSave }) => {
|
||||
isSaving: boolean;
|
||||
}> = React.memo(({ onReset, onSave, isSaving }) => {
|
||||
return (
|
||||
<div className="flex w-full items-center space-x-2.5">
|
||||
<div className="flex items-center space-x-1">
|
||||
|
@ -35,6 +37,7 @@ const SplitterContent: React.FC<{
|
|||
className="flex items-center"
|
||||
variant="black"
|
||||
onClick={onSave}
|
||||
loading={isSaving}
|
||||
suffix={
|
||||
<div className="flex space-x-1">
|
||||
<Command />
|
||||
|
|
|
@ -22,7 +22,7 @@ export const SelectAxisItemLabel = React.memo(
|
|||
return formatLabel(id, columnLabelFormat, true);
|
||||
}, [columnLabelFormat, id]);
|
||||
|
||||
const Icon = useMemo(() => ColumnTypeIcon[style], [style]);
|
||||
const Icon = useMemo(() => ColumnTypeIcon[style] || ColumnTypeIcon.string, [style]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
|
@ -12,7 +12,13 @@ export const MetricViewFile: React.FC<MetricViewProps> = React.memo(({ metricId
|
|||
file_name
|
||||
}));
|
||||
const { openSuccessMessage } = useBusterNotifications();
|
||||
const { mutateAsync: updateMetric, error: updateMetricError } = useSaveMetric();
|
||||
const {
|
||||
mutateAsync: updateMetric,
|
||||
isPending: isUpdatingMetric,
|
||||
error: updateMetricError
|
||||
} = useSaveMetric({
|
||||
updateOnSave: true
|
||||
});
|
||||
|
||||
const updateMetricErrorMessage = updateMetricError?.message;
|
||||
|
||||
|
@ -49,7 +55,12 @@ export const MetricViewFile: React.FC<MetricViewProps> = React.memo(({ metricId
|
|||
error={updateMetricErrorMessage}
|
||||
/>
|
||||
|
||||
<SaveResetFilePopup open={showPopup} onReset={onResetFile} onSave={onSaveFile} />
|
||||
<SaveResetFilePopup
|
||||
open={showPopup}
|
||||
onReset={onResetFile}
|
||||
onSave={onSaveFile}
|
||||
isSaving={isUpdatingMetric}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue