Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/view data card schemas #1345

Merged
merged 5 commits into from
Jul 2, 2024
Merged

Conversation

ARADDCC012
Copy link
Member

image

Comment on lines 58 to 79
schemas.map((schema, index) => (
<ListItem divider={index < schemas.length - 1} key={schema.id}>
<ListItemText>{schema.name}</ListItemText>
<Stack spacing={1} direction={{ xs: 'column', md: 'row' }}>
<Button size='small' variant='outlined' onClick={() => handleSetSchemaActive(schema)}>
{schema.active ? 'Mark as inactive' : 'Mark as active'}
</Button>
<Button size='small' variant='contained' onClick={() => handleDeleteSchemaButtonOnClick(schema.id)}>
Delete
</Button>
</Stack>
))}
</Stack>
)
}, [
schemas,
errorMessage,
open,
schemaToBeDeleted,
handleDeleteConfirm,
handleDeleteSchemaButtonOnClick,
handleSetSchemaActive,
])
<MessageAlert message={errorMessage} severity='error' />
<ConfirmationDialogue
open={open}
title='Delete schema'
onConfirm={() => handleDeleteConfirm(schemaToBeDeleted)}
onCancel={() => setOpen(false)}
errorMessage={errorMessage}
dialogMessage={
'Deleting this schema will break any existing models that are using it. Are you sure you want to do this?'
}
/>
Copy link
Member

@GB27247 GB27247 Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we render the ConfirmationDialog outside of this mapping. Because you're mapping over many schemas when you go to delete one, it will render a ConfirmationDialog for all of them. Cause this has translucent styling it mean's it renders the whole UI opaque black for multiple schemas.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good catch and sloppy work on my part. There's no reason for either the ConfirmationDialog nor MessageAlert to be in here.

@ARADDCC012 ARADDCC012 merged commit 966d1c5 into main Jul 2, 2024
14 checks passed
@ARADDCC012 ARADDCC012 deleted the feature/view-data-card-schemas branch July 2, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants