From c80289e66167cccff05cacfd4833f97a05c821a6 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Wed, 8 Sep 2021 09:37:58 +0530 Subject: [PATCH] feat: Add custom attribute table (#2929) --- app/javascript/dashboard/api/attributes.js | 5 + .../i18n/locale/en/attributesMgmt.json | 24 ++- .../settings/attributes/AddAttribute.vue | 54 +++--- .../settings/attributes/CustomAttribute.vue | 172 ++++++++++++++++++ .../dashboard/settings/attributes/Index.vue | 3 + .../dashboard/store/modules/attributes.js | 8 +- .../modules/specs/attributes/actions.spec.js | 4 +- .../modules/specs/attributes/fixtures.js | 6 +- .../modules/specs/attributes/getters.spec.js | 8 +- 9 files changed, 242 insertions(+), 42 deletions(-) create mode 100644 app/javascript/dashboard/routes/dashboard/settings/attributes/CustomAttribute.vue diff --git a/app/javascript/dashboard/api/attributes.js b/app/javascript/dashboard/api/attributes.js index c93807837..56eb5da76 100644 --- a/app/javascript/dashboard/api/attributes.js +++ b/app/javascript/dashboard/api/attributes.js @@ -1,9 +1,14 @@ +/* global axios */ import ApiClient from './ApiClient'; class AttributeAPI extends ApiClient { constructor() { super('custom_attribute_definitions', { accountScoped: true }); } + + getAttributesByModel(modelId) { + return axios.get(`${this.url}?attribute_model=${modelId}`); + } } export default new AttributeAPI(); diff --git a/app/javascript/dashboard/i18n/locale/en/attributesMgmt.json b/app/javascript/dashboard/i18n/locale/en/attributesMgmt.json index 275cdf81d..a3bbd1254 100644 --- a/app/javascript/dashboard/i18n/locale/en/attributesMgmt.json +++ b/app/javascript/dashboard/i18n/locale/en/attributesMgmt.json @@ -2,6 +2,8 @@ "ATTRIBUTES_MGMT": { "HEADER": "Attributes", "HEADER_BTN_TXT": "Add Attribute", + "LOADING": "Fetching attributes", + "SIDEBAR_TXT": "
Attributes
A custom attribute tracks facts about your contacts/conversation — like the subscription plan, or when they ordered the first item etc.
For creating a Attributes, just click on the Add Attribute. You can also edit or delete an existing Attribute by clicking on the Edit or Delete button.