forms icon indicating copy to clipboard operation
forms copied to clipboard

WIP: allow editing of submission by the user

Open tpokorra opened this issue 2 years ago • 11 comments

this is work in progress, related to #1110

  • [x] show checked radio buttons and check boxes with previous answer
  • [x] update submission and answers, don't delete and create submission or answers
  • [x] allow deletion of submission
  • [x] rebase to main branch
  • [ ] resolve Lint and Unit Test Job Failures
  • [ ] add Unit tests for new functionality

tpokorra avatar Aug 18 '23 10:08 tpokorra

Thank you @Chartman123 I will fix those issues.

The whole pull request is not fully functional yet. I still need to get the vue components to display the previously submitted answers.

tpokorra avatar Aug 18 '23 21:08 tpokorra

@tpokorra yes no problem :) you can have a look at the PR implementing the local storage how the components get their values there. And for getting the values from the database and pass them to the front-end can be seen in the results view...

Chartman123 avatar Aug 18 '23 21:08 Chartman123

TODO list:

  • show checked radio buttons and check boxes with previous answer
  • update answer, don't delete and create answer
  • allow deletion of answer

tpokorra avatar Aug 23 '23 10:08 tpokorra

@tpokorra I've added your checklist to first post :) And btw thank you very much for your contribution to this project 👍🏻

I've also run the automated check workflows for this PR so that you can easily find problems with your commits. Please have a look at the failed checks. If you have questions about some of the checks feel free to ask 🙂

Chartman123 avatar Aug 23 '23 11:08 Chartman123

@tpokorra please don't merge the main branch into your branch. Use git rebase to update your branch to the latest commits to main :)

You can also use git rebase to squash your commits into a single one so that the commit history on your main branch stays clean :)

You can try git rebase -i main to do this :) After that you'll have to use git push --force to push the rebased commits to your branch.

Chartman123 avatar Aug 29 '23 13:08 Chartman123

@Chartman123 I am trying to run the unit tests locally, so that I can fix and extend them.

I have a small question: why is there a reference to Test\TestCase in most test files?

I get this error:

tim03-nextcloud@h13:~/nextcloud/apps/forms$ composer test:unit
> phpunit -c tests/phpunit.xml
PHP Fatal error:  Uncaught Error: Class "Test\TestCase" not found in /home/pacs/tim03/users/nextcloud/nextcloud/apps/forms/tests/Unit/Activity/ActivityManagerTest.php:41
Stack trace:

If I change it from Test\TestCase to PHPUnit\Framework\TestCase it just complains about the next file.

Am I missing something to install?

I ran:

cd nextcloud/apps/forms
composer install
composer dumpautoload -o

phpunit in vendor/bin shows version 9.6.13

tpokorra avatar Oct 23 '23 15:10 tpokorra

@tpokorra didn't manage to run the unit tests locally...

Regarding the extends \Test\TestCase you can also find some information in the dev docs: https://docs.nextcloud.com/server/stable/developer_manual/basics/testing.html

Chartman123 avatar Oct 23 '23 16:10 Chartman123

@Chartman123 Thank you, your hint helped. I needed to copy the folder tests from https://github.com/nextcloud/server/tree/master/tests to my installation of Nextcloud. I can now fix the test issues.

tpokorra avatar Oct 23 '23 17:10 tpokorra

Codecov Report

Attention: 95 lines in your changes are missing coverage. Please review.

Comparison is base (f24a595) 44.62% compared to head (6917908) 41.96%. Report is 1 commits behind head on main.

:exclamation: Current head 6917908 differs from pull request most recent head d60b3c4. Consider uploading reports for the commit d60b3c4 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1690      +/-   ##
============================================
- Coverage     44.62%   41.96%   -2.66%     
+ Complexity      658      653       -5     
============================================
  Files            58       59       +1     
  Lines          2593     2607      +14     
============================================
- Hits           1157     1094      -63     
- Misses         1436     1513      +77     

codecov[bot] avatar Oct 23 '23 17:10 codecov[bot]

Hello @tpokorra

I thank you very much for your good work. I fully support this feature, which I believe is very important in many use cases. Do you need help, and if so, where?

SergioArbarviro avatar Mar 18 '24 21:03 SergioArbarviro