Open martingerdin opened 4 years ago
hi, i need to choose git issue for my assignment in school, can i try to solve this one? i will try to be quick as possible, but i am not pro dev, thanks
Sure, please do!
I could make confirmation alert dialog, that shows up, if user tries to close record without id. What do you think?
I think that sounds good. Let me know if you need any help 👍🏽
Hi @yighax! Any progress on this? Can we help?
Hi, thanks for your patience, i was overwhelmed with school work. I tried to use react-confirm-alert. What do you think?
I think that's pretty cool. I wonder if we can edit the UI of the modal that pops up? Since this project uses a CSS framework called Bulma it'd be nice to have the popup modal in the same style as the rest of our Bulma components.
Here is a link to the kind of component we'd want to switch it out with: Bulma
UPDATE: After taking a quick look at the react-confirm-alert docs I found that they have a API for a custom UI: check it out
Should be pretty simple to do something like this:
customUI: ({ onClose }) => {
return (
<article>
<div className='message-body '>
<h1>Are you sure?</h1>
<p>You want to delete this file?</p>
<button onClick={onClose}>No</button>
<button
onClick={() => {
this.handleClickDelete();
onClose();
}}
>
Yes, Delete it!
</button>
</div>
</article>
);
}
});
Currently, if the user tries to close a record that contains data but no id the record will not be saved and the data will be lost. I suggest that we add a warning saying that the data will be lost unless the user adds an id and allow the user to abort closing the record.