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.
",
"ADD": {
"TITLE": "Add attribute",
"SUBMIT": "Create",
@@ -9,11 +11,13 @@
"FORM": {
"NAME": {
"LABEL": "Display Name",
- "PLACEHOLDER": "Enter attribute display name"
+ "PLACEHOLDER": "Enter attribute display name",
+ "ERROR": "Name is required"
},
"DESC": {
"LABEL": "Description",
- "PLACEHOLDER": "Enter attribute description"
+ "PLACEHOLDER": "Enter attribute description",
+ "ERROR": "Description is required"
},
"MODEL": {
"LABEL": "Model",
@@ -33,6 +37,22 @@
"SUCCESS_MESSAGE": "Attribute added successfully",
"ERROR_MESSAGE": "Could not connect to Woot Server, Please try again later"
}
+ },
+ "TABS": {
+ "HEADER": "Custom Attributes",
+ "CONVERSATION": "Conversation",
+ "CONTACT": "Contact"
+ },
+ "LIST": {
+ "TABLE_HEADER": ["Name", "Description", "Type", "Key"],
+ "BUTTONS": {
+ "EDIT": "Edit",
+ "DELETE": "Delete"
+ },
+ "EMPTY_RESULT": {
+ "404": "There are no attributes created",
+ "NOT_FOUND": "There are no attributes configured"
+ }
}
}
}
diff --git a/app/javascript/dashboard/routes/dashboard/settings/attributes/AddAttribute.vue b/app/javascript/dashboard/routes/dashboard/settings/attributes/AddAttribute.vue
index ba00f54b1..632e520e1 100644
--- a/app/javascript/dashboard/routes/dashboard/settings/attributes/AddAttribute.vue
+++ b/app/javascript/dashboard/routes/dashboard/settings/attributes/AddAttribute.vue
@@ -5,17 +5,19 @@