Compare commits
223
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0bf2bd9d4 | ||
|
|
a0dddae289 | ||
|
|
f4f2d678cf | ||
|
|
4a7a0427e9 | ||
|
|
d107d0adec | ||
|
|
d79d9e8b46 | ||
|
|
b524ceeca1 | ||
|
|
e68dac8c45 | ||
|
|
f0d00b6965 | ||
|
|
f15a4f8aa4 | ||
|
|
c0d5b24881 | ||
|
|
377fb5c3b9 | ||
|
|
58e78621ba | ||
|
|
fba73c7186 | ||
|
|
467700499b | ||
|
|
5d52e4e0a6 | ||
|
|
05b8486538 | ||
|
|
b9ff164041 | ||
|
|
73d448a203 | ||
|
|
8d8ec23aa1 | ||
|
|
add6403aa6 | ||
|
|
4b779dbe0f | ||
|
|
ab86f62fcc | ||
|
|
aaab2ac788 | ||
|
|
aa4edaa1e6 | ||
|
|
a76cd7684a | ||
|
|
2c17c95eab | ||
|
|
bb74c621b5 | ||
|
|
185a122ec7 | ||
|
|
05dece826d | ||
|
|
528b984a8d | ||
|
|
db0e654c03 | ||
|
|
e99e6a8443 | ||
|
|
d6fd3ce048 | ||
|
|
8a2f652b94 | ||
|
|
a3732c8f51 | ||
|
|
3a0e68030a | ||
|
|
f087461abc | ||
|
|
3a47b7e3d1 | ||
|
|
6dda1e8c8f | ||
|
|
098825c149 | ||
|
|
31e7663258 | ||
|
|
3b5f5b41ad | ||
|
|
fe5670832a | ||
|
|
bc6420019f | ||
|
|
f82ec3b885 | ||
|
|
32c25047c4 | ||
|
|
7f8d718da3 | ||
|
|
3489783cb8 | ||
|
|
53d68868c6 | ||
|
|
b61ad6e41a | ||
|
|
41c5e7d3f1 | ||
|
|
abc511d00f | ||
|
|
a48f98de9d | ||
|
|
7c2353c7d9 | ||
|
|
c80de24ac1 | ||
|
|
dadd572f9d | ||
|
|
776579ba5b | ||
|
|
4aa4e2549f | ||
|
|
eb6de74269 | ||
|
|
d19a9c38d7 | ||
|
|
c63a6ed8ec | ||
|
|
429d281501 | ||
|
|
6571baf211 | ||
|
|
44227de97e | ||
|
|
77b718c22c | ||
|
|
04b67eb431 | ||
|
|
a92d7fd7d5 | ||
|
|
e9e515c436 | ||
|
|
bb947ca50d | ||
|
|
8473e72a7e | ||
|
|
292435e0e7 | ||
|
|
d3dacccb1d | ||
|
|
0190b6c36d | ||
|
|
855b9c8f25 | ||
|
|
bb78639696 | ||
|
|
f38101527f | ||
|
|
4310a547ca | ||
|
|
06a362318c | ||
|
|
dd8abe975c | ||
|
|
207933ed70 | ||
|
|
b998f04826 | ||
|
|
7d6466022a | ||
|
|
7ff939efd5 | ||
|
|
b33d59d804 | ||
|
|
c26490e9c1 | ||
|
|
66db9a0cc1 | ||
|
|
b1da3dc7cf | ||
|
|
4c6572c2c9 | ||
|
|
452096f4b2 | ||
|
|
96d60674aa | ||
|
|
0b0e266455 | ||
|
|
6e12ba04ab | ||
|
|
ffc0183809 | ||
|
|
dcefd58240 | ||
|
|
6196a6d99a | ||
|
|
4a63d1d896 | ||
|
|
d5f34bf9d0 | ||
|
|
3558878ae2 | ||
|
|
d1d1398d80 | ||
|
|
40bd79f1ca | ||
|
|
74bbbd25b9 | ||
|
|
ae938b2154 | ||
|
|
80a90d9d8c | ||
|
|
646cfb97e7 | ||
|
|
89acbd8d09 | ||
|
|
b03a839809 | ||
|
|
56e93d152d | ||
|
|
c344f2b9cf | ||
|
|
aea68f1ecf | ||
|
|
e393bcf125 | ||
|
|
e330c2f6c0 | ||
|
|
cb4ad28a13 | ||
|
|
91b713f6f5 | ||
|
|
59b9c55967 | ||
|
|
736f16b170 | ||
|
|
28d4432152 | ||
|
|
e0b67bb552 | ||
|
|
b4b308336f | ||
|
|
6166ccb014 | ||
|
|
8696a4c135 | ||
|
|
829bb842fd | ||
|
|
17a6df10a0 | ||
|
|
3edc636b76 | ||
|
|
68482db3a2 | ||
|
|
f7102d7f8b | ||
|
|
ce8e1ec93d | ||
|
|
dc9da4bb24 | ||
|
|
a196e23587 | ||
|
|
066f0b990a | ||
|
|
6694db093f | ||
|
|
0331815cc5 | ||
|
|
027a540bbd | ||
|
|
239c61095a | ||
|
|
e9d47d31c7 | ||
|
|
8b1d98af52 | ||
|
|
8e2b329202 | ||
|
|
71073a06ff | ||
|
|
39d20b197d | ||
|
|
fb99ba7b40 | ||
|
|
79aa5a5d7f | ||
|
|
10ee773aac | ||
|
|
81d7c51a84 | ||
|
|
79381b08cc | ||
|
|
84c380c8c4 | ||
|
|
cb0642564c | ||
|
|
23e30fcb1a | ||
|
|
ae8619142f | ||
|
|
499408ea6f | ||
|
|
dc245814fe | ||
|
|
8ea412bc85 | ||
|
|
6c52a0638d | ||
|
|
64a9a46b28 | ||
|
|
30d4f6c2f5 | ||
|
|
5909c0f8b7 | ||
|
|
554388bff3 | ||
|
|
ebf3b46f0d | ||
|
|
5cfac31f93 | ||
|
|
787ac3134d | ||
|
|
2a06c85f1a | ||
|
|
acefd82378 | ||
|
|
abf376940d | ||
|
|
9de8c27368 | ||
|
|
9498d1f003 | ||
|
|
a2cb932d54 | ||
|
|
fe246698b6 | ||
|
|
31bcdaa3dd | ||
|
|
6ae606c981 | ||
|
|
aaf47b4c1f | ||
|
|
cc4851b19d | ||
|
|
5520bf68f3 | ||
|
|
46621b0983 | ||
|
|
2c94c89077 | ||
|
|
97de283103 | ||
|
|
862ef37e7f | ||
|
|
7ed7c1b618 | ||
|
|
8f3234cf4b | ||
|
|
b2de6843f6 | ||
|
|
73c4180e64 | ||
|
|
96f4f50d2d | ||
|
|
f7f687ce53 | ||
|
|
5716bb29b8 | ||
|
|
9a1d5519ec | ||
|
|
e72a343612 | ||
|
|
ee2844877c | ||
|
|
66c6b8cd4f | ||
|
|
ef606204a2 | ||
|
|
3dee50d2b1 | ||
|
|
1f09af270c | ||
|
|
e17f0ea753 | ||
|
|
6b0a5bea43 | ||
|
|
c5979c4575 | ||
|
|
9046730206 | ||
|
|
7968e98529 | ||
|
|
08516e6c43 | ||
|
|
5abf0e960a | ||
|
|
650fee58a6 | ||
|
|
9689bbf0dd | ||
|
|
20b2dc8c6f | ||
|
|
da4b75a3af | ||
|
|
576c58419c | ||
|
|
49c3d376de | ||
|
|
76efe3c5c3 | ||
|
|
75c83dd0d9 | ||
|
|
f452565d13 | ||
|
|
839f7fe719 | ||
|
|
c23e235cea | ||
|
|
88e4d9f06f | ||
|
|
bff19eb2e6 | ||
|
|
00ef9c475f | ||
|
|
af90f21cfd | ||
|
|
00da2ac847 | ||
|
|
f7580f864c | ||
|
|
85aeaf2aee | ||
|
|
e93af2681e | ||
|
|
cb2b75ca17 | ||
|
|
608592db0c | ||
|
|
ab1f803354 | ||
|
|
b81c722ac8 | ||
|
|
b40ad399f6 | ||
|
|
dcd18072b4 | ||
|
|
bda2d1d9a4 | ||
|
|
83231b9678 |
@@ -7,7 +7,7 @@ defaults: &defaults
|
|||||||
working_directory: ~/build
|
working_directory: ~/build
|
||||||
docker:
|
docker:
|
||||||
# specify the version you desire here
|
# specify the version you desire here
|
||||||
- image: cimg/ruby:3.2.2-browsers
|
- image: cimg/ruby:3.3.3-browsers
|
||||||
|
|
||||||
# Specify service dependencies here if necessary
|
# Specify service dependencies here if necessary
|
||||||
# CircleCI maintains a library of pre-built images
|
# CircleCI maintains a library of pre-built images
|
||||||
@@ -130,10 +130,7 @@ jobs:
|
|||||||
command: |
|
command: |
|
||||||
mkdir -p ~/tmp/test-results/frontend_specs
|
mkdir -p ~/tmp/test-results/frontend_specs
|
||||||
~/tmp/cc-test-reporter before-build
|
~/tmp/cc-test-reporter before-build
|
||||||
TESTFILES=$(circleci tests glob **/specs/*.spec.js | circleci tests split --split-by=timings)
|
yarn test:coverage
|
||||||
yarn test:coverage --profile 10 \
|
|
||||||
--out ~/tmp/test-results/yarn.xml \
|
|
||||||
-- ${TESTFILES}
|
|
||||||
- run:
|
- run:
|
||||||
name: Code Climate Test Coverage
|
name: Code Climate Test Coverage
|
||||||
command: |
|
command: |
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ services:
|
|||||||
args:
|
args:
|
||||||
VARIANT: "ubuntu-22.04"
|
VARIANT: "ubuntu-22.04"
|
||||||
NODE_VERSION: "20.9.0"
|
NODE_VERSION: "20.9.0"
|
||||||
RUBY_VERSION: "3.2.2"
|
RUBY_VERSION: "3.3.3"
|
||||||
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
|
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
|
||||||
USER_UID: "1000"
|
USER_UID: "1000"
|
||||||
USER_GID: "1000"
|
USER_GID: "1000"
|
||||||
@@ -25,7 +25,7 @@ services:
|
|||||||
args:
|
args:
|
||||||
VARIANT: "ubuntu-22.04"
|
VARIANT: "ubuntu-22.04"
|
||||||
NODE_VERSION: "20.9.0"
|
NODE_VERSION: "20.9.0"
|
||||||
RUBY_VERSION: "3.2.2"
|
RUBY_VERSION: "3.3.3"
|
||||||
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
|
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
|
||||||
USER_UID: "1000"
|
USER_UID: "1000"
|
||||||
USER_GID: "1000"
|
USER_GID: "1000"
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ SMTP_OPENSSL_VERIFY_MODE=peer
|
|||||||
# Comment out the following environment variables if required by your SMTP server
|
# Comment out the following environment variables if required by your SMTP server
|
||||||
# SMTP_TLS=
|
# SMTP_TLS=
|
||||||
# SMTP_SSL=
|
# SMTP_SSL=
|
||||||
|
# SMTP_OPEN_TIMEOUT
|
||||||
|
# SMTP_READ_TIMEOUT
|
||||||
|
|
||||||
# Mail Incoming
|
# Mail Incoming
|
||||||
# This is the domain set for the reply emails when conversation continuity is enabled
|
# This is the domain set for the reply emails when conversation continuity is enabled
|
||||||
@@ -255,3 +257,4 @@ AZURE_APP_SECRET=
|
|||||||
# Set to true if you want to remove stale contact inboxes
|
# Set to true if you want to remove stale contact inboxes
|
||||||
# contact_inboxes with no conversation older than 90 days will be removed
|
# contact_inboxes with no conversation older than 90 days will be removed
|
||||||
# REMOVE_STALE_CONTACT_INBOX_JOB_STATUS=false
|
# REMOVE_STALE_CONTACT_INBOX_JOB_STATUS=false
|
||||||
|
|
||||||
|
|||||||
+155
-1
@@ -27,6 +27,160 @@ module.exports = {
|
|||||||
'import/no-unresolved': 'off',
|
'import/no-unresolved': 'off',
|
||||||
'vue/html-indent': 'off',
|
'vue/html-indent': 'off',
|
||||||
'vue/multi-word-component-names': 'off',
|
'vue/multi-word-component-names': 'off',
|
||||||
|
'vue/next-tick-style': ['error', 'callback'],
|
||||||
|
'vue/block-order': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
order: ['script', 'template', 'style'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'vue/component-name-in-template-casing': [
|
||||||
|
'error',
|
||||||
|
'PascalCase',
|
||||||
|
{
|
||||||
|
registeredComponentsOnly: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'vue/component-options-name-casing': ['error', 'PascalCase'],
|
||||||
|
'vue/custom-event-name-casing': ['error', 'camelCase'],
|
||||||
|
'vue/define-emits-declaration': ['error'],
|
||||||
|
'vue/define-macros-order': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
order: ['defineProps', 'defineEmits'],
|
||||||
|
defineExposeLast: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'vue/define-props-declaration': ['error', 'runtime'],
|
||||||
|
'vue/match-component-import-name': ['error'],
|
||||||
|
'vue/no-bare-strings-in-template': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
allowlist: [
|
||||||
|
'(',
|
||||||
|
')',
|
||||||
|
',',
|
||||||
|
'.',
|
||||||
|
'&',
|
||||||
|
'+',
|
||||||
|
'-',
|
||||||
|
'=',
|
||||||
|
'*',
|
||||||
|
'/',
|
||||||
|
'#',
|
||||||
|
'%',
|
||||||
|
'!',
|
||||||
|
'?',
|
||||||
|
':',
|
||||||
|
'[',
|
||||||
|
']',
|
||||||
|
'{',
|
||||||
|
'}',
|
||||||
|
'<',
|
||||||
|
'>',
|
||||||
|
'⌘',
|
||||||
|
'📄',
|
||||||
|
'🎉',
|
||||||
|
'💬',
|
||||||
|
'👥',
|
||||||
|
'📥',
|
||||||
|
'🔖',
|
||||||
|
'❌',
|
||||||
|
'✅',
|
||||||
|
'\u00b7',
|
||||||
|
'\u2022',
|
||||||
|
'\u2010',
|
||||||
|
'\u2013',
|
||||||
|
'\u2014',
|
||||||
|
'\u2212',
|
||||||
|
'|',
|
||||||
|
],
|
||||||
|
attributes: {
|
||||||
|
'/.+/': [
|
||||||
|
'title',
|
||||||
|
'aria-label',
|
||||||
|
'aria-placeholder',
|
||||||
|
'aria-roledescription',
|
||||||
|
'aria-valuetext',
|
||||||
|
],
|
||||||
|
input: ['placeholder'],
|
||||||
|
},
|
||||||
|
directives: ['v-text'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'vue/no-empty-component-block': 'error',
|
||||||
|
'vue/no-multiple-objects-in-class': 'error',
|
||||||
|
'vue/no-root-v-if': 'warn',
|
||||||
|
'vue/no-static-inline-styles': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
allowBinding: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'vue/no-template-target-blank': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
allowReferrer: false,
|
||||||
|
enforceDynamicLinks: 'always',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'vue/no-required-prop-with-default': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
autofix: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'vue/no-this-in-before-route-enter': 'error',
|
||||||
|
'vue/no-undef-components': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
ignorePatterns: [
|
||||||
|
'^woot-',
|
||||||
|
'^fluent-',
|
||||||
|
'^multiselect',
|
||||||
|
'^router-link',
|
||||||
|
'^router-view',
|
||||||
|
'^ninja-keys',
|
||||||
|
'^FormulateForm',
|
||||||
|
'^FormulateInput',
|
||||||
|
'^highlightjs',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'vue/no-unused-emit-declarations': 'error',
|
||||||
|
'vue/no-unused-refs': 'error',
|
||||||
|
'vue/no-use-v-else-with-v-for': 'error',
|
||||||
|
'vue/prefer-true-attribute-shorthand': 'error',
|
||||||
|
'vue/no-useless-v-bind': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
ignoreIncludesComment: false,
|
||||||
|
ignoreStringEscape: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'vue/no-v-text': 'error',
|
||||||
|
'vue/padding-line-between-blocks': ['error', 'always'],
|
||||||
|
'vue/prefer-separate-static-class': 'error',
|
||||||
|
'vue/require-explicit-slots': 'error',
|
||||||
|
'vue/require-macro-variable-name': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
defineProps: 'props',
|
||||||
|
defineEmits: 'emit',
|
||||||
|
defineSlots: 'slots',
|
||||||
|
useSlots: 'slots',
|
||||||
|
useAttrs: 'attrs',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'vue/no-unused-properties': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
groups: ['props'],
|
||||||
|
deepData: false,
|
||||||
|
ignorePublicMembers: false,
|
||||||
|
unreferencedOptions: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
'vue/max-attributes-per-line': [
|
'vue/max-attributes-per-line': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
@@ -65,10 +219,10 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
browser: true,
|
browser: true,
|
||||||
jest: true,
|
|
||||||
node: true,
|
node: true,
|
||||||
},
|
},
|
||||||
globals: {
|
globals: {
|
||||||
bus: true,
|
bus: true,
|
||||||
|
vi: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,13 +25,5 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
issue-inactive-days: '30'
|
issue-inactive-days: '30'
|
||||||
issue-lock-reason: 'resolved'
|
issue-lock-reason: 'resolved'
|
||||||
issue-comment: >
|
|
||||||
This issue has been automatically locked since there
|
|
||||||
has not been any recent activity after it was closed.
|
|
||||||
Please open a new issue for related bugs.
|
|
||||||
pr-inactive-days: '30'
|
pr-inactive-days: '30'
|
||||||
pr-lock-reason: 'resolved'
|
pr-lock-reason: 'resolved'
|
||||||
pr-comment: >
|
|
||||||
This pull request has been automatically locked since there
|
|
||||||
has not been any recent activity after it was closed.
|
|
||||||
Please open a new issue for related bugs.
|
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
3.2.2
|
3.3.3
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { addDecorator } from '@storybook/vue';
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import Vuex from 'vuex';
|
import Vuex from 'vuex';
|
||||||
import VueI18n from 'vue-i18n';
|
import VueI18n from 'vue-i18n';
|
||||||
import Vuelidate from 'vuelidate';
|
|
||||||
import Multiselect from 'vue-multiselect';
|
import Multiselect from 'vue-multiselect';
|
||||||
import VueDOMPurifyHTML from 'vue-dompurify-html';
|
import VueDOMPurifyHTML from 'vue-dompurify-html';
|
||||||
import FluentIcon from 'shared/components/FluentIcon/DashboardIcon';
|
import FluentIcon from 'shared/components/FluentIcon/DashboardIcon';
|
||||||
@@ -14,7 +13,6 @@ import { domPurifyConfig } from 'shared/helpers/HTMLSanitizer';
|
|||||||
import '../app/javascript/dashboard/assets/scss/storybook.scss';
|
import '../app/javascript/dashboard/assets/scss/storybook.scss';
|
||||||
|
|
||||||
Vue.use(VueI18n);
|
Vue.use(VueI18n);
|
||||||
Vue.use(Vuelidate);
|
|
||||||
Vue.use(WootUiKit);
|
Vue.use(WootUiKit);
|
||||||
Vue.use(Vuex);
|
Vue.use(Vuex);
|
||||||
Vue.use(VueDOMPurifyHTML, domPurifyConfig);
|
Vue.use(VueDOMPurifyHTML, domPurifyConfig);
|
||||||
@@ -32,7 +30,7 @@ addDecorator(() => ({
|
|||||||
template: '<story/>',
|
template: '<story/>',
|
||||||
i18n: i18nConfig,
|
i18n: i18nConfig,
|
||||||
store,
|
store,
|
||||||
beforeCreate: function() {
|
beforeCreate: function () {
|
||||||
this.$root._i18n = this.$i18n;
|
this.$root._i18n = this.$i18n;
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
ruby '3.2.2'
|
ruby '3.3.3'
|
||||||
|
|
||||||
##-- base gems for rails --##
|
##-- base gems for rails --##
|
||||||
gem 'rack-cors', '2.0.0', require: 'rack/cors'
|
gem 'rack-cors', '2.0.0', require: 'rack/cors'
|
||||||
gem 'rails', '~> 7.0.8.1'
|
gem 'rails', '~> 7.0.8.4'
|
||||||
# Reduces boot times through caching; required in config/boot.rb
|
# Reduces boot times through caching; required in config/boot.rb
|
||||||
gem 'bootsnap', require: false
|
gem 'bootsnap', require: false
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ gem 'redis-namespace'
|
|||||||
gem 'activerecord-import'
|
gem 'activerecord-import'
|
||||||
|
|
||||||
##--- gems for server & infra configuration ---##
|
##--- gems for server & infra configuration ---##
|
||||||
gem 'dotenv-rails'
|
gem 'dotenv-rails', '>= 3.0.0'
|
||||||
gem 'foreman'
|
gem 'foreman'
|
||||||
gem 'puma'
|
gem 'puma'
|
||||||
gem 'webpacker'
|
gem 'webpacker'
|
||||||
@@ -96,12 +96,12 @@ gem 'koala'
|
|||||||
# slack client
|
# slack client
|
||||||
gem 'slack-ruby-client', '~> 2.2.0'
|
gem 'slack-ruby-client', '~> 2.2.0'
|
||||||
# for dialogflow integrations
|
# for dialogflow integrations
|
||||||
gem 'google-cloud-dialogflow-v2'
|
gem 'google-cloud-dialogflow-v2', '>= 0.24.0'
|
||||||
gem 'grpc'
|
gem 'grpc'
|
||||||
# Translate integrations
|
# Translate integrations
|
||||||
# 'google-cloud-translate' gem depends on faraday 2.0 version
|
# 'google-cloud-translate' gem depends on faraday 2.0 version
|
||||||
# this dependency breaks the slack-ruby-client gem
|
# this dependency breaks the slack-ruby-client gem
|
||||||
gem 'google-cloud-translate-v3'
|
gem 'google-cloud-translate-v3', '>= 0.7.0'
|
||||||
|
|
||||||
##-- apm and error monitoring ---#
|
##-- apm and error monitoring ---#
|
||||||
# loaded only when environment variables are set.
|
# loaded only when environment variables are set.
|
||||||
@@ -111,18 +111,18 @@ gem 'elastic-apm', require: false
|
|||||||
gem 'newrelic_rpm', require: false
|
gem 'newrelic_rpm', require: false
|
||||||
gem 'newrelic-sidekiq-metrics', '>= 1.6.2', require: false
|
gem 'newrelic-sidekiq-metrics', '>= 1.6.2', require: false
|
||||||
gem 'scout_apm', require: false
|
gem 'scout_apm', require: false
|
||||||
gem 'sentry-rails', '>= 5.14.0', require: false
|
gem 'sentry-rails', '>= 5.19.0', require: false
|
||||||
gem 'sentry-ruby', require: false
|
gem 'sentry-ruby', require: false
|
||||||
gem 'sentry-sidekiq', '>= 5.15.0', require: false
|
gem 'sentry-sidekiq', '>= 5.19.0', require: false
|
||||||
|
|
||||||
##-- background job processing --##
|
##-- background job processing --##
|
||||||
gem 'sidekiq', '>= 7.2.4'
|
gem 'sidekiq', '>= 7.3.1'
|
||||||
# We want cron jobs
|
# We want cron jobs
|
||||||
gem 'sidekiq-cron', '>= 1.12.0'
|
gem 'sidekiq-cron', '>= 1.12.0'
|
||||||
|
|
||||||
##-- Push notification service --##
|
##-- Push notification service --##
|
||||||
gem 'fcm'
|
gem 'fcm'
|
||||||
gem 'web-push'
|
gem 'web-push', '>= 3.0.1'
|
||||||
|
|
||||||
##-- geocoding / parse location from ip --##
|
##-- geocoding / parse location from ip --##
|
||||||
# http://www.rubygeocoder.com/
|
# http://www.rubygeocoder.com/
|
||||||
@@ -165,7 +165,7 @@ gem 'audited', '~> 5.4', '>= 5.4.1'
|
|||||||
|
|
||||||
# need for google auth
|
# need for google auth
|
||||||
gem 'omniauth', '>= 2.1.2'
|
gem 'omniauth', '>= 2.1.2'
|
||||||
gem 'omniauth-google-oauth2', '>= 1.1.2'
|
gem 'omniauth-google-oauth2', '>= 1.1.3'
|
||||||
gem 'omniauth-rails_csrf_protection', '~> 1.0', '>= 1.0.2'
|
gem 'omniauth-rails_csrf_protection', '~> 1.0', '>= 1.0.2'
|
||||||
|
|
||||||
## Gems for reponse bot
|
## Gems for reponse bot
|
||||||
@@ -200,7 +200,7 @@ group :development do
|
|||||||
gem 'rack-mini-profiler', '>= 3.2.0', require: false
|
gem 'rack-mini-profiler', '>= 3.2.0', require: false
|
||||||
gem 'stackprof'
|
gem 'stackprof'
|
||||||
# Should install the associated chrome extension to view query logs
|
# Should install the associated chrome extension to view query logs
|
||||||
gem 'meta_request', '>= 0.8.0'
|
gem 'meta_request', '>= 0.8.3'
|
||||||
end
|
end
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
@@ -228,7 +228,7 @@ group :development, :test do
|
|||||||
gem 'mock_redis'
|
gem 'mock_redis'
|
||||||
gem 'pry-rails'
|
gem 'pry-rails'
|
||||||
gem 'rspec_junit_formatter'
|
gem 'rspec_junit_formatter'
|
||||||
gem 'rspec-rails'
|
gem 'rspec-rails', '>= 6.1.5'
|
||||||
gem 'rubocop', require: false
|
gem 'rubocop', require: false
|
||||||
gem 'rubocop-performance', require: false
|
gem 'rubocop-performance', require: false
|
||||||
gem 'rubocop-rails', require: false
|
gem 'rubocop-rails', require: false
|
||||||
|
|||||||
+162
-156
@@ -33,78 +33,78 @@ GIT
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (7.0.8.3)
|
actioncable (7.0.8.4)
|
||||||
actionpack (= 7.0.8.3)
|
actionpack (= 7.0.8.4)
|
||||||
activesupport (= 7.0.8.3)
|
activesupport (= 7.0.8.4)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailbox (7.0.8.3)
|
actionmailbox (7.0.8.4)
|
||||||
actionpack (= 7.0.8.3)
|
actionpack (= 7.0.8.4)
|
||||||
activejob (= 7.0.8.3)
|
activejob (= 7.0.8.4)
|
||||||
activerecord (= 7.0.8.3)
|
activerecord (= 7.0.8.4)
|
||||||
activestorage (= 7.0.8.3)
|
activestorage (= 7.0.8.4)
|
||||||
activesupport (= 7.0.8.3)
|
activesupport (= 7.0.8.4)
|
||||||
mail (>= 2.7.1)
|
mail (>= 2.7.1)
|
||||||
net-imap
|
net-imap
|
||||||
net-pop
|
net-pop
|
||||||
net-smtp
|
net-smtp
|
||||||
actionmailer (7.0.8.3)
|
actionmailer (7.0.8.4)
|
||||||
actionpack (= 7.0.8.3)
|
actionpack (= 7.0.8.4)
|
||||||
actionview (= 7.0.8.3)
|
actionview (= 7.0.8.4)
|
||||||
activejob (= 7.0.8.3)
|
activejob (= 7.0.8.4)
|
||||||
activesupport (= 7.0.8.3)
|
activesupport (= 7.0.8.4)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
net-imap
|
net-imap
|
||||||
net-pop
|
net-pop
|
||||||
net-smtp
|
net-smtp
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (7.0.8.3)
|
actionpack (7.0.8.4)
|
||||||
actionview (= 7.0.8.3)
|
actionview (= 7.0.8.4)
|
||||||
activesupport (= 7.0.8.3)
|
activesupport (= 7.0.8.4)
|
||||||
rack (~> 2.0, >= 2.2.4)
|
rack (~> 2.0, >= 2.2.4)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||||
actiontext (7.0.8.3)
|
actiontext (7.0.8.4)
|
||||||
actionpack (= 7.0.8.3)
|
actionpack (= 7.0.8.4)
|
||||||
activerecord (= 7.0.8.3)
|
activerecord (= 7.0.8.4)
|
||||||
activestorage (= 7.0.8.3)
|
activestorage (= 7.0.8.4)
|
||||||
activesupport (= 7.0.8.3)
|
activesupport (= 7.0.8.4)
|
||||||
globalid (>= 0.6.0)
|
globalid (>= 0.6.0)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (7.0.8.3)
|
actionview (7.0.8.4)
|
||||||
activesupport (= 7.0.8.3)
|
activesupport (= 7.0.8.4)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.4)
|
erubi (~> 1.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
||||||
active_record_query_trace (1.8)
|
active_record_query_trace (1.8)
|
||||||
activejob (7.0.8.3)
|
activejob (7.0.8.4)
|
||||||
activesupport (= 7.0.8.3)
|
activesupport (= 7.0.8.4)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (7.0.8.3)
|
activemodel (7.0.8.4)
|
||||||
activesupport (= 7.0.8.3)
|
activesupport (= 7.0.8.4)
|
||||||
activerecord (7.0.8.3)
|
activerecord (7.0.8.4)
|
||||||
activemodel (= 7.0.8.3)
|
activemodel (= 7.0.8.4)
|
||||||
activesupport (= 7.0.8.3)
|
activesupport (= 7.0.8.4)
|
||||||
activerecord-import (1.4.1)
|
activerecord-import (1.4.1)
|
||||||
activerecord (>= 4.2)
|
activerecord (>= 4.2)
|
||||||
activestorage (7.0.8.3)
|
activestorage (7.0.8.4)
|
||||||
actionpack (= 7.0.8.3)
|
actionpack (= 7.0.8.4)
|
||||||
activejob (= 7.0.8.3)
|
activejob (= 7.0.8.4)
|
||||||
activerecord (= 7.0.8.3)
|
activerecord (= 7.0.8.4)
|
||||||
activesupport (= 7.0.8.3)
|
activesupport (= 7.0.8.4)
|
||||||
marcel (~> 1.0)
|
marcel (~> 1.0)
|
||||||
mini_mime (>= 1.1.0)
|
mini_mime (>= 1.1.0)
|
||||||
activesupport (7.0.8.3)
|
activesupport (7.0.8.4)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (>= 1.6, < 2)
|
i18n (>= 1.6, < 2)
|
||||||
minitest (>= 5.1)
|
minitest (>= 5.1)
|
||||||
tzinfo (~> 2.0)
|
tzinfo (~> 2.0)
|
||||||
acts-as-taggable-on (9.0.1)
|
acts-as-taggable-on (9.0.1)
|
||||||
activerecord (>= 6.0, < 7.1)
|
activerecord (>= 6.0, < 7.1)
|
||||||
addressable (2.8.4)
|
addressable (2.8.7)
|
||||||
public_suffix (>= 2.0.2, < 6.0)
|
public_suffix (>= 2.0.2, < 7.0)
|
||||||
administrate (0.20.1)
|
administrate (0.20.1)
|
||||||
actionpack (>= 6.0, < 8.0)
|
actionpack (>= 6.0, < 8.0)
|
||||||
actionview (>= 6.0, < 8.0)
|
actionview (>= 6.0, < 8.0)
|
||||||
@@ -150,13 +150,13 @@ GEM
|
|||||||
statsd-ruby (~> 1.1)
|
statsd-ruby (~> 1.1)
|
||||||
base64 (0.2.0)
|
base64 (0.2.0)
|
||||||
bcrypt (3.1.20)
|
bcrypt (3.1.20)
|
||||||
bigdecimal (3.1.7)
|
bigdecimal (3.1.8)
|
||||||
bindex (0.8.1)
|
bindex (0.8.1)
|
||||||
bootsnap (1.16.0)
|
bootsnap (1.16.0)
|
||||||
msgpack (~> 1.2)
|
msgpack (~> 1.2)
|
||||||
brakeman (5.4.1)
|
brakeman (5.4.1)
|
||||||
browser (5.3.1)
|
browser (5.3.1)
|
||||||
builder (3.2.4)
|
builder (3.3.0)
|
||||||
bullet (7.0.7)
|
bullet (7.0.7)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
uniform_notifier (~> 1.11)
|
uniform_notifier (~> 1.11)
|
||||||
@@ -169,12 +169,15 @@ GEM
|
|||||||
climate_control (1.2.0)
|
climate_control (1.2.0)
|
||||||
coderay (1.1.3)
|
coderay (1.1.3)
|
||||||
commonmarker (0.23.10)
|
commonmarker (0.23.10)
|
||||||
concurrent-ruby (1.2.3)
|
concurrent-ruby (1.3.4)
|
||||||
connection_pool (2.4.1)
|
connection_pool (2.4.1)
|
||||||
crack (0.4.5)
|
crack (1.0.0)
|
||||||
|
bigdecimal
|
||||||
rexml
|
rexml
|
||||||
crass (1.0.6)
|
crass (1.0.6)
|
||||||
csv-safe (3.2.1)
|
csv (3.3.0)
|
||||||
|
csv-safe (3.3.1)
|
||||||
|
csv (~> 3.0)
|
||||||
cypress-on-rails (1.16.0)
|
cypress-on-rails (1.16.0)
|
||||||
rack
|
rack
|
||||||
database_cleaner (2.0.2)
|
database_cleaner (2.0.2)
|
||||||
@@ -183,13 +186,16 @@ GEM
|
|||||||
activerecord (>= 5.a)
|
activerecord (>= 5.a)
|
||||||
database_cleaner-core (~> 2.0.0)
|
database_cleaner-core (~> 2.0.0)
|
||||||
database_cleaner-core (2.0.1)
|
database_cleaner-core (2.0.1)
|
||||||
date (3.3.4)
|
datadog-ci (0.8.3)
|
||||||
ddtrace (1.11.1)
|
|
||||||
debase-ruby_core_source (>= 0.10.16, <= 3.2.0)
|
|
||||||
libdatadog (~> 2.0.0.1.0)
|
|
||||||
libddwaf (~> 1.8.2.0.0)
|
|
||||||
msgpack
|
msgpack
|
||||||
debase-ruby_core_source (3.2.0)
|
date (3.3.4)
|
||||||
|
ddtrace (1.23.2)
|
||||||
|
datadog-ci (~> 0.8.1)
|
||||||
|
debase-ruby_core_source (= 3.3.1)
|
||||||
|
libdatadog (~> 7.0.0.1.0)
|
||||||
|
libddwaf (~> 1.14.0.0.0)
|
||||||
|
msgpack
|
||||||
|
debase-ruby_core_source (3.3.1)
|
||||||
debug (1.8.0)
|
debug (1.8.0)
|
||||||
irb (>= 1.5.0)
|
irb (>= 1.5.0)
|
||||||
reline (>= 0.3.1)
|
reline (>= 0.3.1)
|
||||||
@@ -204,16 +210,16 @@ GEM
|
|||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
devise (> 3.5.2, < 5)
|
devise (> 3.5.2, < 5)
|
||||||
rails (>= 4.2.0, < 7.2)
|
rails (>= 4.2.0, < 7.2)
|
||||||
diff-lcs (1.5.0)
|
diff-lcs (1.5.1)
|
||||||
digest-crc (0.6.4)
|
digest-crc (0.6.4)
|
||||||
rake (>= 12.0.0, < 14.0.0)
|
rake (>= 12.0.0, < 14.0.0)
|
||||||
docile (1.4.0)
|
docile (1.4.0)
|
||||||
domain_name (0.5.20190701)
|
domain_name (0.5.20190701)
|
||||||
unf (>= 0.0.5, < 1.0.0)
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
dotenv (2.8.1)
|
dotenv (3.1.2)
|
||||||
dotenv-rails (2.8.1)
|
dotenv-rails (3.1.2)
|
||||||
dotenv (= 2.8.1)
|
dotenv (= 3.1.2)
|
||||||
railties (>= 3.2)
|
railties (>= 6.1)
|
||||||
down (5.4.0)
|
down (5.4.0)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
ecma-re-validator (0.4.0)
|
ecma-re-validator (0.4.0)
|
||||||
@@ -223,8 +229,8 @@ GEM
|
|||||||
http (>= 3.0)
|
http (>= 3.0)
|
||||||
ruby2_keywords
|
ruby2_keywords
|
||||||
email_reply_trimmer (0.1.13)
|
email_reply_trimmer (0.1.13)
|
||||||
erubi (1.12.0)
|
erubi (1.13.0)
|
||||||
et-orbi (1.2.7)
|
et-orbi (1.2.11)
|
||||||
tzinfo
|
tzinfo
|
||||||
execjs (2.8.1)
|
execjs (2.8.1)
|
||||||
facebook-messenger (2.0.1)
|
facebook-messenger (2.0.1)
|
||||||
@@ -251,7 +257,7 @@ GEM
|
|||||||
faraday-net_http_persistent (2.1.0)
|
faraday-net_http_persistent (2.1.0)
|
||||||
faraday (~> 2.5)
|
faraday (~> 2.5)
|
||||||
net-http-persistent (~> 4.0)
|
net-http-persistent (~> 4.0)
|
||||||
faraday-retry (2.1.0)
|
faraday-retry (2.2.1)
|
||||||
faraday (~> 2.0)
|
faraday (~> 2.0)
|
||||||
fcm (1.0.8)
|
fcm (1.0.8)
|
||||||
faraday (>= 1.0.0, < 3.0)
|
faraday (>= 1.0.0, < 3.0)
|
||||||
@@ -262,10 +268,10 @@ GEM
|
|||||||
rake
|
rake
|
||||||
flag_shih_tzu (0.3.23)
|
flag_shih_tzu (0.3.23)
|
||||||
foreman (0.87.2)
|
foreman (0.87.2)
|
||||||
fugit (1.9.0)
|
fugit (1.11.1)
|
||||||
et-orbi (~> 1, >= 1.2.7)
|
et-orbi (~> 1, >= 1.2.11)
|
||||||
raabro (~> 1.4)
|
raabro (~> 1.4)
|
||||||
gapic-common (0.18.0)
|
gapic-common (0.20.0)
|
||||||
faraday (>= 1.9, < 3.a)
|
faraday (>= 1.9, < 3.a)
|
||||||
faraday-retry (>= 1.0, < 3.a)
|
faraday-retry (>= 1.0, < 3.a)
|
||||||
google-protobuf (~> 3.14)
|
google-protobuf (~> 3.14)
|
||||||
@@ -295,15 +301,15 @@ GEM
|
|||||||
google-cloud-core (1.6.0)
|
google-cloud-core (1.6.0)
|
||||||
google-cloud-env (~> 1.0)
|
google-cloud-env (~> 1.0)
|
||||||
google-cloud-errors (~> 1.0)
|
google-cloud-errors (~> 1.0)
|
||||||
google-cloud-dialogflow-v2 (0.23.0)
|
google-cloud-dialogflow-v2 (0.31.0)
|
||||||
gapic-common (>= 0.18.0, < 2.a)
|
gapic-common (>= 0.20.0, < 2.a)
|
||||||
google-cloud-errors (~> 1.0)
|
google-cloud-errors (~> 1.0)
|
||||||
google-cloud-location (>= 0.4, < 2.a)
|
google-cloud-location (>= 0.4, < 2.a)
|
||||||
google-cloud-env (1.6.0)
|
google-cloud-env (1.6.0)
|
||||||
faraday (>= 0.17.3, < 3.0)
|
faraday (>= 0.17.3, < 3.0)
|
||||||
google-cloud-errors (1.3.1)
|
google-cloud-errors (1.3.1)
|
||||||
google-cloud-location (0.4.0)
|
google-cloud-location (0.6.0)
|
||||||
gapic-common (>= 0.17.1, < 2.a)
|
gapic-common (>= 0.20.0, < 2.a)
|
||||||
google-cloud-errors (~> 1.0)
|
google-cloud-errors (~> 1.0)
|
||||||
google-cloud-storage (1.44.0)
|
google-cloud-storage (1.44.0)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
@@ -313,17 +319,17 @@ GEM
|
|||||||
google-cloud-core (~> 1.6)
|
google-cloud-core (~> 1.6)
|
||||||
googleauth (>= 0.16.2, < 2.a)
|
googleauth (>= 0.16.2, < 2.a)
|
||||||
mini_mime (~> 1.0)
|
mini_mime (~> 1.0)
|
||||||
google-cloud-translate-v3 (0.6.0)
|
google-cloud-translate-v3 (0.10.0)
|
||||||
gapic-common (>= 0.17.1, < 2.a)
|
gapic-common (>= 0.20.0, < 2.a)
|
||||||
google-cloud-errors (~> 1.0)
|
google-cloud-errors (~> 1.0)
|
||||||
google-protobuf (3.25.3)
|
google-protobuf (3.25.5)
|
||||||
google-protobuf (3.25.3-arm64-darwin)
|
google-protobuf (3.25.5-arm64-darwin)
|
||||||
google-protobuf (3.25.3-x86_64-darwin)
|
google-protobuf (3.25.5-x86_64-darwin)
|
||||||
google-protobuf (3.25.3-x86_64-linux)
|
google-protobuf (3.25.5-x86_64-linux)
|
||||||
googleapis-common-protos (1.4.0)
|
googleapis-common-protos (1.6.0)
|
||||||
google-protobuf (~> 3.14)
|
google-protobuf (>= 3.18, < 5.a)
|
||||||
googleapis-common-protos-types (~> 1.2)
|
googleapis-common-protos-types (~> 1.7)
|
||||||
grpc (~> 1.27)
|
grpc (~> 1.41)
|
||||||
googleapis-common-protos-types (1.14.0)
|
googleapis-common-protos-types (1.14.0)
|
||||||
google-protobuf (~> 3.18)
|
google-protobuf (~> 3.18)
|
||||||
googleauth (1.5.2)
|
googleauth (1.5.2)
|
||||||
@@ -353,9 +359,8 @@ GEM
|
|||||||
ruby2ruby (~> 2.4)
|
ruby2ruby (~> 2.4)
|
||||||
ruby_parser (~> 3.10)
|
ruby_parser (~> 3.10)
|
||||||
hana (1.3.7)
|
hana (1.3.7)
|
||||||
hashdiff (1.0.1)
|
hashdiff (1.1.0)
|
||||||
hashie (5.0.0)
|
hashie (5.0.0)
|
||||||
hkdf (1.0.0)
|
|
||||||
http (5.1.1)
|
http (5.1.1)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
http-cookie (~> 1.0)
|
http-cookie (~> 1.0)
|
||||||
@@ -417,15 +422,15 @@ GEM
|
|||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
letter_opener (1.8.1)
|
letter_opener (1.8.1)
|
||||||
launchy (>= 2.2, < 3)
|
launchy (>= 2.2, < 3)
|
||||||
libdatadog (2.0.0.1.0)
|
libdatadog (7.0.0.1.0)
|
||||||
libdatadog (2.0.0.1.0-x86_64-linux)
|
libdatadog (7.0.0.1.0-x86_64-linux)
|
||||||
libddwaf (1.8.2.0.0)
|
libddwaf (1.14.0.0.0)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
libddwaf (1.8.2.0.0-arm64-darwin)
|
libddwaf (1.14.0.0.0-arm64-darwin)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
libddwaf (1.8.2.0.0-x86_64-darwin)
|
libddwaf (1.14.0.0.0-x86_64-darwin)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
libddwaf (1.8.2.0.0-x86_64-linux)
|
libddwaf (1.14.0.0.0-x86_64-linux)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
line-bot-api (1.28.0)
|
line-bot-api (1.28.0)
|
||||||
liquid (5.4.0)
|
liquid (5.4.0)
|
||||||
@@ -435,6 +440,7 @@ GEM
|
|||||||
llhttp-ffi (0.4.0)
|
llhttp-ffi (0.4.0)
|
||||||
ffi-compiler (~> 1.0)
|
ffi-compiler (~> 1.0)
|
||||||
rake (~> 13.0)
|
rake (~> 13.0)
|
||||||
|
logger (1.6.0)
|
||||||
lograge (0.14.0)
|
lograge (0.14.0)
|
||||||
actionpack (>= 4)
|
actionpack (>= 4)
|
||||||
activesupport (>= 4)
|
activesupport (>= 4)
|
||||||
@@ -451,7 +457,7 @@ GEM
|
|||||||
marcel (1.0.4)
|
marcel (1.0.4)
|
||||||
maxminddb (0.1.22)
|
maxminddb (0.1.22)
|
||||||
memoist (0.16.2)
|
memoist (0.16.2)
|
||||||
meta_request (0.8.2)
|
meta_request (0.8.3)
|
||||||
rack-contrib (>= 1.1, < 3)
|
rack-contrib (>= 1.1, < 3)
|
||||||
railties (>= 3.0.0, < 8)
|
railties (>= 3.0.0, < 8)
|
||||||
method_source (1.1.0)
|
method_source (1.1.0)
|
||||||
@@ -460,8 +466,8 @@ GEM
|
|||||||
mime-types-data (3.2023.0218.1)
|
mime-types-data (3.2023.0218.1)
|
||||||
mini_magick (4.12.0)
|
mini_magick (4.12.0)
|
||||||
mini_mime (1.1.5)
|
mini_mime (1.1.5)
|
||||||
mini_portile2 (2.8.6)
|
mini_portile2 (2.8.7)
|
||||||
minitest (5.23.0)
|
minitest (5.25.1)
|
||||||
mock_redis (0.36.0)
|
mock_redis (0.36.0)
|
||||||
ruby2_keywords
|
ruby2_keywords
|
||||||
msgpack (1.7.0)
|
msgpack (1.7.0)
|
||||||
@@ -474,7 +480,7 @@ GEM
|
|||||||
uri
|
uri
|
||||||
net-http-persistent (4.0.2)
|
net-http-persistent (4.0.2)
|
||||||
connection_pool (~> 2.2)
|
connection_pool (~> 2.2)
|
||||||
net-imap (0.4.11)
|
net-imap (0.4.14)
|
||||||
date
|
date
|
||||||
net-protocol
|
net-protocol
|
||||||
net-pop (0.1.2)
|
net-pop (0.1.2)
|
||||||
@@ -490,14 +496,14 @@ GEM
|
|||||||
newrelic_rpm (9.6.0)
|
newrelic_rpm (9.6.0)
|
||||||
base64
|
base64
|
||||||
nio4r (2.7.3)
|
nio4r (2.7.3)
|
||||||
nokogiri (1.16.5)
|
nokogiri (1.16.6)
|
||||||
mini_portile2 (~> 2.8.2)
|
mini_portile2 (~> 2.8.2)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.5-arm64-darwin)
|
nokogiri (1.16.6-arm64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.5-x86_64-darwin)
|
nokogiri (1.16.6-x86_64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.5-x86_64-linux)
|
nokogiri (1.16.6-x86_64-linux)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
oauth (1.1.0)
|
oauth (1.1.0)
|
||||||
oauth-tty (~> 1.0, >= 1.0.1)
|
oauth-tty (~> 1.0, >= 1.0.1)
|
||||||
@@ -516,7 +522,7 @@ GEM
|
|||||||
hashie (>= 3.4.6)
|
hashie (>= 3.4.6)
|
||||||
rack (>= 2.2.3)
|
rack (>= 2.2.3)
|
||||||
rack-protection
|
rack-protection
|
||||||
omniauth-google-oauth2 (1.1.2)
|
omniauth-google-oauth2 (1.1.3)
|
||||||
jwt (>= 2.0)
|
jwt (>= 2.0)
|
||||||
oauth2 (~> 2.0)
|
oauth2 (~> 2.0)
|
||||||
omniauth (~> 2.0)
|
omniauth (~> 2.0)
|
||||||
@@ -527,7 +533,7 @@ GEM
|
|||||||
omniauth-rails_csrf_protection (1.0.2)
|
omniauth-rails_csrf_protection (1.0.2)
|
||||||
actionpack (>= 4.2)
|
actionpack (>= 4.2)
|
||||||
omniauth (~> 2.0)
|
omniauth (~> 2.0)
|
||||||
openssl (3.1.0)
|
openssl (3.2.0)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
os (1.1.4)
|
os (1.1.4)
|
||||||
parallel (1.23.0)
|
parallel (1.23.0)
|
||||||
@@ -545,13 +551,13 @@ GEM
|
|||||||
method_source (~> 1.0)
|
method_source (~> 1.0)
|
||||||
pry-rails (0.3.9)
|
pry-rails (0.3.9)
|
||||||
pry (>= 0.10.4)
|
pry (>= 0.10.4)
|
||||||
public_suffix (5.0.1)
|
public_suffix (6.0.0)
|
||||||
puma (6.4.2)
|
puma (6.4.3)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
pundit (2.3.0)
|
pundit (2.3.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
raabro (1.4.0)
|
raabro (1.4.0)
|
||||||
racc (1.7.3)
|
racc (1.8.0)
|
||||||
rack (2.2.9)
|
rack (2.2.9)
|
||||||
rack-attack (6.7.0)
|
rack-attack (6.7.0)
|
||||||
rack (>= 1.0, < 4)
|
rack (>= 1.0, < 4)
|
||||||
@@ -569,20 +575,20 @@ GEM
|
|||||||
rack-test (2.1.0)
|
rack-test (2.1.0)
|
||||||
rack (>= 1.3)
|
rack (>= 1.3)
|
||||||
rack-timeout (0.6.3)
|
rack-timeout (0.6.3)
|
||||||
rails (7.0.8.3)
|
rails (7.0.8.4)
|
||||||
actioncable (= 7.0.8.3)
|
actioncable (= 7.0.8.4)
|
||||||
actionmailbox (= 7.0.8.3)
|
actionmailbox (= 7.0.8.4)
|
||||||
actionmailer (= 7.0.8.3)
|
actionmailer (= 7.0.8.4)
|
||||||
actionpack (= 7.0.8.3)
|
actionpack (= 7.0.8.4)
|
||||||
actiontext (= 7.0.8.3)
|
actiontext (= 7.0.8.4)
|
||||||
actionview (= 7.0.8.3)
|
actionview (= 7.0.8.4)
|
||||||
activejob (= 7.0.8.3)
|
activejob (= 7.0.8.4)
|
||||||
activemodel (= 7.0.8.3)
|
activemodel (= 7.0.8.4)
|
||||||
activerecord (= 7.0.8.3)
|
activerecord (= 7.0.8.4)
|
||||||
activestorage (= 7.0.8.3)
|
activestorage (= 7.0.8.4)
|
||||||
activesupport (= 7.0.8.3)
|
activesupport (= 7.0.8.4)
|
||||||
bundler (>= 1.15.0)
|
bundler (>= 1.15.0)
|
||||||
railties (= 7.0.8.3)
|
railties (= 7.0.8.4)
|
||||||
rails-dom-testing (2.2.0)
|
rails-dom-testing (2.2.0)
|
||||||
activesupport (>= 5.0.0)
|
activesupport (>= 5.0.0)
|
||||||
minitest
|
minitest
|
||||||
@@ -590,9 +596,9 @@ GEM
|
|||||||
rails-html-sanitizer (1.6.0)
|
rails-html-sanitizer (1.6.0)
|
||||||
loofah (~> 2.21)
|
loofah (~> 2.21)
|
||||||
nokogiri (~> 1.14)
|
nokogiri (~> 1.14)
|
||||||
railties (7.0.8.3)
|
railties (7.0.8.4)
|
||||||
actionpack (= 7.0.8.3)
|
actionpack (= 7.0.8.4)
|
||||||
activesupport (= 7.0.8.3)
|
activesupport (= 7.0.8.4)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 12.2)
|
rake (>= 12.2)
|
||||||
thor (~> 1.0)
|
thor (~> 1.0)
|
||||||
@@ -604,7 +610,7 @@ GEM
|
|||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
redis (5.0.6)
|
redis (5.0.6)
|
||||||
redis-client (>= 0.9.0)
|
redis-client (>= 0.9.0)
|
||||||
redis-client (0.22.1)
|
redis-client (0.22.2)
|
||||||
connection_pool
|
connection_pool
|
||||||
redis-namespace (1.10.0)
|
redis-namespace (1.10.0)
|
||||||
redis (>= 4)
|
redis (>= 4)
|
||||||
@@ -628,25 +634,25 @@ GEM
|
|||||||
retriable (3.1.2)
|
retriable (3.1.2)
|
||||||
reverse_markdown (2.1.1)
|
reverse_markdown (2.1.1)
|
||||||
nokogiri
|
nokogiri
|
||||||
rexml (3.2.8)
|
rexml (3.3.6)
|
||||||
strscan (>= 3.0.9)
|
strscan
|
||||||
rspec-core (3.12.2)
|
rspec-core (3.13.0)
|
||||||
rspec-support (~> 3.12.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-expectations (3.12.3)
|
rspec-expectations (3.13.2)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.12.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-mocks (3.12.5)
|
rspec-mocks (3.13.1)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.12.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-rails (6.0.2)
|
rspec-rails (7.0.1)
|
||||||
actionpack (>= 6.1)
|
actionpack (>= 7.0)
|
||||||
activesupport (>= 6.1)
|
activesupport (>= 7.0)
|
||||||
railties (>= 6.1)
|
railties (>= 7.0)
|
||||||
rspec-core (~> 3.12)
|
rspec-core (~> 3.13)
|
||||||
rspec-expectations (~> 3.12)
|
rspec-expectations (~> 3.13)
|
||||||
rspec-mocks (~> 3.12)
|
rspec-mocks (~> 3.13)
|
||||||
rspec-support (~> 3.12)
|
rspec-support (~> 3.13)
|
||||||
rspec-support (3.12.0)
|
rspec-support (3.13.1)
|
||||||
rspec_junit_formatter (0.6.0)
|
rspec_junit_formatter (0.6.0)
|
||||||
rspec-core (>= 2, < 4, != 2.12.0)
|
rspec-core (>= 2, < 4, != 2.12.0)
|
||||||
rubocop (1.50.2)
|
rubocop (1.50.2)
|
||||||
@@ -704,23 +710,24 @@ GEM
|
|||||||
activesupport (>= 4)
|
activesupport (>= 4)
|
||||||
selectize-rails (0.12.6)
|
selectize-rails (0.12.6)
|
||||||
semantic_range (3.0.0)
|
semantic_range (3.0.0)
|
||||||
sentry-rails (5.17.3)
|
sentry-rails (5.19.0)
|
||||||
railties (>= 5.0)
|
railties (>= 5.0)
|
||||||
sentry-ruby (~> 5.17.3)
|
sentry-ruby (~> 5.19.0)
|
||||||
sentry-ruby (5.17.3)
|
sentry-ruby (5.19.0)
|
||||||
bigdecimal
|
bigdecimal
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
sentry-sidekiq (5.17.3)
|
sentry-sidekiq (5.19.0)
|
||||||
sentry-ruby (~> 5.17.3)
|
sentry-ruby (~> 5.19.0)
|
||||||
sidekiq (>= 3.0)
|
sidekiq (>= 3.0)
|
||||||
sexp_processor (4.17.0)
|
sexp_processor (4.17.0)
|
||||||
shoulda-matchers (5.3.0)
|
shoulda-matchers (5.3.0)
|
||||||
activesupport (>= 5.2.0)
|
activesupport (>= 5.2.0)
|
||||||
sidekiq (7.2.4)
|
sidekiq (7.3.1)
|
||||||
concurrent-ruby (< 2)
|
concurrent-ruby (< 2)
|
||||||
connection_pool (>= 2.3.0)
|
connection_pool (>= 2.3.0)
|
||||||
|
logger
|
||||||
rack (>= 2.2.4)
|
rack (>= 2.2.4)
|
||||||
redis-client (>= 0.19.0)
|
redis-client (>= 0.22.2)
|
||||||
sidekiq-cron (1.12.0)
|
sidekiq-cron (1.12.0)
|
||||||
fugit (~> 1.8)
|
fugit (~> 1.8)
|
||||||
globalid (>= 1.0.1)
|
globalid (>= 1.0.1)
|
||||||
@@ -789,7 +796,7 @@ GEM
|
|||||||
uniform_notifier (1.16.0)
|
uniform_notifier (1.16.0)
|
||||||
uri (0.13.0)
|
uri (0.13.0)
|
||||||
uri_template (0.7.0)
|
uri_template (0.7.0)
|
||||||
valid_email2 (4.0.6)
|
valid_email2 (5.2.6)
|
||||||
activemodel (>= 3.2)
|
activemodel (>= 3.2)
|
||||||
mail (~> 2.5)
|
mail (~> 2.5)
|
||||||
version_gem (1.1.4)
|
version_gem (1.1.4)
|
||||||
@@ -800,11 +807,10 @@ GEM
|
|||||||
activemodel (>= 6.0.0)
|
activemodel (>= 6.0.0)
|
||||||
bindex (>= 0.4.0)
|
bindex (>= 0.4.0)
|
||||||
railties (>= 6.0.0)
|
railties (>= 6.0.0)
|
||||||
web-push (3.0.0)
|
web-push (3.0.1)
|
||||||
hkdf (~> 1.0)
|
|
||||||
jwt (~> 2.0)
|
jwt (~> 2.0)
|
||||||
openssl (~> 3.0)
|
openssl (~> 3.0)
|
||||||
webmock (3.18.1)
|
webmock (3.23.1)
|
||||||
addressable (>= 2.8.0)
|
addressable (>= 2.8.0)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
hashdiff (>= 0.4.0, < 2.0.0)
|
hashdiff (>= 0.4.0, < 2.0.0)
|
||||||
@@ -813,7 +819,7 @@ GEM
|
|||||||
rack-proxy (>= 0.6.1)
|
rack-proxy (>= 0.6.1)
|
||||||
railties (>= 5.2)
|
railties (>= 5.2)
|
||||||
semantic_range (>= 2.3.0)
|
semantic_range (>= 2.3.0)
|
||||||
webrick (1.8.1)
|
webrick (1.8.2)
|
||||||
websocket-driver (0.7.6)
|
websocket-driver (0.7.6)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.5)
|
websocket-extensions (0.1.5)
|
||||||
@@ -821,7 +827,7 @@ GEM
|
|||||||
working_hours (1.4.1)
|
working_hours (1.4.1)
|
||||||
activesupport (>= 3.2)
|
activesupport (>= 3.2)
|
||||||
tzinfo
|
tzinfo
|
||||||
zeitwerk (2.6.14)
|
zeitwerk (2.6.16)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
arm64-darwin-20
|
arm64-darwin-20
|
||||||
@@ -863,7 +869,7 @@ DEPENDENCIES
|
|||||||
devise (>= 4.9.4)
|
devise (>= 4.9.4)
|
||||||
devise-secure_password!
|
devise-secure_password!
|
||||||
devise_token_auth (>= 1.2.3)
|
devise_token_auth (>= 1.2.3)
|
||||||
dotenv-rails
|
dotenv-rails (>= 3.0.0)
|
||||||
down
|
down
|
||||||
elastic-apm
|
elastic-apm
|
||||||
email_reply_trimmer
|
email_reply_trimmer
|
||||||
@@ -875,9 +881,9 @@ DEPENDENCIES
|
|||||||
foreman
|
foreman
|
||||||
geocoder
|
geocoder
|
||||||
gmail_xoauth
|
gmail_xoauth
|
||||||
google-cloud-dialogflow-v2
|
google-cloud-dialogflow-v2 (>= 0.24.0)
|
||||||
google-cloud-storage
|
google-cloud-storage
|
||||||
google-cloud-translate-v3
|
google-cloud-translate-v3 (>= 0.7.0)
|
||||||
groupdate
|
groupdate
|
||||||
grpc
|
grpc
|
||||||
haikunator
|
haikunator
|
||||||
@@ -897,14 +903,14 @@ DEPENDENCIES
|
|||||||
listen
|
listen
|
||||||
lograge (~> 0.14.0)
|
lograge (~> 0.14.0)
|
||||||
maxminddb
|
maxminddb
|
||||||
meta_request (>= 0.8.0)
|
meta_request (>= 0.8.3)
|
||||||
mock_redis
|
mock_redis
|
||||||
neighbor
|
neighbor
|
||||||
net-smtp (~> 0.3.4)
|
net-smtp (~> 0.3.4)
|
||||||
newrelic-sidekiq-metrics (>= 1.6.2)
|
newrelic-sidekiq-metrics (>= 1.6.2)
|
||||||
newrelic_rpm
|
newrelic_rpm
|
||||||
omniauth (>= 2.1.2)
|
omniauth (>= 2.1.2)
|
||||||
omniauth-google-oauth2 (>= 1.1.2)
|
omniauth-google-oauth2 (>= 1.1.3)
|
||||||
omniauth-oauth2
|
omniauth-oauth2
|
||||||
omniauth-rails_csrf_protection (~> 1.0, >= 1.0.2)
|
omniauth-rails_csrf_protection (~> 1.0, >= 1.0.2)
|
||||||
pg
|
pg
|
||||||
@@ -918,13 +924,13 @@ DEPENDENCIES
|
|||||||
rack-cors (= 2.0.0)
|
rack-cors (= 2.0.0)
|
||||||
rack-mini-profiler (>= 3.2.0)
|
rack-mini-profiler (>= 3.2.0)
|
||||||
rack-timeout
|
rack-timeout
|
||||||
rails (~> 7.0.8.1)
|
rails (~> 7.0.8.4)
|
||||||
redis
|
redis
|
||||||
redis-namespace
|
redis-namespace
|
||||||
responders (>= 3.1.1)
|
responders (>= 3.1.1)
|
||||||
rest-client
|
rest-client
|
||||||
reverse_markdown
|
reverse_markdown
|
||||||
rspec-rails
|
rspec-rails (>= 6.1.5)
|
||||||
rspec_junit_formatter
|
rspec_junit_formatter
|
||||||
rubocop
|
rubocop
|
||||||
rubocop-performance
|
rubocop-performance
|
||||||
@@ -933,11 +939,11 @@ DEPENDENCIES
|
|||||||
scout_apm
|
scout_apm
|
||||||
scss_lint
|
scss_lint
|
||||||
seed_dump
|
seed_dump
|
||||||
sentry-rails (>= 5.14.0)
|
sentry-rails (>= 5.19.0)
|
||||||
sentry-ruby
|
sentry-ruby
|
||||||
sentry-sidekiq (>= 5.15.0)
|
sentry-sidekiq (>= 5.19.0)
|
||||||
shoulda-matchers
|
shoulda-matchers
|
||||||
sidekiq (>= 7.2.4)
|
sidekiq (>= 7.3.1)
|
||||||
sidekiq-cron (>= 1.12.0)
|
sidekiq-cron (>= 1.12.0)
|
||||||
simplecov (= 0.17.1)
|
simplecov (= 0.17.1)
|
||||||
slack-ruby-client (~> 2.2.0)
|
slack-ruby-client (~> 2.2.0)
|
||||||
@@ -955,14 +961,14 @@ DEPENDENCIES
|
|||||||
uglifier
|
uglifier
|
||||||
valid_email2
|
valid_email2
|
||||||
web-console (>= 4.2.1)
|
web-console (>= 4.2.1)
|
||||||
web-push
|
web-push (>= 3.0.1)
|
||||||
webmock
|
webmock
|
||||||
webpacker
|
webpacker
|
||||||
wisper (= 2.0.0)
|
wisper (= 2.0.0)
|
||||||
working_hours
|
working_hours
|
||||||
|
|
||||||
RUBY VERSION
|
RUBY VERSION
|
||||||
ruby 3.2.2p185
|
ruby 3.3.3p89
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.4.6
|
2.5.16
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
3.3.1
|
3.9.0
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
2.7.0
|
2.8.0
|
||||||
|
|||||||
@@ -32,11 +32,13 @@ class AccountBuilder
|
|||||||
end
|
end
|
||||||
|
|
||||||
def validate_email
|
def validate_email
|
||||||
|
raise InvalidEmail.new({ domain_blocked: domain_blocked }) if domain_blocked?
|
||||||
|
|
||||||
address = ValidEmail2::Address.new(@email)
|
address = ValidEmail2::Address.new(@email)
|
||||||
if address.valid? # && !address.disposable?
|
if address.valid? && !address.disposable?
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
raise InvalidEmail.new(valid: address.valid?)
|
raise InvalidEmail.new({ valid: address.valid?, disposable: address.disposable? })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -79,4 +81,21 @@ class AccountBuilder
|
|||||||
@user.confirm if @confirmed
|
@user.confirm if @confirmed
|
||||||
@user.save!
|
@user.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def domain_blocked?
|
||||||
|
domain = @email.split('@').last
|
||||||
|
|
||||||
|
blocked_domains.each do |blocked_domain|
|
||||||
|
return true if domain.match?(blocked_domain)
|
||||||
|
end
|
||||||
|
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
def blocked_domains
|
||||||
|
domains = GlobalConfigService.load('BLOCKED_EMAIL_DOMAINS', '')
|
||||||
|
return [] if domains.blank?
|
||||||
|
|
||||||
|
domains.split("\n").map(&:strip)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class Messages::Messenger::MessageBuilder
|
|||||||
file_type = attachment['type'].to_sym
|
file_type = attachment['type'].to_sym
|
||||||
params = { file_type: file_type, account_id: @message.account_id }
|
params = { file_type: file_type, account_id: @message.account_id }
|
||||||
|
|
||||||
if [:image, :file, :audio, :video, :share, :story_mention].include? file_type
|
if [:image, :file, :audio, :video, :share, :story_mention, :ig_reel].include? file_type
|
||||||
params.merge!(file_type_params(attachment))
|
params.merge!(file_type_params(attachment))
|
||||||
elsif file_type == :location
|
elsif file_type == :location
|
||||||
params.merge!(location_params(attachment))
|
params.merge!(location_params(attachment))
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
|
|||||||
|
|
||||||
def update
|
def update
|
||||||
@agent.update!(agent_params.slice(:name).compact)
|
@agent.update!(agent_params.slice(:name).compact)
|
||||||
@agent.current_account_user.update!(agent_params.slice(:role, :availability, :auto_offline).compact)
|
@agent.current_account_user.update!(agent_params.slice(*account_user_attributes).compact)
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@@ -67,8 +67,16 @@ class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
|
|||||||
@agent = agents.find(params[:id])
|
@agent = agents.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def account_user_attributes
|
||||||
|
[:role, :availability, :auto_offline]
|
||||||
|
end
|
||||||
|
|
||||||
|
def allowed_agent_params
|
||||||
|
[:name, :email, :name, :role, :availability, :auto_offline]
|
||||||
|
end
|
||||||
|
|
||||||
def agent_params
|
def agent_params
|
||||||
params.require(:agent).permit(:name, :email, :name, :role, :availability, :auto_offline)
|
params.require(:agent).permit(allowed_agent_params)
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_agent_params
|
def new_agent_params
|
||||||
@@ -101,3 +109,5 @@ class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
|
|||||||
DeleteObjectJob.perform_later(agent) if agent.reload.account_users.blank?
|
DeleteObjectJob.perform_later(agent) if agent.reload.account_users.blank?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Api::V1::Accounts::AgentsController.prepend_mod_with('Api::V1::Accounts::AgentsController')
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Api::V1::Accounts::Conversations::MessagesController < Api::V1::Accounts::
|
|||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
message.update!(content: I18n.t('conversations.messages.deleted'), content_attributes: { deleted: true })
|
message.update!(content: I18n.t('conversations.messages.deleted'), content_type: :text, content_attributes: { deleted: true })
|
||||||
message.attachments.destroy_all
|
message.attachments.destroy_all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
class Api::V1::Accounts::Google::AuthorizationsController < Api::V1::Accounts::BaseController
|
||||||
|
include GoogleConcern
|
||||||
|
before_action :check_authorization
|
||||||
|
|
||||||
|
def create
|
||||||
|
email = params[:authorization][:email]
|
||||||
|
redirect_url = google_client.auth_code.authorize_url(
|
||||||
|
{
|
||||||
|
redirect_uri: "#{base_url}/google/callback",
|
||||||
|
scope: 'email profile https://mail.google.com/',
|
||||||
|
response_type: 'code',
|
||||||
|
prompt: 'consent', # the oauth flow does not return a refresh token, this is supposed to fix it
|
||||||
|
access_type: 'offline', # the default is 'online'
|
||||||
|
client_id: GlobalConfigService.load('GOOGLE_OAUTH_CLIENT_ID', nil)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if redirect_url
|
||||||
|
cache_key = "google::#{email.downcase}"
|
||||||
|
::Redis::Alfred.setex(cache_key, Current.account.id, 5.minutes)
|
||||||
|
render json: { success: true, url: redirect_url }
|
||||||
|
else
|
||||||
|
render json: { success: false }, status: :unprocessable_entity
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def check_authorization
|
||||||
|
raise Pundit::NotAuthorizedError unless Current.account_user.administrator?
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -10,7 +10,7 @@ class Api::V1::Accounts::Integrations::AppsController < Api::V1::Accounts::BaseC
|
|||||||
private
|
private
|
||||||
|
|
||||||
def fetch_apps
|
def fetch_apps
|
||||||
@apps = Integrations::App.all.select(&:active?)
|
@apps = Integrations::App.all.select { |app| app.active?(Current.account) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch_app
|
def fetch_app
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
class Api::V1::Accounts::Integrations::CaptainController < Api::V1::Accounts::BaseController
|
||||||
|
before_action :check_admin_authorization?
|
||||||
|
before_action :fetch_hook
|
||||||
|
|
||||||
|
def sso_url
|
||||||
|
params_string =
|
||||||
|
"token=#{URI.encode_www_form_component(@hook['settings']['access_token'])}" \
|
||||||
|
"&email=#{URI.encode_www_form_component(@hook['settings']['account_email'])}" \
|
||||||
|
"&account_id=#{URI.encode_www_form_component(@hook['settings']['account_id'])}"
|
||||||
|
|
||||||
|
installation_config = InstallationConfig.find_by(name: 'CAPTAIN_APP_URL')
|
||||||
|
|
||||||
|
sso_url = "#{installation_config.value}/sso?#{params_string}"
|
||||||
|
render json: { sso_url: sso_url }, status: :ok
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def fetch_hook
|
||||||
|
@hook = Current.account.hooks.find_by!(app_id: 'captain')
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -11,7 +11,17 @@ class Api::V1::Accounts::Integrations::HooksController < Api::V1::Accounts::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def process_event
|
def process_event
|
||||||
render json: { message: @hook.process_event(params[:event]) }
|
response = @hook.process_event(params[:event])
|
||||||
|
|
||||||
|
# for cases like an invalid event, or when conversation does not have enough messages
|
||||||
|
# for a label suggestion, the response is nil
|
||||||
|
if response.nil?
|
||||||
|
render json: { message: nil }
|
||||||
|
elsif response[:error]
|
||||||
|
render json: { error: response[:error] }, status: :unprocessable_entity
|
||||||
|
else
|
||||||
|
render json: { message: response[:message] }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ class Api::V1::Accounts::Microsoft::AuthorizationsController < Api::V1::Accounts
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
if redirect_url
|
if redirect_url
|
||||||
email = email.downcase
|
cache_key = "microsoft::#{email.downcase}"
|
||||||
::Redis::Alfred.setex(email, Current.account.id, 5.minutes)
|
::Redis::Alfred.setex(cache_key, Current.account.id, 5.minutes)
|
||||||
render json: { success: true, url: redirect_url }
|
render json: { success: true, url: redirect_url }
|
||||||
else
|
else
|
||||||
render json: { success: false }, status: :unprocessable_entity
|
render json: { success: false }, status: :unprocessable_entity
|
||||||
|
|||||||
@@ -1,13 +1,68 @@
|
|||||||
class Api::V1::Accounts::UploadController < Api::V1::Accounts::BaseController
|
class Api::V1::Accounts::UploadController < Api::V1::Accounts::BaseController
|
||||||
def create
|
def create
|
||||||
file_blob = ActiveStorage::Blob.create_and_upload!(
|
result = if params[:attachment].present?
|
||||||
key: nil,
|
create_from_file
|
||||||
io: params[:attachment].tempfile,
|
elsif params[:external_url].present?
|
||||||
filename: params[:attachment].original_filename,
|
create_from_url
|
||||||
content_type: params[:attachment].content_type
|
else
|
||||||
)
|
render_error('No file or URL provided', :unprocessable_entity)
|
||||||
file_blob.save!
|
end
|
||||||
|
|
||||||
|
render_success(result) if result.is_a?(ActiveStorage::Blob)
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def create_from_file
|
||||||
|
attachment = params[:attachment]
|
||||||
|
create_and_save_blob(attachment.tempfile, attachment.original_filename, attachment.content_type)
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_from_url
|
||||||
|
uri = parse_uri(params[:external_url])
|
||||||
|
return if performed?
|
||||||
|
|
||||||
|
fetch_and_process_file_from_uri(uri)
|
||||||
|
end
|
||||||
|
|
||||||
|
def parse_uri(url)
|
||||||
|
uri = URI.parse(url)
|
||||||
|
validate_uri(uri)
|
||||||
|
uri
|
||||||
|
rescue URI::InvalidURIError, SocketError
|
||||||
|
render_error('Invalid URL provided', :unprocessable_entity)
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def validate_uri(uri)
|
||||||
|
raise URI::InvalidURIError unless uri.is_a?(URI::HTTP) || uri.is_a?(URI::HTTPS)
|
||||||
|
end
|
||||||
|
|
||||||
|
def fetch_and_process_file_from_uri(uri)
|
||||||
|
uri.open do |file|
|
||||||
|
create_and_save_blob(file, File.basename(uri.path), file.content_type)
|
||||||
|
end
|
||||||
|
rescue OpenURI::HTTPError => e
|
||||||
|
render_error("Failed to fetch file from URL: #{e.message}", :unprocessable_entity)
|
||||||
|
rescue SocketError
|
||||||
|
render_error('Invalid URL provided', :unprocessable_entity)
|
||||||
|
rescue StandardError
|
||||||
|
render_error('An unexpected error occurred', :internal_server_error)
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_and_save_blob(io, filename, content_type)
|
||||||
|
ActiveStorage::Blob.create_and_upload!(
|
||||||
|
io: io,
|
||||||
|
filename: filename,
|
||||||
|
content_type: content_type
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
def render_success(file_blob)
|
||||||
render json: { file_url: url_for(file_blob), blob_key: file_blob.key, blob_id: file_blob.id }
|
render json: { file_url: url_for(file_blob), blob_key: file_blob.key, blob_id: file_blob.id }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def render_error(message, status)
|
||||||
|
render json: { error: message }, status: status
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ class Api::V1::Widget::ConversationsController < Api::V1::Widget::BaseController
|
|||||||
process_update_contact
|
process_update_contact
|
||||||
@conversation = create_conversation
|
@conversation = create_conversation
|
||||||
conversation.messages.create!(message_params)
|
conversation.messages.create!(message_params)
|
||||||
|
# TODO: Temporary fix for message type cast issue, since message_type is returning as string instead of integer
|
||||||
|
conversation.reload
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,9 @@ class Api::V2::Accounts::ReportsController < Api::V1::Accounts::BaseController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def check_authorization
|
def check_authorization
|
||||||
raise Pundit::NotAuthorizedError unless Current.account_user.administrator?
|
return if Current.account_user.administrator?
|
||||||
|
|
||||||
|
raise Pundit::NotAuthorizedError
|
||||||
end
|
end
|
||||||
|
|
||||||
def common_params
|
def common_params
|
||||||
@@ -135,3 +137,5 @@ class Api::V2::Accounts::ReportsController < Api::V1::Accounts::BaseController
|
|||||||
V2::ReportBuilder.new(Current.account, conversation_params).conversation_metrics
|
V2::ReportBuilder.new(Current.account, conversation_params).conversation_metrics
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Api::V2::Accounts::ReportsController.prepend_mod_with('Api::V2::Accounts::ReportsController')
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
module GoogleConcern
|
||||||
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
def google_client
|
||||||
|
app_id = GlobalConfigService.load('GOOGLE_OAUTH_CLIENT_ID', nil)
|
||||||
|
app_secret = GlobalConfigService.load('GOOGLE_OAUTH_CLIENT_SECRET', nil)
|
||||||
|
|
||||||
|
::OAuth2::Client.new(app_id, app_secret, {
|
||||||
|
site: 'https://oauth2.googleapis.com',
|
||||||
|
authorize_url: 'https://accounts.google.com/o/oauth2/auth',
|
||||||
|
token_url: 'https://accounts.google.com/o/oauth2/token'
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def base_url
|
||||||
|
ENV.fetch('FRONTEND_URL', 'http://localhost:3000')
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -15,10 +15,6 @@ module MicrosoftConcern
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def parsed_body
|
|
||||||
@parsed_body ||= Rack::Utils.parse_nested_query(@response.raw_response.body)
|
|
||||||
end
|
|
||||||
|
|
||||||
def base_url
|
def base_url
|
||||||
ENV.fetch('FRONTEND_URL', 'http://localhost:3000')
|
ENV.fetch('FRONTEND_URL', 'http://localhost:3000')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class DashboardController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def set_dashboard_scripts
|
def set_dashboard_scripts
|
||||||
@dashboard_scripts = GlobalConfig.get_value('DASHBOARD_SCRIPTS')
|
@dashboard_scripts = sensitive_path? ? nil : GlobalConfig.get_value('DASHBOARD_SCRIPTS')
|
||||||
end
|
end
|
||||||
|
|
||||||
def ensure_installation_onboarding
|
def ensure_installation_onboarding
|
||||||
@@ -75,4 +75,14 @@ class DashboardController < ActionController::Base
|
|||||||
'application'
|
'application'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def sensitive_path?
|
||||||
|
# dont load dashboard scripts on sensitive paths like password reset
|
||||||
|
sensitive_paths = [edit_user_password_path].freeze
|
||||||
|
|
||||||
|
# remove app prefix
|
||||||
|
current_path = request.path.gsub(%r{^/app}, '')
|
||||||
|
|
||||||
|
sensitive_paths.include?(current_path)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
class Google::CallbacksController < OauthCallbackController
|
||||||
|
include GoogleConcern
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def provider_name
|
||||||
|
'google'
|
||||||
|
end
|
||||||
|
|
||||||
|
def imap_address
|
||||||
|
'imap.gmail.com'
|
||||||
|
end
|
||||||
|
|
||||||
|
def oauth_client
|
||||||
|
# from GoogleConcern
|
||||||
|
google_client
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,90 +1,17 @@
|
|||||||
class Microsoft::CallbacksController < ApplicationController
|
class Microsoft::CallbacksController < OauthCallbackController
|
||||||
include MicrosoftConcern
|
include MicrosoftConcern
|
||||||
|
|
||||||
def show
|
|
||||||
@response = microsoft_client.auth_code.get_token(
|
|
||||||
oauth_code,
|
|
||||||
redirect_uri: "#{base_url}/microsoft/callback"
|
|
||||||
)
|
|
||||||
|
|
||||||
inbox, already_exists = find_or_create_inbox
|
|
||||||
::Redis::Alfred.delete(users_data['email'].downcase)
|
|
||||||
|
|
||||||
if already_exists
|
|
||||||
redirect_to app_microsoft_inbox_settings_url(account_id: account.id, inbox_id: inbox.id)
|
|
||||||
else
|
|
||||||
redirect_to app_microsoft_inbox_agents_url(account_id: account.id, inbox_id: inbox.id)
|
|
||||||
end
|
|
||||||
rescue StandardError => e
|
|
||||||
ChatwootExceptionTracker.new(e).capture_exception
|
|
||||||
redirect_to '/'
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def oauth_code
|
def oauth_client
|
||||||
params[:code]
|
microsoft_client
|
||||||
end
|
end
|
||||||
|
|
||||||
def users_data
|
def provider_name
|
||||||
decoded_token = JWT.decode parsed_body[:id_token], nil, false
|
'microsoft'
|
||||||
decoded_token[0]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def parsed_body
|
def imap_address
|
||||||
@parsed_body ||= @response.response.parsed
|
'outlook.office365.com'
|
||||||
end
|
|
||||||
|
|
||||||
def account_id
|
|
||||||
::Redis::Alfred.get(users_data['email'].downcase)
|
|
||||||
end
|
|
||||||
|
|
||||||
def account
|
|
||||||
@account ||= Account.find(account_id)
|
|
||||||
end
|
|
||||||
|
|
||||||
def find_or_create_inbox
|
|
||||||
channel_email = Channel::Email.find_by(email: users_data['email'], account: account)
|
|
||||||
# we need this value to know where to redirect on sucessful processing of the callback
|
|
||||||
channel_exists = channel_email.present?
|
|
||||||
|
|
||||||
channel_email ||= create_microsoft_channel_with_inbox
|
|
||||||
update_microsoft_channel(channel_email)
|
|
||||||
|
|
||||||
# reauthorize channel, this code path only triggers when microsoft auth is successful
|
|
||||||
# reauthorized will also update cache keys for the associated inbox
|
|
||||||
channel_email.reauthorized!
|
|
||||||
|
|
||||||
[channel_email.inbox, channel_exists]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Fallback name, for when name field is missing from users_data
|
|
||||||
def fallback_name
|
|
||||||
users_data['email'].split('@').first.parameterize.titleize
|
|
||||||
end
|
|
||||||
|
|
||||||
def create_microsoft_channel_with_inbox
|
|
||||||
ActiveRecord::Base.transaction do
|
|
||||||
channel_email = Channel::Email.create!(email: users_data['email'], account: account)
|
|
||||||
account.inboxes.create!(
|
|
||||||
account: account,
|
|
||||||
channel: channel_email,
|
|
||||||
name: users_data['name'] || fallback_name
|
|
||||||
)
|
|
||||||
channel_email
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def update_microsoft_channel(channel_email)
|
|
||||||
channel_email.update!({
|
|
||||||
imap_login: users_data['email'], imap_address: 'outlook.office365.com',
|
|
||||||
imap_port: '993', imap_enabled: true,
|
|
||||||
provider: 'microsoft',
|
|
||||||
provider_config: {
|
|
||||||
access_token: parsed_body['access_token'],
|
|
||||||
refresh_token: parsed_body['refresh_token'],
|
|
||||||
expires_on: (Time.current.utc + 1.hour).to_s
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,108 @@
|
|||||||
|
class OauthCallbackController < ApplicationController
|
||||||
|
def show
|
||||||
|
@response = oauth_client.auth_code.get_token(
|
||||||
|
oauth_code,
|
||||||
|
redirect_uri: "#{base_url}/#{provider_name}/callback"
|
||||||
|
)
|
||||||
|
|
||||||
|
handle_response
|
||||||
|
::Redis::Alfred.delete(cache_key)
|
||||||
|
rescue StandardError => e
|
||||||
|
ChatwootExceptionTracker.new(e).capture_exception
|
||||||
|
redirect_to '/'
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def handle_response
|
||||||
|
inbox, already_exists = find_or_create_inbox
|
||||||
|
|
||||||
|
if already_exists
|
||||||
|
redirect_to app_email_inbox_settings_url(account_id: account.id, inbox_id: inbox.id)
|
||||||
|
else
|
||||||
|
redirect_to app_email_inbox_agents_url(account_id: account.id, inbox_id: inbox.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_or_create_inbox
|
||||||
|
channel_email = Channel::Email.find_by(email: users_data['email'], account: account)
|
||||||
|
# we need this value to know where to redirect on sucessful processing of the callback
|
||||||
|
channel_exists = channel_email.present?
|
||||||
|
|
||||||
|
channel_email ||= create_channel_with_inbox
|
||||||
|
update_channel(channel_email)
|
||||||
|
|
||||||
|
# reauthorize channel, this code path only triggers when microsoft auth is successful
|
||||||
|
# reauthorized will also update cache keys for the associated inbox
|
||||||
|
channel_email.reauthorized!
|
||||||
|
|
||||||
|
[channel_email.inbox, channel_exists]
|
||||||
|
end
|
||||||
|
|
||||||
|
def update_channel(channel_email)
|
||||||
|
channel_email.update!({
|
||||||
|
imap_login: users_data['email'], imap_address: imap_address,
|
||||||
|
imap_port: '993', imap_enabled: true,
|
||||||
|
provider: provider_name,
|
||||||
|
provider_config: {
|
||||||
|
access_token: parsed_body['access_token'],
|
||||||
|
refresh_token: parsed_body['refresh_token'],
|
||||||
|
expires_on: (Time.current.utc + 1.hour).to_s
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
def provider_name
|
||||||
|
raise NotImplementedError
|
||||||
|
end
|
||||||
|
|
||||||
|
def oauth_client
|
||||||
|
raise NotImplementedError
|
||||||
|
end
|
||||||
|
|
||||||
|
def cache_key
|
||||||
|
"#{provider_name}::#{users_data['email'].downcase}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_channel_with_inbox
|
||||||
|
ActiveRecord::Base.transaction do
|
||||||
|
channel_email = Channel::Email.create!(email: users_data['email'], account: account)
|
||||||
|
account.inboxes.create!(
|
||||||
|
account: account,
|
||||||
|
channel: channel_email,
|
||||||
|
name: users_data['name'] || fallback_name
|
||||||
|
)
|
||||||
|
channel_email
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def users_data
|
||||||
|
decoded_token = JWT.decode parsed_body[:id_token], nil, false
|
||||||
|
decoded_token[0]
|
||||||
|
end
|
||||||
|
|
||||||
|
def account_id
|
||||||
|
::Redis::Alfred.get(cache_key)
|
||||||
|
end
|
||||||
|
|
||||||
|
def account
|
||||||
|
@account ||= Account.find(account_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Fallback name, for when name field is missing from users_data
|
||||||
|
def fallback_name
|
||||||
|
users_data['email'].split('@').first.parameterize.titleize
|
||||||
|
end
|
||||||
|
|
||||||
|
def oauth_code
|
||||||
|
params[:code]
|
||||||
|
end
|
||||||
|
|
||||||
|
def base_url
|
||||||
|
ENV.fetch('FRONTEND_URL', 'http://localhost:3000')
|
||||||
|
end
|
||||||
|
|
||||||
|
def parsed_body
|
||||||
|
@parsed_body ||= @response.response.parsed
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -6,7 +6,7 @@ class Public::Api::V1::Portals::ArticlesController < Public::Api::V1::Portals::B
|
|||||||
layout 'portal'
|
layout 'portal'
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@articles = @portal.articles
|
@articles = @portal.articles.published
|
||||||
search_articles
|
search_articles
|
||||||
order_by_sort_param
|
order_by_sort_param
|
||||||
@articles.page(list_params[:page]) if list_params[:page].present?
|
@articles.page(list_params[:page]) if list_params[:page].present?
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class SuperAdmin::AppConfigsController < SuperAdmin::ApplicationController
|
|||||||
when 'email'
|
when 'email'
|
||||||
['MAILER_INBOUND_EMAIL_DOMAIN']
|
['MAILER_INBOUND_EMAIL_DOMAIN']
|
||||||
else
|
else
|
||||||
%w[ENABLE_ACCOUNT_SIGNUP]
|
%w[ENABLE_ACCOUNT_SIGNUP FIREBASE_PROJECT_ID FIREBASE_CREDENTIALS]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
import App from './App';
|
|
||||||
import '../../test-matchers';
|
|
||||||
|
|
||||||
describe(`App component`, () => {
|
|
||||||
it(`should be a component`, () => {
|
|
||||||
// Arrange
|
|
||||||
// Act
|
|
||||||
expect(App).toBeVueComponent('App');
|
|
||||||
// Assert
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,32 +1,6 @@
|
|||||||
<template>
|
|
||||||
<div
|
|
||||||
v-if="!authUIFlags.isFetching && !accountUIFlags.isFetchingItem"
|
|
||||||
id="app"
|
|
||||||
class="flex-grow-0 w-full h-full min-h-0 app-wrapper"
|
|
||||||
:class="{ 'app-rtl--wrapper': isRTLView }"
|
|
||||||
:dir="isRTLView ? 'rtl' : 'ltr'"
|
|
||||||
>
|
|
||||||
<update-banner :latest-chatwoot-version="latestChatwootVersion" />
|
|
||||||
<template v-if="currentAccountId">
|
|
||||||
<pending-email-verification-banner v-if="hideOnOnboardingView" />
|
|
||||||
<payment-pending-banner v-if="hideOnOnboardingView" />
|
|
||||||
<upgrade-banner />
|
|
||||||
</template>
|
|
||||||
<transition name="fade" mode="out-in">
|
|
||||||
<router-view />
|
|
||||||
</transition>
|
|
||||||
<add-account-modal
|
|
||||||
:show="showAddAccountModal"
|
|
||||||
:has-accounts="hasAccounts"
|
|
||||||
/>
|
|
||||||
<woot-snackbar-box />
|
|
||||||
<network-notification />
|
|
||||||
</div>
|
|
||||||
<loading-state v-else />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
|
import router from '../dashboard/routes';
|
||||||
import AddAccountModal from '../dashboard/components/layout/sidebarComponents/AddAccountModal.vue';
|
import AddAccountModal from '../dashboard/components/layout/sidebarComponents/AddAccountModal.vue';
|
||||||
import LoadingState from './components/widgets/LoadingState.vue';
|
import LoadingState from './components/widgets/LoadingState.vue';
|
||||||
import NetworkNotification from './components/NetworkNotification.vue';
|
import NetworkNotification from './components/NetworkNotification.vue';
|
||||||
@@ -36,13 +10,13 @@ import PaymentPendingBanner from './components/app/PaymentPendingBanner.vue';
|
|||||||
import PendingEmailVerificationBanner from './components/app/PendingEmailVerificationBanner.vue';
|
import PendingEmailVerificationBanner from './components/app/PendingEmailVerificationBanner.vue';
|
||||||
import vueActionCable from './helper/actionCable';
|
import vueActionCable from './helper/actionCable';
|
||||||
import WootSnackbarBox from './components/SnackbarContainer.vue';
|
import WootSnackbarBox from './components/SnackbarContainer.vue';
|
||||||
import rtlMixin from 'shared/mixins/rtlMixin';
|
|
||||||
import { setColorTheme } from './helper/themeHelper';
|
import { setColorTheme } from './helper/themeHelper';
|
||||||
import { isOnOnboardingView } from 'v3/helpers/RouteHelper';
|
import { isOnOnboardingView } from 'v3/helpers/RouteHelper';
|
||||||
import {
|
import {
|
||||||
registerSubscription,
|
registerSubscription,
|
||||||
verifyServiceWorkerExistence,
|
verifyServiceWorkerExistence,
|
||||||
} from './helper/pushHelper';
|
} from './helper/pushHelper';
|
||||||
|
import ReconnectService from 'dashboard/helper/ReconnectService';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
@@ -57,21 +31,19 @@ export default {
|
|||||||
UpgradeBanner,
|
UpgradeBanner,
|
||||||
PendingEmailVerificationBanner,
|
PendingEmailVerificationBanner,
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [rtlMixin],
|
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showAddAccountModal: false,
|
showAddAccountModal: false,
|
||||||
latestChatwootVersion: null,
|
latestChatwootVersion: null,
|
||||||
|
reconnectService: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
getAccount: 'accounts/getAccount',
|
getAccount: 'accounts/getAccount',
|
||||||
|
isRTL: 'accounts/isRTL',
|
||||||
currentUser: 'getCurrentUser',
|
currentUser: 'getCurrentUser',
|
||||||
globalConfig: 'globalConfig/get',
|
|
||||||
authUIFlags: 'getAuthUIFlags',
|
authUIFlags: 'getAuthUIFlags',
|
||||||
accountUIFlags: 'accounts/getUIFlags',
|
accountUIFlags: 'accounts/getUIFlags',
|
||||||
currentAccountId: 'getCurrentAccountId',
|
currentAccountId: 'getCurrentAccountId',
|
||||||
@@ -102,6 +74,11 @@ export default {
|
|||||||
this.listenToThemeChanges();
|
this.listenToThemeChanges();
|
||||||
this.setLocale(window.chatwootConfig.selectedLocale);
|
this.setLocale(window.chatwootConfig.selectedLocale);
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
if (this.reconnectService) {
|
||||||
|
this.reconnectService.disconnect();
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initializeColorTheme() {
|
initializeColorTheme() {
|
||||||
setColorTheme(window.matchMedia('(prefers-color-scheme: dark)').matches);
|
setColorTheme(window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||||
@@ -122,9 +99,9 @@ export default {
|
|||||||
this.getAccount(this.currentAccountId);
|
this.getAccount(this.currentAccountId);
|
||||||
const { pubsub_token: pubsubToken } = this.currentUser || {};
|
const { pubsub_token: pubsubToken } = this.currentUser || {};
|
||||||
this.setLocale(locale);
|
this.setLocale(locale);
|
||||||
this.updateRTLDirectionView(locale);
|
|
||||||
this.latestChatwootVersion = latestChatwootVersion;
|
this.latestChatwootVersion = latestChatwootVersion;
|
||||||
vueActionCable.init(pubsubToken);
|
vueActionCable.init(pubsubToken);
|
||||||
|
this.reconnectService = new ReconnectService(this.$store, router);
|
||||||
|
|
||||||
verifyServiceWorkerExistence(registration =>
|
verifyServiceWorkerExistence(registration =>
|
||||||
registration.pushManager.getSubscription().then(subscription => {
|
registration.pushManager.getSubscription().then(subscription => {
|
||||||
@@ -138,6 +115,30 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
v-if="!authUIFlags.isFetching && !accountUIFlags.isFetchingItem"
|
||||||
|
id="app"
|
||||||
|
class="flex-grow-0 w-full h-full min-h-0 app-wrapper"
|
||||||
|
:class="{ 'app-rtl--wrapper': isRTL }"
|
||||||
|
:dir="isRTL ? 'rtl' : 'ltr'"
|
||||||
|
>
|
||||||
|
<UpdateBanner :latest-chatwoot-version="latestChatwootVersion" />
|
||||||
|
<template v-if="currentAccountId">
|
||||||
|
<PendingEmailVerificationBanner v-if="hideOnOnboardingView" />
|
||||||
|
<PaymentPendingBanner v-if="hideOnOnboardingView" />
|
||||||
|
<UpgradeBanner />
|
||||||
|
</template>
|
||||||
|
<transition name="fade" mode="out-in">
|
||||||
|
<router-view />
|
||||||
|
</transition>
|
||||||
|
<AddAccountModal :show="showAddAccountModal" :has-accounts="hasAccounts" />
|
||||||
|
<WootSnackbarBox />
|
||||||
|
<NetworkNotification />
|
||||||
|
</div>
|
||||||
|
<LoadingState v-else />
|
||||||
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import './assets/scss/app';
|
@import './assets/scss/app';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -9,6 +9,13 @@ class AccountAPI extends ApiClient {
|
|||||||
createAccount(data) {
|
createAccount(data) {
|
||||||
return axios.post(`${this.apiVersion}/accounts`, data);
|
return axios.post(`${this.apiVersion}/accounts`, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getCacheKeys() {
|
||||||
|
const response = await axios.get(
|
||||||
|
`/api/v1/accounts/${this.accountIdFromRoute}/cache_keys`
|
||||||
|
);
|
||||||
|
return response.data.cache_keys;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new AccountAPI();
|
export default new AccountAPI();
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/* global axios */
|
||||||
|
import ApiClient from '../ApiClient';
|
||||||
|
|
||||||
|
class MicrosoftClient extends ApiClient {
|
||||||
|
constructor() {
|
||||||
|
super('google', { accountScoped: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
generateAuthorization(payload) {
|
||||||
|
return axios.post(`${this.url}/authorization`, payload);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default new MicrosoftClient();
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import ApiClient from './ApiClient';
|
||||||
|
|
||||||
|
class CustomRole extends ApiClient {
|
||||||
|
constructor() {
|
||||||
|
super('custom_roles', { accountScoped: true });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default new CustomRole();
|
||||||
@@ -15,10 +15,10 @@ describe('#enterpriseAccountAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ class IntegrationsAPI extends ApiClient {
|
|||||||
deleteHook(hookId) {
|
deleteHook(hookId) {
|
||||||
return axios.delete(`${this.baseUrl()}/integrations/hooks/${hookId}`);
|
return axios.delete(`${this.baseUrl()}/integrations/hooks/${hookId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fetchCaptainURL() {
|
||||||
|
return axios.get(`${this.baseUrl()}/integrations/captain/sso_url`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new IntegrationsAPI();
|
export default new IntegrationsAPI();
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ describe('#accountAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ describe('#ContactsAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ describe('#AgentAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ describe('#PortalAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -44,10 +44,10 @@ describe('#PortalAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -71,10 +71,10 @@ describe('#PortalAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -98,10 +98,10 @@ describe('#PortalAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -129,10 +129,10 @@ describe('#PortalAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ describe('#AssignableAgentsAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ describe('#FBChannel', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ describe('#ContactsAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ describe('#ConversationApi', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ describe('#Reports API', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ describe('#ConversationAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ describe('#ConversationAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ describe('#InboxesAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ describe('#integrationAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ describe('#accountAPI', () => {
|
|||||||
describe('createAMeeting', () => {
|
describe('createAMeeting', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -39,10 +39,10 @@ describe('#accountAPI', () => {
|
|||||||
describe('addParticipantToMeeting', () => {
|
describe('addParticipantToMeeting', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ describe('#linearAPI', () => {
|
|||||||
describe('getTeams', () => {
|
describe('getTeams', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -41,10 +41,10 @@ describe('#linearAPI', () => {
|
|||||||
describe('getTeamEntities', () => {
|
describe('getTeamEntities', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -66,10 +66,10 @@ describe('#linearAPI', () => {
|
|||||||
describe('createIssue', () => {
|
describe('createIssue', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -96,10 +96,10 @@ describe('#linearAPI', () => {
|
|||||||
describe('link_issue', () => {
|
describe('link_issue', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -125,10 +125,10 @@ describe('#linearAPI', () => {
|
|||||||
describe('getLinkedIssue', () => {
|
describe('getLinkedIssue', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -150,10 +150,10 @@ describe('#linearAPI', () => {
|
|||||||
describe('unlinkIssue', () => {
|
describe('unlinkIssue', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -178,10 +178,10 @@ describe('#linearAPI', () => {
|
|||||||
describe('searchIssues', () => {
|
describe('searchIssues', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ describe('#NotificationAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ describe('#Reports API', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ describe('#SLAReports API', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ describe('#TeamsAPI', () => {
|
|||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
const originalAxios = window.axios;
|
const originalAxios = window.axios;
|
||||||
const axiosMock = {
|
const axiosMock = {
|
||||||
post: jest.fn(() => Promise.resolve()),
|
post: vi.fn(() => Promise.resolve()),
|
||||||
get: jest.fn(() => Promise.resolve()),
|
get: vi.fn(() => Promise.resolve()),
|
||||||
patch: jest.fn(() => Promise.resolve()),
|
patch: vi.fn(() => Promise.resolve()),
|
||||||
delete: jest.fn(() => Promise.resolve()),
|
delete: vi.fn(() => Promise.resolve()),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
@import 'tailwindcss/utilities';
|
@import 'tailwindcss/utilities';
|
||||||
|
|
||||||
@import 'shared/assets/fonts/plus-jakarta';
|
@import 'shared/assets/fonts/plus-jakarta';
|
||||||
|
@import 'shared/assets/fonts/InterDisplay/inter-display';
|
||||||
|
@import 'shared/assets/fonts/inter';
|
||||||
|
|
||||||
@import 'shared/assets/stylesheets/animations';
|
@import 'shared/assets/stylesheets/animations';
|
||||||
@import 'shared/assets/stylesheets/colors';
|
@import 'shared/assets/stylesheets/colors';
|
||||||
@import 'shared/assets/stylesheets/spacing';
|
@import 'shared/assets/stylesheets/spacing';
|
||||||
@@ -42,6 +45,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
|
|
||||||
// scss-lint:disable PropertySortOrder
|
// scss-lint:disable PropertySortOrder
|
||||||
:root {
|
:root {
|
||||||
--color-amber-25: 254 253 251;
|
--color-amber-25: 254 253 251;
|
||||||
@@ -213,6 +217,7 @@
|
|||||||
--color-orange-800: 204 78 0;
|
--color-orange-800: 204 78 0;
|
||||||
--color-orange-900: 88 45 29;
|
--color-orange-900: 88 45 29;
|
||||||
}
|
}
|
||||||
|
|
||||||
// scss-lint:disable QualifyingElement
|
// scss-lint:disable QualifyingElement
|
||||||
body.dark {
|
body.dark {
|
||||||
--color-amber-25: 31 19 0;
|
--color-amber-25: 31 19 0;
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
table {
|
table {
|
||||||
@apply border-spacing-0 text-sm w-full;
|
@apply border-spacing-0 text-sm w-full;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.woot-table {
|
||||||
thead {
|
thead {
|
||||||
th {
|
th {
|
||||||
@apply font-semibold tracking-[1px] text-left px-2.5 uppercase text-slate-900 dark:text-slate-200;
|
@apply font-semibold tracking-[1px] text-left px-2.5 uppercase text-slate-900 dark:text-slate-200;
|
||||||
@@ -16,9 +20,7 @@ table {
|
|||||||
@apply p-2.5 text-slate-700 dark:text-slate-100;
|
@apply p-2.5 text-slate-700 dark:text-slate-100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.woot-table {
|
|
||||||
tr {
|
tr {
|
||||||
.show-if-hover {
|
.show-if-hover {
|
||||||
transition: opacity 0.2s $swift-ease-out-function;
|
transition: opacity 0.2s $swift-ease-out-function;
|
||||||
|
|||||||
@@ -1,35 +1,3 @@
|
|||||||
<template>
|
|
||||||
<div class="-mt-px text-sm">
|
|
||||||
<button
|
|
||||||
class="flex items-center select-none w-full rounded-none bg-slate-50 dark:bg-slate-800 border border-l-0 border-r-0 border-solid m-0 border-slate-100 dark:border-slate-700/50 cursor-grab justify-between py-2 px-4 drag-handle"
|
|
||||||
@click="$emit('click')"
|
|
||||||
>
|
|
||||||
<div class="flex justify-between mb-0.5">
|
|
||||||
<emoji-or-icon class="inline-block w-5" :icon="icon" :emoji="emoji" />
|
|
||||||
<h5
|
|
||||||
class="text-slate-800 text-sm dark:text-slate-100 mb-0 py-0 pr-2 pl-0"
|
|
||||||
>
|
|
||||||
{{ title }}
|
|
||||||
</h5>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-row">
|
|
||||||
<slot name="button" />
|
|
||||||
<div class="flex justify-end w-3 text-woot-500">
|
|
||||||
<fluent-icon v-if="isOpen" size="24" icon="subtract" type="solid" />
|
|
||||||
<fluent-icon v-else size="24" icon="add" type="solid" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
<div
|
|
||||||
v-if="isOpen"
|
|
||||||
class="bg-white dark:bg-slate-900"
|
|
||||||
:class="compact ? 'p-0' : 'p-4'"
|
|
||||||
>
|
|
||||||
<slot />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import EmojiOrIcon from 'shared/components/EmojiOrIcon.vue';
|
import EmojiOrIcon from 'shared/components/EmojiOrIcon.vue';
|
||||||
|
|
||||||
@@ -61,3 +29,35 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="-mt-px text-sm">
|
||||||
|
<button
|
||||||
|
class="flex items-center select-none w-full rounded-none bg-slate-50 dark:bg-slate-800 border border-l-0 border-r-0 border-solid m-0 border-slate-100 dark:border-slate-700/50 cursor-grab justify-between py-2 px-4 drag-handle"
|
||||||
|
@click="$emit('click')"
|
||||||
|
>
|
||||||
|
<div class="flex justify-between mb-0.5">
|
||||||
|
<EmojiOrIcon class="inline-block w-5" :icon="icon" :emoji="emoji" />
|
||||||
|
<h5
|
||||||
|
class="text-slate-800 text-sm dark:text-slate-100 mb-0 py-0 pr-2 pl-0"
|
||||||
|
>
|
||||||
|
{{ title }}
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-row">
|
||||||
|
<slot name="button" />
|
||||||
|
<div class="flex justify-end w-3 text-woot-500">
|
||||||
|
<fluent-icon v-if="isOpen" size="24" icon="subtract" type="solid" />
|
||||||
|
<fluent-icon v-else size="24" icon="add" type="solid" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
<div
|
||||||
|
v-if="isOpen"
|
||||||
|
class="bg-white dark:bg-slate-900"
|
||||||
|
:class="compact ? 'p-0' : 'p-4'"
|
||||||
|
>
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,17 +1,3 @@
|
|||||||
<template>
|
|
||||||
<button
|
|
||||||
class="bg-white dark:bg-slate-900 cursor-pointer flex flex-col transition-all duration-200 ease-in -m-px py-4 px-0 items-center border border-solid border-slate-25 dark:border-slate-800 hover:border-woot-500 dark:hover:border-woot-500 hover:shadow-md hover:z-50 disabled:opacity-60"
|
|
||||||
@click="$emit('click')"
|
|
||||||
>
|
|
||||||
<img :src="src" :alt="title" class="w-1/2 my-4 mx-auto" />
|
|
||||||
<h3
|
|
||||||
class="text-slate-800 dark:text-slate-100 text-base text-center capitalize"
|
|
||||||
>
|
|
||||||
{{ title }}
|
|
||||||
</h3>
|
|
||||||
</button>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -27,6 +13,20 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<button
|
||||||
|
class="bg-white dark:bg-slate-900 cursor-pointer flex flex-col justify-end transition-all duration-200 ease-in -m-px py-4 px-0 items-center border border-solid border-slate-25 dark:border-slate-800 hover:border-woot-500 dark:hover:border-woot-500 hover:shadow-md hover:z-50 disabled:opacity-60"
|
||||||
|
@click="$emit('click')"
|
||||||
|
>
|
||||||
|
<img :src="src" :alt="title" class="w-1/2 my-4 mx-auto" />
|
||||||
|
<h3
|
||||||
|
class="text-slate-800 dark:text-slate-100 text-base text-center capitalize"
|
||||||
|
>
|
||||||
|
{{ title }}
|
||||||
|
</h3>
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.inactive {
|
.inactive {
|
||||||
img {
|
img {
|
||||||
|
|||||||
@@ -1,148 +1,22 @@
|
|||||||
<template>
|
|
||||||
<div
|
|
||||||
class="flex flex-col flex-shrink-0 overflow-hidden border-r conversations-list-wrap rtl:border-r-0 rtl:border-l border-slate-50 dark:border-slate-800/50"
|
|
||||||
:class="[
|
|
||||||
{ hidden: !showConversationList },
|
|
||||||
isOnExpandedLayout ? 'basis-full' : 'flex-basis-clamp',
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<slot />
|
|
||||||
<chat-list-header
|
|
||||||
:page-title="pageTitle"
|
|
||||||
:has-applied-filters="hasAppliedFilters"
|
|
||||||
:has-active-folders="hasActiveFolders"
|
|
||||||
:active-status="activeStatus"
|
|
||||||
@add-folders="onClickOpenAddFoldersModal"
|
|
||||||
@delete-folders="onClickOpenDeleteFoldersModal"
|
|
||||||
@filters-modal="onToggleAdvanceFiltersModal"
|
|
||||||
@reset-filters="resetAndFetchData"
|
|
||||||
@basic-filter-change="onBasicFilterChange"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<add-custom-views
|
|
||||||
v-if="showAddFoldersModal"
|
|
||||||
:custom-views-query="foldersQuery"
|
|
||||||
:open-last-saved-item="openLastSavedItemInFolder"
|
|
||||||
@close="onCloseAddFoldersModal"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<delete-custom-views
|
|
||||||
v-if="showDeleteFoldersModal"
|
|
||||||
:show-delete-popup.sync="showDeleteFoldersModal"
|
|
||||||
:active-custom-view="activeFolder"
|
|
||||||
:custom-views-id="foldersId"
|
|
||||||
:open-last-item-after-delete="openLastItemAfterDeleteInFolder"
|
|
||||||
@close="onCloseDeleteFoldersModal"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<chat-type-tabs
|
|
||||||
v-if="!hasAppliedFiltersOrActiveFolders"
|
|
||||||
:items="assigneeTabItems"
|
|
||||||
:active-tab="activeAssigneeTab"
|
|
||||||
class="tab--chat-type"
|
|
||||||
@chatTabChange="updateAssigneeTab"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<p
|
|
||||||
v-if="!chatListLoading && !conversationList.length"
|
|
||||||
class="flex items-center justify-center p-4 overflow-auto"
|
|
||||||
>
|
|
||||||
{{ $t('CHAT_LIST.LIST.404') }}
|
|
||||||
</p>
|
|
||||||
<conversation-bulk-actions
|
|
||||||
v-if="selectedConversations.length"
|
|
||||||
:conversations="selectedConversations"
|
|
||||||
:all-conversations-selected="allConversationsSelected"
|
|
||||||
:selected-inboxes="uniqueInboxes"
|
|
||||||
:show-open-action="allSelectedConversationsStatus('open')"
|
|
||||||
:show-resolved-action="allSelectedConversationsStatus('resolved')"
|
|
||||||
:show-snoozed-action="allSelectedConversationsStatus('snoozed')"
|
|
||||||
@select-all-conversations="selectAllConversations"
|
|
||||||
@assign-agent="onAssignAgent"
|
|
||||||
@update-conversations="onUpdateConversations"
|
|
||||||
@assign-labels="onAssignLabels"
|
|
||||||
@assign-team="onAssignTeamsForBulk"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
ref="conversationList"
|
|
||||||
class="flex-1 conversations-list"
|
|
||||||
:class="{ 'overflow-hidden': isContextMenuOpen }"
|
|
||||||
>
|
|
||||||
<virtual-list
|
|
||||||
ref="conversationVirtualList"
|
|
||||||
:data-key="'id'"
|
|
||||||
:data-sources="conversationList"
|
|
||||||
:data-component="itemComponent"
|
|
||||||
:extra-props="virtualListExtraProps"
|
|
||||||
class="w-full h-full overflow-auto"
|
|
||||||
footer-tag="div"
|
|
||||||
>
|
|
||||||
<template #footer>
|
|
||||||
<div v-if="chatListLoading" class="text-center">
|
|
||||||
<span class="mt-4 mb-4 spinner" />
|
|
||||||
</div>
|
|
||||||
<p
|
|
||||||
v-if="showEndOfListMessage"
|
|
||||||
class="p-4 text-center text-slate-400 dark:text-slate-300"
|
|
||||||
>
|
|
||||||
{{ $t('CHAT_LIST.EOF') }}
|
|
||||||
</p>
|
|
||||||
<intersection-observer
|
|
||||||
v-if="!showEndOfListMessage && !chatListLoading"
|
|
||||||
:options="infiniteLoaderOptions"
|
|
||||||
@observed="loadMoreConversations"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</virtual-list>
|
|
||||||
</div>
|
|
||||||
<woot-modal
|
|
||||||
:show.sync="showAdvancedFilters"
|
|
||||||
:on-close="closeAdvanceFiltersModal"
|
|
||||||
size="medium"
|
|
||||||
>
|
|
||||||
<conversation-advanced-filter
|
|
||||||
v-if="showAdvancedFilters"
|
|
||||||
:initial-filter-types="advancedFilterTypes"
|
|
||||||
:initial-applied-filters="appliedFilter"
|
|
||||||
:active-folder-name="activeFolderName"
|
|
||||||
:on-close="closeAdvanceFiltersModal"
|
|
||||||
:is-folder-view="hasActiveFolders"
|
|
||||||
@applyFilter="onApplyFilter"
|
|
||||||
@updateFolder="onUpdateSavedFilter"
|
|
||||||
/>
|
|
||||||
</woot-modal>
|
|
||||||
<woot-modal
|
|
||||||
:show.sync="showCustomSnoozeModal"
|
|
||||||
:on-close="hideCustomSnoozeModal"
|
|
||||||
>
|
|
||||||
<custom-snooze-modal
|
|
||||||
@close="hideCustomSnoozeModal"
|
|
||||||
@choose-time="chooseSnoozeTime"
|
|
||||||
/>
|
|
||||||
</woot-modal>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { ref } from 'vue';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
|
import { useUISettings } from 'dashboard/composables/useUISettings';
|
||||||
|
import { useAlert } from 'dashboard/composables';
|
||||||
|
import { useKeyboardEvents } from 'dashboard/composables/useKeyboardEvents';
|
||||||
|
import { useFilter } from 'shared/composables/useFilter';
|
||||||
import VirtualList from 'vue-virtual-scroll-list';
|
import VirtualList from 'vue-virtual-scroll-list';
|
||||||
|
|
||||||
import ChatListHeader from './ChatListHeader.vue';
|
import ChatListHeader from './ChatListHeader.vue';
|
||||||
import ConversationAdvancedFilter from './widgets/conversation/ConversationAdvancedFilter.vue';
|
import ConversationAdvancedFilter from './widgets/conversation/ConversationAdvancedFilter.vue';
|
||||||
import ChatTypeTabs from './widgets/ChatTypeTabs.vue';
|
import ChatTypeTabs from './widgets/ChatTypeTabs.vue';
|
||||||
import ConversationItem from './ConversationItem.vue';
|
import ConversationItem from './ConversationItem.vue';
|
||||||
import timeMixin from '../mixins/time';
|
|
||||||
import keyboardEventListenerMixins from 'shared/mixins/keyboardEventListenerMixins';
|
|
||||||
import conversationMixin from '../mixins/conversations';
|
|
||||||
import wootConstants from 'dashboard/constants/globals';
|
import wootConstants from 'dashboard/constants/globals';
|
||||||
import advancedFilterTypes from './widgets/conversation/advancedFilterItems';
|
import advancedFilterTypes from './widgets/conversation/advancedFilterItems';
|
||||||
import filterQueryGenerator from '../helper/filterQueryGenerator.js';
|
import filterQueryGenerator from '../helper/filterQueryGenerator.js';
|
||||||
import AddCustomViews from 'dashboard/routes/dashboard/customviews/AddCustomViews.vue';
|
import AddCustomViews from 'dashboard/routes/dashboard/customviews/AddCustomViews.vue';
|
||||||
import DeleteCustomViews from 'dashboard/routes/dashboard/customviews/DeleteCustomViews.vue';
|
import DeleteCustomViews from 'dashboard/routes/dashboard/customviews/DeleteCustomViews.vue';
|
||||||
import ConversationBulkActions from './widgets/conversation/conversationBulkActions/Index.vue';
|
import ConversationBulkActions from './widgets/conversation/conversationBulkActions/Index.vue';
|
||||||
import alertMixin from 'shared/mixins/alertMixin';
|
|
||||||
import filterMixin from 'shared/mixins/filterMixin';
|
|
||||||
import uiSettingsMixin from 'dashboard/mixins/uiSettings';
|
|
||||||
import languages from 'dashboard/components/widgets/conversation/advancedFilterItems/languages';
|
import languages from 'dashboard/components/widgets/conversation/advancedFilterItems/languages';
|
||||||
import countries from 'shared/constants/countries';
|
import countries from 'shared/constants/countries';
|
||||||
import { generateValuesForEditCustomViews } from 'dashboard/helper/customViewsHelper';
|
import { generateValuesForEditCustomViews } from 'dashboard/helper/customViewsHelper';
|
||||||
@@ -152,11 +26,12 @@ import {
|
|||||||
isOnUnattendedView,
|
isOnUnattendedView,
|
||||||
} from '../store/modules/conversations/helpers/actionHelpers';
|
} from '../store/modules/conversations/helpers/actionHelpers';
|
||||||
import { CONVERSATION_EVENTS } from '../helper/AnalyticsHelper/events';
|
import { CONVERSATION_EVENTS } from '../helper/AnalyticsHelper/events';
|
||||||
import { CMD_SNOOZE_CONVERSATION } from 'dashboard/routes/dashboard/commands/commandBarBusEvents';
|
|
||||||
import { findSnoozeTime } from 'dashboard/helper/snoozeHelpers';
|
|
||||||
import { getUnixTime } from 'date-fns';
|
|
||||||
import CustomSnoozeModal from 'dashboard/components/CustomSnoozeModal.vue';
|
|
||||||
import IntersectionObserver from './IntersectionObserver.vue';
|
import IntersectionObserver from './IntersectionObserver.vue';
|
||||||
|
import {
|
||||||
|
getUserPermissions,
|
||||||
|
filterItemsByPermission,
|
||||||
|
} from 'dashboard/helper/permissionsHelper.js';
|
||||||
|
import { ASSIGNEE_TYPE_TAB_PERMISSIONS } from 'dashboard/constants/permissions.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -170,16 +45,7 @@ export default {
|
|||||||
ConversationBulkActions,
|
ConversationBulkActions,
|
||||||
IntersectionObserver,
|
IntersectionObserver,
|
||||||
VirtualList,
|
VirtualList,
|
||||||
CustomSnoozeModal,
|
|
||||||
},
|
},
|
||||||
mixins: [
|
|
||||||
timeMixin,
|
|
||||||
conversationMixin,
|
|
||||||
keyboardEventListenerMixins,
|
|
||||||
alertMixin,
|
|
||||||
filterMixin,
|
|
||||||
uiSettingsMixin,
|
|
||||||
],
|
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
// Actions to be performed on virtual list item and context menu.
|
// Actions to be performed on virtual list item and context menu.
|
||||||
@@ -224,6 +90,86 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
setup() {
|
||||||
|
const { uiSettings } = useUISettings();
|
||||||
|
|
||||||
|
const conversationListRef = ref(null);
|
||||||
|
|
||||||
|
const {
|
||||||
|
setFilterAttributes,
|
||||||
|
initializeStatusAndAssigneeFilterToModal,
|
||||||
|
initializeInboxTeamAndLabelFilterToModal,
|
||||||
|
} = useFilter({
|
||||||
|
filteri18nKey: 'FILTER',
|
||||||
|
attributeModel: 'conversation_attribute',
|
||||||
|
});
|
||||||
|
|
||||||
|
const getKeyboardListenerParams = () => {
|
||||||
|
const allConversations = conversationListRef.value.querySelectorAll(
|
||||||
|
'div.conversations-list div.conversation'
|
||||||
|
);
|
||||||
|
const activeConversation = conversationListRef.value.querySelector(
|
||||||
|
'div.conversations-list div.conversation.active'
|
||||||
|
);
|
||||||
|
const activeConversationIndex = [...allConversations].indexOf(
|
||||||
|
activeConversation
|
||||||
|
);
|
||||||
|
const lastConversationIndex = allConversations.length - 1;
|
||||||
|
return {
|
||||||
|
allConversations,
|
||||||
|
activeConversation,
|
||||||
|
activeConversationIndex,
|
||||||
|
lastConversationIndex,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
const handleConversationNavigation = direction => {
|
||||||
|
const {
|
||||||
|
allConversations,
|
||||||
|
activeConversationIndex,
|
||||||
|
lastConversationIndex,
|
||||||
|
} = getKeyboardListenerParams();
|
||||||
|
|
||||||
|
// Determine the new index based on the direction
|
||||||
|
const newIndex =
|
||||||
|
direction === 'previous'
|
||||||
|
? activeConversationIndex - 1
|
||||||
|
: activeConversationIndex + 1;
|
||||||
|
|
||||||
|
// Check if the new index is within the valid range
|
||||||
|
if (
|
||||||
|
allConversations.length > 0 &&
|
||||||
|
newIndex >= 0 &&
|
||||||
|
newIndex <= lastConversationIndex
|
||||||
|
) {
|
||||||
|
// Click the conversation at the new index
|
||||||
|
allConversations[newIndex].click();
|
||||||
|
} else if (allConversations.length > 0) {
|
||||||
|
// If the new index is out of range, click the first or last conversation based on the direction
|
||||||
|
const fallbackIndex =
|
||||||
|
direction === 'previous' ? 0 : lastConversationIndex;
|
||||||
|
allConversations[fallbackIndex].click();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const keyboardEvents = {
|
||||||
|
'Alt+KeyJ': {
|
||||||
|
action: () => handleConversationNavigation('previous'),
|
||||||
|
allowOnFocusedInput: true,
|
||||||
|
},
|
||||||
|
'Alt+KeyK': {
|
||||||
|
action: () => handleConversationNavigation('next'),
|
||||||
|
allowOnFocusedInput: true,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
useKeyboardEvents(keyboardEvents);
|
||||||
|
|
||||||
|
return {
|
||||||
|
uiSettings,
|
||||||
|
conversationListRef,
|
||||||
|
setFilterAttributes,
|
||||||
|
initializeStatusAndAssigneeFilterToModal,
|
||||||
|
initializeInboxTeamAndLabelFilterToModal,
|
||||||
|
};
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeAssigneeTab: wootConstants.ASSIGNEE_TYPE.ME,
|
activeAssigneeTab: wootConstants.ASSIGNEE_TYPE.ME,
|
||||||
@@ -244,10 +190,9 @@ export default {
|
|||||||
isContextMenuOpen: false,
|
isContextMenuOpen: false,
|
||||||
appliedFilter: [],
|
appliedFilter: [],
|
||||||
infiniteLoaderOptions: {
|
infiniteLoaderOptions: {
|
||||||
root: this.$refs.conversationList,
|
root: this.$refs.conversationListRef,
|
||||||
rootMargin: '100px 0px 100px 0px',
|
rootMargin: '100px 0px 100px 0px',
|
||||||
},
|
},
|
||||||
showCustomSnoozeModal: false,
|
|
||||||
|
|
||||||
itemComponent: ConversationItem,
|
itemComponent: ConversationItem,
|
||||||
// virtualListExtraProps is to pass the props to the conversationItem component.
|
// virtualListExtraProps is to pass the props to the conversationItem component.
|
||||||
@@ -263,27 +208,23 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
currentChat: 'getSelectedChat',
|
|
||||||
currentUser: 'getCurrentUser',
|
currentUser: 'getCurrentUser',
|
||||||
|
currentAccountId: 'getCurrentAccountId',
|
||||||
chatLists: 'getAllConversations',
|
chatLists: 'getAllConversations',
|
||||||
mineChatsList: 'getMineChats',
|
mineChatsList: 'getMineChats',
|
||||||
allChatList: 'getAllStatusChats',
|
allChatList: 'getAllStatusChats',
|
||||||
chatListFilters: 'getChatListFilters',
|
|
||||||
unAssignedChatsList: 'getUnAssignedChats',
|
unAssignedChatsList: 'getUnAssignedChats',
|
||||||
chatListLoading: 'getChatListLoadingStatus',
|
chatListLoading: 'getChatListLoadingStatus',
|
||||||
currentUserID: 'getCurrentUserID',
|
|
||||||
activeInbox: 'getSelectedInbox',
|
activeInbox: 'getSelectedInbox',
|
||||||
conversationStats: 'conversationStats/getStats',
|
conversationStats: 'conversationStats/getStats',
|
||||||
appliedFilters: 'getAppliedConversationFilters',
|
appliedFilters: 'getAppliedConversationFilters',
|
||||||
folders: 'customViews/getCustomViews',
|
folders: 'customViews/getCustomViews',
|
||||||
inboxes: 'inboxes/getInboxes',
|
|
||||||
agentList: 'agents/getAgents',
|
agentList: 'agents/getAgents',
|
||||||
teamsList: 'teams/getTeams',
|
teamsList: 'teams/getTeams',
|
||||||
inboxesList: 'inboxes/getInboxes',
|
inboxesList: 'inboxes/getInboxes',
|
||||||
campaigns: 'campaigns/getAllCampaigns',
|
campaigns: 'campaigns/getAllCampaigns',
|
||||||
labels: 'labels/getLabels',
|
labels: 'labels/getLabels',
|
||||||
selectedConversations: 'bulkActions/getSelectedConversationIds',
|
selectedConversations: 'bulkActions/getSelectedConversationIds',
|
||||||
contextMenuChatId: 'getContextMenuChatId',
|
|
||||||
}),
|
}),
|
||||||
hasAppliedFilters() {
|
hasAppliedFilters() {
|
||||||
return this.appliedFilters.length !== 0;
|
return this.appliedFilters.length !== 0;
|
||||||
@@ -308,20 +249,19 @@ export default {
|
|||||||
name,
|
name,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
userPermissions() {
|
||||||
|
return getUserPermissions(this.currentUser, this.currentAccountId);
|
||||||
|
},
|
||||||
assigneeTabItems() {
|
assigneeTabItems() {
|
||||||
const ASSIGNEE_TYPE_TAB_KEYS = {
|
return filterItemsByPermission(
|
||||||
me: 'mineCount',
|
ASSIGNEE_TYPE_TAB_PERMISSIONS,
|
||||||
unassigned: 'unAssignedCount',
|
this.userPermissions,
|
||||||
all: 'allCount',
|
item => item.permissions
|
||||||
};
|
).map(({ key, count: countKey }) => ({
|
||||||
return Object.keys(ASSIGNEE_TYPE_TAB_KEYS).map(key => {
|
key,
|
||||||
const count = this.conversationStats[ASSIGNEE_TYPE_TAB_KEYS[key]] || 0;
|
name: this.$t(`CHAT_LIST.ASSIGNEE_TYPE_TABS.${key}`),
|
||||||
return {
|
count: this.conversationStats[countKey] || 0,
|
||||||
key,
|
}));
|
||||||
name: this.$t(`CHAT_LIST.ASSIGNEE_TYPE_TABS.${key}`),
|
|
||||||
count,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
showAssigneeInConversationCard() {
|
showAssigneeInConversationCard() {
|
||||||
return (
|
return (
|
||||||
@@ -517,11 +457,6 @@ export default {
|
|||||||
this.$emitter.on('fetch_conversation_stats', () => {
|
this.$emitter.on('fetch_conversation_stats', () => {
|
||||||
this.$store.dispatch('conversationStats/get', this.conversationFilters);
|
this.$store.dispatch('conversationStats/get', this.conversationFilters);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$emitter.on(CMD_SNOOZE_CONVERSATION, this.onCmdSnoozeConversation);
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
this.$emitter.off(CMD_SNOOZE_CONVERSATION, this.onCmdSnoozeConversation);
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateVirtualListProps(key, value) {
|
updateVirtualListProps(key, value) {
|
||||||
@@ -632,58 +567,6 @@ export default {
|
|||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
getKeyboardListenerParams() {
|
|
||||||
const allConversations = this.$refs.conversationList.querySelectorAll(
|
|
||||||
'div.conversations-list div.conversation'
|
|
||||||
);
|
|
||||||
const activeConversation = this.$refs.conversationList.querySelector(
|
|
||||||
'div.conversations-list div.conversation.active'
|
|
||||||
);
|
|
||||||
const activeConversationIndex = [...allConversations].indexOf(
|
|
||||||
activeConversation
|
|
||||||
);
|
|
||||||
const lastConversationIndex = allConversations.length - 1;
|
|
||||||
return {
|
|
||||||
allConversations,
|
|
||||||
activeConversation,
|
|
||||||
activeConversationIndex,
|
|
||||||
lastConversationIndex,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
handlePreviousConversation() {
|
|
||||||
const { allConversations, activeConversationIndex } =
|
|
||||||
this.getKeyboardListenerParams();
|
|
||||||
if (activeConversationIndex === -1) {
|
|
||||||
allConversations[0].click();
|
|
||||||
}
|
|
||||||
if (activeConversationIndex >= 1) {
|
|
||||||
allConversations[activeConversationIndex - 1].click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleNextConversation() {
|
|
||||||
const {
|
|
||||||
allConversations,
|
|
||||||
activeConversationIndex,
|
|
||||||
lastConversationIndex,
|
|
||||||
} = this.getKeyboardListenerParams();
|
|
||||||
if (activeConversationIndex === -1) {
|
|
||||||
allConversations[lastConversationIndex].click();
|
|
||||||
} else if (activeConversationIndex < lastConversationIndex) {
|
|
||||||
allConversations[activeConversationIndex + 1].click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getKeyboardEvents() {
|
|
||||||
return {
|
|
||||||
'Alt+KeyJ': {
|
|
||||||
action: () => this.handlePreviousConversation(),
|
|
||||||
allowOnFocusedInput: true,
|
|
||||||
},
|
|
||||||
'Alt+KeyK': {
|
|
||||||
action: () => this.handleNextConversation(),
|
|
||||||
allowOnFocusedInput: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
resetAndFetchData() {
|
resetAndFetchData() {
|
||||||
this.appliedFilter = [];
|
this.appliedFilter = [];
|
||||||
this.resetBulkActions();
|
this.resetBulkActions();
|
||||||
@@ -750,7 +633,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
emitConversationLoaded() {
|
emitConversationLoaded() {
|
||||||
this.$emit('conversation-load');
|
this.$emit('conversationLoad');
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
// Addressing a known issue in the virtual list library where dynamically added items
|
// Addressing a known issue in the virtual list library where dynamically added items
|
||||||
// might not render correctly. This workaround involves a slight manual adjustment
|
// might not render correctly. This workaround involves a slight manual adjustment
|
||||||
@@ -833,7 +716,7 @@ export default {
|
|||||||
});
|
});
|
||||||
this.$store.dispatch('bulkActions/clearSelectedConversationIds');
|
this.$store.dispatch('bulkActions/clearSelectedConversationIds');
|
||||||
if (conversationId) {
|
if (conversationId) {
|
||||||
this.showAlert(
|
useAlert(
|
||||||
this.$t(
|
this.$t(
|
||||||
'CONVERSATION.CARD_CONTEXT_MENU.API.AGENT_ASSIGNMENT.SUCCESFUL',
|
'CONVERSATION.CARD_CONTEXT_MENU.API.AGENT_ASSIGNMENT.SUCCESFUL',
|
||||||
{
|
{
|
||||||
@@ -843,10 +726,10 @@ export default {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.showAlert(this.$t('BULK_ACTION.ASSIGN_SUCCESFUL'));
|
useAlert(this.$t('BULK_ACTION.ASSIGN_SUCCESFUL'));
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.showAlert(this.$t('BULK_ACTION.ASSIGN_FAILED'));
|
useAlert(this.$t('BULK_ACTION.ASSIGN_FAILED'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async assignPriority(priority, conversationId = null) {
|
async assignPriority(priority, conversationId = null) {
|
||||||
@@ -861,7 +744,7 @@ export default {
|
|||||||
newValue: priority,
|
newValue: priority,
|
||||||
from: 'Context menu',
|
from: 'Context menu',
|
||||||
});
|
});
|
||||||
this.showAlert(
|
useAlert(
|
||||||
this.$t('CONVERSATION.PRIORITY.CHANGE_PRIORITY.SUCCESSFUL', {
|
this.$t('CONVERSATION.PRIORITY.CHANGE_PRIORITY.SUCCESSFUL', {
|
||||||
priority,
|
priority,
|
||||||
conversationId,
|
conversationId,
|
||||||
@@ -904,7 +787,7 @@ export default {
|
|||||||
conversationId,
|
conversationId,
|
||||||
teamId: team.id,
|
teamId: team.id,
|
||||||
});
|
});
|
||||||
this.showAlert(
|
useAlert(
|
||||||
this.$t(
|
this.$t(
|
||||||
'CONVERSATION.CARD_CONTEXT_MENU.API.TEAM_ASSIGNMENT.SUCCESFUL',
|
'CONVERSATION.CARD_CONTEXT_MENU.API.TEAM_ASSIGNMENT.SUCCESFUL',
|
||||||
{
|
{
|
||||||
@@ -914,7 +797,7 @@ export default {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.showAlert(
|
useAlert(
|
||||||
this.$t('CONVERSATION.CARD_CONTEXT_MENU.API.TEAM_ASSIGNMENT.FAILED')
|
this.$t('CONVERSATION.CARD_CONTEXT_MENU.API.TEAM_ASSIGNMENT.FAILED')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -931,7 +814,7 @@ export default {
|
|||||||
});
|
});
|
||||||
this.$store.dispatch('bulkActions/clearSelectedConversationIds');
|
this.$store.dispatch('bulkActions/clearSelectedConversationIds');
|
||||||
if (conversationId) {
|
if (conversationId) {
|
||||||
this.showAlert(
|
useAlert(
|
||||||
this.$t(
|
this.$t(
|
||||||
'CONVERSATION.CARD_CONTEXT_MENU.API.LABEL_ASSIGNMENT.SUCCESFUL',
|
'CONVERSATION.CARD_CONTEXT_MENU.API.LABEL_ASSIGNMENT.SUCCESFUL',
|
||||||
{
|
{
|
||||||
@@ -941,10 +824,10 @@ export default {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.showAlert(this.$t('BULK_ACTION.LABELS.ASSIGN_SUCCESFUL'));
|
useAlert(this.$t('BULK_ACTION.LABELS.ASSIGN_SUCCESFUL'));
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.showAlert(this.$t('BULK_ACTION.LABELS.ASSIGN_FAILED'));
|
useAlert(this.$t('BULK_ACTION.LABELS.ASSIGN_FAILED'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async onAssignTeamsForBulk(team) {
|
async onAssignTeamsForBulk(team) {
|
||||||
@@ -957,9 +840,9 @@ export default {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.$store.dispatch('bulkActions/clearSelectedConversationIds');
|
this.$store.dispatch('bulkActions/clearSelectedConversationIds');
|
||||||
this.showAlert(this.$t('BULK_ACTION.TEAMS.ASSIGN_SUCCESFUL'));
|
useAlert(this.$t('BULK_ACTION.TEAMS.ASSIGN_SUCCESFUL'));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.showAlert(this.$t('BULK_ACTION.TEAMS.ASSIGN_FAILED'));
|
useAlert(this.$t('BULK_ACTION.TEAMS.ASSIGN_FAILED'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async onUpdateConversations(status, snoozedUntil) {
|
async onUpdateConversations(status, snoozedUntil) {
|
||||||
@@ -973,9 +856,9 @@ export default {
|
|||||||
snoozed_until: snoozedUntil,
|
snoozed_until: snoozedUntil,
|
||||||
});
|
});
|
||||||
this.$store.dispatch('bulkActions/clearSelectedConversationIds');
|
this.$store.dispatch('bulkActions/clearSelectedConversationIds');
|
||||||
this.showAlert(this.$t('BULK_ACTION.UPDATE.UPDATE_SUCCESFUL'));
|
useAlert(this.$t('BULK_ACTION.UPDATE.UPDATE_SUCCESFUL'));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.showAlert(this.$t('BULK_ACTION.UPDATE.UPDATE_FAILED'));
|
useAlert(this.$t('BULK_ACTION.UPDATE.UPDATE_FAILED'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggleConversationStatus(conversationId, status, snoozedUntil) {
|
toggleConversationStatus(conversationId, status, snoozedUntil) {
|
||||||
@@ -986,7 +869,7 @@ export default {
|
|||||||
snoozedUntil,
|
snoozedUntil,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.showAlert(this.$t('CONVERSATION.CHANGE_STATUS'));
|
useAlert(this.$t('CONVERSATION.CHANGE_STATUS'));
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -999,46 +882,144 @@ export default {
|
|||||||
onContextMenuToggle(state) {
|
onContextMenuToggle(state) {
|
||||||
this.isContextMenuOpen = state;
|
this.isContextMenuOpen = state;
|
||||||
},
|
},
|
||||||
onCmdSnoozeConversation(snoozeType) {
|
initializeExistingFilterToModal() {
|
||||||
if (snoozeType === wootConstants.SNOOZE_OPTIONS.UNTIL_CUSTOM_TIME) {
|
const statusFilter = this.initializeStatusAndAssigneeFilterToModal(
|
||||||
this.showCustomSnoozeModal = true;
|
this.activeStatus,
|
||||||
} else {
|
this.currentUserDetails,
|
||||||
this.toggleStatus(
|
this.activeAssigneeTab
|
||||||
wootConstants.STATUS_TYPE.SNOOZED,
|
);
|
||||||
findSnoozeTime(snoozeType) || null
|
if (statusFilter) {
|
||||||
);
|
this.appliedFilter.push(statusFilter);
|
||||||
}
|
}
|
||||||
},
|
|
||||||
chooseSnoozeTime(customSnoozeTime) {
|
const otherFilters = this.initializeInboxTeamAndLabelFilterToModal(
|
||||||
this.showCustomSnoozeModal = false;
|
this.conversationInbox,
|
||||||
if (customSnoozeTime) {
|
this.inbox,
|
||||||
this.toggleStatus(
|
this.teamId,
|
||||||
wootConstants.STATUS_TYPE.SNOOZED,
|
this.activeTeam,
|
||||||
getUnixTime(customSnoozeTime)
|
this.label
|
||||||
);
|
);
|
||||||
}
|
this.appliedFilter.push(...otherFilters);
|
||||||
},
|
|
||||||
toggleStatus(status, snoozedUntil) {
|
|
||||||
this.$store
|
|
||||||
.dispatch('toggleStatus', {
|
|
||||||
conversationId: this.currentChat?.id || this.contextMenuChatId,
|
|
||||||
status,
|
|
||||||
snoozedUntil,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.$store.dispatch('setContextMenuChatId', null);
|
|
||||||
this.showAlert(this.$t('CONVERSATION.CHANGE_STATUS'));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
hideCustomSnoozeModal() {
|
|
||||||
// if we select custom snooze and then the custom snooze modal is open
|
|
||||||
// Then if the custom snooze modal is closed and set the context menu chat id to null
|
|
||||||
this.$store.dispatch('setContextMenuChatId', null);
|
|
||||||
this.showCustomSnoozeModal = false;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="flex flex-col flex-shrink-0 overflow-hidden border-r conversations-list-wrap rtl:border-r-0 rtl:border-l border-slate-50 dark:border-slate-800/50"
|
||||||
|
:class="[
|
||||||
|
{ hidden: !showConversationList },
|
||||||
|
isOnExpandedLayout ? 'basis-full' : 'flex-basis-clamp',
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<slot />
|
||||||
|
<ChatListHeader
|
||||||
|
:page-title="pageTitle"
|
||||||
|
:has-applied-filters="hasAppliedFilters"
|
||||||
|
:has-active-folders="hasActiveFolders"
|
||||||
|
:active-status="activeStatus"
|
||||||
|
@addFolders="onClickOpenAddFoldersModal"
|
||||||
|
@deleteFolders="onClickOpenDeleteFoldersModal"
|
||||||
|
@filtersModal="onToggleAdvanceFiltersModal"
|
||||||
|
@resetFilters="resetAndFetchData"
|
||||||
|
@basicFilterChange="onBasicFilterChange"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<AddCustomViews
|
||||||
|
v-if="showAddFoldersModal"
|
||||||
|
:custom-views-query="foldersQuery"
|
||||||
|
:open-last-saved-item="openLastSavedItemInFolder"
|
||||||
|
@close="onCloseAddFoldersModal"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<DeleteCustomViews
|
||||||
|
v-if="showDeleteFoldersModal"
|
||||||
|
:show-delete-popup.sync="showDeleteFoldersModal"
|
||||||
|
:active-custom-view="activeFolder"
|
||||||
|
:custom-views-id="foldersId"
|
||||||
|
:open-last-item-after-delete="openLastItemAfterDeleteInFolder"
|
||||||
|
@close="onCloseDeleteFoldersModal"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ChatTypeTabs
|
||||||
|
v-if="!hasAppliedFiltersOrActiveFolders"
|
||||||
|
:items="assigneeTabItems"
|
||||||
|
:active-tab="activeAssigneeTab"
|
||||||
|
@chatTabChange="updateAssigneeTab"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<p
|
||||||
|
v-if="!chatListLoading && !conversationList.length"
|
||||||
|
class="flex items-center justify-center p-4 overflow-auto"
|
||||||
|
>
|
||||||
|
{{ $t('CHAT_LIST.LIST.404') }}
|
||||||
|
</p>
|
||||||
|
<ConversationBulkActions
|
||||||
|
v-if="selectedConversations.length"
|
||||||
|
:conversations="selectedConversations"
|
||||||
|
:all-conversations-selected="allConversationsSelected"
|
||||||
|
:selected-inboxes="uniqueInboxes"
|
||||||
|
:show-open-action="allSelectedConversationsStatus('open')"
|
||||||
|
:show-resolved-action="allSelectedConversationsStatus('resolved')"
|
||||||
|
:show-snoozed-action="allSelectedConversationsStatus('snoozed')"
|
||||||
|
@selectAllConversations="selectAllConversations"
|
||||||
|
@assignAgent="onAssignAgent"
|
||||||
|
@updateConversations="onUpdateConversations"
|
||||||
|
@assignLabels="onAssignLabels"
|
||||||
|
@assignTeam="onAssignTeamsForBulk"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
ref="conversationListRef"
|
||||||
|
class="flex-1 conversations-list"
|
||||||
|
:class="{ 'overflow-hidden': isContextMenuOpen }"
|
||||||
|
>
|
||||||
|
<VirtualList
|
||||||
|
ref="conversationVirtualList"
|
||||||
|
data-key="id"
|
||||||
|
:data-sources="conversationList"
|
||||||
|
:data-component="itemComponent"
|
||||||
|
:extra-props="virtualListExtraProps"
|
||||||
|
class="w-full h-full overflow-auto"
|
||||||
|
footer-tag="div"
|
||||||
|
>
|
||||||
|
<template #footer>
|
||||||
|
<div v-if="chatListLoading" class="text-center">
|
||||||
|
<span class="mt-4 mb-4 spinner" />
|
||||||
|
</div>
|
||||||
|
<p
|
||||||
|
v-if="showEndOfListMessage"
|
||||||
|
class="p-4 text-center text-slate-400 dark:text-slate-300"
|
||||||
|
>
|
||||||
|
{{ $t('CHAT_LIST.EOF') }}
|
||||||
|
</p>
|
||||||
|
<IntersectionObserver
|
||||||
|
v-if="!showEndOfListMessage && !chatListLoading"
|
||||||
|
:options="infiniteLoaderOptions"
|
||||||
|
@observed="loadMoreConversations"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</VirtualList>
|
||||||
|
</div>
|
||||||
|
<woot-modal
|
||||||
|
:show.sync="showAdvancedFilters"
|
||||||
|
:on-close="closeAdvanceFiltersModal"
|
||||||
|
size="medium"
|
||||||
|
>
|
||||||
|
<ConversationAdvancedFilter
|
||||||
|
v-if="showAdvancedFilters"
|
||||||
|
:initial-filter-types="advancedFilterTypes"
|
||||||
|
:initial-applied-filters="appliedFilter"
|
||||||
|
:active-folder-name="activeFolderName"
|
||||||
|
:on-close="closeAdvanceFiltersModal"
|
||||||
|
:is-folder-view="hasActiveFolders"
|
||||||
|
@applyFilter="onApplyFilter"
|
||||||
|
@updateFolder="onUpdateSavedFilter"
|
||||||
|
/>
|
||||||
|
</woot-modal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@layer components {
|
@layer components {
|
||||||
@@ -1052,14 +1033,4 @@ export default {
|
|||||||
.conversations-list {
|
.conversations-list {
|
||||||
@apply overflow-hidden hover:overflow-y-auto;
|
@apply overflow-hidden hover:overflow-y-auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab--chat-type {
|
|
||||||
@apply py-0 px-4;
|
|
||||||
|
|
||||||
::v-deep {
|
|
||||||
.tabs {
|
|
||||||
@apply p-0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -21,16 +21,16 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits([
|
const emit = defineEmits([
|
||||||
'add-folders',
|
'addFolders',
|
||||||
'delete-folders',
|
'deleteFolders',
|
||||||
'reset-filters',
|
'resetFilters',
|
||||||
'basic-filter-change',
|
'basicFilterChange',
|
||||||
'filters-modal',
|
'filtersModal',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const onBasicFilterChange = (value, type) => {
|
const onBasicFilterChange = (value, type) => {
|
||||||
emits('basic-filter-change', value, type);
|
emit('basicFilterChange', value, type);
|
||||||
};
|
};
|
||||||
|
|
||||||
const hasAppliedFiltersOrActiveFolders = computed(() => {
|
const hasAppliedFiltersOrActiveFolders = computed(() => {
|
||||||
@@ -68,7 +68,7 @@ const hasAppliedFiltersOrActiveFolders = computed(() => {
|
|||||||
variant="smooth"
|
variant="smooth"
|
||||||
color-scheme="secondary"
|
color-scheme="secondary"
|
||||||
icon="save"
|
icon="save"
|
||||||
@click="emits('add-folders')"
|
@click="emit('addFolders')"
|
||||||
/>
|
/>
|
||||||
<woot-button
|
<woot-button
|
||||||
v-tooltip.top-end="$t('FILTER.CLEAR_BUTTON_LABEL')"
|
v-tooltip.top-end="$t('FILTER.CLEAR_BUTTON_LABEL')"
|
||||||
@@ -76,7 +76,7 @@ const hasAppliedFiltersOrActiveFolders = computed(() => {
|
|||||||
variant="smooth"
|
variant="smooth"
|
||||||
color-scheme="alert"
|
color-scheme="alert"
|
||||||
icon="dismiss-circle"
|
icon="dismiss-circle"
|
||||||
@click="emits('reset-filters')"
|
@click="emit('resetFilters')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="hasActiveFolders">
|
<div v-if="hasActiveFolders">
|
||||||
@@ -86,7 +86,7 @@ const hasAppliedFiltersOrActiveFolders = computed(() => {
|
|||||||
variant="smooth"
|
variant="smooth"
|
||||||
color-scheme="secondary"
|
color-scheme="secondary"
|
||||||
icon="edit"
|
icon="edit"
|
||||||
@click="emits('filters-modal')"
|
@click="emit('filtersModal')"
|
||||||
/>
|
/>
|
||||||
<woot-button
|
<woot-button
|
||||||
v-tooltip.top-end="$t('FILTER.CUSTOM_VIEWS.DELETE.DELETE_BUTTON')"
|
v-tooltip.top-end="$t('FILTER.CUSTOM_VIEWS.DELETE.DELETE_BUTTON')"
|
||||||
@@ -94,7 +94,7 @@ const hasAppliedFiltersOrActiveFolders = computed(() => {
|
|||||||
variant="smooth"
|
variant="smooth"
|
||||||
color-scheme="alert"
|
color-scheme="alert"
|
||||||
icon="delete"
|
icon="delete"
|
||||||
@click="emits('delete-folders')"
|
@click="emit('deleteFolders')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<woot-button
|
<woot-button
|
||||||
@@ -104,9 +104,9 @@ const hasAppliedFiltersOrActiveFolders = computed(() => {
|
|||||||
color-scheme="secondary"
|
color-scheme="secondary"
|
||||||
icon="filter"
|
icon="filter"
|
||||||
size="tiny"
|
size="tiny"
|
||||||
@click="emits('filters-modal')"
|
@click="emit('filtersModal')"
|
||||||
/>
|
/>
|
||||||
<conversation-basic-filter
|
<ConversationBasicFilter
|
||||||
v-if="!hasAppliedFiltersOrActiveFolders"
|
v-if="!hasAppliedFiltersOrActiveFolders"
|
||||||
@changeFilter="onBasicFilterChange"
|
@changeFilter="onBasicFilterChange"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,34 +1,9 @@
|
|||||||
<template>
|
|
||||||
<div class="code--container">
|
|
||||||
<div class="code--action-area">
|
|
||||||
<form
|
|
||||||
v-if="enableCodePen"
|
|
||||||
class="code--codeopen-form"
|
|
||||||
action="https://codepen.io/pen/define"
|
|
||||||
method="POST"
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
<input type="hidden" name="data" :value="codepenScriptValue" />
|
|
||||||
|
|
||||||
<button type="submit" class="button secondary tiny">
|
|
||||||
{{ $t('COMPONENTS.CODE.CODEPEN') }}
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
<button class="button secondary tiny" @click="onCopy">
|
|
||||||
{{ $t('COMPONENTS.CODE.BUTTON_TEXT') }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<highlightjs v-if="script" :language="lang" :code="script" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import 'highlight.js/styles/default.css';
|
import 'highlight.js/styles/default.css';
|
||||||
import { copyTextToClipboard } from 'shared/helpers/clipboard';
|
import { copyTextToClipboard } from 'shared/helpers/clipboard';
|
||||||
import alertMixin from 'shared/mixins/alertMixin';
|
import { useAlert } from 'dashboard/composables';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [alertMixin],
|
|
||||||
props: {
|
props: {
|
||||||
script: {
|
script: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -61,12 +36,36 @@ export default {
|
|||||||
async onCopy(e) {
|
async onCopy(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
await copyTextToClipboard(this.script);
|
await copyTextToClipboard(this.script);
|
||||||
this.showAlert(this.$t('COMPONENTS.CODE.COPY_SUCCESSFUL'));
|
useAlert(this.$t('COMPONENTS.CODE.COPY_SUCCESSFUL'));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="code--container">
|
||||||
|
<div class="code--action-area">
|
||||||
|
<form
|
||||||
|
v-if="enableCodePen"
|
||||||
|
class="code--codeopen-form"
|
||||||
|
action="https://codepen.io/pen/define"
|
||||||
|
method="POST"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
<input type="hidden" name="data" :value="codepenScriptValue" />
|
||||||
|
|
||||||
|
<button type="submit" class="button secondary tiny">
|
||||||
|
{{ $t('COMPONENTS.CODE.CODEPEN') }}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<button class="button secondary tiny" @click="onCopy">
|
||||||
|
{{ $t('COMPONENTS.CODE.BUTTON_TEXT') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<highlightjs v-if="script" :language="lang" :code="script" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.code--container {
|
.code--container {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -1,26 +1,3 @@
|
|||||||
<template>
|
|
||||||
<conversation-card
|
|
||||||
:key="source.id"
|
|
||||||
:active-label="label"
|
|
||||||
:team-id="teamId"
|
|
||||||
:folders-id="foldersId"
|
|
||||||
:chat="source"
|
|
||||||
:conversation-type="conversationType"
|
|
||||||
:selected="isConversationSelected(source.id)"
|
|
||||||
:show-assignee="showAssignee"
|
|
||||||
:enable-context-menu="true"
|
|
||||||
@select-conversation="selectConversation"
|
|
||||||
@de-select-conversation="deSelectConversation"
|
|
||||||
@assign-agent="assignAgent"
|
|
||||||
@assign-team="assignTeam"
|
|
||||||
@assign-label="assignLabels"
|
|
||||||
@update-conversation-status="updateConversationStatus"
|
|
||||||
@context-menu-toggle="toggleContextMenu"
|
|
||||||
@mark-as-unread="markAsUnread"
|
|
||||||
@assign-priority="assignPriority"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ConversationCard from './widgets/conversation/ConversationCard.vue';
|
import ConversationCard from './widgets/conversation/ConversationCard.vue';
|
||||||
export default {
|
export default {
|
||||||
@@ -70,3 +47,26 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ConversationCard
|
||||||
|
:key="source.id"
|
||||||
|
:active-label="label"
|
||||||
|
:team-id="teamId"
|
||||||
|
:folders-id="foldersId"
|
||||||
|
:chat="source"
|
||||||
|
:conversation-type="conversationType"
|
||||||
|
:selected="isConversationSelected(source.id)"
|
||||||
|
:show-assignee="showAssignee"
|
||||||
|
enable-context-menu
|
||||||
|
@selectConversation="selectConversation"
|
||||||
|
@deSelectConversation="deSelectConversation"
|
||||||
|
@assignAgent="assignAgent"
|
||||||
|
@assignTeam="assignTeam"
|
||||||
|
@assignLabel="assignLabels"
|
||||||
|
@updateConversationStatus="updateConversationStatus"
|
||||||
|
@contextMenuToggle="toggleContextMenu"
|
||||||
|
@markAsUnread="markAsUnread"
|
||||||
|
@assignPriority="assignPriority"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,147 +1,12 @@
|
|||||||
<template>
|
|
||||||
<div class="py-3 px-4">
|
|
||||||
<div class="flex items-center mb-1">
|
|
||||||
<h4 class="text-sm flex items-center m-0 w-full error">
|
|
||||||
<div v-if="isAttributeTypeCheckbox" class="flex items-center">
|
|
||||||
<input
|
|
||||||
v-model="editedValue"
|
|
||||||
class="!my-0 mr-2 ml-0"
|
|
||||||
type="checkbox"
|
|
||||||
@change="onUpdate"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center justify-between w-full">
|
|
||||||
<span
|
|
||||||
class="w-full inline-flex gap-1.5 items-start font-medium whitespace-nowrap text-sm mb-0"
|
|
||||||
:class="
|
|
||||||
$v.editedValue.$error
|
|
||||||
? 'text-red-400 dark:text-red-500'
|
|
||||||
: 'text-slate-800 dark:text-slate-100'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ label }}
|
|
||||||
<helper-text-popup
|
|
||||||
v-if="description"
|
|
||||||
:message="description"
|
|
||||||
class="mt-0.5"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
<woot-button
|
|
||||||
v-if="showActions && value"
|
|
||||||
v-tooltip.left="$t('CUSTOM_ATTRIBUTES.ACTIONS.DELETE')"
|
|
||||||
variant="link"
|
|
||||||
size="medium"
|
|
||||||
color-scheme="secondary"
|
|
||||||
icon="delete"
|
|
||||||
class-names="flex justify-end w-4"
|
|
||||||
@click="onDelete"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</h4>
|
|
||||||
</div>
|
|
||||||
<div v-if="notAttributeTypeCheckboxAndList">
|
|
||||||
<div v-if="isEditing" v-on-clickaway="onClickAway">
|
|
||||||
<div class="mb-2 w-full flex items-center">
|
|
||||||
<input
|
|
||||||
ref="inputfield"
|
|
||||||
v-model="editedValue"
|
|
||||||
:type="inputType"
|
|
||||||
class="!h-8 ltr:!rounded-r-none rtl:!rounded-l-none !mb-0 !text-sm"
|
|
||||||
autofocus="true"
|
|
||||||
:class="{ error: $v.editedValue.$error }"
|
|
||||||
@blur="$v.editedValue.$touch"
|
|
||||||
@keyup.enter="onUpdate"
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
<woot-button
|
|
||||||
size="small"
|
|
||||||
icon="checkmark"
|
|
||||||
class="rounded-l-none rtl:rounded-r-none"
|
|
||||||
@click="onUpdate"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<span
|
|
||||||
v-if="shouldShowErrorMessage"
|
|
||||||
class="text-red-400 dark:text-red-500 text-sm block font-normal -mt-px w-full"
|
|
||||||
>
|
|
||||||
{{ errorMessage }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-show="!isEditing"
|
|
||||||
class="flex group"
|
|
||||||
:class="{ 'is-editable': showActions }"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
v-if="isAttributeTypeLink"
|
|
||||||
:href="hrefURL"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
class="group-hover:bg-slate-50 group-hover:dark:bg-slate-700 inline-block rounded-sm mb-0 break-all py-0.5 px-1"
|
|
||||||
>
|
|
||||||
{{ urlValue }}
|
|
||||||
</a>
|
|
||||||
<p
|
|
||||||
v-else
|
|
||||||
class="group-hover:bg-slate-50 group-hover:dark:bg-slate-700 inline-block rounded-sm mb-0 break-all py-0.5 px-1"
|
|
||||||
>
|
|
||||||
{{ displayValue || '---' }}
|
|
||||||
</p>
|
|
||||||
<div class="flex max-w-[2rem] gap-1 ml-1 rtl:mr-1 rtl:ml-0">
|
|
||||||
<woot-button
|
|
||||||
v-if="showActions && value"
|
|
||||||
v-tooltip="$t('CUSTOM_ATTRIBUTES.ACTIONS.COPY')"
|
|
||||||
variant="link"
|
|
||||||
size="small"
|
|
||||||
color-scheme="secondary"
|
|
||||||
icon="clipboard"
|
|
||||||
class-names="hidden group-hover:flex !w-6 flex-shrink-0"
|
|
||||||
@click="onCopy"
|
|
||||||
/>
|
|
||||||
<woot-button
|
|
||||||
v-if="showActions"
|
|
||||||
v-tooltip.right="$t('CUSTOM_ATTRIBUTES.ACTIONS.EDIT')"
|
|
||||||
variant="link"
|
|
||||||
size="small"
|
|
||||||
color-scheme="secondary"
|
|
||||||
icon="edit"
|
|
||||||
class-names="hidden group-hover:flex !w-6 flex-shrink-0"
|
|
||||||
@click="onEdit"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-if="isAttributeTypeList">
|
|
||||||
<multiselect-dropdown
|
|
||||||
:options="listOptions"
|
|
||||||
:selected-item="selectedItem"
|
|
||||||
:has-thumbnail="false"
|
|
||||||
:multiselector-placeholder="
|
|
||||||
$t('CUSTOM_ATTRIBUTES.FORM.ATTRIBUTE_TYPE.LIST.PLACEHOLDER')
|
|
||||||
"
|
|
||||||
:no-search-result="
|
|
||||||
$t('CUSTOM_ATTRIBUTES.FORM.ATTRIBUTE_TYPE.LIST.NO_RESULT')
|
|
||||||
"
|
|
||||||
:input-placeholder="
|
|
||||||
$t(
|
|
||||||
'CUSTOM_ATTRIBUTES.FORM.ATTRIBUTE_TYPE.LIST.SEARCH_INPUT_PLACEHOLDER'
|
|
||||||
)
|
|
||||||
"
|
|
||||||
@click="onUpdateListValue"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { format, parseISO } from 'date-fns';
|
import { format, parseISO } from 'date-fns';
|
||||||
import { required, url } from 'vuelidate/lib/validators';
|
import { required, url } from '@vuelidate/validators';
|
||||||
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
||||||
import MultiselectDropdown from 'shared/components/ui/MultiselectDropdown.vue';
|
import MultiselectDropdown from 'shared/components/ui/MultiselectDropdown.vue';
|
||||||
import HelperTextPopup from 'dashboard/components/ui/HelperTextPopup.vue';
|
import HelperTextPopup from 'dashboard/components/ui/HelperTextPopup.vue';
|
||||||
import { isValidURL } from '../helper/URLHelper';
|
import { isValidURL } from '../helper/URLHelper';
|
||||||
import customAttributeMixin from '../mixins/customAttributeMixin';
|
import { getRegexp } from 'shared/helpers/Validators';
|
||||||
|
import { useVuelidate } from '@vuelidate/core';
|
||||||
|
|
||||||
const DATE_FORMAT = 'yyyy-MM-dd';
|
const DATE_FORMAT = 'yyyy-MM-dd';
|
||||||
|
|
||||||
@@ -150,7 +15,6 @@ export default {
|
|||||||
MultiselectDropdown,
|
MultiselectDropdown,
|
||||||
HelperTextPopup,
|
HelperTextPopup,
|
||||||
},
|
},
|
||||||
mixins: [customAttributeMixin],
|
|
||||||
props: {
|
props: {
|
||||||
label: { type: String, required: true },
|
label: { type: String, required: true },
|
||||||
description: { type: String, default: '' },
|
description: { type: String, default: '' },
|
||||||
@@ -163,10 +27,12 @@ export default {
|
|||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
regexCue: { type: String, default: null },
|
regexCue: { type: String, default: null },
|
||||||
regexEnabled: { type: Boolean, default: false },
|
|
||||||
attributeKey: { type: String, required: true },
|
attributeKey: { type: String, required: true },
|
||||||
contactId: { type: Number, default: null },
|
contactId: { type: Number, default: null },
|
||||||
},
|
},
|
||||||
|
setup() {
|
||||||
|
return { v$: useVuelidate() };
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isEditing: false,
|
isEditing: false,
|
||||||
@@ -225,13 +91,13 @@ export default {
|
|||||||
return this.isAttributeTypeLink ? 'url' : this.attributeType;
|
return this.isAttributeTypeLink ? 'url' : this.attributeType;
|
||||||
},
|
},
|
||||||
shouldShowErrorMessage() {
|
shouldShowErrorMessage() {
|
||||||
return this.$v.editedValue.$error;
|
return this.v$.editedValue.$error;
|
||||||
},
|
},
|
||||||
errorMessage() {
|
errorMessage() {
|
||||||
if (this.$v.editedValue.url) {
|
if (this.v$.editedValue.url) {
|
||||||
return this.$t('CUSTOM_ATTRIBUTES.VALIDATIONS.INVALID_URL');
|
return this.$t('CUSTOM_ATTRIBUTES.VALIDATIONS.INVALID_URL');
|
||||||
}
|
}
|
||||||
if (!this.$v.editedValue.regexValidation) {
|
if (!this.v$.editedValue.regexValidation) {
|
||||||
return this.regexCue
|
return this.regexCue
|
||||||
? this.regexCue
|
? this.regexCue
|
||||||
: this.$t('CUSTOM_ATTRIBUTES.VALIDATIONS.INVALID_INPUT');
|
: this.$t('CUSTOM_ATTRIBUTES.VALIDATIONS.INVALID_INPUT');
|
||||||
@@ -246,7 +112,7 @@ export default {
|
|||||||
},
|
},
|
||||||
contactId() {
|
contactId() {
|
||||||
// Fix to solve validation not resetting when contactId changes in contact page
|
// Fix to solve validation not resetting when contactId changes in contact page
|
||||||
this.$v.$reset();
|
this.v$.$reset();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -261,8 +127,7 @@ export default {
|
|||||||
required,
|
required,
|
||||||
regexValidation: value => {
|
regexValidation: value => {
|
||||||
return !(
|
return !(
|
||||||
this.attributeRegex &&
|
this.attributeRegex && !getRegexp(this.attributeRegex).test(value)
|
||||||
!this.getRegexp(this.attributeRegex).test(value)
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -287,7 +152,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onClickAway() {
|
onClickAway() {
|
||||||
this.$v.$reset();
|
this.v$.$reset();
|
||||||
this.isEditing = false;
|
this.isEditing = false;
|
||||||
},
|
},
|
||||||
onEdit() {
|
onEdit() {
|
||||||
@@ -307,8 +172,8 @@ export default {
|
|||||||
this.attributeType === 'date'
|
this.attributeType === 'date'
|
||||||
? parseISO(this.editedValue)
|
? parseISO(this.editedValue)
|
||||||
: this.editedValue;
|
: this.editedValue;
|
||||||
this.$v.$touch();
|
this.v$.$touch();
|
||||||
if (this.$v.$invalid) {
|
if (this.v$.$invalid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.isEditing = false;
|
this.isEditing = false;
|
||||||
@@ -316,7 +181,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onDelete() {
|
onDelete() {
|
||||||
this.isEditing = false;
|
this.isEditing = false;
|
||||||
this.$v.$reset();
|
this.v$.$reset();
|
||||||
this.$emit('delete', this.attributeKey);
|
this.$emit('delete', this.attributeKey);
|
||||||
},
|
},
|
||||||
onCopy() {
|
onCopy() {
|
||||||
@@ -326,14 +191,152 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="px-4 py-3">
|
||||||
|
<div class="flex items-center mb-1">
|
||||||
|
<h4 class="flex items-center w-full m-0 text-sm error">
|
||||||
|
<div v-if="isAttributeTypeCheckbox" class="flex items-center">
|
||||||
|
<input
|
||||||
|
v-model="editedValue"
|
||||||
|
class="!my-0 mr-2 ml-0"
|
||||||
|
type="checkbox"
|
||||||
|
@change="onUpdate"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between w-full">
|
||||||
|
<span
|
||||||
|
class="w-full inline-flex gap-1.5 items-start font-medium whitespace-nowrap text-sm mb-0"
|
||||||
|
:class="
|
||||||
|
v$.editedValue.$error
|
||||||
|
? 'text-red-400 dark:text-red-500'
|
||||||
|
: 'text-slate-800 dark:text-slate-100'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ label }}
|
||||||
|
<HelperTextPopup
|
||||||
|
v-if="description"
|
||||||
|
:message="description"
|
||||||
|
class="mt-0.5"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<woot-button
|
||||||
|
v-if="showActions && value"
|
||||||
|
v-tooltip.left="$t('CUSTOM_ATTRIBUTES.ACTIONS.DELETE')"
|
||||||
|
variant="link"
|
||||||
|
size="medium"
|
||||||
|
color-scheme="secondary"
|
||||||
|
icon="delete"
|
||||||
|
class-names="flex justify-end w-4"
|
||||||
|
@click="onDelete"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div v-if="notAttributeTypeCheckboxAndList">
|
||||||
|
<div v-if="isEditing" v-on-clickaway="onClickAway">
|
||||||
|
<div class="flex items-center w-full mb-2">
|
||||||
|
<input
|
||||||
|
ref="inputfield"
|
||||||
|
v-model="editedValue"
|
||||||
|
:type="inputType"
|
||||||
|
class="!h-8 ltr:!rounded-r-none rtl:!rounded-l-none !mb-0 !text-sm"
|
||||||
|
autofocus="true"
|
||||||
|
:class="{ error: v$.editedValue.$error }"
|
||||||
|
@blur="v$.editedValue.$touch"
|
||||||
|
@keyup.enter="onUpdate"
|
||||||
|
/>
|
||||||
|
<div>
|
||||||
|
<woot-button
|
||||||
|
size="small"
|
||||||
|
icon="checkmark"
|
||||||
|
class="rounded-l-none rtl:rounded-r-none"
|
||||||
|
@click="onUpdate"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span
|
||||||
|
v-if="shouldShowErrorMessage"
|
||||||
|
class="block w-full -mt-px text-sm font-normal text-red-400 dark:text-red-500"
|
||||||
|
>
|
||||||
|
{{ errorMessage }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-show="!isEditing"
|
||||||
|
class="flex group"
|
||||||
|
:class="{ 'is-editable': showActions }"
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
v-if="isAttributeTypeLink"
|
||||||
|
:href="hrefURL"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
class="group-hover:bg-slate-50 group-hover:dark:bg-slate-700 inline-block rounded-sm mb-0 break-all py-0.5 px-1"
|
||||||
|
>
|
||||||
|
{{ urlValue }}
|
||||||
|
</a>
|
||||||
|
<p
|
||||||
|
v-else
|
||||||
|
class="group-hover:bg-slate-50 group-hover:dark:bg-slate-700 inline-block rounded-sm mb-0 break-all py-0.5 px-1"
|
||||||
|
>
|
||||||
|
{{ displayValue || '---' }}
|
||||||
|
</p>
|
||||||
|
<div class="flex max-w-[2rem] gap-1 ml-1 rtl:mr-1 rtl:ml-0">
|
||||||
|
<woot-button
|
||||||
|
v-if="showActions && value"
|
||||||
|
v-tooltip="$t('CUSTOM_ATTRIBUTES.ACTIONS.COPY')"
|
||||||
|
variant="link"
|
||||||
|
size="small"
|
||||||
|
color-scheme="secondary"
|
||||||
|
icon="clipboard"
|
||||||
|
class-names="hidden group-hover:flex !w-6 flex-shrink-0"
|
||||||
|
@click="onCopy"
|
||||||
|
/>
|
||||||
|
<woot-button
|
||||||
|
v-if="showActions"
|
||||||
|
v-tooltip.right="$t('CUSTOM_ATTRIBUTES.ACTIONS.EDIT')"
|
||||||
|
variant="link"
|
||||||
|
size="small"
|
||||||
|
color-scheme="secondary"
|
||||||
|
icon="edit"
|
||||||
|
class-names="hidden group-hover:flex !w-6 flex-shrink-0"
|
||||||
|
@click="onEdit"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="isAttributeTypeList">
|
||||||
|
<MultiselectDropdown
|
||||||
|
:options="listOptions"
|
||||||
|
:selected-item="selectedItem"
|
||||||
|
:has-thumbnail="false"
|
||||||
|
:multiselector-placeholder="
|
||||||
|
$t('CUSTOM_ATTRIBUTES.FORM.ATTRIBUTE_TYPE.LIST.PLACEHOLDER')
|
||||||
|
"
|
||||||
|
:no-search-result="
|
||||||
|
$t('CUSTOM_ATTRIBUTES.FORM.ATTRIBUTE_TYPE.LIST.NO_RESULT')
|
||||||
|
"
|
||||||
|
:input-placeholder="
|
||||||
|
$t(
|
||||||
|
'CUSTOM_ATTRIBUTES.FORM.ATTRIBUTE_TYPE.LIST.SEARCH_INPUT_PLACEHOLDER'
|
||||||
|
)
|
||||||
|
"
|
||||||
|
@click="onUpdateListValue"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
::v-deep {
|
::v-deep {
|
||||||
.selector-wrap {
|
.selector-wrap {
|
||||||
@apply m-0 top-1;
|
@apply m-0 top-1;
|
||||||
|
|
||||||
.selector-name {
|
.selector-name {
|
||||||
@apply ml-0;
|
@apply ml-0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
@apply ml-0;
|
@apply ml-0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<script setup>
|
||||||
|
import { useStoreGetters } from 'dashboard/composables/store';
|
||||||
|
import { computed } from 'vue';
|
||||||
|
const props = defineProps({
|
||||||
|
showOnCustomBrandedInstance: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const getters = useStoreGetters();
|
||||||
|
|
||||||
|
const isACustomBrandedInstance =
|
||||||
|
getters['globalConfig/isACustomBrandedInstance'];
|
||||||
|
|
||||||
|
const shouldShowContent = computed(
|
||||||
|
() => props.showOnCustomBrandedInstance || !isACustomBrandedInstance.value
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div v-if="shouldShowContent">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -1,28 +1,3 @@
|
|||||||
<template>
|
|
||||||
<div class="flex flex-col">
|
|
||||||
<woot-modal-header :header-title="$t('CONVERSATION.CUSTOM_SNOOZE.TITLE')" />
|
|
||||||
<form class="modal-content" @submit.prevent="chooseTime">
|
|
||||||
<date-picker
|
|
||||||
v-model="snoozeTime"
|
|
||||||
type="datetime"
|
|
||||||
inline
|
|
||||||
:lang="lang"
|
|
||||||
:disabled-date="disabledDate"
|
|
||||||
:disabled-time="disabledTime"
|
|
||||||
:popup-style="{ width: '100%' }"
|
|
||||||
/>
|
|
||||||
<div class="flex flex-row justify-end gap-2 py-2 px-0 w-full">
|
|
||||||
<woot-button variant="clear" @click.prevent="onClose">
|
|
||||||
{{ $t('CONVERSATION.CUSTOM_SNOOZE.CANCEL') }}
|
|
||||||
</woot-button>
|
|
||||||
<woot-button>
|
|
||||||
{{ $t('CONVERSATION.CUSTOM_SNOOZE.APPLY') }}
|
|
||||||
</woot-button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import DatePicker from 'vue2-datepicker';
|
import DatePicker from 'vue2-datepicker';
|
||||||
|
|
||||||
@@ -47,7 +22,7 @@ export default {
|
|||||||
this.$emit('close');
|
this.$emit('close');
|
||||||
},
|
},
|
||||||
chooseTime() {
|
chooseTime() {
|
||||||
this.$emit('choose-time', this.snoozeTime);
|
this.$emit('chooseTime', this.snoozeTime);
|
||||||
},
|
},
|
||||||
disabledDate(date) {
|
disabledDate(date) {
|
||||||
// Disable all the previous dates
|
// Disable all the previous dates
|
||||||
@@ -64,6 +39,32 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<woot-modal-header :header-title="$t('CONVERSATION.CUSTOM_SNOOZE.TITLE')" />
|
||||||
|
<form class="modal-content" @submit.prevent="chooseTime">
|
||||||
|
<DatePicker
|
||||||
|
v-model="snoozeTime"
|
||||||
|
type="datetime"
|
||||||
|
inline
|
||||||
|
:lang="lang"
|
||||||
|
:disabled-date="disabledDate"
|
||||||
|
:disabled-time="disabledTime"
|
||||||
|
:popup-style="{ width: '100%' }"
|
||||||
|
/>
|
||||||
|
<div class="flex flex-row justify-end w-full gap-2 px-0 py-2">
|
||||||
|
<woot-button variant="clear" @click.prevent="onClose">
|
||||||
|
{{ $t('CONVERSATION.CUSTOM_SNOOZE.CANCEL') }}
|
||||||
|
</woot-button>
|
||||||
|
<woot-button>
|
||||||
|
{{ $t('CONVERSATION.CUSTOM_SNOOZE.APPLY') }}
|
||||||
|
</woot-button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.modal-content {
|
.modal-content {
|
||||||
@apply pt-2 px-5 pb-6;
|
@apply pt-2 px-5 pb-6;
|
||||||
|
|||||||
@@ -1,3 +1,16 @@
|
|||||||
|
<script setup>
|
||||||
|
defineProps({
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="flex flex-col items-start w-full gap-6">
|
<div class="flex flex-col items-start w-full gap-6">
|
||||||
<div class="flex flex-col w-full gap-4">
|
<div class="flex flex-col w-full gap-4">
|
||||||
@@ -16,16 +29,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
|
||||||
defineProps({
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
description: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
<template>
|
|
||||||
<div ref="observedElement" class="h-6 w-full" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -32,3 +28,7 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div ref="observedElement" class="h-6 w-full" />
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,3 +1,33 @@
|
|||||||
|
<script>
|
||||||
|
import 'highlight.js/styles/default.css';
|
||||||
|
import { copyTextToClipboard } from 'shared/helpers/clipboard';
|
||||||
|
import { useAlert } from 'dashboard/composables';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
masked: true,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async onCopy(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
await copyTextToClipboard(this.value);
|
||||||
|
useAlert(this.$t('COMPONENTS.CODE.COPY_SUCCESSFUL'));
|
||||||
|
},
|
||||||
|
toggleMasked() {
|
||||||
|
this.masked = !this.masked;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="text--container">
|
<div class="text--container">
|
||||||
<woot-button size="small" class="button--text" @click="onCopy">
|
<woot-button size="small" class="button--text" @click="onCopy">
|
||||||
@@ -15,37 +45,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
import 'highlight.js/styles/default.css';
|
|
||||||
import { copyTextToClipboard } from 'shared/helpers/clipboard';
|
|
||||||
import alertMixin from 'shared/mixins/alertMixin';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [alertMixin],
|
|
||||||
props: {
|
|
||||||
value: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
masked: true,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async onCopy(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
await copyTextToClipboard(this.value);
|
|
||||||
this.showAlert(this.$t('COMPONENTS.CODE.COPY_SUCCESSFUL'));
|
|
||||||
},
|
|
||||||
toggleMasked() {
|
|
||||||
this.masked = !this.masked;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.text--container {
|
.text--container {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -1,36 +1,3 @@
|
|||||||
<template>
|
|
||||||
<transition name="modal-fade">
|
|
||||||
<div
|
|
||||||
v-if="show"
|
|
||||||
:class="modalClassName"
|
|
||||||
transition="modal"
|
|
||||||
@mousedown="handleMouseDown"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
:class="{
|
|
||||||
'modal-container rtl:text-right shadow-md max-h-full overflow-auto relative bg-white dark:bg-slate-800 skip-context-menu': true,
|
|
||||||
'rounded-xl w-[37.5rem]': !fullWidth,
|
|
||||||
'items-center rounded-none flex h-full justify-center w-full':
|
|
||||||
fullWidth,
|
|
||||||
[size]: true,
|
|
||||||
}"
|
|
||||||
@mouse.stop
|
|
||||||
@mousedown="event => event.stopPropagation()"
|
|
||||||
>
|
|
||||||
<woot-button
|
|
||||||
v-if="showCloseButton"
|
|
||||||
color-scheme="secondary"
|
|
||||||
icon="dismiss"
|
|
||||||
variant="clear"
|
|
||||||
class="absolute z-10 ltr:right-2 rtl:left-2 top-2"
|
|
||||||
@click="close"
|
|
||||||
/>
|
|
||||||
<slot />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -108,6 +75,39 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<transition name="modal-fade">
|
||||||
|
<div
|
||||||
|
v-if="show"
|
||||||
|
:class="modalClassName"
|
||||||
|
transition="modal"
|
||||||
|
@mousedown="handleMouseDown"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="relative max-h-full overflow-auto bg-white shadow-md modal-container rtl:text-right dark:bg-slate-800 skip-context-menu"
|
||||||
|
:class="{
|
||||||
|
'rounded-xl w-[37.5rem]': !fullWidth,
|
||||||
|
'items-center rounded-none flex h-full justify-center w-full':
|
||||||
|
fullWidth,
|
||||||
|
[size]: true,
|
||||||
|
}"
|
||||||
|
@mouse.stop
|
||||||
|
@mousedown="event => event.stopPropagation()"
|
||||||
|
>
|
||||||
|
<woot-button
|
||||||
|
v-if="showCloseButton"
|
||||||
|
color-scheme="secondary"
|
||||||
|
icon="dismiss"
|
||||||
|
variant="clear"
|
||||||
|
class="absolute z-10 ltr:right-2 rtl:left-2 top-2"
|
||||||
|
@click="close"
|
||||||
|
/>
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.modal-mask {
|
.modal-mask {
|
||||||
@apply flex items-center justify-center bg-modal-backdrop-light dark:bg-modal-backdrop-dark z-[9990] h-full left-0 fixed top-0 w-full;
|
@apply flex items-center justify-center bg-modal-backdrop-light dark:bg-modal-backdrop-dark z-[9990] h-full left-0 fixed top-0 w-full;
|
||||||
|
|||||||
@@ -1,3 +1,28 @@
|
|||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
headerTitle: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
headerContent: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
headerContentValue: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
headerImage: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- eslint-disable vue/no-unused-refs -->
|
||||||
|
<!-- Added ref for writing specs -->
|
||||||
<template>
|
<template>
|
||||||
<div class="flex flex-col items-start px-8 pt-8 pb-0">
|
<div class="flex flex-col items-start px-8 pt-8 pb-0">
|
||||||
<img v-if="headerImage" :src="headerImage" alt="No image" />
|
<img v-if="headerImage" :src="headerImage" alt="No image" />
|
||||||
@@ -23,26 +48,3 @@
|
|||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
headerTitle: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
headerContent: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
headerContentValue: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
headerImage: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -1,26 +1,133 @@
|
|||||||
|
<script setup>
|
||||||
|
import { ref, computed, onBeforeUnmount } from 'vue';
|
||||||
|
import { useI18n } from 'dashboard/composables/useI18n';
|
||||||
|
import { useRoute } from 'dashboard/composables/route';
|
||||||
|
import { useEmitter } from 'dashboard/composables/emitter';
|
||||||
|
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
||||||
|
import {
|
||||||
|
isAConversationRoute,
|
||||||
|
isAInboxViewRoute,
|
||||||
|
isNotificationRoute,
|
||||||
|
} from 'dashboard/helper/routeHelpers';
|
||||||
|
import { useEventListener } from '@vueuse/core';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
|
const RECONNECTED_BANNER_TIMEOUT = 2000;
|
||||||
|
|
||||||
|
const showNotification = ref(!navigator.onLine);
|
||||||
|
const isDisconnected = ref(false);
|
||||||
|
const isReconnecting = ref(false);
|
||||||
|
const isReconnected = ref(false);
|
||||||
|
let reconnectTimeout = null;
|
||||||
|
|
||||||
|
const bannerText = computed(() => {
|
||||||
|
if (isReconnecting.value) return t('NETWORK.NOTIFICATION.RECONNECTING');
|
||||||
|
if (isReconnected.value) return t('NETWORK.NOTIFICATION.RECONNECT_SUCCESS');
|
||||||
|
return t('NETWORK.NOTIFICATION.OFFLINE');
|
||||||
|
});
|
||||||
|
|
||||||
|
const iconName = computed(() => (isReconnected.value ? 'wifi' : 'wifi-off'));
|
||||||
|
const canRefresh = computed(
|
||||||
|
() => !isReconnecting.value && !isReconnected.value
|
||||||
|
);
|
||||||
|
|
||||||
|
const refreshPage = () => {
|
||||||
|
window.location.reload();
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeNotification = () => {
|
||||||
|
showNotification.value = false;
|
||||||
|
isReconnected.value = false;
|
||||||
|
clearTimeout(reconnectTimeout);
|
||||||
|
};
|
||||||
|
|
||||||
|
const isInAnyOfTheRoutes = routeName => {
|
||||||
|
return (
|
||||||
|
isAConversationRoute(routeName, true) ||
|
||||||
|
isAInboxViewRoute(routeName, true) ||
|
||||||
|
isNotificationRoute(routeName, true)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateWebsocketStatus = () => {
|
||||||
|
isDisconnected.value = true;
|
||||||
|
showNotification.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleReconnectionCompleted = () => {
|
||||||
|
isDisconnected.value = false;
|
||||||
|
isReconnecting.value = false;
|
||||||
|
isReconnected.value = true;
|
||||||
|
showNotification.value = true;
|
||||||
|
reconnectTimeout = setTimeout(closeNotification, RECONNECTED_BANNER_TIMEOUT);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleReconnecting = () => {
|
||||||
|
if (isInAnyOfTheRoutes(route.name)) {
|
||||||
|
isReconnecting.value = true;
|
||||||
|
isReconnected.value = false;
|
||||||
|
showNotification.value = true;
|
||||||
|
} else {
|
||||||
|
handleReconnectionCompleted();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateOnlineStatus = event => {
|
||||||
|
// Case: Websocket is not disconnected
|
||||||
|
// If the app goes offline, show the notification
|
||||||
|
// If the app goes online, close the notification
|
||||||
|
|
||||||
|
// Case: Websocket is disconnected
|
||||||
|
// If the app goes offline, show the notification
|
||||||
|
// If the app goes online but the websocket is disconnected, don't close the notification
|
||||||
|
// If the app goes online and the websocket is not disconnected, close the notification
|
||||||
|
|
||||||
|
if (event.type === 'offline') {
|
||||||
|
showNotification.value = true;
|
||||||
|
} else if (event.type === 'online' && !isDisconnected.value) {
|
||||||
|
handleReconnectionCompleted();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
useEventListener('online', updateOnlineStatus);
|
||||||
|
useEventListener('offline', updateOnlineStatus);
|
||||||
|
useEmitter(BUS_EVENTS.WEBSOCKET_DISCONNECT, updateWebsocketStatus);
|
||||||
|
useEmitter(
|
||||||
|
BUS_EVENTS.WEBSOCKET_RECONNECT_COMPLETED,
|
||||||
|
handleReconnectionCompleted
|
||||||
|
);
|
||||||
|
useEmitter(BUS_EVENTS.WEBSOCKET_RECONNECT, handleReconnecting);
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
clearTimeout(reconnectTimeout);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<transition name="network-notification-fade" tag="div">
|
<transition name="network-notification-fade" tag="div">
|
||||||
<div v-show="showNotification" class="fixed top-4 left-2 z-50 group">
|
<div v-show="showNotification" class="fixed z-50 top-4 left-2 group">
|
||||||
<div
|
<div
|
||||||
class="flex items-center justify-between py-1 px-2 w-full rounded-lg shadow-lg bg-yellow-200 dark:bg-yellow-700 relative"
|
class="relative flex items-center justify-between w-full px-2 py-1 bg-yellow-200 rounded-lg shadow-lg dark:bg-yellow-700"
|
||||||
>
|
>
|
||||||
<fluent-icon
|
<fluent-icon
|
||||||
icon="wifi-off"
|
:icon="iconName"
|
||||||
class="text-yellow-700/50 dark:text-yellow-50"
|
class="text-yellow-700/50 dark:text-yellow-50"
|
||||||
size="18"
|
size="18"
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
class="text-xs tracking-wide font-medium px-2 text-yellow-700/70 dark:text-yellow-50"
|
class="px-2 text-xs font-medium tracking-wide text-yellow-700/70 dark:text-yellow-50"
|
||||||
>
|
>
|
||||||
{{ $t('NETWORK.NOTIFICATION.OFFLINE') }}
|
{{ bannerText }}
|
||||||
</span>
|
</span>
|
||||||
<woot-button
|
<woot-button
|
||||||
|
v-if="canRefresh"
|
||||||
:title="$t('NETWORK.BUTTON.REFRESH')"
|
:title="$t('NETWORK.BUTTON.REFRESH')"
|
||||||
variant="clear"
|
variant="clear"
|
||||||
size="small"
|
size="small"
|
||||||
color-scheme="warning"
|
color-scheme="warning"
|
||||||
icon="arrow-clockwise"
|
icon="arrow-clockwise"
|
||||||
class="visible transition-all duration-500 ease-in-out ml-1"
|
|
||||||
@click="refreshPage"
|
@click="refreshPage"
|
||||||
/>
|
/>
|
||||||
<woot-button
|
<woot-button
|
||||||
@@ -34,55 +141,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [globalConfigMixin],
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
showNotification: !navigator.onLine,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
...mapGetters({ globalConfig: 'globalConfig/get' }),
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
window.addEventListener('offline', this.updateOnlineStatus);
|
|
||||||
this.$emitter.on(BUS_EVENTS.WEBSOCKET_DISCONNECT, () => {
|
|
||||||
// TODO: Remove this after completing the conversation list refetching
|
|
||||||
// TODO: DIRTY FIX : CLEAN UP THIS WITH PROPER FIX, DELAYING THE RECONNECT FOR NOW
|
|
||||||
// THE CABLE IS FIRING IS VERY COMMON AND THUS INTERFERING USER EXPERIENCE
|
|
||||||
setTimeout(() => {
|
|
||||||
this.updateOnlineStatus({ type: 'offline' });
|
|
||||||
}, 4000);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
beforeDestroy() {
|
|
||||||
window.removeEventListener('offline', this.updateOnlineStatus);
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
refreshPage() {
|
|
||||||
window.location.reload();
|
|
||||||
},
|
|
||||||
|
|
||||||
closeNotification() {
|
|
||||||
this.showNotification = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
updateOnlineStatus(event) {
|
|
||||||
if (event.type === 'offline') {
|
|
||||||
this.showNotification = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -1,3 +1,26 @@
|
|||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
subTitle: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
showBorder: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
note: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="ml-0 mr-0 flex py-8 w-full xl:w-3/4 flex-col xl:flex-row"
|
class="ml-0 mr-0 flex py-8 w-full xl:w-3/4 flex-col xl:flex-row"
|
||||||
@@ -30,26 +53,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
subTitle: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
showBorder: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
note: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -1,14 +1,3 @@
|
|||||||
<template>
|
|
||||||
<woot-button
|
|
||||||
:size="size"
|
|
||||||
variant="clear"
|
|
||||||
color-scheme="secondary"
|
|
||||||
class="-ml-3 text-black-900 dark:text-slate-300"
|
|
||||||
icon="list"
|
|
||||||
@click="onMenuItemClick"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
||||||
|
|
||||||
@@ -26,3 +15,14 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<woot-button
|
||||||
|
:size="size"
|
||||||
|
variant="clear"
|
||||||
|
color-scheme="secondary"
|
||||||
|
class="-ml-3 text-black-900 dark:text-slate-300"
|
||||||
|
icon="list"
|
||||||
|
@click="onMenuItemClick"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<div
|
|
||||||
class="shadow-sm bg-slate-800 dark:bg-slate-700 rounded-[4px] items-center gap-3 inline-flex mb-2 max-w-[25rem] min-h-[1.875rem] min-w-[15rem] px-6 py-3 text-left"
|
|
||||||
>
|
|
||||||
<div class="text-white dark:text-white text-sm font-medium">
|
|
||||||
{{ message }}
|
|
||||||
</div>
|
|
||||||
<div v-if="action">
|
|
||||||
<router-link
|
|
||||||
v-if="action.type == 'link'"
|
|
||||||
:to="action.to"
|
|
||||||
class="text-woot-500 dark:text-woot-500 cursor-pointer font-medium hover:text-woot-600 dark:hover:text-woot-600 select-none"
|
|
||||||
>
|
|
||||||
{{ action.message }}
|
|
||||||
</router-link>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -27,11 +6,6 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
showButton: Boolean,
|
|
||||||
duration: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: 3000,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -42,3 +16,24 @@ export default {
|
|||||||
methods: {},
|
methods: {},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="shadow-sm bg-slate-800 dark:bg-slate-700 rounded-[4px] items-center gap-3 inline-flex mb-2 max-w-[25rem] min-h-[1.875rem] min-w-[15rem] px-6 py-3 text-left"
|
||||||
|
>
|
||||||
|
<div class="text-sm font-medium text-white dark:text-white">
|
||||||
|
{{ message }}
|
||||||
|
</div>
|
||||||
|
<div v-if="action">
|
||||||
|
<router-link
|
||||||
|
v-if="action.type == 'link'"
|
||||||
|
:to="action.to"
|
||||||
|
class="font-medium cursor-pointer select-none text-woot-500 dark:text-woot-500 hover:text-woot-600 dark:hover:text-woot-600"
|
||||||
|
>
|
||||||
|
{{ action.message }}
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,27 +1,10 @@
|
|||||||
<template>
|
|
||||||
<transition-group
|
|
||||||
name="toast-fade"
|
|
||||||
tag="div"
|
|
||||||
class="left-0 my-0 mx-auto max-w-[25rem] overflow-hidden absolute right-0 text-center top-4 z-[9999]"
|
|
||||||
>
|
|
||||||
<woot-snackbar
|
|
||||||
v-for="snackMessage in snackMessages"
|
|
||||||
:key="snackMessage.key"
|
|
||||||
:message="snackMessage.message"
|
|
||||||
:action="snackMessage.action"
|
|
||||||
/>
|
|
||||||
</transition-group>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import WootSnackbar from './Snackbar.vue';
|
import WootSnackbar from './Snackbar.vue';
|
||||||
import alertMixin from 'shared/mixins/alertMixin';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
WootSnackbar,
|
WootSnackbar,
|
||||||
},
|
},
|
||||||
mixins: [alertMixin],
|
|
||||||
props: {
|
props: {
|
||||||
duration: {
|
duration: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -42,7 +25,7 @@ export default {
|
|||||||
this.$emitter.off('newToastMessage', this.onNewToastMessage);
|
this.$emitter.off('newToastMessage', this.onNewToastMessage);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onNewToastMessage(message, action) {
|
onNewToastMessage({ message, action }) {
|
||||||
this.snackMessages.push({
|
this.snackMessages.push({
|
||||||
key: new Date().getTime(),
|
key: new Date().getTime(),
|
||||||
message,
|
message,
|
||||||
@@ -55,3 +38,18 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<transition-group
|
||||||
|
name="toast-fade"
|
||||||
|
tag="div"
|
||||||
|
class="left-0 my-0 mx-auto max-w-[25rem] overflow-hidden absolute right-0 text-center top-4 z-[9999]"
|
||||||
|
>
|
||||||
|
<WootSnackbar
|
||||||
|
v-for="snackMessage in snackMessages"
|
||||||
|
:key="snackMessage.key"
|
||||||
|
:message="snackMessage.message"
|
||||||
|
:action="snackMessage.action"
|
||||||
|
/>
|
||||||
|
</transition-group>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,19 +1,8 @@
|
|||||||
<template>
|
|
||||||
<banner
|
|
||||||
v-if="shouldShowBanner"
|
|
||||||
color-scheme="alert"
|
|
||||||
:banner-message="bannerMessage"
|
|
||||||
:action-button-label="actionButtonMessage"
|
|
||||||
has-action-button
|
|
||||||
@click="routeToBilling"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Banner from 'dashboard/components/ui/Banner.vue';
|
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import adminMixin from 'dashboard/mixins/isAdmin';
|
import { useAdmin } from 'dashboard/composables/useAdmin';
|
||||||
import accountMixin from 'dashboard/mixins/account';
|
import { useAccount } from 'dashboard/composables/useAccount';
|
||||||
|
import Banner from 'dashboard/components/ui/Banner.vue';
|
||||||
|
|
||||||
const EMPTY_SUBSCRIPTION_INFO = {
|
const EMPTY_SUBSCRIPTION_INFO = {
|
||||||
status: null,
|
status: null,
|
||||||
@@ -22,7 +11,16 @@ const EMPTY_SUBSCRIPTION_INFO = {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { Banner },
|
components: { Banner },
|
||||||
mixins: [adminMixin, accountMixin],
|
setup() {
|
||||||
|
const { isAdmin } = useAdmin();
|
||||||
|
|
||||||
|
const { accountId } = useAccount();
|
||||||
|
|
||||||
|
return {
|
||||||
|
accountId,
|
||||||
|
isAdmin,
|
||||||
|
};
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
isOnChatwootCloud: 'globalConfig/isOnChatwootCloud',
|
isOnChatwootCloud: 'globalConfig/isOnChatwootCloud',
|
||||||
@@ -80,3 +78,14 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Banner
|
||||||
|
v-if="shouldShowBanner"
|
||||||
|
color-scheme="alert"
|
||||||
|
:banner-message="bannerMessage"
|
||||||
|
:action-button-label="actionButtonMessage"
|
||||||
|
has-action-button
|
||||||
|
@click="routeToBilling"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,24 +1,10 @@
|
|||||||
<template>
|
|
||||||
<banner
|
|
||||||
v-if="shouldShowBanner"
|
|
||||||
color-scheme="alert"
|
|
||||||
:banner-message="bannerMessage"
|
|
||||||
:action-button-label="actionButtonMessage"
|
|
||||||
action-button-icon="mail"
|
|
||||||
has-action-button
|
|
||||||
@click="resendVerificationEmail"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Banner from 'dashboard/components/ui/Banner.vue';
|
import Banner from 'dashboard/components/ui/Banner.vue';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import accountMixin from 'dashboard/mixins/account';
|
import { useAlert } from 'dashboard/composables';
|
||||||
import alertMixin from 'shared/mixins/alertMixin';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { Banner },
|
components: { Banner },
|
||||||
mixins: [accountMixin, alertMixin],
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
currentUser: 'getCurrentUser',
|
currentUser: 'getCurrentUser',
|
||||||
@@ -36,8 +22,20 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
resendVerificationEmail() {
|
resendVerificationEmail() {
|
||||||
this.$store.dispatch('resendConfirmation');
|
this.$store.dispatch('resendConfirmation');
|
||||||
this.showAlert(this.$t('APP_GLOBAL.EMAIL_VERIFICATION_SENT'));
|
useAlert(this.$t('APP_GLOBAL.EMAIL_VERIFICATION_SENT'));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Banner
|
||||||
|
v-if="shouldShowBanner"
|
||||||
|
color-scheme="alert"
|
||||||
|
:banner-message="bannerMessage"
|
||||||
|
:action-button-label="actionButtonMessage"
|
||||||
|
action-button-icon="mail"
|
||||||
|
has-action-button
|
||||||
|
@click="resendVerificationEmail"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,28 +1,22 @@
|
|||||||
<template>
|
|
||||||
<banner
|
|
||||||
v-if="shouldShowBanner"
|
|
||||||
color-scheme="primary"
|
|
||||||
:banner-message="bannerMessage"
|
|
||||||
href-link="https://github.com/chatwoot/chatwoot/releases"
|
|
||||||
:href-link-text="$t('GENERAL_SETTINGS.LEARN_MORE')"
|
|
||||||
has-close-button
|
|
||||||
@close="dismissUpdateBanner"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<script>
|
<script>
|
||||||
import Banner from 'dashboard/components/ui/Banner.vue';
|
import Banner from 'dashboard/components/ui/Banner.vue';
|
||||||
import { LOCAL_STORAGE_KEYS } from 'dashboard/constants/localStorage';
|
import { LOCAL_STORAGE_KEYS } from 'dashboard/constants/localStorage';
|
||||||
import { LocalStorage } from 'shared/helpers/localStorage';
|
import { LocalStorage } from 'shared/helpers/localStorage';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import adminMixin from 'dashboard/mixins/isAdmin';
|
import { useAdmin } from 'dashboard/composables/useAdmin';
|
||||||
import { hasAnUpdateAvailable } from './versionCheckHelper';
|
import { hasAnUpdateAvailable } from './versionCheckHelper';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { Banner },
|
components: { Banner },
|
||||||
mixins: [adminMixin],
|
|
||||||
props: {
|
props: {
|
||||||
latestChatwootVersion: { type: String, default: '' },
|
latestChatwootVersion: { type: String, default: '' },
|
||||||
},
|
},
|
||||||
|
setup() {
|
||||||
|
const { isAdmin } = useAdmin();
|
||||||
|
return {
|
||||||
|
isAdmin,
|
||||||
|
};
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return { userDismissedBanner: false };
|
return { userDismissedBanner: false };
|
||||||
},
|
},
|
||||||
@@ -72,3 +66,15 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Banner
|
||||||
|
v-if="shouldShowBanner"
|
||||||
|
color-scheme="primary"
|
||||||
|
:banner-message="bannerMessage"
|
||||||
|
href-link="https://github.com/chatwoot/chatwoot/releases"
|
||||||
|
:href-link-text="$t('GENERAL_SETTINGS.LEARN_MORE')"
|
||||||
|
has-close-button
|
||||||
|
@close="dismissUpdateBanner"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,24 +1,17 @@
|
|||||||
<template>
|
|
||||||
<banner
|
|
||||||
v-if="shouldShowBanner"
|
|
||||||
color-scheme="alert"
|
|
||||||
:banner-message="bannerMessage"
|
|
||||||
:action-button-label="actionButtonMessage"
|
|
||||||
has-action-button
|
|
||||||
@click="routeToBilling"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Banner from 'dashboard/components/ui/Banner.vue';
|
import Banner from 'dashboard/components/ui/Banner.vue';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import adminMixin from 'dashboard/mixins/isAdmin';
|
import { useAccount } from 'dashboard/composables/useAccount';
|
||||||
import accountMixin from 'dashboard/mixins/account';
|
|
||||||
import { differenceInDays } from 'date-fns';
|
import { differenceInDays } from 'date-fns';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { Banner },
|
components: { Banner },
|
||||||
mixins: [adminMixin, accountMixin],
|
setup() {
|
||||||
|
const { accountId } = useAccount();
|
||||||
|
return {
|
||||||
|
accountId,
|
||||||
|
};
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return { conversationMeta: {} };
|
return { conversationMeta: {} };
|
||||||
},
|
},
|
||||||
@@ -87,3 +80,14 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Banner
|
||||||
|
v-if="shouldShowBanner"
|
||||||
|
color-scheme="alert"
|
||||||
|
:banner-message="bannerMessage"
|
||||||
|
:action-button-label="actionButtonMessage"
|
||||||
|
has-action-button
|
||||||
|
@click="routeToBilling"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
<template>
|
|
||||||
<kbd class="hotkey p-0.5 min-w-[1rem] uppercase" :class="customClass">
|
|
||||||
<slot />
|
|
||||||
</kbd>
|
|
||||||
</template>
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -14,6 +9,12 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<kbd class="hotkey p-0.5 min-w-[1rem] uppercase" :class="customClass">
|
||||||
|
<slot />
|
||||||
|
</kbd>
|
||||||
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
kbd.hotkey {
|
kbd.hotkey {
|
||||||
@apply inline-flex leading-[0.625rem] rounded tracking-wide flex-shrink-0 items-center select-none justify-center;
|
@apply inline-flex leading-[0.625rem] rounded tracking-wide flex-shrink-0 items-center select-none justify-center;
|
||||||
|
|||||||
@@ -1,18 +1,10 @@
|
|||||||
<template>
|
|
||||||
<button :type="type" class="button nice" :class="variant" @click="onClick">
|
|
||||||
<fluent-icon
|
|
||||||
v-if="!isLoading && icon"
|
|
||||||
class="icon"
|
|
||||||
:class="buttonIconClass"
|
|
||||||
:icon="icon"
|
|
||||||
/>
|
|
||||||
<spinner v-if="isLoading" />
|
|
||||||
<slot />
|
|
||||||
</button>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Spinner from 'shared/components/Spinner.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
Spinner,
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
isLoading: {
|
isLoading: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -42,3 +34,16 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<button :type="type" class="button nice" :class="variant" @click="onClick">
|
||||||
|
<fluent-icon
|
||||||
|
v-if="!isLoading && icon"
|
||||||
|
class="icon"
|
||||||
|
:class="buttonIconClass"
|
||||||
|
:icon="icon"
|
||||||
|
/>
|
||||||
|
<Spinner v-if="isLoading" />
|
||||||
|
<slot />
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,17 +1,3 @@
|
|||||||
<template>
|
|
||||||
<button
|
|
||||||
:type="type"
|
|
||||||
data-testid="submit_button"
|
|
||||||
:disabled="disabled"
|
|
||||||
:class="computedClass"
|
|
||||||
@click="onClick"
|
|
||||||
>
|
|
||||||
<fluent-icon v-if="!!iconClass" :icon="iconClass" class="icon" />
|
|
||||||
<span>{{ buttonText }}</span>
|
|
||||||
<spinner v-if="loading" class="ml-2" :color-scheme="spinnerClass" />
|
|
||||||
</button>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Spinner from 'shared/components/Spinner.vue';
|
import Spinner from 'shared/components/Spinner.vue';
|
||||||
|
|
||||||
@@ -61,6 +47,21 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<button
|
||||||
|
:type="type"
|
||||||
|
data-testid="submit_button"
|
||||||
|
:disabled="disabled"
|
||||||
|
:class="computedClass"
|
||||||
|
@click="onClick"
|
||||||
|
>
|
||||||
|
<fluent-icon v-if="!!iconClass" :icon="iconClass" class="icon" />
|
||||||
|
<span>{{ buttonText }}</span>
|
||||||
|
<Spinner v-if="loading" class="ml-2" :color-scheme="spinnerClass" />
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
button:disabled {
|
button:disabled {
|
||||||
@apply bg-woot-100 dark:bg-woot-500/25 dark:text-slate-500 opacity-100;
|
@apply bg-woot-100 dark:bg-woot-500/25 dark:text-slate-500 opacity-100;
|
||||||
|
|||||||
@@ -1,3 +1,141 @@
|
|||||||
|
<script setup>
|
||||||
|
import { ref, computed } from 'vue';
|
||||||
|
import { useAlert } from 'dashboard/composables';
|
||||||
|
import { useToggle } from '@vueuse/core';
|
||||||
|
import { useI18n } from 'dashboard/composables/useI18n';
|
||||||
|
import { useStore, useStoreGetters } from 'dashboard/composables/store';
|
||||||
|
import { useEmitter } from 'dashboard/composables/emitter';
|
||||||
|
import { useKeyboardEvents } from 'dashboard/composables/useKeyboardEvents';
|
||||||
|
|
||||||
|
import WootDropdownItem from 'shared/components/ui/dropdown/DropdownItem.vue';
|
||||||
|
import WootDropdownMenu from 'shared/components/ui/dropdown/DropdownMenu.vue';
|
||||||
|
import wootConstants from 'dashboard/constants/globals';
|
||||||
|
import {
|
||||||
|
CMD_REOPEN_CONVERSATION,
|
||||||
|
CMD_RESOLVE_CONVERSATION,
|
||||||
|
} from 'dashboard/helper/commandbar/events';
|
||||||
|
|
||||||
|
const store = useStore();
|
||||||
|
const getters = useStoreGetters();
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const arrowDownButtonRef = ref(null);
|
||||||
|
const isLoading = ref(false);
|
||||||
|
|
||||||
|
const [showActionsDropdown, toggleDropdown] = useToggle();
|
||||||
|
const closeDropdown = () => toggleDropdown(false);
|
||||||
|
const openDropdown = () => toggleDropdown(true);
|
||||||
|
|
||||||
|
const currentChat = computed(() => getters.getSelectedChat.value);
|
||||||
|
|
||||||
|
const isOpen = computed(
|
||||||
|
() => currentChat.value.status === wootConstants.STATUS_TYPE.OPEN
|
||||||
|
);
|
||||||
|
const isPending = computed(
|
||||||
|
() => currentChat.value.status === wootConstants.STATUS_TYPE.PENDING
|
||||||
|
);
|
||||||
|
const isResolved = computed(
|
||||||
|
() => currentChat.value.status === wootConstants.STATUS_TYPE.RESOLVED
|
||||||
|
);
|
||||||
|
const isSnoozed = computed(
|
||||||
|
() => currentChat.value.status === wootConstants.STATUS_TYPE.SNOOZED
|
||||||
|
);
|
||||||
|
|
||||||
|
const buttonClass = computed(() => {
|
||||||
|
if (isPending.value) return 'primary';
|
||||||
|
if (isOpen.value) return 'success';
|
||||||
|
if (isResolved.value) return 'warning';
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
const showAdditionalActions = computed(
|
||||||
|
() => !isPending.value && !isSnoozed.value
|
||||||
|
);
|
||||||
|
|
||||||
|
const showOpenButton = computed(() => {
|
||||||
|
return isPending.value || isSnoozed.value;
|
||||||
|
});
|
||||||
|
|
||||||
|
const getConversationParams = () => {
|
||||||
|
const allConversations = document.querySelectorAll(
|
||||||
|
'.conversations-list .conversation'
|
||||||
|
);
|
||||||
|
|
||||||
|
const activeConversation = document.querySelector(
|
||||||
|
'div.conversations-list div.conversation.active'
|
||||||
|
);
|
||||||
|
const activeConversationIndex = [...allConversations].indexOf(
|
||||||
|
activeConversation
|
||||||
|
);
|
||||||
|
const lastConversationIndex = allConversations.length - 1;
|
||||||
|
|
||||||
|
return {
|
||||||
|
all: allConversations,
|
||||||
|
activeIndex: activeConversationIndex,
|
||||||
|
lastIndex: lastConversationIndex,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const openSnoozeModal = () => {
|
||||||
|
const ninja = document.querySelector('ninja-keys');
|
||||||
|
ninja.open({ parent: 'snooze_conversation' });
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggleStatus = (status, snoozedUntil) => {
|
||||||
|
closeDropdown();
|
||||||
|
isLoading.value = true;
|
||||||
|
store
|
||||||
|
.dispatch('toggleStatus', {
|
||||||
|
conversationId: currentChat.value.id,
|
||||||
|
status,
|
||||||
|
snoozedUntil,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
useAlert(t('CONVERSATION.CHANGE_STATUS'));
|
||||||
|
isLoading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onCmdOpenConversation = () => {
|
||||||
|
toggleStatus(wootConstants.STATUS_TYPE.OPEN);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onCmdResolveConversation = () => {
|
||||||
|
toggleStatus(wootConstants.STATUS_TYPE.RESOLVED);
|
||||||
|
};
|
||||||
|
|
||||||
|
const keyboardEvents = {
|
||||||
|
'Alt+KeyM': {
|
||||||
|
action: () => arrowDownButtonRef.value?.$el.click(),
|
||||||
|
allowOnFocusedInput: true,
|
||||||
|
},
|
||||||
|
'Alt+KeyE': {
|
||||||
|
action: async () => {
|
||||||
|
await toggleStatus(wootConstants.STATUS_TYPE.RESOLVED);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'$mod+Alt+KeyE': {
|
||||||
|
action: async event => {
|
||||||
|
const { all, activeIndex, lastIndex } = getConversationParams();
|
||||||
|
await toggleStatus(wootConstants.STATUS_TYPE.RESOLVED);
|
||||||
|
|
||||||
|
if (activeIndex < lastIndex) {
|
||||||
|
all[activeIndex + 1].click();
|
||||||
|
} else if (all.length > 1) {
|
||||||
|
all[0].click();
|
||||||
|
document.querySelector('.conversations-list').scrollTop = 0;
|
||||||
|
}
|
||||||
|
event.preventDefault();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
useKeyboardEvents(keyboardEvents);
|
||||||
|
|
||||||
|
useEmitter(CMD_REOPEN_CONVERSATION, onCmdOpenConversation);
|
||||||
|
useEmitter(CMD_RESOLVE_CONVERSATION, onCmdResolveConversation);
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="relative flex items-center justify-end resolve-actions">
|
<div class="relative flex items-center justify-end resolve-actions">
|
||||||
<div class="button-group">
|
<div class="button-group">
|
||||||
@@ -21,7 +159,7 @@
|
|||||||
:is-loading="isLoading"
|
:is-loading="isLoading"
|
||||||
@click="onCmdOpenConversation"
|
@click="onCmdOpenConversation"
|
||||||
>
|
>
|
||||||
{{ $t('CONVERSATION.HEADER.REOPEN_ACTION') }}
|
{{ t('CONVERSATION.HEADER.REOPEN_ACTION') }}
|
||||||
</woot-button>
|
</woot-button>
|
||||||
<woot-button
|
<woot-button
|
||||||
v-else-if="showOpenButton"
|
v-else-if="showOpenButton"
|
||||||
@@ -31,11 +169,11 @@
|
|||||||
:is-loading="isLoading"
|
:is-loading="isLoading"
|
||||||
@click="onCmdOpenConversation"
|
@click="onCmdOpenConversation"
|
||||||
>
|
>
|
||||||
{{ $t('CONVERSATION.HEADER.OPEN_ACTION') }}
|
{{ t('CONVERSATION.HEADER.OPEN_ACTION') }}
|
||||||
</woot-button>
|
</woot-button>
|
||||||
<woot-button
|
<woot-button
|
||||||
v-if="showAdditionalActions"
|
v-if="showAdditionalActions"
|
||||||
ref="arrowDownButton"
|
ref="arrowDownButtonRef"
|
||||||
:color-scheme="buttonClass"
|
:color-scheme="buttonClass"
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
icon="chevron-down"
|
icon="chevron-down"
|
||||||
@@ -46,10 +184,10 @@
|
|||||||
<div
|
<div
|
||||||
v-if="showActionsDropdown"
|
v-if="showActionsDropdown"
|
||||||
v-on-clickaway="closeDropdown"
|
v-on-clickaway="closeDropdown"
|
||||||
class="dropdown-pane dropdown-pane--open"
|
class="dropdown-pane dropdown-pane--open left-auto top-[2.625rem] mt-0.5 right-0 max-w-[12.5rem] min-w-[9.75rem]"
|
||||||
>
|
>
|
||||||
<woot-dropdown-menu class="mb-0">
|
<WootDropdownMenu class="mb-0">
|
||||||
<woot-dropdown-item v-if="!isPending">
|
<WootDropdownItem v-if="!isPending">
|
||||||
<woot-button
|
<woot-button
|
||||||
variant="clear"
|
variant="clear"
|
||||||
color-scheme="secondary"
|
color-scheme="secondary"
|
||||||
@@ -57,173 +195,27 @@
|
|||||||
icon="snooze"
|
icon="snooze"
|
||||||
@click="() => openSnoozeModal()"
|
@click="() => openSnoozeModal()"
|
||||||
>
|
>
|
||||||
{{ $t('CONVERSATION.RESOLVE_DROPDOWN.SNOOZE_UNTIL') }}
|
{{ t('CONVERSATION.RESOLVE_DROPDOWN.SNOOZE_UNTIL') }}
|
||||||
</woot-button>
|
</woot-button>
|
||||||
</woot-dropdown-item>
|
</WootDropdownItem>
|
||||||
<woot-dropdown-item v-if="!isPending">
|
<WootDropdownItem v-if="!isPending">
|
||||||
<woot-button
|
<woot-button
|
||||||
variant="clear"
|
variant="clear"
|
||||||
color-scheme="secondary"
|
color-scheme="secondary"
|
||||||
size="small"
|
size="small"
|
||||||
icon="book-clock"
|
icon="book-clock"
|
||||||
@click="() => toggleStatus(STATUS_TYPE.PENDING)"
|
@click="() => toggleStatus(wootConstants.STATUS_TYPE.PENDING)"
|
||||||
>
|
>
|
||||||
{{ $t('CONVERSATION.RESOLVE_DROPDOWN.MARK_PENDING') }}
|
{{ t('CONVERSATION.RESOLVE_DROPDOWN.MARK_PENDING') }}
|
||||||
</woot-button>
|
</woot-button>
|
||||||
</woot-dropdown-item>
|
</WootDropdownItem>
|
||||||
</woot-dropdown-menu>
|
</WootDropdownMenu>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import alertMixin from 'shared/mixins/alertMixin';
|
|
||||||
import keyboardEventListenerMixins from 'shared/mixins/keyboardEventListenerMixins';
|
|
||||||
import WootDropdownItem from 'shared/components/ui/dropdown/DropdownItem.vue';
|
|
||||||
import WootDropdownMenu from 'shared/components/ui/dropdown/DropdownMenu.vue';
|
|
||||||
|
|
||||||
import wootConstants from 'dashboard/constants/globals';
|
|
||||||
import {
|
|
||||||
CMD_REOPEN_CONVERSATION,
|
|
||||||
CMD_RESOLVE_CONVERSATION,
|
|
||||||
} from '../../routes/dashboard/commands/commandBarBusEvents';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
WootDropdownItem,
|
|
||||||
WootDropdownMenu,
|
|
||||||
},
|
|
||||||
mixins: [alertMixin, keyboardEventListenerMixins],
|
|
||||||
props: { conversationId: { type: [String, Number], required: true } },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isLoading: false,
|
|
||||||
showActionsDropdown: false,
|
|
||||||
STATUS_TYPE: wootConstants.STATUS_TYPE,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapGetters({ currentChat: 'getSelectedChat' }),
|
|
||||||
isOpen() {
|
|
||||||
return this.currentChat.status === wootConstants.STATUS_TYPE.OPEN;
|
|
||||||
},
|
|
||||||
isPending() {
|
|
||||||
return this.currentChat.status === wootConstants.STATUS_TYPE.PENDING;
|
|
||||||
},
|
|
||||||
isResolved() {
|
|
||||||
return this.currentChat.status === wootConstants.STATUS_TYPE.RESOLVED;
|
|
||||||
},
|
|
||||||
isSnoozed() {
|
|
||||||
return this.currentChat.status === wootConstants.STATUS_TYPE.SNOOZED;
|
|
||||||
},
|
|
||||||
buttonClass() {
|
|
||||||
if (this.isPending) return 'primary';
|
|
||||||
if (this.isOpen) return 'success';
|
|
||||||
if (this.isResolved) return 'warning';
|
|
||||||
return '';
|
|
||||||
},
|
|
||||||
showAdditionalActions() {
|
|
||||||
return !this.isPending && !this.isSnoozed;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$emitter.on(CMD_REOPEN_CONVERSATION, this.onCmdOpenConversation);
|
|
||||||
this.$emitter.on(CMD_RESOLVE_CONVERSATION, this.onCmdResolveConversation);
|
|
||||||
},
|
|
||||||
destroyed() {
|
|
||||||
this.$emitter.off(CMD_REOPEN_CONVERSATION, this.onCmdOpenConversation);
|
|
||||||
this.$emitter.off(CMD_RESOLVE_CONVERSATION, this.onCmdResolveConversation);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getKeyboardEvents() {
|
|
||||||
return {
|
|
||||||
'Alt+KeyM': {
|
|
||||||
action: () => this.$refs.arrowDownButton?.$el.click(),
|
|
||||||
allowOnFocusedInput: true,
|
|
||||||
},
|
|
||||||
'Alt+KeyE': this.resolveOrToast,
|
|
||||||
'$mod+Alt+KeyE': async event => {
|
|
||||||
const { all, activeIndex, lastIndex } = this.getConversationParams();
|
|
||||||
await this.resolveOrToast();
|
|
||||||
|
|
||||||
if (activeIndex < lastIndex) {
|
|
||||||
all[activeIndex + 1].click();
|
|
||||||
} else if (all.length > 1) {
|
|
||||||
all[0].click();
|
|
||||||
document.querySelector('.conversations-list').scrollTop = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
getConversationParams() {
|
|
||||||
const allConversations = document.querySelectorAll(
|
|
||||||
'.conversations-list .conversation'
|
|
||||||
);
|
|
||||||
|
|
||||||
const activeConversation = document.querySelector(
|
|
||||||
'div.conversations-list div.conversation.active'
|
|
||||||
);
|
|
||||||
const activeConversationIndex = [...allConversations].indexOf(
|
|
||||||
activeConversation
|
|
||||||
);
|
|
||||||
const lastConversationIndex = allConversations.length - 1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
all: allConversations,
|
|
||||||
activeIndex: activeConversationIndex,
|
|
||||||
lastIndex: lastConversationIndex,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
async resolveOrToast() {
|
|
||||||
try {
|
|
||||||
await this.toggleStatus(wootConstants.STATUS_TYPE.RESOLVED);
|
|
||||||
} catch (error) {
|
|
||||||
// error
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onCmdOpenConversation() {
|
|
||||||
this.toggleStatus(this.STATUS_TYPE.OPEN);
|
|
||||||
},
|
|
||||||
onCmdResolveConversation() {
|
|
||||||
this.toggleStatus(this.STATUS_TYPE.RESOLVED);
|
|
||||||
},
|
|
||||||
showOpenButton() {
|
|
||||||
return this.isResolved || this.isSnoozed;
|
|
||||||
},
|
|
||||||
closeDropdown() {
|
|
||||||
this.showActionsDropdown = false;
|
|
||||||
},
|
|
||||||
openDropdown() {
|
|
||||||
this.showActionsDropdown = true;
|
|
||||||
},
|
|
||||||
toggleStatus(status, snoozedUntil) {
|
|
||||||
this.closeDropdown();
|
|
||||||
this.isLoading = true;
|
|
||||||
this.$store
|
|
||||||
.dispatch('toggleStatus', {
|
|
||||||
conversationId: this.currentChat.id,
|
|
||||||
status,
|
|
||||||
snoozedUntil,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.showAlert(this.$t('CONVERSATION.CHANGE_STATUS'));
|
|
||||||
this.isLoading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
openSnoozeModal() {
|
|
||||||
const ninja = document.querySelector('ninja-keys');
|
|
||||||
ninja.open({ parent: 'snooze_conversation' });
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.dropdown-pane {
|
.dropdown-pane {
|
||||||
@apply left-auto top-[2.625rem] mt-0.5 right-0 max-w-[12.5rem] min-w-[9.75rem];
|
|
||||||
|
|
||||||
.dropdown-menu__item {
|
.dropdown-menu__item {
|
||||||
@apply mb-0;
|
@apply mb-0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,53 +1,6 @@
|
|||||||
<template>
|
|
||||||
<woot-dropdown-menu>
|
|
||||||
<woot-dropdown-header :title="$t('SIDEBAR.SET_AVAILABILITY_TITLE')" />
|
|
||||||
<woot-dropdown-item
|
|
||||||
v-for="status in availabilityStatuses"
|
|
||||||
:key="status.value"
|
|
||||||
class="flex items-baseline"
|
|
||||||
>
|
|
||||||
<woot-button
|
|
||||||
size="small"
|
|
||||||
:color-scheme="status.disabled ? '' : 'secondary'"
|
|
||||||
:variant="status.disabled ? 'smooth' : 'clear'"
|
|
||||||
class-names="status-change--dropdown-button"
|
|
||||||
@click="changeAvailabilityStatus(status.value)"
|
|
||||||
>
|
|
||||||
<availability-status-badge :status="status.value" />
|
|
||||||
{{ status.label }}
|
|
||||||
</woot-button>
|
|
||||||
</woot-dropdown-item>
|
|
||||||
<woot-dropdown-divider />
|
|
||||||
<woot-dropdown-item class="m-0 flex items-center justify-between p-2">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<fluent-icon
|
|
||||||
v-tooltip.right-start="$t('SIDEBAR.SET_AUTO_OFFLINE.INFO_TEXT')"
|
|
||||||
icon="info"
|
|
||||||
size="14"
|
|
||||||
class="mt-px"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<span
|
|
||||||
class="my-0 mx-1 text-xs font-medium text-slate-600 dark:text-slate-100"
|
|
||||||
>
|
|
||||||
{{ $t('SIDEBAR.SET_AUTO_OFFLINE.TEXT') }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<woot-switch
|
|
||||||
size="small"
|
|
||||||
class="mt-px mx-1 mb-0"
|
|
||||||
:value="currentUserAutoOffline"
|
|
||||||
@input="updateAutoOffline"
|
|
||||||
/>
|
|
||||||
</woot-dropdown-item>
|
|
||||||
<woot-dropdown-divider />
|
|
||||||
</woot-dropdown-menu>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import alertMixin from 'shared/mixins/alertMixin';
|
import { useAlert } from 'dashboard/composables';
|
||||||
import WootDropdownItem from 'shared/components/ui/dropdown/DropdownItem.vue';
|
import WootDropdownItem from 'shared/components/ui/dropdown/DropdownItem.vue';
|
||||||
import WootDropdownMenu from 'shared/components/ui/dropdown/DropdownMenu.vue';
|
import WootDropdownMenu from 'shared/components/ui/dropdown/DropdownMenu.vue';
|
||||||
import WootDropdownHeader from 'shared/components/ui/dropdown/DropdownHeader.vue';
|
import WootDropdownHeader from 'shared/components/ui/dropdown/DropdownHeader.vue';
|
||||||
@@ -65,9 +18,6 @@ export default {
|
|||||||
WootDropdownItem,
|
WootDropdownItem,
|
||||||
AvailabilityStatusBadge,
|
AvailabilityStatusBadge,
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [alertMixin],
|
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isStatusMenuOpened: false,
|
isStatusMenuOpened: false,
|
||||||
@@ -129,7 +79,7 @@ export default {
|
|||||||
account_id: this.currentAccountId,
|
account_id: this.currentAccountId,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.showAlert(
|
useAlert(
|
||||||
this.$t('PROFILE_SETTINGS.FORM.AVAILABILITY.SET_AVAILABILITY_ERROR')
|
this.$t('PROFILE_SETTINGS.FORM.AVAILABILITY.SET_AVAILABILITY_ERROR')
|
||||||
);
|
);
|
||||||
} finally {
|
} finally {
|
||||||
@@ -139,3 +89,50 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<WootDropdownMenu>
|
||||||
|
<WootDropdownHeader :title="$t('SIDEBAR.SET_AVAILABILITY_TITLE')" />
|
||||||
|
<WootDropdownItem
|
||||||
|
v-for="status in availabilityStatuses"
|
||||||
|
:key="status.value"
|
||||||
|
class="flex items-baseline"
|
||||||
|
>
|
||||||
|
<woot-button
|
||||||
|
size="small"
|
||||||
|
:color-scheme="status.disabled ? '' : 'secondary'"
|
||||||
|
:variant="status.disabled ? 'smooth' : 'clear'"
|
||||||
|
class-names="status-change--dropdown-button"
|
||||||
|
@click="changeAvailabilityStatus(status.value)"
|
||||||
|
>
|
||||||
|
<AvailabilityStatusBadge :status="status.value" />
|
||||||
|
{{ status.label }}
|
||||||
|
</woot-button>
|
||||||
|
</WootDropdownItem>
|
||||||
|
<WootDropdownDivider />
|
||||||
|
<WootDropdownItem class="flex items-center justify-between p-2 m-0">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<fluent-icon
|
||||||
|
v-tooltip.right-start="$t('SIDEBAR.SET_AUTO_OFFLINE.INFO_TEXT')"
|
||||||
|
icon="info"
|
||||||
|
size="14"
|
||||||
|
class="mt-px"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<span
|
||||||
|
class="mx-1 my-0 text-xs font-medium text-slate-600 dark:text-slate-100"
|
||||||
|
>
|
||||||
|
{{ $t('SIDEBAR.SET_AUTO_OFFLINE.TEXT') }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<woot-switch
|
||||||
|
size="small"
|
||||||
|
class="mx-1 mt-px mb-0"
|
||||||
|
:value="currentUserAutoOffline"
|
||||||
|
@input="updateAutoOffline"
|
||||||
|
/>
|
||||||
|
</WootDropdownItem>
|
||||||
|
<WootDropdownDivider />
|
||||||
|
</WootDropdownMenu>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,50 +1,22 @@
|
|||||||
<template>
|
|
||||||
<aside class="flex h-full">
|
|
||||||
<primary-sidebar
|
|
||||||
:logo-source="globalConfig.logoThumbnail"
|
|
||||||
:installation-name="globalConfig.installationName"
|
|
||||||
:is-a-custom-branded-instance="isACustomBrandedInstance"
|
|
||||||
:account-id="accountId"
|
|
||||||
:menu-items="primaryMenuItems"
|
|
||||||
:active-menu-item="activePrimaryMenu.key"
|
|
||||||
@toggle-accounts="toggleAccountModal"
|
|
||||||
@key-shortcut-modal="toggleKeyShortcutModal"
|
|
||||||
@open-notification-panel="openNotificationPanel"
|
|
||||||
/>
|
|
||||||
<secondary-sidebar
|
|
||||||
v-if="showSecondarySidebar"
|
|
||||||
:class="sidebarClassName"
|
|
||||||
:account-id="accountId"
|
|
||||||
:inboxes="inboxes"
|
|
||||||
:labels="labels"
|
|
||||||
:teams="teams"
|
|
||||||
:custom-views="customViews"
|
|
||||||
:menu-config="activeSecondaryMenu"
|
|
||||||
:current-role="currentRole"
|
|
||||||
:is-on-chatwoot-cloud="isOnChatwootCloud"
|
|
||||||
@add-label="showAddLabelPopup"
|
|
||||||
@toggle-accounts="toggleAccountModal"
|
|
||||||
/>
|
|
||||||
</aside>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import adminMixin from '../../mixins/isAdmin';
|
|
||||||
import { getSidebarItems } from './config/default-sidebar';
|
import { getSidebarItems } from './config/default-sidebar';
|
||||||
import alertMixin from 'shared/mixins/alertMixin';
|
import { useKeyboardEvents } from 'dashboard/composables/useKeyboardEvents';
|
||||||
|
import { useRoute, useRouter } from 'dashboard/composables/route';
|
||||||
|
|
||||||
import PrimarySidebar from './sidebarComponents/Primary.vue';
|
import PrimarySidebar from './sidebarComponents/Primary.vue';
|
||||||
import SecondarySidebar from './sidebarComponents/Secondary.vue';
|
import SecondarySidebar from './sidebarComponents/Secondary.vue';
|
||||||
import keyboardEventListenerMixins from 'shared/mixins/keyboardEventListenerMixins';
|
import { routesWithPermissions } from '../../routes';
|
||||||
import router from '../../routes';
|
import {
|
||||||
|
getUserPermissions,
|
||||||
|
hasPermissions,
|
||||||
|
} from '../../helper/permissionsHelper';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
PrimarySidebar,
|
PrimarySidebar,
|
||||||
SecondarySidebar,
|
SecondarySidebar,
|
||||||
},
|
},
|
||||||
mixins: [adminMixin, alertMixin, keyboardEventListenerMixins],
|
|
||||||
props: {
|
props: {
|
||||||
showSecondarySidebar: {
|
showSecondarySidebar: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -55,6 +27,50 @@ export default {
|
|||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const toggleKeyShortcutModal = () => {
|
||||||
|
emit('openKeyShortcutModal');
|
||||||
|
};
|
||||||
|
const closeKeyShortcutModal = () => {
|
||||||
|
emit('closeKeyShortcutModal');
|
||||||
|
};
|
||||||
|
const isCurrentRouteSameAsNavigation = routeName => {
|
||||||
|
return route.name === routeName;
|
||||||
|
};
|
||||||
|
const navigateToRoute = routeName => {
|
||||||
|
if (!isCurrentRouteSameAsNavigation(routeName)) {
|
||||||
|
router.push({ name: routeName });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const keyboardEvents = {
|
||||||
|
'$mod+Slash': {
|
||||||
|
action: toggleKeyShortcutModal,
|
||||||
|
},
|
||||||
|
'$mod+Escape': {
|
||||||
|
action: closeKeyShortcutModal,
|
||||||
|
},
|
||||||
|
'Alt+KeyC': {
|
||||||
|
action: () => navigateToRoute('home'),
|
||||||
|
},
|
||||||
|
'Alt+KeyV': {
|
||||||
|
action: () => navigateToRoute('contacts_dashboard'),
|
||||||
|
},
|
||||||
|
'Alt+KeyR': {
|
||||||
|
action: () => navigateToRoute('account_overview_reports'),
|
||||||
|
},
|
||||||
|
'Alt+KeyS': {
|
||||||
|
action: () => navigateToRoute('agent_list'),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
useKeyboardEvents(keyboardEvents);
|
||||||
|
|
||||||
|
return {
|
||||||
|
toggleKeyShortcutModal,
|
||||||
|
};
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showOptionsMenu: false,
|
showOptionsMenu: false,
|
||||||
@@ -64,7 +80,6 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
accountId: 'getCurrentAccountId',
|
accountId: 'getCurrentAccountId',
|
||||||
currentRole: 'getCurrentRole',
|
|
||||||
currentUser: 'getCurrentUser',
|
currentUser: 'getCurrentUser',
|
||||||
globalConfig: 'globalConfig/get',
|
globalConfig: 'globalConfig/get',
|
||||||
inboxes: 'inboxes/getInboxes',
|
inboxes: 'inboxes/getInboxes',
|
||||||
@@ -98,9 +113,16 @@ export default {
|
|||||||
return getSidebarItems(this.accountId);
|
return getSidebarItems(this.accountId);
|
||||||
},
|
},
|
||||||
primaryMenuItems() {
|
primaryMenuItems() {
|
||||||
|
const userPermissions = getUserPermissions(
|
||||||
|
this.currentUser,
|
||||||
|
this.accountId
|
||||||
|
);
|
||||||
const menuItems = this.sideMenuConfig.primaryMenu;
|
const menuItems = this.sideMenuConfig.primaryMenu;
|
||||||
return menuItems.filter(menuItem => {
|
return menuItems.filter(menuItem => {
|
||||||
const isAvailableForTheUser = menuItem.roles.includes(this.currentRole);
|
const isAvailableForTheUser = hasPermissions(
|
||||||
|
routesWithPermissions[menuItem.toStateName],
|
||||||
|
userPermissions
|
||||||
|
);
|
||||||
|
|
||||||
if (!isAvailableForTheUser) {
|
if (!isAvailableForTheUser) {
|
||||||
return false;
|
return false;
|
||||||
@@ -159,50 +181,48 @@ export default {
|
|||||||
this.$store.dispatch('customViews/get', this.activeCustomView);
|
this.$store.dispatch('customViews/get', this.activeCustomView);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggleKeyShortcutModal() {
|
|
||||||
this.$emit('open-key-shortcut-modal');
|
|
||||||
},
|
|
||||||
closeKeyShortcutModal() {
|
|
||||||
this.$emit('close-key-shortcut-modal');
|
|
||||||
},
|
|
||||||
getKeyboardEvents() {
|
|
||||||
return {
|
|
||||||
'$mod+Slash': this.toggleKeyShortcutModal,
|
|
||||||
'$mod+Escape': this.closeKeyShortcutModal,
|
|
||||||
'Alt+KeyC': {
|
|
||||||
action: () => this.navigateToRoute('home'),
|
|
||||||
},
|
|
||||||
'Alt+KeyV': {
|
|
||||||
action: () => this.navigateToRoute('contacts_dashboard'),
|
|
||||||
},
|
|
||||||
'Alt+KeyR': {
|
|
||||||
action: () => this.navigateToRoute('account_overview_reports'),
|
|
||||||
},
|
|
||||||
'Alt+KeyS': {
|
|
||||||
action: () => this.navigateToRoute('agent_list'),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
navigateToRoute(routeName) {
|
|
||||||
if (!this.isCurrentRouteSameAsNavigation(routeName)) {
|
|
||||||
router.push({ name: routeName });
|
|
||||||
}
|
|
||||||
},
|
|
||||||
isCurrentRouteSameAsNavigation(routeName) {
|
|
||||||
return this.$route.name === routeName;
|
|
||||||
},
|
|
||||||
toggleSupportChatWindow() {
|
toggleSupportChatWindow() {
|
||||||
window.$chatwoot.toggle();
|
window.$chatwoot.toggle();
|
||||||
},
|
},
|
||||||
toggleAccountModal() {
|
toggleAccountModal() {
|
||||||
this.$emit('toggle-account-modal');
|
this.$emit('toggleAccountModal');
|
||||||
},
|
},
|
||||||
showAddLabelPopup() {
|
showAddLabelPopup() {
|
||||||
this.$emit('show-add-label-popup');
|
this.$emit('showAddLabelPopup');
|
||||||
},
|
},
|
||||||
openNotificationPanel() {
|
openNotificationPanel() {
|
||||||
this.$emit('open-notification-panel');
|
this.$emit('openNotificationPanel');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<aside class="flex h-full">
|
||||||
|
<PrimarySidebar
|
||||||
|
:logo-source="globalConfig.logoThumbnail"
|
||||||
|
:installation-name="globalConfig.installationName"
|
||||||
|
:is-a-custom-branded-instance="isACustomBrandedInstance"
|
||||||
|
:account-id="accountId"
|
||||||
|
:menu-items="primaryMenuItems"
|
||||||
|
:active-menu-item="activePrimaryMenu.key"
|
||||||
|
@toggleAccounts="toggleAccountModal"
|
||||||
|
@openKeyShortcutModal="toggleKeyShortcutModal"
|
||||||
|
@openNotificationPanel="openNotificationPanel"
|
||||||
|
/>
|
||||||
|
<SecondarySidebar
|
||||||
|
v-if="showSecondarySidebar"
|
||||||
|
:class="sidebarClassName"
|
||||||
|
:account-id="accountId"
|
||||||
|
:inboxes="inboxes"
|
||||||
|
:labels="labels"
|
||||||
|
:teams="teams"
|
||||||
|
:custom-views="customViews"
|
||||||
|
:menu-config="activeSecondaryMenu"
|
||||||
|
:current-user="currentUser"
|
||||||
|
:is-on-chatwoot-cloud="isOnChatwootCloud"
|
||||||
|
@addLabel="showAddLabelPopup"
|
||||||
|
@toggleAccounts="toggleAccountModal"
|
||||||
|
/>
|
||||||
|
</aside>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ const primaryMenuItems = accountId => [
|
|||||||
featureFlag: FEATURE_FLAGS.INBOX_VIEW,
|
featureFlag: FEATURE_FLAGS.INBOX_VIEW,
|
||||||
toState: frontendURL(`accounts/${accountId}/inbox-view`),
|
toState: frontendURL(`accounts/${accountId}/inbox-view`),
|
||||||
toStateName: 'inbox_view',
|
toStateName: 'inbox_view',
|
||||||
roles: ['administrator', 'agent'],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'chat',
|
icon: 'chat',
|
||||||
@@ -17,7 +16,14 @@ const primaryMenuItems = accountId => [
|
|||||||
label: 'CONVERSATIONS',
|
label: 'CONVERSATIONS',
|
||||||
toState: frontendURL(`accounts/${accountId}/dashboard`),
|
toState: frontendURL(`accounts/${accountId}/dashboard`),
|
||||||
toStateName: 'home',
|
toStateName: 'home',
|
||||||
roles: ['administrator', 'agent'],
|
},
|
||||||
|
{
|
||||||
|
icon: 'captain',
|
||||||
|
key: 'captain',
|
||||||
|
label: 'CAPTAIN',
|
||||||
|
featureFlag: FEATURE_FLAGS.CAPTAIN,
|
||||||
|
toState: frontendURL(`accounts/${accountId}/captain`),
|
||||||
|
toStateName: 'captain',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'book-contacts',
|
icon: 'book-contacts',
|
||||||
@@ -26,7 +32,6 @@ const primaryMenuItems = accountId => [
|
|||||||
featureFlag: FEATURE_FLAGS.CRM,
|
featureFlag: FEATURE_FLAGS.CRM,
|
||||||
toState: frontendURL(`accounts/${accountId}/contacts`),
|
toState: frontendURL(`accounts/${accountId}/contacts`),
|
||||||
toStateName: 'contacts_dashboard',
|
toStateName: 'contacts_dashboard',
|
||||||
roles: ['administrator', 'agent'],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'arrow-trending-lines',
|
icon: 'arrow-trending-lines',
|
||||||
@@ -34,8 +39,7 @@ const primaryMenuItems = accountId => [
|
|||||||
label: 'REPORTS',
|
label: 'REPORTS',
|
||||||
featureFlag: FEATURE_FLAGS.REPORTS,
|
featureFlag: FEATURE_FLAGS.REPORTS,
|
||||||
toState: frontendURL(`accounts/${accountId}/reports`),
|
toState: frontendURL(`accounts/${accountId}/reports`),
|
||||||
toStateName: 'settings_account_reports',
|
toStateName: 'account_overview_reports',
|
||||||
roles: ['administrator'],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'megaphone',
|
icon: 'megaphone',
|
||||||
@@ -44,7 +48,6 @@ const primaryMenuItems = accountId => [
|
|||||||
featureFlag: FEATURE_FLAGS.CAMPAIGNS,
|
featureFlag: FEATURE_FLAGS.CAMPAIGNS,
|
||||||
toState: frontendURL(`accounts/${accountId}/campaigns`),
|
toState: frontendURL(`accounts/${accountId}/campaigns`),
|
||||||
toStateName: 'ongoing_campaigns',
|
toStateName: 'ongoing_campaigns',
|
||||||
roles: ['administrator'],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'library',
|
icon: 'library',
|
||||||
@@ -54,7 +57,6 @@ const primaryMenuItems = accountId => [
|
|||||||
alwaysVisibleOnChatwootInstances: true,
|
alwaysVisibleOnChatwootInstances: true,
|
||||||
toState: frontendURL(`accounts/${accountId}/portals`),
|
toState: frontendURL(`accounts/${accountId}/portals`),
|
||||||
toStateName: 'default_portal_articles',
|
toStateName: 'default_portal_articles',
|
||||||
roles: ['administrator'],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'settings',
|
icon: 'settings',
|
||||||
@@ -62,7 +64,6 @@ const primaryMenuItems = accountId => [
|
|||||||
label: 'SETTINGS',
|
label: 'SETTINGS',
|
||||||
toState: frontendURL(`accounts/${accountId}/settings`),
|
toState: frontendURL(`accounts/${accountId}/settings`),
|
||||||
toStateName: 'settings_home',
|
toStateName: 'settings_home',
|
||||||
roles: ['administrator', 'agent'],
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ const settings = accountId => ({
|
|||||||
'settings_inbox_list',
|
'settings_inbox_list',
|
||||||
'settings_inbox_new',
|
'settings_inbox_new',
|
||||||
'settings_inbox_show',
|
'settings_inbox_show',
|
||||||
'settings_inbox',
|
|
||||||
'settings_inboxes_add_agents',
|
'settings_inboxes_add_agents',
|
||||||
'settings_inboxes_page_channel',
|
'settings_inboxes_page_channel',
|
||||||
'settings_integrations_dashboard_apps',
|
'settings_integrations_dashboard_apps',
|
||||||
@@ -40,12 +39,16 @@ const settings = accountId => ({
|
|||||||
'settings_teams_list',
|
'settings_teams_list',
|
||||||
'settings_teams_new',
|
'settings_teams_new',
|
||||||
'sla_list',
|
'sla_list',
|
||||||
|
'custom_roles_list',
|
||||||
],
|
],
|
||||||
menuItems: [
|
menuItems: [
|
||||||
{
|
{
|
||||||
icon: 'briefcase',
|
icon: 'briefcase',
|
||||||
label: 'ACCOUNT_SETTINGS',
|
label: 'ACCOUNT_SETTINGS',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/general`),
|
toState: frontendURL(`accounts/${accountId}/settings/general`),
|
||||||
toStateName: 'general_settings_index',
|
toStateName: 'general_settings_index',
|
||||||
},
|
},
|
||||||
@@ -53,6 +56,9 @@ const settings = accountId => ({
|
|||||||
icon: 'people',
|
icon: 'people',
|
||||||
label: 'AGENTS',
|
label: 'AGENTS',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/agents/list`),
|
toState: frontendURL(`accounts/${accountId}/settings/agents/list`),
|
||||||
toStateName: 'agent_list',
|
toStateName: 'agent_list',
|
||||||
featureFlag: FEATURE_FLAGS.AGENT_MANAGEMENT,
|
featureFlag: FEATURE_FLAGS.AGENT_MANAGEMENT,
|
||||||
@@ -61,6 +67,9 @@ const settings = accountId => ({
|
|||||||
icon: 'people-team',
|
icon: 'people-team',
|
||||||
label: 'TEAMS',
|
label: 'TEAMS',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/teams/list`),
|
toState: frontendURL(`accounts/${accountId}/settings/teams/list`),
|
||||||
toStateName: 'settings_teams_list',
|
toStateName: 'settings_teams_list',
|
||||||
featureFlag: FEATURE_FLAGS.TEAM_MANAGEMENT,
|
featureFlag: FEATURE_FLAGS.TEAM_MANAGEMENT,
|
||||||
@@ -69,6 +78,9 @@ const settings = accountId => ({
|
|||||||
icon: 'mail-inbox-all',
|
icon: 'mail-inbox-all',
|
||||||
label: 'INBOXES',
|
label: 'INBOXES',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/inboxes/list`),
|
toState: frontendURL(`accounts/${accountId}/settings/inboxes/list`),
|
||||||
toStateName: 'settings_inbox_list',
|
toStateName: 'settings_inbox_list',
|
||||||
featureFlag: FEATURE_FLAGS.INBOX_MANAGEMENT,
|
featureFlag: FEATURE_FLAGS.INBOX_MANAGEMENT,
|
||||||
@@ -77,6 +89,9 @@ const settings = accountId => ({
|
|||||||
icon: 'tag',
|
icon: 'tag',
|
||||||
label: 'LABELS',
|
label: 'LABELS',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/labels/list`),
|
toState: frontendURL(`accounts/${accountId}/settings/labels/list`),
|
||||||
toStateName: 'labels_list',
|
toStateName: 'labels_list',
|
||||||
featureFlag: FEATURE_FLAGS.LABELS,
|
featureFlag: FEATURE_FLAGS.LABELS,
|
||||||
@@ -85,6 +100,9 @@ const settings = accountId => ({
|
|||||||
icon: 'code',
|
icon: 'code',
|
||||||
label: 'CUSTOM_ATTRIBUTES',
|
label: 'CUSTOM_ATTRIBUTES',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
toState: frontendURL(
|
toState: frontendURL(
|
||||||
`accounts/${accountId}/settings/custom-attributes/list`
|
`accounts/${accountId}/settings/custom-attributes/list`
|
||||||
),
|
),
|
||||||
@@ -95,6 +113,9 @@ const settings = accountId => ({
|
|||||||
icon: 'automation',
|
icon: 'automation',
|
||||||
label: 'AUTOMATION',
|
label: 'AUTOMATION',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/automation/list`),
|
toState: frontendURL(`accounts/${accountId}/settings/automation/list`),
|
||||||
toStateName: 'automation_list',
|
toStateName: 'automation_list',
|
||||||
featureFlag: FEATURE_FLAGS.AUTOMATIONS,
|
featureFlag: FEATURE_FLAGS.AUTOMATIONS,
|
||||||
@@ -103,6 +124,9 @@ const settings = accountId => ({
|
|||||||
icon: 'bot',
|
icon: 'bot',
|
||||||
label: 'AGENT_BOTS',
|
label: 'AGENT_BOTS',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
globalConfigFlag: 'csmlEditorHost',
|
globalConfigFlag: 'csmlEditorHost',
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/agent-bots`),
|
toState: frontendURL(`accounts/${accountId}/settings/agent-bots`),
|
||||||
toStateName: 'agent_bots',
|
toStateName: 'agent_bots',
|
||||||
@@ -112,6 +136,9 @@ const settings = accountId => ({
|
|||||||
icon: 'flash-settings',
|
icon: 'flash-settings',
|
||||||
label: 'MACROS',
|
label: 'MACROS',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator', 'agent'],
|
||||||
|
},
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/macros`),
|
toState: frontendURL(`accounts/${accountId}/settings/macros`),
|
||||||
toStateName: 'macros_wrapper',
|
toStateName: 'macros_wrapper',
|
||||||
featureFlag: FEATURE_FLAGS.MACROS,
|
featureFlag: FEATURE_FLAGS.MACROS,
|
||||||
@@ -120,6 +147,9 @@ const settings = accountId => ({
|
|||||||
icon: 'chat-multiple',
|
icon: 'chat-multiple',
|
||||||
label: 'CANNED_RESPONSES',
|
label: 'CANNED_RESPONSES',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator', 'agent'],
|
||||||
|
},
|
||||||
toState: frontendURL(
|
toState: frontendURL(
|
||||||
`accounts/${accountId}/settings/canned-response/list`
|
`accounts/${accountId}/settings/canned-response/list`
|
||||||
),
|
),
|
||||||
@@ -130,15 +160,10 @@ const settings = accountId => ({
|
|||||||
icon: 'flash-on',
|
icon: 'flash-on',
|
||||||
label: 'INTEGRATIONS',
|
label: 'INTEGRATIONS',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/integrations`),
|
toState: frontendURL(`accounts/${accountId}/settings/integrations`),
|
||||||
toStateName: 'settings_integrations',
|
|
||||||
featureFlag: FEATURE_FLAGS.INTEGRATIONS,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'star-emphasis',
|
|
||||||
label: 'APPLICATIONS',
|
|
||||||
hasSubMenu: false,
|
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/applications`),
|
|
||||||
toStateName: 'settings_applications',
|
toStateName: 'settings_applications',
|
||||||
featureFlag: FEATURE_FLAGS.INTEGRATIONS,
|
featureFlag: FEATURE_FLAGS.INTEGRATIONS,
|
||||||
},
|
},
|
||||||
@@ -146,16 +171,33 @@ const settings = accountId => ({
|
|||||||
icon: 'key',
|
icon: 'key',
|
||||||
label: 'AUDIT_LOGS',
|
label: 'AUDIT_LOGS',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/audit-log/list`),
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
|
toState: frontendURL(`accounts/${accountId}/settings/audit-logs/list`),
|
||||||
toStateName: 'auditlogs_list',
|
toStateName: 'auditlogs_list',
|
||||||
isEnterpriseOnly: true,
|
isEnterpriseOnly: true,
|
||||||
featureFlag: FEATURE_FLAGS.AUDIT_LOGS,
|
featureFlag: FEATURE_FLAGS.AUDIT_LOGS,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'scan-person',
|
||||||
|
label: 'CUSTOM_ROLES',
|
||||||
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
|
toState: frontendURL(`accounts/${accountId}/settings/custom-roles/list`),
|
||||||
|
toStateName: 'custom_roles_list',
|
||||||
|
isEnterpriseOnly: true,
|
||||||
beta: true,
|
beta: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'document-list-clock',
|
icon: 'document-list-clock',
|
||||||
label: 'SLA',
|
label: 'SLA',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/sla/list`),
|
toState: frontendURL(`accounts/${accountId}/settings/sla/list`),
|
||||||
toStateName: 'sla_list',
|
toStateName: 'sla_list',
|
||||||
isEnterpriseOnly: true,
|
isEnterpriseOnly: true,
|
||||||
@@ -166,6 +208,9 @@ const settings = accountId => ({
|
|||||||
icon: 'credit-card-person',
|
icon: 'credit-card-person',
|
||||||
label: 'BILLING',
|
label: 'BILLING',
|
||||||
hasSubMenu: false,
|
hasSubMenu: false,
|
||||||
|
meta: {
|
||||||
|
permissions: ['administrator'],
|
||||||
|
},
|
||||||
toState: frontendURL(`accounts/${accountId}/settings/billing`),
|
toState: frontendURL(`accounts/${accountId}/settings/billing`),
|
||||||
toStateName: 'billing_settings_index',
|
toStateName: 'billing_settings_index',
|
||||||
showOnlyOnCloud: true,
|
showOnlyOnCloud: true,
|
||||||
|
|||||||
@@ -1,35 +1,3 @@
|
|||||||
<template>
|
|
||||||
<div
|
|
||||||
v-if="showShowCurrentAccountContext"
|
|
||||||
class="text-slate-700 dark:text-slate-200 rounded-md text-xs py-2 px-2 mt-2 relative border border-slate-50 dark:border-slate-800/50 hover:bg-slate-50 dark:hover:bg-slate-800 cursor-pointer"
|
|
||||||
@mouseover="setShowSwitch"
|
|
||||||
@mouseleave="resetShowSwitch"
|
|
||||||
>
|
|
||||||
{{ $t('SIDEBAR.CURRENTLY_VIEWING_ACCOUNT') }}
|
|
||||||
<p
|
|
||||||
class="text-ellipsis overflow-hidden whitespace-nowrap font-medium mb-0 text-slate-800 dark:text-slate-100"
|
|
||||||
>
|
|
||||||
{{ account.name }}
|
|
||||||
</p>
|
|
||||||
<transition name="fade">
|
|
||||||
<div
|
|
||||||
v-if="showSwitchButton"
|
|
||||||
class="ltr:overlay-shadow ltr:dark:overlay-shadow-dark rtl:rtl-overlay-shadow rtl:dark:rtl-overlay-shadow-dark flex items-center h-full rounded-md justify-end absolute top-0 right-0 w-full"
|
|
||||||
>
|
|
||||||
<div class="my-0 mx-2">
|
|
||||||
<woot-button
|
|
||||||
variant="clear"
|
|
||||||
size="tiny"
|
|
||||||
icon="arrow-swap"
|
|
||||||
@click="$emit('toggle-accounts')"
|
|
||||||
>
|
|
||||||
{{ $t('SIDEBAR.SWITCH') }}
|
|
||||||
</woot-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
@@ -56,6 +24,40 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
v-if="showShowCurrentAccountContext"
|
||||||
|
class="relative px-2 py-2 mt-2 text-xs border rounded-md cursor-pointer text-slate-700 dark:text-slate-200 border-slate-50 dark:border-slate-800/50 hover:bg-slate-50 dark:hover:bg-slate-800"
|
||||||
|
@mouseover="setShowSwitch"
|
||||||
|
@mouseleave="resetShowSwitch"
|
||||||
|
>
|
||||||
|
{{ $t('SIDEBAR.CURRENTLY_VIEWING_ACCOUNT') }}
|
||||||
|
<p
|
||||||
|
class="mb-0 overflow-hidden font-medium text-ellipsis whitespace-nowrap text-slate-800 dark:text-slate-100"
|
||||||
|
>
|
||||||
|
{{ account.name }}
|
||||||
|
</p>
|
||||||
|
<transition name="fade">
|
||||||
|
<div
|
||||||
|
v-if="showSwitchButton"
|
||||||
|
class="absolute top-0 right-0 flex items-center justify-end w-full h-full rounded-md ltr:overlay-shadow ltr:dark:overlay-shadow-dark rtl:rtl-overlay-shadow rtl:dark:rtl-overlay-shadow-dark"
|
||||||
|
>
|
||||||
|
<div class="mx-2 my-0">
|
||||||
|
<woot-button
|
||||||
|
variant="clear"
|
||||||
|
size="tiny"
|
||||||
|
icon="arrow-swap"
|
||||||
|
@click="$emit('toggleAccounts')"
|
||||||
|
>
|
||||||
|
{{ $t('SIDEBAR.SWITCH') }}
|
||||||
|
</woot-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@layer components {
|
@layer components {
|
||||||
|
|||||||
@@ -1,62 +1,3 @@
|
|||||||
<template>
|
|
||||||
<woot-modal
|
|
||||||
:show="showAccountModal"
|
|
||||||
:on-close="() => $emit('close-account-modal')"
|
|
||||||
>
|
|
||||||
<woot-modal-header
|
|
||||||
:header-title="$t('SIDEBAR_ITEMS.CHANGE_ACCOUNTS')"
|
|
||||||
:header-content="$t('SIDEBAR_ITEMS.SELECTOR_SUBTITLE')"
|
|
||||||
/>
|
|
||||||
<div class="px-8 py-4">
|
|
||||||
<div
|
|
||||||
v-for="account in currentUser.accounts"
|
|
||||||
:id="`account-${account.id}`"
|
|
||||||
:key="account.id"
|
|
||||||
class="pt-0 pb-0"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
class="flex justify-between items-center expanded clear link cursor-pointer px-4 py-3 w-full rounded-lg hover:underline hover:bg-slate-25 dark:hover:bg-slate-900"
|
|
||||||
@click="onChangeAccount(account.id)"
|
|
||||||
>
|
|
||||||
<span class="w-full">
|
|
||||||
<label :for="account.name" class="text-left rtl:text-right">
|
|
||||||
<div
|
|
||||||
class="text-slate-700 text-lg dark:text-slate-100 font-medium hover:underline-offset-4 leading-5"
|
|
||||||
>
|
|
||||||
{{ account.name }}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="text-slate-500 text-xs dark:text-slate-500 font-medium hover:underline-offset-4"
|
|
||||||
>
|
|
||||||
{{ account.role }}
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</span>
|
|
||||||
<fluent-icon
|
|
||||||
v-show="account.id === accountId"
|
|
||||||
class="text-slate-800 dark:text-slate-100"
|
|
||||||
icon="checkmark-circle"
|
|
||||||
type="solid"
|
|
||||||
size="24"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
v-if="globalConfig.createNewAccountFromDashboard"
|
|
||||||
class="flex justify-end items-center px-8 pb-8 pt-4 gap-2"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
class="button success large expanded nice w-full"
|
|
||||||
@click="$emit('show-create-account-modal')"
|
|
||||||
>
|
|
||||||
{{ $t('CREATE_ACCOUNT.NEW_ACCOUNT') }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</woot-modal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
@@ -82,3 +23,66 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<woot-modal
|
||||||
|
:show="showAccountModal"
|
||||||
|
:on-close="() => $emit('closeAccountModal')"
|
||||||
|
>
|
||||||
|
<woot-modal-header
|
||||||
|
:header-title="$t('SIDEBAR_ITEMS.CHANGE_ACCOUNTS')"
|
||||||
|
:header-content="$t('SIDEBAR_ITEMS.SELECTOR_SUBTITLE')"
|
||||||
|
/>
|
||||||
|
<div class="px-8 py-4">
|
||||||
|
<div
|
||||||
|
v-for="account in currentUser.accounts"
|
||||||
|
:id="`account-${account.id}`"
|
||||||
|
:key="account.id"
|
||||||
|
class="pt-0 pb-0"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
class="flex items-center justify-between w-full px-4 py-3 rounded-lg cursor-pointer expanded clear link hover:underline hover:bg-slate-25 dark:hover:bg-slate-900"
|
||||||
|
@click="onChangeAccount(account.id)"
|
||||||
|
>
|
||||||
|
<span class="w-full">
|
||||||
|
<label :for="account.name" class="text-left rtl:text-right">
|
||||||
|
<div
|
||||||
|
class="text-lg font-medium leading-5 text-slate-700 dark:text-slate-100 hover:underline-offset-4"
|
||||||
|
>
|
||||||
|
{{ account.name }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="text-xs font-medium lowercase text-slate-500 dark:text-slate-500 hover:underline-offset-4"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
account.custom_role_id
|
||||||
|
? account.custom_role.name
|
||||||
|
: account.role
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</span>
|
||||||
|
<fluent-icon
|
||||||
|
v-show="account.id === accountId"
|
||||||
|
class="text-slate-800 dark:text-slate-100"
|
||||||
|
icon="checkmark-circle"
|
||||||
|
type="solid"
|
||||||
|
size="24"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="globalConfig.createNewAccountFromDashboard"
|
||||||
|
class="flex items-center justify-end gap-2 px-8 pt-4 pb-8"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
class="w-full button success large expanded nice"
|
||||||
|
@click="$emit('showCreateAccountModal')"
|
||||||
|
>
|
||||||
|
{{ $t('CREATE_ACCOUNT.NEW_ACCOUNT') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</woot-modal>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,60 +1,10 @@
|
|||||||
<template>
|
|
||||||
<woot-modal
|
|
||||||
:show="show"
|
|
||||||
:on-close="() => $emit('close-account-create-modal')"
|
|
||||||
>
|
|
||||||
<div class="h-auto overflow-auto flex flex-col">
|
|
||||||
<woot-modal-header
|
|
||||||
:header-title="$t('CREATE_ACCOUNT.NEW_ACCOUNT')"
|
|
||||||
:header-content="$t('CREATE_ACCOUNT.SELECTOR_SUBTITLE')"
|
|
||||||
/>
|
|
||||||
<div v-if="!hasAccounts" class="text-sm mt-6 mx-8 mb-0">
|
|
||||||
<div class="items-center rounded-md flex alert">
|
|
||||||
<div class="ml-1 mr-3">
|
|
||||||
<fluent-icon icon="warning" />
|
|
||||||
</div>
|
|
||||||
{{ $t('CREATE_ACCOUNT.NO_ACCOUNT_WARNING') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form class="flex flex-col w-full" @submit.prevent="addAccount">
|
|
||||||
<div class="w-full">
|
|
||||||
<label :class="{ error: $v.accountName.$error }">
|
|
||||||
{{ $t('CREATE_ACCOUNT.FORM.NAME.LABEL') }}
|
|
||||||
<input
|
|
||||||
v-model.trim="accountName"
|
|
||||||
type="text"
|
|
||||||
:placeholder="$t('CREATE_ACCOUNT.FORM.NAME.PLACEHOLDER')"
|
|
||||||
@input="$v.accountName.$touch"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="w-full">
|
|
||||||
<div class="w-full">
|
|
||||||
<woot-submit-button
|
|
||||||
:disabled="
|
|
||||||
$v.accountName.$invalid ||
|
|
||||||
$v.accountName.$invalid ||
|
|
||||||
uiFlags.isCreating
|
|
||||||
"
|
|
||||||
:button-text="$t('CREATE_ACCOUNT.FORM.SUBMIT')"
|
|
||||||
:loading="uiFlags.isCreating"
|
|
||||||
button-class="large expanded"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</woot-modal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { required, minLength } from 'vuelidate/lib/validators';
|
import { useVuelidate } from '@vuelidate/core';
|
||||||
|
import { required, minLength } from '@vuelidate/validators';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import alertMixin from 'shared/mixins/alertMixin';
|
import { useAlert } from 'dashboard/composables';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [alertMixin],
|
|
||||||
props: {
|
props: {
|
||||||
show: {
|
show: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -65,6 +15,9 @@ export default {
|
|||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
setup() {
|
||||||
|
return { v$: useVuelidate() };
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
accountName: '',
|
accountName: '',
|
||||||
@@ -87,17 +40,64 @@ export default {
|
|||||||
const account_id = await this.$store.dispatch('accounts/create', {
|
const account_id = await this.$store.dispatch('accounts/create', {
|
||||||
account_name: this.accountName,
|
account_name: this.accountName,
|
||||||
});
|
});
|
||||||
this.$emit('close-account-create-modal');
|
this.$emit('closeAccountCreateModal');
|
||||||
this.showAlert(this.$t('CREATE_ACCOUNT.API.SUCCESS_MESSAGE'));
|
useAlert(this.$t('CREATE_ACCOUNT.API.SUCCESS_MESSAGE'));
|
||||||
window.location = `/app/accounts/${account_id}/dashboard`;
|
window.location = `/app/accounts/${account_id}/dashboard`;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response.status === 422) {
|
if (error.response.status === 422) {
|
||||||
this.showAlert(this.$t('CREATE_ACCOUNT.API.EXIST_MESSAGE'));
|
useAlert(this.$t('CREATE_ACCOUNT.API.EXIST_MESSAGE'));
|
||||||
} else {
|
} else {
|
||||||
this.showAlert(this.$t('CREATE_ACCOUNT.API.ERROR_MESSAGE'));
|
useAlert(this.$t('CREATE_ACCOUNT.API.ERROR_MESSAGE'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<woot-modal :show="show" :on-close="() => $emit('closeAccountCreateModal')">
|
||||||
|
<div class="flex flex-col h-auto overflow-auto">
|
||||||
|
<woot-modal-header
|
||||||
|
:header-title="$t('CREATE_ACCOUNT.NEW_ACCOUNT')"
|
||||||
|
:header-content="$t('CREATE_ACCOUNT.SELECTOR_SUBTITLE')"
|
||||||
|
/>
|
||||||
|
<div v-if="!hasAccounts" class="mx-8 mt-6 mb-0 text-sm">
|
||||||
|
<div class="flex items-center rounded-md alert">
|
||||||
|
<div class="ml-1 mr-3">
|
||||||
|
<fluent-icon icon="warning" />
|
||||||
|
</div>
|
||||||
|
{{ $t('CREATE_ACCOUNT.NO_ACCOUNT_WARNING') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form class="flex flex-col w-full" @submit.prevent="addAccount">
|
||||||
|
<div class="w-full">
|
||||||
|
<label :class="{ error: v$.accountName.$error }">
|
||||||
|
{{ $t('CREATE_ACCOUNT.FORM.NAME.LABEL') }}
|
||||||
|
<input
|
||||||
|
v-model.trim="accountName"
|
||||||
|
type="text"
|
||||||
|
:placeholder="$t('CREATE_ACCOUNT.FORM.NAME.PLACEHOLDER')"
|
||||||
|
@input="v$.accountName.$touch"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="w-full">
|
||||||
|
<div class="w-full">
|
||||||
|
<woot-submit-button
|
||||||
|
:disabled="
|
||||||
|
v$.accountName.$invalid ||
|
||||||
|
v$.accountName.$invalid ||
|
||||||
|
uiFlags.isCreating
|
||||||
|
"
|
||||||
|
:button-text="$t('CREATE_ACCOUNT.FORM.SUBMIT')"
|
||||||
|
:loading="uiFlags.isCreating"
|
||||||
|
button-class="large expanded"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</woot-modal>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,19 +1,3 @@
|
|||||||
<template>
|
|
||||||
<woot-button
|
|
||||||
v-tooltip.right="$t(`SIDEBAR.PROFILE_SETTINGS`)"
|
|
||||||
variant="link"
|
|
||||||
class="items-center flex rounded-full"
|
|
||||||
@click="handleClick"
|
|
||||||
>
|
|
||||||
<thumbnail
|
|
||||||
:src="currentUser.avatar_url"
|
|
||||||
:username="currentUser.name"
|
|
||||||
:status="statusOfAgent"
|
|
||||||
should-show-status-always
|
|
||||||
size="32px"
|
|
||||||
/>
|
|
||||||
</woot-button>
|
|
||||||
</template>
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import Thumbnail from '../../widgets/Thumbnail.vue';
|
import Thumbnail from '../../widgets/Thumbnail.vue';
|
||||||
@@ -33,8 +17,25 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClick() {
|
handleClick() {
|
||||||
this.$emit('toggle-menu');
|
this.$emit('toggleMenu');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<woot-button
|
||||||
|
v-tooltip.right="$t(`SIDEBAR.PROFILE_SETTINGS`)"
|
||||||
|
variant="link"
|
||||||
|
class="flex items-center rounded-full"
|
||||||
|
@click="handleClick"
|
||||||
|
>
|
||||||
|
<Thumbnail
|
||||||
|
:src="currentUser.avatar_url"
|
||||||
|
:username="currentUser.name"
|
||||||
|
:status="statusOfAgent"
|
||||||
|
should-show-status-always
|
||||||
|
size="32px"
|
||||||
|
/>
|
||||||
|
</woot-button>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
<template>
|
|
||||||
<div class="w-8 h-8">
|
|
||||||
<router-link :to="dashboardPath" replace>
|
|
||||||
<img :src="source" :alt="name" />
|
|
||||||
</router-link>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
<script>
|
||||||
import { frontendURL } from 'dashboard/helper/URLHelper';
|
import { frontendURL } from 'dashboard/helper/URLHelper';
|
||||||
|
|
||||||
@@ -30,3 +23,11 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="w-8 h-8">
|
||||||
|
<router-link :to="dashboardPath" replace>
|
||||||
|
<img :src="source" :alt="name" />
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,7 +1,38 @@
|
|||||||
|
<script>
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
computed: {
|
||||||
|
...mapGetters({
|
||||||
|
notificationMetadata: 'notifications/getMeta',
|
||||||
|
}),
|
||||||
|
unreadCount() {
|
||||||
|
if (!this.notificationMetadata.unreadCount) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.notificationMetadata.unreadCount < 100
|
||||||
|
? `${this.notificationMetadata.unreadCount}`
|
||||||
|
: '99+';
|
||||||
|
},
|
||||||
|
isNotificationPanelActive() {
|
||||||
|
return this.$route.name === 'notifications_index';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
openNotificationPanel() {
|
||||||
|
if (this.$route.name !== 'notifications_index') {
|
||||||
|
this.$emit('openNotificationPanel');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<button
|
<button
|
||||||
class="text-slate-600 dark:text-slate-100 w-10 h-10 my-2 p-0 flex items-center justify-center rounded-lg hover:bg-slate-25 dark:hover:bg-slate-700 dark:hover:text-slate-100 hover:text-slate-600 relative"
|
class="relative flex items-center justify-center w-10 h-10 p-0 my-2 rounded-lg text-slate-600 dark:text-slate-100 hover:bg-slate-25 dark:hover:bg-slate-700 dark:hover:text-slate-100 hover:text-slate-600"
|
||||||
:class="{
|
:class="{
|
||||||
'bg-woot-50 dark:bg-slate-800 text-woot-500 hover:bg-woot-50':
|
'bg-woot-50 dark:bg-slate-800 text-woot-500 hover:bg-woot-50':
|
||||||
isNotificationPanelActive,
|
isNotificationPanelActive,
|
||||||
@@ -23,34 +54,3 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
computed: {
|
|
||||||
...mapGetters({
|
|
||||||
accountId: 'getCurrentAccountId',
|
|
||||||
notificationMetadata: 'notifications/getMeta',
|
|
||||||
}),
|
|
||||||
unreadCount() {
|
|
||||||
if (!this.notificationMetadata.unreadCount) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.notificationMetadata.unreadCount < 100
|
|
||||||
? `${this.notificationMetadata.unreadCount}`
|
|
||||||
: '99+';
|
|
||||||
},
|
|
||||||
isNotificationPanelActive() {
|
|
||||||
return this.$route.name === 'notifications_index';
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
openNotificationPanel() {
|
|
||||||
if (this.$route.name !== 'notifications_index') {
|
|
||||||
this.$emit('open-notification-panel');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -1,110 +1,3 @@
|
|||||||
<template>
|
|
||||||
<transition name="menu-slide">
|
|
||||||
<div
|
|
||||||
v-if="show"
|
|
||||||
v-on-clickaway="onClickAway"
|
|
||||||
class="left-3 rtl:left-auto rtl:right-3 bottom-16 w-64 absolute z-30 rounded-md shadow-xl bg-white dark:bg-slate-800 py-2 px-2 border border-slate-25 dark:border-slate-700"
|
|
||||||
:class="{ 'block visible': show }"
|
|
||||||
>
|
|
||||||
<availability-status />
|
|
||||||
<woot-dropdown-menu>
|
|
||||||
<woot-dropdown-item v-if="showChangeAccountOption">
|
|
||||||
<woot-button
|
|
||||||
variant="clear"
|
|
||||||
color-scheme="secondary"
|
|
||||||
size="small"
|
|
||||||
icon="arrow-swap"
|
|
||||||
@click="$emit('toggle-accounts')"
|
|
||||||
>
|
|
||||||
{{ $t('SIDEBAR_ITEMS.CHANGE_ACCOUNTS') }}
|
|
||||||
</woot-button>
|
|
||||||
</woot-dropdown-item>
|
|
||||||
<woot-dropdown-item v-if="globalConfig.chatwootInboxToken">
|
|
||||||
<woot-button
|
|
||||||
variant="clear"
|
|
||||||
color-scheme="secondary"
|
|
||||||
size="small"
|
|
||||||
icon="chat-help"
|
|
||||||
@click="$emit('show-support-chat-window')"
|
|
||||||
>
|
|
||||||
{{ $t('SIDEBAR_ITEMS.CONTACT_SUPPORT') }}
|
|
||||||
</woot-button>
|
|
||||||
</woot-dropdown-item>
|
|
||||||
<woot-dropdown-item>
|
|
||||||
<woot-button
|
|
||||||
variant="clear"
|
|
||||||
color-scheme="secondary"
|
|
||||||
size="small"
|
|
||||||
icon="keyboard"
|
|
||||||
@click="handleKeyboardHelpClick"
|
|
||||||
>
|
|
||||||
{{ $t('SIDEBAR_ITEMS.KEYBOARD_SHORTCUTS') }}
|
|
||||||
</woot-button>
|
|
||||||
</woot-dropdown-item>
|
|
||||||
<woot-dropdown-item>
|
|
||||||
<router-link
|
|
||||||
v-slot="{ href, isActive, navigate }"
|
|
||||||
:to="`/app/accounts/${accountId}/profile/settings`"
|
|
||||||
custom
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
:href="href"
|
|
||||||
class="button small clear secondary bg-white dark:bg-slate-800 h-8"
|
|
||||||
:class="{ 'is-active': isActive }"
|
|
||||||
@click="e => handleProfileSettingClick(e, navigate)"
|
|
||||||
>
|
|
||||||
<fluent-icon icon="person" size="14" class="icon icon--font" />
|
|
||||||
<span class="button__content">
|
|
||||||
{{ $t('SIDEBAR_ITEMS.PROFILE_SETTINGS') }}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</router-link>
|
|
||||||
</woot-dropdown-item>
|
|
||||||
<woot-dropdown-item>
|
|
||||||
<woot-button
|
|
||||||
variant="clear"
|
|
||||||
color-scheme="secondary"
|
|
||||||
size="small"
|
|
||||||
icon="appearance"
|
|
||||||
@click="openAppearanceOptions"
|
|
||||||
>
|
|
||||||
{{ $t('SIDEBAR_ITEMS.APPEARANCE') }}
|
|
||||||
</woot-button>
|
|
||||||
</woot-dropdown-item>
|
|
||||||
<woot-dropdown-item v-if="currentUser.type === 'SuperAdmin'">
|
|
||||||
<a
|
|
||||||
href="/super_admin"
|
|
||||||
class="button small clear secondary bg-white dark:bg-slate-800 h-8"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener nofollow noreferrer"
|
|
||||||
@click="$emit('close')"
|
|
||||||
>
|
|
||||||
<fluent-icon
|
|
||||||
icon="content-settings"
|
|
||||||
size="14"
|
|
||||||
class="icon icon--font"
|
|
||||||
/>
|
|
||||||
<span class="button__content">
|
|
||||||
{{ $t('SIDEBAR_ITEMS.SUPER_ADMIN_CONSOLE') }}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</woot-dropdown-item>
|
|
||||||
<woot-dropdown-item>
|
|
||||||
<woot-button
|
|
||||||
variant="clear"
|
|
||||||
color-scheme="secondary"
|
|
||||||
size="small"
|
|
||||||
icon="power"
|
|
||||||
@click="logout"
|
|
||||||
>
|
|
||||||
{{ $t('SIDEBAR_ITEMS.LOGOUT') }}
|
|
||||||
</woot-button>
|
|
||||||
</woot-dropdown-item>
|
|
||||||
</woot-dropdown-menu>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import Auth from '../../../api/auth';
|
import Auth from '../../../api/auth';
|
||||||
@@ -145,7 +38,7 @@ export default {
|
|||||||
navigate(e);
|
navigate(e);
|
||||||
},
|
},
|
||||||
handleKeyboardHelpClick() {
|
handleKeyboardHelpClick() {
|
||||||
this.$emit('key-shortcut-modal');
|
this.$emit('openKeyShortcutModal');
|
||||||
this.$emit('close');
|
this.$emit('close');
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
@@ -161,3 +54,110 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<transition name="menu-slide">
|
||||||
|
<div
|
||||||
|
v-if="show"
|
||||||
|
v-on-clickaway="onClickAway"
|
||||||
|
class="absolute z-30 w-64 px-2 py-2 bg-white border rounded-md shadow-xl left-3 rtl:left-auto rtl:right-3 bottom-16 dark:bg-slate-800 border-slate-25 dark:border-slate-700"
|
||||||
|
:class="{ 'block visible': show }"
|
||||||
|
>
|
||||||
|
<AvailabilityStatus />
|
||||||
|
<WootDropdownMenu>
|
||||||
|
<WootDropdownItem v-if="showChangeAccountOption">
|
||||||
|
<woot-button
|
||||||
|
variant="clear"
|
||||||
|
color-scheme="secondary"
|
||||||
|
size="small"
|
||||||
|
icon="arrow-swap"
|
||||||
|
@click="$emit('toggleAccounts')"
|
||||||
|
>
|
||||||
|
{{ $t('SIDEBAR_ITEMS.CHANGE_ACCOUNTS') }}
|
||||||
|
</woot-button>
|
||||||
|
</WootDropdownItem>
|
||||||
|
<WootDropdownItem v-if="globalConfig.chatwootInboxToken">
|
||||||
|
<woot-button
|
||||||
|
variant="clear"
|
||||||
|
color-scheme="secondary"
|
||||||
|
size="small"
|
||||||
|
icon="chat-help"
|
||||||
|
@click="$emit('showSupportChatWindow')"
|
||||||
|
>
|
||||||
|
{{ $t('SIDEBAR_ITEMS.CONTACT_SUPPORT') }}
|
||||||
|
</woot-button>
|
||||||
|
</WootDropdownItem>
|
||||||
|
<WootDropdownItem>
|
||||||
|
<woot-button
|
||||||
|
variant="clear"
|
||||||
|
color-scheme="secondary"
|
||||||
|
size="small"
|
||||||
|
icon="keyboard"
|
||||||
|
@click="handleKeyboardHelpClick"
|
||||||
|
>
|
||||||
|
{{ $t('SIDEBAR_ITEMS.KEYBOARD_SHORTCUTS') }}
|
||||||
|
</woot-button>
|
||||||
|
</WootDropdownItem>
|
||||||
|
<WootDropdownItem>
|
||||||
|
<router-link
|
||||||
|
v-slot="{ href, isActive, navigate }"
|
||||||
|
:to="`/app/accounts/${accountId}/profile/settings`"
|
||||||
|
custom
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
:href="href"
|
||||||
|
class="h-8 bg-white button small clear secondary dark:bg-slate-800"
|
||||||
|
:class="{ 'is-active': isActive }"
|
||||||
|
@click="e => handleProfileSettingClick(e, navigate)"
|
||||||
|
>
|
||||||
|
<fluent-icon icon="person" size="14" class="icon icon--font" />
|
||||||
|
<span class="button__content">
|
||||||
|
{{ $t('SIDEBAR_ITEMS.PROFILE_SETTINGS') }}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</router-link>
|
||||||
|
</WootDropdownItem>
|
||||||
|
<WootDropdownItem>
|
||||||
|
<woot-button
|
||||||
|
variant="clear"
|
||||||
|
color-scheme="secondary"
|
||||||
|
size="small"
|
||||||
|
icon="appearance"
|
||||||
|
@click="openAppearanceOptions"
|
||||||
|
>
|
||||||
|
{{ $t('SIDEBAR_ITEMS.APPEARANCE') }}
|
||||||
|
</woot-button>
|
||||||
|
</WootDropdownItem>
|
||||||
|
<WootDropdownItem v-if="currentUser.type === 'SuperAdmin'">
|
||||||
|
<a
|
||||||
|
href="/super_admin"
|
||||||
|
class="h-8 bg-white button small clear secondary dark:bg-slate-800"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener nofollow noreferrer"
|
||||||
|
@click="$emit('close')"
|
||||||
|
>
|
||||||
|
<fluent-icon
|
||||||
|
icon="content-settings"
|
||||||
|
size="14"
|
||||||
|
class="icon icon--font"
|
||||||
|
/>
|
||||||
|
<span class="button__content">
|
||||||
|
{{ $t('SIDEBAR_ITEMS.SUPER_ADMIN_CONSOLE') }}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</WootDropdownItem>
|
||||||
|
<WootDropdownItem>
|
||||||
|
<woot-button
|
||||||
|
variant="clear"
|
||||||
|
color-scheme="secondary"
|
||||||
|
size="small"
|
||||||
|
icon="power"
|
||||||
|
@click="logout"
|
||||||
|
>
|
||||||
|
{{ $t('SIDEBAR_ITEMS.LOGOUT') }}
|
||||||
|
</woot-button>
|
||||||
|
</WootDropdownItem>
|
||||||
|
</WootDropdownMenu>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,43 +1,3 @@
|
|||||||
<template>
|
|
||||||
<div
|
|
||||||
class="h-full w-16 bg-white dark:bg-slate-900 border-r border-slate-50 dark:border-slate-800/50 rtl:border-l rtl:border-r-0 flex justify-between flex-col"
|
|
||||||
>
|
|
||||||
<div class="flex flex-col items-center">
|
|
||||||
<logo
|
|
||||||
:source="logoSource"
|
|
||||||
:name="installationName"
|
|
||||||
:account-id="accountId"
|
|
||||||
class="m-4 mb-10"
|
|
||||||
/>
|
|
||||||
<primary-nav-item
|
|
||||||
v-for="menuItem in menuItems"
|
|
||||||
:key="menuItem.toState"
|
|
||||||
:icon="menuItem.icon"
|
|
||||||
:name="menuItem.label"
|
|
||||||
:to="menuItem.toState"
|
|
||||||
:is-child-menu-active="menuItem.key === activeMenuItem"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col items-center justify-end pb-6">
|
|
||||||
<primary-nav-item
|
|
||||||
v-if="!isACustomBrandedInstance"
|
|
||||||
icon="book-open-globe"
|
|
||||||
name="DOCS"
|
|
||||||
:open-in-new-page="true"
|
|
||||||
:to="helpDocsURL"
|
|
||||||
/>
|
|
||||||
<notification-bell @open-notification-panel="openNotificationPanel" />
|
|
||||||
<agent-details @toggle-menu="toggleOptions" />
|
|
||||||
<options-menu
|
|
||||||
:show="showOptionsMenu"
|
|
||||||
@toggle-accounts="toggleAccountModal"
|
|
||||||
@show-support-chat-window="toggleSupportChatWindow"
|
|
||||||
@key-shortcut-modal="$emit('key-shortcut-modal')"
|
|
||||||
@close="toggleOptions"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
<script>
|
||||||
import Logo from './Logo.vue';
|
import Logo from './Logo.vue';
|
||||||
import PrimaryNavItem from './PrimaryNavItem.vue';
|
import PrimaryNavItem from './PrimaryNavItem.vue';
|
||||||
@@ -94,15 +54,56 @@ export default {
|
|||||||
this.showOptionsMenu = !this.showOptionsMenu;
|
this.showOptionsMenu = !this.showOptionsMenu;
|
||||||
},
|
},
|
||||||
toggleAccountModal() {
|
toggleAccountModal() {
|
||||||
this.$emit('toggle-accounts');
|
this.$emit('toggleAccounts');
|
||||||
},
|
},
|
||||||
toggleSupportChatWindow() {
|
toggleSupportChatWindow() {
|
||||||
window.$chatwoot.toggle();
|
window.$chatwoot.toggle();
|
||||||
},
|
},
|
||||||
openNotificationPanel() {
|
openNotificationPanel() {
|
||||||
this.$track(ACCOUNT_EVENTS.OPENED_NOTIFICATIONS);
|
this.$track(ACCOUNT_EVENTS.OPENED_NOTIFICATIONS);
|
||||||
this.$emit('open-notification-panel');
|
this.$emit('openNotificationPanel');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="flex flex-col justify-between w-16 h-full bg-white border-r dark:bg-slate-900 border-slate-50 dark:border-slate-800/50 rtl:border-l rtl:border-r-0"
|
||||||
|
>
|
||||||
|
<div class="flex flex-col items-center">
|
||||||
|
<Logo
|
||||||
|
:source="logoSource"
|
||||||
|
:name="installationName"
|
||||||
|
:account-id="accountId"
|
||||||
|
class="m-4 mb-10"
|
||||||
|
/>
|
||||||
|
<PrimaryNavItem
|
||||||
|
v-for="menuItem in menuItems"
|
||||||
|
:key="menuItem.toState"
|
||||||
|
:icon="menuItem.icon"
|
||||||
|
:name="menuItem.label"
|
||||||
|
:to="menuItem.toState"
|
||||||
|
:is-child-menu-active="menuItem.key === activeMenuItem"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col items-center justify-end pb-6">
|
||||||
|
<PrimaryNavItem
|
||||||
|
v-if="!isACustomBrandedInstance"
|
||||||
|
icon="book-open-globe"
|
||||||
|
name="DOCS"
|
||||||
|
open-in-new-page
|
||||||
|
:to="helpDocsURL"
|
||||||
|
/>
|
||||||
|
<NotificationBell @openNotificationPanel="openNotificationPanel" />
|
||||||
|
<AgentDetails @toggleMenu="toggleOptions" />
|
||||||
|
<OptionsMenu
|
||||||
|
:show="showOptionsMenu"
|
||||||
|
@toggleAccounts="toggleAccountModal"
|
||||||
|
@showSupportChatWindow="toggleSupportChatWindow"
|
||||||
|
@openKeyShortcutModal="$emit('openKeyShortcutModal')"
|
||||||
|
@close="toggleOptions"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,33 +1,3 @@
|
|||||||
<template>
|
|
||||||
<router-link v-slot="{ href, isActive, navigate }" :to="to" custom>
|
|
||||||
<a
|
|
||||||
v-tooltip.right="$t(`SIDEBAR.${name}`)"
|
|
||||||
:href="href"
|
|
||||||
class="text-slate-700 dark:text-slate-100 w-10 h-10 my-2 flex items-center justify-center rounded-lg hover:bg-slate-25 dark:hover:bg-slate-700 dark:hover:text-slate-100 hover:text-slate-600 relative"
|
|
||||||
:class="{
|
|
||||||
'bg-woot-50 dark:bg-slate-800 text-woot-500 hover:bg-woot-50':
|
|
||||||
isActive || isChildMenuActive,
|
|
||||||
}"
|
|
||||||
:rel="openInNewPage ? 'noopener noreferrer nofollow' : undefined"
|
|
||||||
:target="openInNewPage ? '_blank' : undefined"
|
|
||||||
@click="navigate"
|
|
||||||
>
|
|
||||||
<fluent-icon
|
|
||||||
:icon="icon"
|
|
||||||
:class="{
|
|
||||||
'text-woot-500': isActive || isChildMenuActive,
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
<span class="sr-only">{{ name }}</span>
|
|
||||||
<span
|
|
||||||
v-if="count"
|
|
||||||
class="text-black-900 bg-yellow-500 absolute -top-1 -right-1"
|
|
||||||
>
|
|
||||||
{{ count }}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</router-link>
|
|
||||||
</template>
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -58,3 +28,34 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<router-link v-slot="{ href, isActive, navigate }" :to="to" custom>
|
||||||
|
<a
|
||||||
|
v-tooltip.right="$t(`SIDEBAR.${name}`)"
|
||||||
|
:href="href"
|
||||||
|
class="text-slate-700 dark:text-slate-100 w-10 h-10 my-2 flex items-center justify-center rounded-lg hover:bg-slate-25 dark:hover:bg-slate-700 dark:hover:text-slate-100 hover:text-slate-600 relative"
|
||||||
|
:class="{
|
||||||
|
'bg-woot-50 dark:bg-slate-800 text-woot-500 hover:bg-woot-50':
|
||||||
|
isActive || isChildMenuActive,
|
||||||
|
}"
|
||||||
|
:rel="openInNewPage ? 'noopener noreferrer nofollow' : undefined"
|
||||||
|
:target="openInNewPage ? '_blank' : undefined"
|
||||||
|
@click="navigate"
|
||||||
|
>
|
||||||
|
<fluent-icon
|
||||||
|
:icon="icon"
|
||||||
|
:class="{
|
||||||
|
'text-woot-500': isActive || isChildMenuActive,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<span class="sr-only">{{ name }}</span>
|
||||||
|
<span
|
||||||
|
v-if="count"
|
||||||
|
class="text-black-900 bg-yellow-500 absolute -top-1 -right-1"
|
||||||
|
>
|
||||||
|
{{ count }}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</router-link>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -1,34 +1,14 @@
|
|||||||
<template>
|
|
||||||
<div
|
|
||||||
v-if="hasSecondaryMenu"
|
|
||||||
class="h-full overflow-auto w-48 flex flex-col bg-white dark:bg-slate-900 border-r dark:border-slate-800/50 rtl:border-r-0 rtl:border-l border-slate-50 text-sm px-2 pb-8"
|
|
||||||
>
|
|
||||||
<account-context @toggle-accounts="toggleAccountModal" />
|
|
||||||
<transition-group
|
|
||||||
name="menu-list"
|
|
||||||
tag="ul"
|
|
||||||
class="pt-2 list-none ml-0 mb-0"
|
|
||||||
>
|
|
||||||
<secondary-nav-item
|
|
||||||
v-for="menuItem in accessibleMenuItems"
|
|
||||||
:key="menuItem.toState"
|
|
||||||
:menu-item="menuItem"
|
|
||||||
/>
|
|
||||||
<secondary-nav-item
|
|
||||||
v-for="menuItem in additionalSecondaryMenuItems[menuConfig.parentNav]"
|
|
||||||
:key="menuItem.key"
|
|
||||||
:menu-item="menuItem"
|
|
||||||
@add-label="showAddLabelPopup"
|
|
||||||
/>
|
|
||||||
</transition-group>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
<script>
|
||||||
import { frontendURL } from '../../../helper/URLHelper';
|
import { frontendURL } from '../../../helper/URLHelper';
|
||||||
import SecondaryNavItem from './SecondaryNavItem.vue';
|
import SecondaryNavItem from './SecondaryNavItem.vue';
|
||||||
import AccountContext from './AccountContext.vue';
|
import AccountContext from './AccountContext.vue';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import { FEATURE_FLAGS } from '../../../featureFlags';
|
import { FEATURE_FLAGS } from '../../../featureFlags';
|
||||||
|
import {
|
||||||
|
getUserPermissions,
|
||||||
|
hasPermissions,
|
||||||
|
} from '../../../helper/permissionsHelper';
|
||||||
|
import { routesWithPermissions } from '../../../routes';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -60,9 +40,9 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
currentRole: {
|
currentUser: {
|
||||||
type: String,
|
type: Object,
|
||||||
default: '',
|
default: () => {},
|
||||||
},
|
},
|
||||||
isOnChatwootCloud: {
|
isOnChatwootCloud: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -80,16 +60,19 @@ export default {
|
|||||||
return this.customViews.filter(view => view.filter_type === 'contact');
|
return this.customViews.filter(view => view.filter_type === 'contact');
|
||||||
},
|
},
|
||||||
accessibleMenuItems() {
|
accessibleMenuItems() {
|
||||||
if (!this.currentRole) {
|
const menuItemsFilteredByPermissions = this.menuConfig.menuItems.filter(
|
||||||
return [];
|
menuItem => {
|
||||||
}
|
const userPermissions = getUserPermissions(
|
||||||
const menuItemsFilteredByRole = this.menuConfig.menuItems.filter(
|
this.currentUser,
|
||||||
menuItem =>
|
this.accountId
|
||||||
window.roleWiseRoutes[this.currentRole].indexOf(
|
);
|
||||||
menuItem.toStateName
|
return hasPermissions(
|
||||||
) > -1
|
routesWithPermissions[menuItem.toStateName],
|
||||||
|
userPermissions
|
||||||
|
);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
return menuItemsFilteredByRole.filter(item => {
|
return menuItemsFilteredByPermissions.filter(item => {
|
||||||
if (item.showOnlyOnCloud) {
|
if (item.showOnlyOnCloud) {
|
||||||
return this.isOnChatwootCloud;
|
return this.isOnChatwootCloud;
|
||||||
}
|
}
|
||||||
@@ -246,10 +229,10 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showAddLabelPopup() {
|
showAddLabelPopup() {
|
||||||
this.$emit('add-label');
|
this.$emit('addLabel');
|
||||||
},
|
},
|
||||||
toggleAccountModal() {
|
toggleAccountModal() {
|
||||||
this.$emit('toggle-accounts');
|
this.$emit('toggleAccounts');
|
||||||
},
|
},
|
||||||
showNewLink(featureFlag) {
|
showNewLink(featureFlag) {
|
||||||
return this.isFeatureEnabledonAccount(this.accountId, featureFlag);
|
return this.isFeatureEnabledonAccount(this.accountId, featureFlag);
|
||||||
@@ -257,3 +240,29 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
v-if="hasSecondaryMenu"
|
||||||
|
class="flex flex-col w-48 h-full px-2 pb-8 overflow-auto text-sm bg-white border-r dark:bg-slate-900 dark:border-slate-800/50 rtl:border-r-0 rtl:border-l border-slate-50"
|
||||||
|
>
|
||||||
|
<AccountContext @toggleAccounts="toggleAccountModal" />
|
||||||
|
<transition-group
|
||||||
|
name="menu-list"
|
||||||
|
tag="ul"
|
||||||
|
class="pt-2 mb-0 ml-0 list-none"
|
||||||
|
>
|
||||||
|
<SecondaryNavItem
|
||||||
|
v-for="menuItem in accessibleMenuItems"
|
||||||
|
:key="menuItem.toState"
|
||||||
|
:menu-item="menuItem"
|
||||||
|
/>
|
||||||
|
<SecondaryNavItem
|
||||||
|
v-for="menuItem in additionalSecondaryMenuItems[menuConfig.parentNav]"
|
||||||
|
:key="menuItem.key"
|
||||||
|
:menu-item="menuItem"
|
||||||
|
@addLabel="showAddLabelPopup"
|
||||||
|
/>
|
||||||
|
</transition-group>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user