Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add forms state to close and archive forms #1925

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

susnux
Copy link
Collaborator

@susnux susnux commented Jan 30, 2024

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 susnux force-pushed the enh/allow-archive-forms branch 3 times, most recently from 5ea7066 to 3e64873 Compare February 18, 2024 15:33
@susnux susnux changed the title enh: Add forms state to close and archive forms feat: Add forms state to close and archive forms Feb 18, 2024
@susnux susnux added enhancement New feature or request 3. to review Waiting for reviews feature: 📑 form creation labels Feb 18, 2024
@susnux susnux added this to the 4.2 milestone Feb 18, 2024
@susnux susnux force-pushed the enh/allow-archive-forms branch 3 times, most recently from b7602c3 to 4215fbe Compare February 18, 2024 15:51
@susnux susnux marked this pull request as ready for review February 18, 2024 15:51
@susnux
Copy link
Collaborator Author

susnux commented Feb 18, 2024

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

@susnux

This comment was marked as resolved.

@Chartman123

This comment was marked as resolved.

@susnux

This comment was marked as resolved.

Chartman123

This comment was marked as resolved.

@susnux susnux force-pushed the enh/allow-archive-forms branch 2 times, most recently from b7b3a5c to 20124f7 Compare February 19, 2024 12:49
@susnux
Copy link
Collaborator Author

susnux commented Feb 19, 2024

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 :)

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@susnux
Copy link
Collaborator Author

susnux commented Feb 19, 2024

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:

vokoscreenNG-2024-02-19_21-36-15.mp4

@susnux
Copy link
Collaborator Author

susnux commented Feb 26, 2024

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

Copy link
Collaborator

@Chartman123 Chartman123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now :)

Just some design/UX related things: Should we make it possible to dearchive a form directly from the modal? And on a public share page you always show the "expired" message in the NcEmptyContent as the FormsService always returns isExpired as soon as the state is not "active". So no hint for archived/closed there...

@Chartman123
Copy link
Collaborator

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
Copy link
Collaborator

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 :)

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late design feedback, 3 things:

  • 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.
  • The "Archived forms" entry on the bottom does not have proper spacing to the bottom. Check how "Files settings" does it – left aligned, tertiary button, non-bold text.
  • In the modal, the actions button should show for all entries by default, not only on hover or focus → this is better for discoverability

@Chartman123
Copy link
Collaborator

Chartman123 commented Mar 7, 2024

  • 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 :)

@susnux
Copy link
Collaborator Author

susnux commented Mar 20, 2024

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

a.mp4

@Chartman123 Chartman123 force-pushed the enh/allow-archive-forms branch 2 times, most recently from 17f34a1 to 4c4b77d Compare March 21, 2024 18:08
Copy link
Collaborator Author

@susnux susnux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chartman123 changes make sense, one comment.

But I think we need a follow up some when, because always loading all forms is pretty bad. For small instances this works but what if there are 30'000 forms? 100'000?

Archived forms can not be changed (except from being un-archived).
Closed forms behave like expired forms and just do not allow new submissions.
By default forms are in state `active`.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
Copy link
Collaborator Author

susnux commented Mar 22, 2024

Should be ready to merge now

Co-authored-by: Chartman123 <chris-hartmann@gmx.de>
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@Chartman123 Chartman123 merged commit 7d6ce87 into main Mar 22, 2024
48 checks passed
@Chartman123 Chartman123 deleted the enh/allow-archive-forms branch March 22, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request feature: 📑 form creation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Archive forms Deactivate Form manually
3 participants