mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-11 16:39:01 +08:00
Fix: FE: pipelines: should be able to exit edit mode without making a change (#4335)
* fix: show cancel button on entering edit mode before any changes have been made * chore: align pipeline page save/cancel buttons to the right
This commit is contained in:
parent
722a38491e
commit
d65d75ef69
@ -506,8 +506,9 @@ function PipelineListsView({
|
||||
pagination={false}
|
||||
/>
|
||||
</DndProvider>
|
||||
{showSaveButton && (
|
||||
{isEditingActionMode && (
|
||||
<SaveConfigButton
|
||||
showSaveButton={Boolean(showSaveButton)}
|
||||
onSaveConfigurationHandler={onSaveConfigurationHandler}
|
||||
onCancelConfigurationHandler={onCancelConfigurationHandler}
|
||||
/>
|
||||
|
@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import { SaveConfigWrapper } from './styles';
|
||||
|
||||
function SaveConfigButton({
|
||||
showSaveButton,
|
||||
onSaveConfigurationHandler,
|
||||
onCancelConfigurationHandler,
|
||||
}: SaveConfigButtonTypes): JSX.Element {
|
||||
@ -11,14 +12,16 @@ function SaveConfigButton({
|
||||
|
||||
return (
|
||||
<SaveConfigWrapper>
|
||||
<Button
|
||||
key="submit"
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
onClick={onSaveConfigurationHandler}
|
||||
>
|
||||
{t('save_configuration')}
|
||||
</Button>
|
||||
{showSaveButton && (
|
||||
<Button
|
||||
key="submit"
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
onClick={onSaveConfigurationHandler}
|
||||
>
|
||||
{t('save_configuration')}
|
||||
</Button>
|
||||
)}
|
||||
<Button key="cancel" onClick={onCancelConfigurationHandler}>
|
||||
{t('cancel')}
|
||||
</Button>
|
||||
@ -26,6 +29,7 @@ function SaveConfigButton({
|
||||
);
|
||||
}
|
||||
export interface SaveConfigButtonTypes {
|
||||
showSaveButton: boolean;
|
||||
onSaveConfigurationHandler: VoidFunction;
|
||||
onCancelConfigurationHandler: VoidFunction;
|
||||
}
|
||||
|
@ -108,6 +108,7 @@ export const ModeAndConfigWrapper = styled.div`
|
||||
|
||||
export const SaveConfigWrapper = styled.div`
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 0.938rem;
|
||||
margin-top: 1.25rem;
|
||||
`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user