diff --git a/app/javascript/dashboard/components/index.js b/app/javascript/dashboard/components/index.js index 981d9d476..cc2a70a2c 100644 --- a/app/javascript/dashboard/components/index.js +++ b/app/javascript/dashboard/components/index.js @@ -6,6 +6,8 @@ import Button from './ui/WootButton'; import Code from './Code'; import ColorPicker from './widgets/ColorPicker'; import DeleteModal from './widgets/modal/DeleteModal.vue'; +import DropdownItem from 'shared/components/ui/dropdown/DropdownItem'; +import DropdownMenu from 'shared/components/ui/dropdown/DropdownMenu'; import Input from './widgets/forms/Input.vue'; import Label from './ui/Label'; import LoadingState from './widgets/LoadingState'; @@ -26,6 +28,8 @@ const WootUIKit = { Code, ColorPicker, DeleteModal, + DropdownItem, + DropdownMenu, Input, LoadingState, Label, diff --git a/app/javascript/dashboard/i18n/locale/en/contact.json b/app/javascript/dashboard/i18n/locale/en/contact.json index 5b021a9e8..6a94011a5 100644 --- a/app/javascript/dashboard/i18n/locale/en/contact.json +++ b/app/javascript/dashboard/i18n/locale/en/contact.json @@ -28,11 +28,17 @@ "INACTIVE_LABELS": "Labels available in the account", "REMOVE": "Click on X icon to remove the label", "ADD": "Click on + icon to add the label", + "ADD_BUTTON": "Add Labels", "UPDATE_BUTTON": "Update labels", "UPDATE_ERROR": "Couldn't update labels, try again." }, "NO_LABELS_TO_ADD": "There are no more labels defined in the account.", - "NO_AVAILABLE_LABELS": "There are no labels added to this conversation." + "NO_AVAILABLE_LABELS": "There are no labels added to this conversation.", + "LABEL_SELECT": { + "TITLE": "Add Labels", + "PLACEHOLDER": "Search labels", + "NO_RESULT": "No labels found" + } }, "MUTE_CONTACT": "Mute Conversation", "UNMUTE_CONTACT": "Unmute Conversation", diff --git a/app/javascript/shared/components/ui/dropdown/DropdownItem.vue b/app/javascript/shared/components/ui/dropdown/DropdownItem.vue index 21a4f950c..b791fd937 100644 --- a/app/javascript/shared/components/ui/dropdown/DropdownItem.vue +++ b/app/javascript/shared/components/ui/dropdown/DropdownItem.vue @@ -27,19 +27,21 @@ export default { }; diff --git a/app/javascript/shared/components/ui/label/LabelDropdownItem.stories.js b/app/javascript/shared/components/ui/label/LabelDropdownItem.stories.js new file mode 100644 index 000000000..e5e7cf4af --- /dev/null +++ b/app/javascript/shared/components/ui/label/LabelDropdownItem.stories.js @@ -0,0 +1,39 @@ +import { action } from '@storybook/addon-actions'; +import LabelDropdownItem from './LabelDropdownItem'; + +export default { + title: 'Components/Label/Item', + component: LabelDropdownItem, + argTypes: { + title: { + defaultValue: 'sales', + control: { + type: 'text', + }, + }, + color: { + defaultValue: '#555', + control: { + type: 'text', + }, + }, + selected: { + defaultValue: true, + control: { + type: 'boolean', + }, + }, + }, +}; + +const Template = (args, { argTypes }) => ({ + props: Object.keys(argTypes), + components: { LabelDropdownItem }, + template: + '', +}); + +export const item = Template.bind({}); +item.args = { + onClick: action('Selected'), +}; diff --git a/app/javascript/shared/components/ui/label/LabelDropdownItem.vue b/app/javascript/shared/components/ui/label/LabelDropdownItem.vue new file mode 100644 index 000000000..e692bfd0b --- /dev/null +++ b/app/javascript/shared/components/ui/label/LabelDropdownItem.vue @@ -0,0 +1,82 @@ + + + + +