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: Allow to reorder options of "checkbox" "radio" and "dropdown" question types in frontend #2092

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 45 additions & 34 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
'verb' => 'OPTIONS',
'requirements' => [
'path' => '.+',
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],

Expand All @@ -91,31 +91,31 @@
'url' => '/api/{apiVersion}/forms',
'verb' => 'GET',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#newForm',
'url' => '/api/{apiVersion}/form',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#getForm',
'url' => '/api/{apiVersion}/form/{id}',
'verb' => 'GET',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#cloneForm',
'url' => '/api/{apiVersion}/form/clone/{id}',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
// TODO: Remove POST in next API release
Expand All @@ -124,47 +124,47 @@
'url' => '/api/{apiVersion}/form/update',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#updateForm',
'url' => '/api/{apiVersion}/form/update',
'verb' => 'PATCH',
'requirements' => [
'apiVersion' => 'v2\.[2-4]'
'apiVersion' => 'v2\.[2-5]'
]
],
[
'name' => 'api#transferOwner',
'url' => '/api/{apiVersion}/form/transfer',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2\.[2-4]'
'apiVersion' => 'v2\.[2-5]'
]
],
[
'name' => 'api#deleteForm',
'url' => '/api/{apiVersion}/form/{id}',
'verb' => 'DELETE',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#getPartialForm',
'url' => '/api/{apiVersion}/partial_form/{hash}',
'verb' => 'GET',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#getSharedForms',
'url' => '/api/{apiVersion}/shared_forms',
'verb' => 'GET',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],

Expand All @@ -174,7 +174,7 @@
'url' => '/api/{apiVersion}/question',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
// TODO: Remove POST in next API release
Expand All @@ -183,15 +183,15 @@
'url' => '/api/{apiVersion}/question/update',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#updateQuestion',
'url' => '/api/{apiVersion}/question/update',
'verb' => 'PATCH',
'requirements' => [
'apiVersion' => 'v2\.[2-4]'
'apiVersion' => 'v2\.[2-5]'
]
],
// TODO: Remove POST in next API release
Expand All @@ -200,31 +200,42 @@
'url' => '/api/{apiVersion}/question/reorder',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#reorderQuestions',
'url' => '/api/{apiVersion}/question/reorder',
'verb' => 'PUT',
'requirements' => [
'apiVersion' => 'v2\.[2-4]'
'apiVersion' => 'v2\.[2-5]'
]
],
[
'name' => 'api#deleteQuestion',
'url' => '/api/{apiVersion}/question/{id}',
'verb' => 'DELETE',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#cloneQuestion',
'url' => '/api/{apiVersion}/question/clone/{id}',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2\.[3-4]'
'apiVersion' => 'v2\.[3-5]'
]
],

// Batch processing for reordering of options
[
'name' => 'api#reorderOptions',
'url' => '/api/{apiVersion}/question/{id}/options',
'verb' => 'PATCH',
'requirements' => [
'apiVersion' => 'v2(\.5)?',
'id' => '\d+',
]
],

Expand All @@ -234,7 +245,7 @@
'url' => '/api/{apiVersion}/option',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
// TODO: Remove POST in next API release
Expand All @@ -243,23 +254,23 @@
'url' => '/api/{apiVersion}/option/update',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#updateOption',
'url' => '/api/{apiVersion}/option/update',
'verb' => 'PATCH',
'requirements' => [
'apiVersion' => 'v2\.[2-4]'
'apiVersion' => 'v2\.[2-5]'
]
],
[
'name' => 'api#deleteOption',
'url' => '/api/{apiVersion}/option/{id}',
'verb' => 'DELETE',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],

Expand All @@ -269,15 +280,15 @@
'url' => '/api/{apiVersion}/share',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'shareApi#deleteShare',
'url' => '/api/{apiVersion}/share/{id}',
'verb' => 'DELETE',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
// TODO: Remove POST in next API release
Expand All @@ -286,15 +297,15 @@
'url' => '/api/{apiVersion}/share/update',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2\.[1-4]'
'apiVersion' => 'v2\.[1-5]'
]
],
[
'name' => 'shareApi#updateShare',
'url' => '/api/{apiVersion}/share/update',
'verb' => 'PATCH',
'requirements' => [
'apiVersion' => 'v2\.[2-4]'
'apiVersion' => 'v2\.[2-5]'
]
],

Expand All @@ -304,47 +315,47 @@
'url' => '/api/{apiVersion}/submissions/{hash}',
'verb' => 'GET',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#exportSubmissions',
'url' => '/api/{apiVersion}/submissions/export/{hash}',
'verb' => 'GET',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#exportSubmissionsToCloud',
'url' => '/api/{apiVersion}/submissions/export',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#deleteAllSubmissions',
'url' => '/api/{apiVersion}/submissions/{formId}',
'verb' => 'DELETE',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#insertSubmission',
'url' => '/api/{apiVersion}/submission/insert',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
[
'name' => 'api#deleteSubmission',
'url' => '/api/{apiVersion}/submission/{id}',
'verb' => 'DELETE',
'requirements' => [
'apiVersion' => 'v2(\.[1-4])?'
'apiVersion' => 'v2(\.[1-5])?'
]
],
// Submissions linking with file in cloud
Expand All @@ -353,7 +364,7 @@
'url' => '/api/{apiVersion}/form/link/{fileFormat}',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2.4',
'apiVersion' => 'v2\.[4-5]',
'fileFormat' => 'csv|ods|xlsx'
]
],
Expand All @@ -362,7 +373,7 @@
'url' => '/api/{apiVersion}/form/unlink',
'verb' => 'POST',
'requirements' => [
'apiVersion' => 'v2.4',
'apiVersion' => 'v2\.[4-5]',
]
]
]
Expand Down
Loading
Loading