forms icon indicating copy to clipboard operation
forms copied to clipboard

feat: Add forms `state` to close and archive forms

Open susnux opened this issue 1 year ago • 13 comments

  • Resolves #1834
  • Resolves #1101

I recommend to hide white space when review.

This adds a new field "state" to a form, this field is 0 by default which means the form is in active state. Currently two other states are implemented:

  • closed when then form was manually closed
  • archived when the form was archived

Closed forms do not allow any new submissions, archived forms even do not allow any modification. Archived forms are shown in a separate list on the side bar to save space.

Screenshots

open list closed list
Screenshot 2024-02-19 at 13-57-03 Formulare - Nextcloud Screenshot 2024-02-19 at 13-56-47 Formulare - Nextcloud

susnux avatar Jan 30 '24 11:01 susnux

Rebased, squashed and fixed the tests. Ready for review :)

susnux avatar Feb 18 '24 16:02 susnux

Only the codecov actions fails... see the PR for updating it...

Meaning that is unrelated.

susnux avatar Feb 18 '24 17:02 susnux

Only the codecov actions fails... see the PR for updating it...

But the error here is just an invalid token. I experimented with the token yesterday. Perhaps we just need to paste it once more into the repository secrets.

The other PR is about stable3.

Also please add the new prop to the docs :)

Chartman123 avatar Feb 18 '24 18:02 Chartman123

Also please add the new prop to the docs :)

@Chartman123 already done :)

susnux avatar Feb 18 '24 18:02 susnux

We should ask the designers about their opinion. IIRC Jan didn't want to have the archived forms in the App Navigation but in a modal...

I have added screenshots and requested a review from @jancborchardt :)

susnux avatar Feb 19 '24 12:02 susnux

Yeah, "Archived forms" would be better as a sticky entry on the bottom left which opens a modal, just like in Contacts and Calendar.

Thank you @jancborchardt ! I now changed it to show the archived forms in a dialog / modal instead:

https://github.com/nextcloud/forms/assets/1855448/81451fa8-c5da-4669-b521-64004d5deea5

susnux avatar Feb 19 '24 20:02 susnux

One more thing: Do you really want to move closed/expired forms into a separate area in the App Navigation? I think this is not necessary as we already have the archiving for hiding them from the list and the subtitle for the closed/expired forms to identify them directly.

Think of a freshly expired form: if you have a large list of forms, you would have to scroll first to see the latest results.

Chartman123 avatar Feb 19 '24 22:02 Chartman123

Think of a freshly expired form: if you have a large list of forms, you would have to scroll first to see the latest results.

My idea was that closed / expired forms are not that important anymore, so grouping them allow to better manage the active forms (e.g. you have 20+ forms active).

But if we agree on not grouping its fine for me to revert that :)

susnux avatar Feb 20 '24 09:02 susnux

Yes I understand that and agree that after a while they will be less important. But for that one can archive the form. So I'd be happier without this grouping :)

Chartman123 avatar Feb 20 '24 10:02 Chartman123

Yes I understand that and agree that after a while they will be less important. But for that one can archive the form. So I'd be happier without this grouping :)

Done

susnux avatar Feb 26 '24 14:02 susnux

One more comment: the state is not imported in FormsMigrator.php. The linked file related props are also missing, but I'm not sure if they really make sense when you import a Form in another instance. The state however could make sense, so I think we should add it there.

Chartman123 avatar Feb 26 '24 23:02 Chartman123

Please integrate the fix for #1991 into this PR. Should be easy to fix and you can directly address the new state prop as well :)

Chartman123 avatar Mar 06 '24 18:03 Chartman123

  • The layout of the left navigation is a bit off, lot of whitespace (e.g. below the "Your forms" heading) and the entries are too big. Since there is no subline, they should be single-line entries like in Files or the left navigation of Mail, not multiline list items like in Talk or the message list in Mail.

This is only true for forms without expiration date. Then the expiration is shown in the subline. Also closed forms show the information in the subline. So no changes needed here :)

Chartman123 avatar Mar 07 '24 11:03 Chartman123

Thank you for the feedback, I resolved the comments :)

https://github.com/nextcloud/forms/assets/1855448/17aa10b9-57ee-49e9-9747-594226924215

susnux avatar Mar 20 '24 00:03 susnux

Should be ready to merge now

susnux avatar Mar 22 '24 12:03 susnux