Tangerine-Community / Tangerine

Digitize your offline data collection. Create your Forms online with Tangerine Editor, conduct them offline with the Tangerine Android App. All results you collect can be exported as a CSV file, easy for processing in a spreadsheet. Tangerine has been used in over 1 million assessments and surveys in over 60 countries and in 100 languages.
http://www.tangerinecentral.org/
GNU General Public License v3.0
50 stars 29 forks source link

Editor: Submitting form does not dismiss process monitor. #3050

Open chrisekelley opened 3 years ago

chrisekelley commented 3 years ago

Current version: v3.20.0

Issue on server:

Expected behavior

Process prompt "Updating a form response." should be dismissed once form is submitted.

Actual behavior

It stays on the screen and user must dismiss it, which results in another dialogue box that is scary.

Steps to reproduce the behavior

Go to Device Users and create a new device user, submit.

chrisekelley commented 3 years ago

Editor's tangy-forms-player component starts the process monitor service here:

      formEl.addEventListener('before-submit', async (event) => {
        if (this.preventSubmit) event.preventDefault()
        this.process = this.processMonitorService.start('saving-a-tangy-form', 'Updating a form response.')
        this.$submit.next(true)
      })

and listens for completion here:

      formEl.addEventListener('after-resubmit', async (event) => {
        if (this.preventSubmit) event.preventDefault() 
        while (this.throttledSaveFiring === true) {
          await sleep(1000)
        }
        this.processMonitorService.stop(this.process.id)
        this.$afterResubmit.next(true)
      })