forms
forms copied to clipboard
Archive forms
Nextcloud (please complete the following information):
- Nextcloud-Version: 27.1.2
- Forms-Version: 3.4.3
Is your feature request related to a problem? Please describe. If you have many forms that may be outdated but you want to keep them anyway, an archive function would solve that problem.
Describe the solution you'd like I have implemented an archive function in the "Cospend" project; you can find more details and a video at https://github.com/julien-nc/cospend-nc/pull/236. I plan to introduce this same functionality in this project.
If this is acceptable to you, please let me know, and I will begin development.
Describe alternatives you've considered none.
Additional context none.
Hi @j0hannesr0th and thanks for your offer to contribute!
For me, this sounds like a good idea. While you're at it, you could perhaps also implement #1101: Disabling would keep the form in the normal navigation, but no longer allow submissions. Archiving would hide the form from the normal navigation and also no longer allow submissions.
I'm unsure if we should use two flags isDisabled and isArchived or if we should go for one prop state with e.g. 0 for active, 1 for disabled and 2 for archived.
@susnux @jotoeri What do you think about it?
@nextcloud/designers Any suggestions from a design perspective on how it should look like?
@Chartman123 for me it's ok to not add a second state, so I'll use isDisabled
@j0hannesr0th I've talked to @susnux in the meantime. We both think that it makes sense to implement this the following way:
- add a field to the forms table
stateas tinyint:null/0enabled,1disabled manually,2archived (do we wantnullvalues here? we could also set all form to0in the migration and make it the default value for the column) - keep
expiresfield for time based expiration - only move forms with state
2out of the list and to a list of archived forms - submissions are only allowed to enabled forms, not to expired, archived or disabled forms
Regarding the UI, I'll ping the designers once more :) I'm unsure if we should add the UI elements to the settings sidebar or to the navigation menu or to both...
In the navigation we have "Your forms" and "Shared with you", we could add another section "Archived forms" below this?
Btw, do we use AppNavigationCaption there? Cause e.g. unlike in Contacts, the headings are not blue (color-primary-element)
another section "Archived forms" below
I like the way it is implemented in the link in the OP here :)
AppNavigationCaption
Yes, we're using AppNavigationCaption without any additional styling...
@jancborchardt
e.g. unlike in Contacts, the headings are not blue (color-primary-element)
Seems like contacts is using old version of @nextcloud/vue, there the color was changes due to lack of contrast (our primary-element color only satisfies 3:1 contrast for graphical elements but not 4.5:1 for text).
@j0hannesr0th an issue with the implementation example is that it creates a mode toggle. It is not directly obvious whether one is in the archive or in the active projects.
What would be preferable is if "Archived forms" opens a modal with a list much like "Deleted calendars" does.
Additionally, there is no need to have a counter on the archive since counters are calling for attention, e.g. if something is new or unread.
Does that work @j0hannesr0th @susnux @Chartman123? :)
@jancborchardt In the latest released version, I've updated the icons - see video below. This makes it clear whether a project is archived or not. I'm not in favor of the modal concept. The toggle option is also much quicker.
@Chartman123 After considering your suggestion, I've decided it's better to utilize the isDisabled state. I manage numerous forms and sought a simple filter to display only old/disabled projects. For archival and revision purposes, I prefer not to delete these forms, but also wish to keep them hidden.
Here's my approach:
- Implement a toggle mode with distinct icons.
- Avoid creating new states or modifying the database.
Idea: implement some kind of filter input, which filters visible projects by name while typing (can be done in second step also):
Released version of the cospend implementation:
https://github.com/nextcloud/forms/assets/36242595/487396f0-10d4-4c96-87f2-245b7f74240f
@j0hannesr0th Please create a PR in this repository for your WIP, so that it's easier for us to see what you're doing. Also please don't mix any feature additions in a single PR. This one should be about archiving forms only and not about filtering...
And as pointed out above we'd like to ~~keep isDisabled and isArchived in two different fields~~ have a field state because only archiving should hide the form from the list. Disabling should keep it in the normal list, just like expired forms.
@Chartman123, there isn't a work-in-progress (WIP) version yet, as I first need to determine what should be implemented and how.
By archiving forms, I mean that I want to view only "active" projects. I have many forms that are currently not in use, but I wish to retain them for revision purposes.
Introducing a new state isArchived seems to add unnecessary complexity, in my opinion. With this, toggling becomes impractical due to the possible combinations:
isDisabled = True, isArchived = True isDisabled = True, isArchived = False isDisabled = False, isArchived = True isDisabled = False, isArchived = False
So, to clarify: I don't intend to add an archive feature. Instead, I simply want to switch between active and inactive projects.
Yes, I understand what you mean, but we want to have this the way we pointed out in the discussion above. Not everyone wants to have all "inactive" forms hidden. So we will need a distinction. Therefore the state and not isDisabled\isArchived. Sorry for confusing this in my last post, for explanation see https://github.com/nextcloud/forms/issues/1834#issuecomment-1864063085
So there are basically only three possible combinations:
state == 0 AND expires > now-> form is shown in normal list and accepts submissionsstate == 1 OR expires <= now-> form is shown in normal list and doesn't accept submissionsstate == 2-> form is not shown in normal list and doesn't accept submissions
Hi @Chartman123 I've forked this and implemented it the way I wanted/needed it - without extra state and with toggle function. I can merge that. If you don't want that, I'll unassign this issue.
@j0hannesr0th Ok, then thanks, but no, we want to have it the way we elaborated here in the discussion. So no backport needed from your fork.