Skip to content

Commit

Permalink
feat: Creates custom attributes route (#2877)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsivin committed Aug 25, 2021
1 parent 8d6b3ef commit 4a23a39
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/javascript/dashboard/i18n/default-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export const getSidebarItems = accountId => ({
'canned_list',
'labels_list',
'settings_inbox',
'attributes_list',
'settings_inbox_new',
'settings_inbox_list',
'settings_inbox_show',
Expand Down Expand Up @@ -202,6 +203,13 @@ export const getSidebarItems = accountId => ({
toState: frontendURL(`accounts/${accountId}/settings/labels/list`),
toStateName: 'labels_list',
},
attributes: {
icon: 'ion-code',
label: 'ATTRIBUTES',
hasSubMenu: false,
toState: frontendURL(`accounts/${accountId}/settings/attributes/list`),
toStateName: 'attributes_list',
},
cannedResponses: {
icon: 'ion-chatbox-working',
label: 'CANNED_RESPONSES',
Expand Down
6 changes: 6 additions & 0 deletions app/javascript/dashboard/i18n/locale/en/attributesMgmt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ATTRIBUTES_MGMT": {
"HEADER": "Attributes",
"HEADER_BTN_TXT": "Add Attribute"
}
}
2 changes: 2 additions & 0 deletions app/javascript/dashboard/i18n/locale/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { default as _signup } from './signup.json';
import { default as _teamsSettings } from './teamsSettings.json';
import { default as _integrationApps } from './integrationApps.json';
import { default as _csatMgmtMgmt } from './csatMgmt.json';
import { default as _attributesMgmt } from './attributesMgmt.json';

export default {
..._agentMgmt,
Expand All @@ -38,4 +39,5 @@ export default {
..._teamsSettings,
..._integrationApps,
..._csatMgmtMgmt,
..._attributesMgmt,
};
1 change: 1 addition & 0 deletions app/javascript/dashboard/i18n/locale/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
"ACCOUNT_SETTINGS": "Account Settings",
"APPLICATIONS": "Applications",
"LABELS": "Labels",
"ATTRIBUTES": "Attributes",
"TEAMS": "Teams",
"ALL_CONTACTS": "All Contacts",
"TAGGED_WITH": "Tagged with",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<template>
<div class="column content-box">
<woot-button
color-scheme="success"
class-names="button--fixed-right-top"
icon="ion-android-add-circle"
>
{{ $t('ATTRIBUTES_MGMT.HEADER_BTN_TXT') }}
</woot-button>
</div>
</template>

<script>
export default {};
</script>

<style></style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import SettingsContent from '../Wrapper';
import AttributesHome from './Index';
import { frontendURL } from '../../../../helper/URLHelper';

export default {
routes: [
{
path: frontendURL('accounts/:accountId/settings/attributes'),
component: SettingsContent,
props: {
headerTitle: 'ATTRIBUTES_MGMT.HEADER',
icon: 'ion-code',
showNewButton: false,
},
children: [
{
path: '',
name: 'attributes_wrapper',
redirect: 'list',
},
{
path: 'list',
name: 'attributes_list',
component: AttributesHome,
roles: ['administrator'],
},
],
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import profile from './profile/profile.routes';
import reports from './reports/reports.routes';
import campaigns from './campaigns/campaigns.routes';
import teams from './teams/teams.routes';
import attributes from './attributes/attributes.routes';
import store from '../../../store';

export default {
Expand All @@ -35,6 +36,7 @@ export default {
...reports.routes,
...teams.routes,
...campaigns.routes,
...attributes.routes,
...integrationapps.routes,
],
};

0 comments on commit 4a23a39

Please sign in to comment.