diff --git a/.codeclimate.yml b/.codeclimate.yml index 50d5360fd..667b0f340 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -17,7 +17,11 @@ checks: method-count: enabled: true config: - threshold: 25 + threshold: 30 + file-lines: + enabled: true + config: + threshold: 300 exclude_patterns: - "spec/" - "**/specs/" diff --git a/app/javascript/dashboard/api/inbox/conversation.js b/app/javascript/dashboard/api/inbox/conversation.js index d5599ade0..e407aecb0 100644 --- a/app/javascript/dashboard/api/inbox/conversation.js +++ b/app/javascript/dashboard/api/inbox/conversation.js @@ -80,6 +80,12 @@ class ConversationApi extends ApiClient { sendEmailTranscript({ conversationId, email }) { return axios.post(`${this.url}/${conversationId}/transcript`, { email }); } + + updateCustomAttributes({ conversationId, customAttributes }) { + return axios.post(`${this.url}/${conversationId}/custom_attributes`, { + custom_attributes: customAttributes, + }); + } } export default new ConversationApi(); diff --git a/app/javascript/dashboard/api/specs/inbox/conversation.spec.js b/app/javascript/dashboard/api/specs/inbox/conversation.spec.js index f068b4a4f..814b83446 100644 --- a/app/javascript/dashboard/api/specs/inbox/conversation.spec.js +++ b/app/javascript/dashboard/api/specs/inbox/conversation.spec.js @@ -160,5 +160,18 @@ describe('#ConversationAPI', () => { } ); }); + + it('#updateCustomAttributes', () => { + conversationAPI.updateCustomAttributes({ + conversationId: 45, + customAttributes: { order_d: '1001' }, + }); + expect(context.axiosMock.post).toHaveBeenCalledWith( + '/api/v1/conversations/45/custom_attributes', + { + custom_attributes: { order_d: '1001' }, + } + ); + }); }); }); diff --git a/app/javascript/dashboard/assets/scss/widgets/_forms.scss b/app/javascript/dashboard/assets/scss/widgets/_forms.scss index 17a7acaa8..13548db5f 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_forms.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_forms.scss @@ -1,8 +1,7 @@ .error { - #{$all-text-inputs}, select, - .multiselect>.multiselect__tags { + .multiselect > .multiselect__tags { @include thin-border(var(--r-400)); } @@ -40,4 +39,8 @@ input { font-size: var(--font-size-small); height: var(--space-large); } + + .error { + border-color: var(--r-400); + } } diff --git a/app/javascript/dashboard/components/Accordion/AccordionItem.vue b/app/javascript/dashboard/components/Accordion/AccordionItem.vue index c162ee313..bfe817285 100644 --- a/app/javascript/dashboard/components/Accordion/AccordionItem.vue +++ b/app/javascript/dashboard/components/Accordion/AccordionItem.vue @@ -15,7 +15,11 @@ -