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

Archive forms #1834

Closed
j0hannesr0th opened this issue Dec 14, 2023 · 13 comments · Fixed by #1925
Closed

Archive forms #1834

j0hannesr0th opened this issue Dec 14, 2023 · 13 comments · Fixed by #1925
Labels
1. to develop Accepted and waiting to be taken care of enhancement New feature or request
Milestone

Comments

@j0hannesr0th
Copy link

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 julien-nc/cospend-nc#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.

@j0hannesr0th j0hannesr0th added 0. Needs triage Pending approval or rejection. This issue is pending approval. enhancement New feature or request labels Dec 14, 2023
@Chartman123 Chartman123 added the discussion Being discussed label Dec 15, 2023
@Chartman123
Copy link
Collaborator

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?

@j0hannesr0th
Copy link
Author

@Chartman123 for me it's ok to not add a second state, so I'll use isDisabled

@Chartman123
Copy link
Collaborator

Chartman123 commented Dec 20, 2023

@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 state as tinyint: null/0 enabled, 1 disabled manually, 2 archived (do we want null values here? we could also set all form to 0 in the migration and make it the default value for the column)
  • keep expires field for time based expiration
  • only move forms with state 2 out 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...

@jancborchardt
Copy link
Member

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)

@Chartman123
Copy link
Collaborator

Chartman123 commented Dec 20, 2023

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...

@Chartman123 Chartman123 added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending approval or rejection. This issue is pending approval. discussion Being discussed labels Dec 20, 2023
@susnux
Copy link
Collaborator

susnux commented Dec 20, 2023

@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).

@jancborchardt
Copy link
Member

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

@j0hannesr0th
Copy link
Author

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

image


Released version of the cospend implementation:

2023-12-25_171115.mp4

@Chartman123
Copy link
Collaborator

Chartman123 commented Dec 25, 2023

@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.

@j0hannesr0th
Copy link
Author

@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.

@Chartman123
Copy link
Collaborator

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 #1834 (comment)

So there are basically only three possible combinations:

  • state == 0 AND expires > now -> form is shown in normal list and accepts submissions
  • state == 1 OR expires <= now -> form is shown in normal list and doesn't accept submissions
  • state == 2 -> form is not shown in normal list and doesn't accept submissions

@j0hannesr0th
Copy link
Author

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.

@Chartman123
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants