Skip to content

Commit 56c80e5

Browse files
committed
Merge branch 'main' into anji/dev-1194-clear-button
2 parents 49e970e + 07b003f commit 56c80e5

File tree

8 files changed

+25
-19
lines changed

8 files changed

+25
-19
lines changed

jsapp/js/api/models/hook.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export interface Hook {
2929
/** @nullable */
3030
payload_template?: string | null
3131
readonly pending_count: number
32-
settings: HookSettings
33-
subset_fields: string[]
32+
settings?: HookSettings
33+
subset_fields?: string[]
3434
readonly success_count: number
3535
readonly uid: string
3636
readonly url: string

jsapp/js/components/processing/analysis/editors/analysisQuestionEditor.component.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ export default function AnalysisQuestionEditor(props: AnalysisQuestionEditorProp
201201

202202
{qaDefinition.additionalFieldNames && (
203203
// Hard coded left padding to account for the 32px icon size + 8px gap
204-
<Stack pl={'40px'}>
204+
// 0px gap because the children still did not get a mantine refactor so we must respect existing styles
205+
<Stack pl={'40px'} gap={'0px'}>
205206
{question.type === 'qual_auto_keyword_count' && (
206207
<KeywordSearchFieldsEditor
207208
questionUuid={question.uuid}

jsapp/js/components/processing/analysis/responseForms/responseWrapper.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default function ResponseWrapper(props: ResponseWrapperProps) {
111111
</ButtonNew>
112112

113113
<ButtonNew size='md' onClick={deleteQuestion} variant='danger'>
114-
{t('Delete account')}
114+
{t('Delete')}
115115
</ButtonNew>
116116
</Group>
117117
</Stack>

kobo/apps/hook/serializers/v2/hook.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323

2424
class HookSerializer(serializers.ModelSerializer):
2525

26-
payload_template = serializers.CharField(required=False, allow_blank=True,
27-
allow_null=True)
26+
payload_template = serializers.CharField(
27+
required=False, allow_blank=True, allow_null=True
28+
)
2829

29-
settings = JSONFieldWithSchemaField(SettingsField)
30-
subset_fields = ListFieldWithSchemaField(SubsetFieldsField)
30+
settings = JSONFieldWithSchemaField(SettingsField, required=False)
31+
subset_fields = ListFieldWithSchemaField(SubsetFieldsField, required=False)
3132

3233
class Meta:
3334
model = Hook

kobo/apps/hook/tests/test_api_hook.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def test_anonymous_access(self):
6363
def test_create_hook(self):
6464
self._create_hook()
6565

66+
def test_create_minimal_hook(self):
67+
self._create_hook(minimal=True)
68+
6669
def test_editor_access(self):
6770
hook = self._create_hook()
6871

kobo/apps/hook/utils/tests/mixins.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,23 @@ def _create_hook(self, return_response_only=False, **kwargs):
2828
self._add_submissions()
2929

3030
url = reverse('hook-list', args=(self.asset.uid,))
31+
3132
data = {
3233
'name': kwargs.get('name', 'some external service with token'),
3334
'endpoint': kwargs.get('endpoint', 'http://external.service.local/'),
34-
'settings': kwargs.get(
35-
'settings', {'custom_headers': {'X-Token': '1234abcd'}}
36-
),
37-
'export_type': format_type,
38-
'active': kwargs.get('active', True),
39-
'subset_fields': kwargs.get('subset_fields', []),
40-
'payload_template': kwargs.get('payload_template', None),
4135
}
4236

37+
if not kwargs.get('minimal', False):
38+
data.update({
39+
'settings': kwargs.get(
40+
'settings', {'custom_headers': {'X-Token': '1234abcd'}}
41+
),
42+
'active': kwargs.get('active', True),
43+
'export_type': format_type,
44+
'subset_fields': kwargs.get('subset_fields', []),
45+
'payload_template': kwargs.get('payload_template', None),
46+
})
47+
4348
response = self.client.post(url, data, format='json')
4449
if return_response_only:
4550
return response

static/openapi/schema_v2.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15368,8 +15368,6 @@
1536815368
"logs_url",
1536915369
"name",
1537015370
"pending_count",
15371-
"settings",
15372-
"subset_fields",
1537315371
"success_count",
1537415372
"uid",
1537515373
"url"

static/openapi/schema_v2.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11082,8 +11082,6 @@ components:
1108211082
- logs_url
1108311083
- name
1108411084
- pending_count
11085-
- settings
11086-
- subset_fields
1108711085
- success_count
1108811086
- uid
1108911087
- url

0 commit comments

Comments
 (0)