tracits / rodant

New repository for the new data collection tool
MIT License
0 stars 2 forks source link

Add warning if user tries to close record without id but with data #140

Open martingerdin opened 4 years ago

martingerdin commented 4 years ago

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.

yighax commented 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

martingerdin commented 4 years ago

Sure, please do!

martingerdin commented 4 years ago

133 would be a good place to start!

yighax commented 4 years ago

I could make confirmation alert dialog, that shows up, if user tries to close record without id. What do you think?

KarnellSchultz commented 4 years ago

I think that sounds good. Let me know if you need any help 👍🏽

martingerdin commented 4 years ago

Hi @yighax! Any progress on this? Can we help?

yighax commented 3 years ago

Hi, thanks for your patience, i was overwhelmed with school work. I tried to use react-confirm-alert. What do you think? git

KarnellSchultz commented 3 years ago

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>
    );
  }
});