Initial commit: Add logistics and order_detail message types
Some checks failed
Lock Threads / action (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot EE docker images / merge (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot CE docker images / merge (push) Has been cancelled
Run Chatwoot CE spec / lint-backend (push) Has been cancelled
Run Chatwoot CE spec / lint-frontend (push) Has been cancelled
Run Chatwoot CE spec / frontend-tests (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (0, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (1, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (10, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (11, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (12, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (13, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (14, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (15, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (2, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (3, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (4, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (5, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (6, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (7, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (8, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (9, 16) (push) Has been cancelled
Run Linux nightly installer / nightly (push) Has been cancelled

- Add Logistics component with progress tracking
- Add OrderDetail component for order information
- Support data-driven steps and actions
- Add blue color scale to widget SCSS
- Fix node overflow and progress bar rendering issues
- Add English translations for dashboard components

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Liang XJ
2026-01-26 11:16:56 +08:00
commit 092fb2e083
7646 changed files with 975643 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
export default {
computed: {
useInboxAvatarForBot() {
return this.channelConfig.enabledFeatures.includes(
'use_inbox_avatar_for_bot'
);
},
hasAConnectedAgentBot() {
return !!window.chatwootWebChannel.hasAConnectedAgentBot;
},
inboxAvatarUrl() {
return window.chatwootWebChannel.avatarUrl;
},
channelConfig() {
return window.chatwootWebChannel;
},
hasEmojiPickerEnabled() {
return this.channelConfig.enabledFeatures.includes('emoji_picker');
},
hasAttachmentsEnabled() {
return this.channelConfig.enabledFeatures.includes('attachments');
},
hasEndConversationEnabled() {
return this.channelConfig.enabledFeatures.includes('end_conversation');
},
preChatFormEnabled() {
return window.chatwootWebChannel.preChatFormEnabled;
},
preChatFormOptions() {
let preChatMessage = '';
const options = window.chatwootWebChannel.preChatFormOptions || {};
preChatMessage = options.pre_chat_message;
const { pre_chat_fields: preChatFields = [] } = options;
return {
preChatMessage,
preChatFields,
};
},
shouldShowPreChatForm() {
const { preChatFields } = this.preChatFormOptions;
// Check if at least one enabled field in pre-chat fields
const hasEnabledFields =
preChatFields.filter(field => field.enabled).length > 0;
return this.preChatFormEnabled && hasEnabledFields;
},
},
};

View File

@@ -0,0 +1,13 @@
export default {
computed: {
messageContentAttributes() {
const { content_attributes: attribute = {} } = this.message;
return attribute;
},
hasAttachments() {
return !!(
this.message.attachments && this.message.attachments.length > 0
);
},
},
};

View File

@@ -0,0 +1,78 @@
import { shallowMount } from '@vue/test-utils';
import configMixin from '../configMixin';
import { reactive } from 'vue';
const preChatFields = [
{
label: 'Email Id',
name: 'emailAddress',
type: 'email',
field_type: 'standard',
required: false,
enabled: false,
},
{
label: 'Full name',
name: 'fullName',
type: 'text',
field_type: 'standard',
required: true,
enabled: true,
},
];
global.chatwootWebChannel = {
avatarUrl: 'https://test.url',
hasAConnectedAgentBot: 'AgentBot',
enabledFeatures: [
'emoji_picker',
'attachments',
'end_conversation',
'use_inbox_avatar_for_bot',
],
preChatFormOptions: { pre_chat_fields: preChatFields, pre_chat_message: '' },
preChatFormEnabled: true,
};
describe('configMixin', () => {
test('returns config', () => {
const wrapper = shallowMount({
mixins: [configMixin],
data() {
return {
channelConfig: reactive(global.chatwootWebChannel),
};
},
template: '<div />', // Render a simple div as the template
});
expect(wrapper.vm.hasEmojiPickerEnabled).toBe(true);
expect(wrapper.vm.hasEndConversationEnabled).toBe(true);
expect(wrapper.vm.hasAttachmentsEnabled).toBe(true);
expect(wrapper.vm.hasAConnectedAgentBot).toBe(true);
expect(wrapper.vm.useInboxAvatarForBot).toBe(true);
expect(wrapper.vm.inboxAvatarUrl).toBe('https://test.url');
expect(wrapper.vm.channelConfig).toEqual({
avatarUrl: 'https://test.url',
hasAConnectedAgentBot: 'AgentBot',
enabledFeatures: [
'emoji_picker',
'attachments',
'end_conversation',
'use_inbox_avatar_for_bot',
],
preChatFormOptions: {
pre_chat_message: '',
pre_chat_fields: preChatFields,
},
preChatFormEnabled: true,
});
expect(wrapper.vm.preChatFormOptions).toEqual({
preChatMessage: '',
preChatFields: preChatFields,
});
expect(wrapper.vm.preChatFormEnabled).toBe(true);
expect(wrapper.vm.shouldShowPreChatForm).toBe(true);
});
});

View File

@@ -0,0 +1,27 @@
export default {
nonDeletedMessage: {
content: 'Hey',
content_attributes: {},
attachments: [
{
data_url: 'https://assets.com/kseb-bill.pdf',
extension: null,
file_type: 'file',
},
],
content_type: 'text',
conversation_id: 1,
created_at: 1626111625,
id: 1,
message_type: 0,
},
deletedMessage: {
content: 'This message was deleted',
content_attributes: { deleted: true },
content_type: null,
conversation_id: 1,
created_at: 1626111634,
id: 2,
message_type: 1,
},
};

View File

@@ -0,0 +1,37 @@
import { shallowMount } from '@vue/test-utils';
import messageMixin from '../messageMixin';
import messages from './messageFixture';
describe('messageMixin', () => {
let Component = {
render() {},
title: 'TestComponent',
mixins: [messageMixin],
};
it('deleted messages', async () => {
const wrapper = shallowMount(Component, {
data() {
return {
message: messages.deletedMessage,
};
},
});
expect(wrapper.vm.messageContentAttributes).toEqual({
deleted: true,
});
expect(wrapper.vm.hasAttachments).toBe(false);
});
it('non-deleted messages', async () => {
const wrapper = shallowMount(Component, {
data() {
return {
message: messages.nonDeletedMessage,
};
},
});
expect(wrapper.vm.deletedMessage).toBe(undefined);
expect(wrapper.vm.messageContentAttributes).toEqual({});
expect(wrapper.vm.hasAttachments).toBe(true);
});
});