From bd7a56061e8e2266471a6cf1b5cb0118f238a90e Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Tue, 26 Jul 2022 12:15:01 +0530 Subject: [PATCH] feat: Create category component (#5103) --- .../helpCenter/AddCategory.stories.js | 30 ++++ .../components/helpCenter/AddCategory.vue | 160 ++++++++++++++++++ .../components/widgets/forms/Input.vue | 24 ++- app/javascript/dashboard/helper/commons.js | 9 +- .../dashboard/helper/specs/commons.spec.js | 17 +- .../dashboard/i18n/locale/en/helpCenter.json | 29 ++++ .../settings/attributes/AddAttribute.vue | 4 +- 7 files changed, 264 insertions(+), 9 deletions(-) create mode 100644 app/javascript/dashboard/components/helpCenter/AddCategory.stories.js create mode 100644 app/javascript/dashboard/components/helpCenter/AddCategory.vue diff --git a/app/javascript/dashboard/components/helpCenter/AddCategory.stories.js b/app/javascript/dashboard/components/helpCenter/AddCategory.stories.js new file mode 100644 index 000000000..024d85fe7 --- /dev/null +++ b/app/javascript/dashboard/components/helpCenter/AddCategory.stories.js @@ -0,0 +1,30 @@ +import AddCategoryComponent from './AddCategory.vue'; +import { action } from '@storybook/addon-actions'; + +export default { + title: 'Components/Help Center', + component: AddCategoryComponent, + argTypes: { + show: { + defaultValue: true, + control: { + type: 'boolean', + }, + }, + }, +}; + +const Template = (args, { argTypes }) => ({ + props: Object.keys(argTypes), + components: { AddCategoryComponent }, + template: + '', +}); + +export const AddCategory = Template.bind({}); +AddCategory.args = { + portalName: 'Chatwoot help center', + locale: 'En-US', + onCreate: action('create'), + onClose: action('cancel'), +}; diff --git a/app/javascript/dashboard/components/helpCenter/AddCategory.vue b/app/javascript/dashboard/components/helpCenter/AddCategory.vue new file mode 100644 index 000000000..2a1b9854c --- /dev/null +++ b/app/javascript/dashboard/components/helpCenter/AddCategory.vue @@ -0,0 +1,160 @@ +