Repository navigation
feat: allow to specify opening date #3810
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
Open
susnux
wants to merge
18
commits into
main
Choose a base branch
from
feat/form-opening-date
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+878
−54
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
01a9af0
feat(api): add opening date for forms
susnux 8e16f5b
feat(ui): allow setting an opening date
susnux d304a84
test(e2e): cover the opening date of forms
susnux f974ec1
fix(api): do not return questions before the opening date
susnux fff1ff0
fix(migration): store the opening date as 64-bit integer
susnux 6b90527
fix(api): validate opening and expiration date the same way
susnux 519253f
test: build import test data from one base form
susnux 34b47d1
fix(import): ignore an opening date that is not before the expiration
susnux b84a3bc
docs: document the 403 for forms that are not yet open
susnux e4f8fb5
test: reuse the opening date data provider
susnux cccb17f
test: share the initial state capture of the public view tests
susnux 63ccf98
fix(ui): restrict the date pickers with min and max
susnux 693060d
refactor(ui): share the change handler of the date pickers
susnux 99065ef
fix(ui): do not allow changing dates of locked forms
susnux 272a024
fix(ui): only allow an opening date that is in the future
susnux 6eff724
fix(ui): give the date pickers distinct accessible names
susnux 80ea229
fix(ui): do not HTML-escape dates shown as text
susnux 91f21df
perf(ui): format the opening date without moment on empty content pages
susnux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /** | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| namespace OCA\Forms\Migration; | ||
|
|
||
| use Closure; | ||
| use OCP\DB\ISchemaWrapper; | ||
| use OCP\DB\Types; | ||
| use OCP\Migration\Attributes\AddColumn; | ||
| use OCP\Migration\Attributes\ColumnType; | ||
| use OCP\Migration\IOutput; | ||
| use OCP\Migration\SimpleMigrationStep; | ||
| use Override; | ||
|
|
||
| #[AddColumn(table: 'forms_v2_forms', name: 'opens', type: ColumnType::BIGINT, description: 'Timestamp from which a form accepts responses')] | ||
| class Version050500Date20261030000000 extends SimpleMigrationStep { | ||
| #[Override] | ||
| public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { | ||
| /** @var ISchemaWrapper $schema */ | ||
| $schema = $schemaClosure(); | ||
| $table = $schema->getTable('forms_v2_forms'); | ||
|
|
||
| if ($table->hasColumn('opens')) { | ||
| return null; | ||
| } | ||
|
|
||
| $table->addColumn('opens', Types::BIGINT, [ | ||
| 'notnull' => true, | ||
| 'default' => 0, | ||
| 'comment' => 'Timestamp from which the form accepts responses, 0 means immediately', | ||
| ]); | ||
|
|
||
| return $schema; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.