Compare commits
206
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f74d3904ad | ||
|
|
7d5635685a | ||
|
|
5a7b44e1b6 | ||
|
|
24e5e9d0b9 | ||
|
|
fe7afa564b | ||
|
|
fed636c903 | ||
|
|
8c54d7f794 | ||
|
|
c25429999c | ||
|
|
4d2ee79bdd | ||
|
|
aeac5a22ee | ||
|
|
8c3b740e26 | ||
|
|
371076f9a9 | ||
|
|
29a7ff9202 | ||
|
|
bd88bfb0fe | ||
|
|
83100b8f60 | ||
|
|
0f26351fd3 | ||
|
|
6d053e5816 | ||
|
|
bbb8e57fee | ||
|
|
5eac95732b | ||
|
|
b3262597c1 | ||
|
|
701135df92 | ||
|
|
fdc3e370ef | ||
|
|
f14edd5242 | ||
|
|
578dce81a1 | ||
|
|
c51a458c25 | ||
|
|
b8d0252511 | ||
|
|
edc1fe2363 | ||
|
|
0491ffc94e | ||
|
|
b52950ba5a | ||
|
|
a3b602290a | ||
|
|
fce4d5e26e | ||
|
|
42f6621afb | ||
|
|
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 |
@@ -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"
|
||||||
|
|||||||
@@ -257,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
|
||||||
|
|
||||||
|
|||||||
+157
-21
@@ -1,17 +1,6 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
extends: [
|
extends: ['airbnb-base/legacy', 'prettier', 'plugin:vue/vue3-recommended'],
|
||||||
'airbnb-base/legacy',
|
plugins: ['html', 'prettier'],
|
||||||
'prettier',
|
|
||||||
'plugin:vue/recommended',
|
|
||||||
'plugin:storybook/recommended',
|
|
||||||
'plugin:cypress/recommended',
|
|
||||||
],
|
|
||||||
parserOptions: {
|
|
||||||
parser: '@babel/eslint-parser',
|
|
||||||
ecmaVersion: 2020,
|
|
||||||
sourceType: 'module',
|
|
||||||
},
|
|
||||||
plugins: ['html', 'prettier', 'babel'],
|
|
||||||
rules: {
|
rules: {
|
||||||
'prettier/prettier': ['error'],
|
'prettier/prettier': ['error'],
|
||||||
camelcase: 'off',
|
camelcase: 'off',
|
||||||
@@ -27,6 +16,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',
|
||||||
{
|
{
|
||||||
@@ -56,19 +199,12 @@ module.exports = {
|
|||||||
'import/extensions': ['off'],
|
'import/extensions': ['off'],
|
||||||
'no-console': 'error',
|
'no-console': 'error',
|
||||||
},
|
},
|
||||||
settings: {
|
|
||||||
'import/resolver': {
|
|
||||||
webpack: {
|
|
||||||
config: 'config/webpack/resolve.js',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
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.
|
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
|
version: 9
|
||||||
ref: ${{ github.event.pull_request.head.ref }}
|
ref: ${{ github.event.pull_request.head.ref }}
|
||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
|
||||||
@@ -53,10 +55,10 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
cache: yarn
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: yarn
|
- name: Install pnpm dependencies
|
||||||
run: yarn install
|
run: pnpm i
|
||||||
|
|
||||||
- name: Strip enterprise code
|
- name: Strip enterprise code
|
||||||
run: |
|
run: |
|
||||||
@@ -69,9 +71,6 @@ jobs:
|
|||||||
- name: Seed database
|
- name: Seed database
|
||||||
run: bundle exec rake db:schema:load
|
run: bundle exec rake db:schema:load
|
||||||
|
|
||||||
- name: yarn check-files
|
|
||||||
run: yarn install --check-files
|
|
||||||
|
|
||||||
# Run rails tests
|
# Run rails tests
|
||||||
- name: Run backend tests
|
- name: Run backend tests
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -49,13 +49,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
with:
|
||||||
|
version: 9.3.0
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
cache: yarn
|
cache: pnpm
|
||||||
|
|
||||||
- name: yarn
|
- name: pnpm
|
||||||
run: yarn install
|
run: pnpm install
|
||||||
|
|
||||||
- name: Create database
|
- name: Create database
|
||||||
run: bundle exec rake db:create
|
run: bundle exec rake db:create
|
||||||
|
|||||||
@@ -19,23 +19,33 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
with:
|
||||||
|
version: 9.3.0
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
cache: 'yarn'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: yarn
|
- name: pnpm
|
||||||
run: yarn install
|
run: pnpm install
|
||||||
|
|
||||||
- name: Strip enterprise code
|
- name: Strip enterprise code
|
||||||
run: |
|
run: |
|
||||||
rm -rf enterprise
|
rm -rf enterprise
|
||||||
rm -rf spec/enterprise
|
rm -rf spec/enterprise
|
||||||
|
|
||||||
|
- name: setup env
|
||||||
|
run: |
|
||||||
|
cp .env.example .env
|
||||||
|
|
||||||
- name: Run asset compile
|
- name: Run asset compile
|
||||||
run: bundle exec rake assets:precompile
|
run: bundle exec rake assets:precompile
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: --openssl-legacy-provider
|
RAILS_ENV: production
|
||||||
|
|
||||||
- name: Size Check
|
- name: Size Check
|
||||||
run: yarn run size
|
run: pnpm run size
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+15
-1
@@ -32,6 +32,16 @@ master.key
|
|||||||
|
|
||||||
public/uploads
|
public/uploads
|
||||||
public/packs*
|
public/packs*
|
||||||
|
public/assets/administrate*
|
||||||
|
public/assets/action*.js
|
||||||
|
public/assets/activestorage*.js
|
||||||
|
public/assets/trix*
|
||||||
|
public/assets/belongs_to*.js
|
||||||
|
public/assets/manifest*.js
|
||||||
|
public/assets/manifest*.js
|
||||||
|
public/assets/*.js.gz
|
||||||
|
public/assets/secretField*
|
||||||
|
public/assets/.sprockets-manifest-*.json
|
||||||
|
|
||||||
# VIM files
|
# VIM files
|
||||||
*.swp
|
*.swp
|
||||||
@@ -75,4 +85,8 @@ yalc.lock
|
|||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
.yarn-integrity
|
.yarn-integrity
|
||||||
|
|
||||||
/storybook-static
|
# Vite Ruby
|
||||||
|
/public/vite*
|
||||||
|
# Vite uses dotenv and suggests to ignore local-only env files. See
|
||||||
|
# https://vitejs.dev/guide/env-and-mode.html#env-files
|
||||||
|
*.local
|
||||||
|
|||||||
+8
-8
@@ -1,11 +1,11 @@
|
|||||||
#!/bin/sh
|
# #!/bin/sh
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
# . "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
# lint js and vue files
|
# # lint js and vue files
|
||||||
npx --no-install lint-staged
|
# npx --no-install lint-staged
|
||||||
|
|
||||||
# lint only staged ruby files
|
# # lint only staged ruby files
|
||||||
git diff --name-only --cached | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop --force-exclusion -a
|
# git diff --name-only --cached | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop --force-exclusion -a
|
||||||
|
|
||||||
# stage rubocop changes to files
|
# # stage rubocop changes to files
|
||||||
git diff --name-only --cached | xargs git add
|
# git diff --name-only --cached | xargs git add
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
3.2.2
|
3.3.3
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const resolve = require('../config/webpack/resolve');
|
|
||||||
|
|
||||||
// Chatwoot's webpack.config.js
|
|
||||||
process.env.NODE_ENV = 'development';
|
|
||||||
const custom = require('../config/webpack/environment');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
stories: [
|
|
||||||
'../stories/**/*.stories.mdx',
|
|
||||||
'../app/javascript/**/*.stories.@(js|jsx|ts|tsx)',
|
|
||||||
],
|
|
||||||
addons: [
|
|
||||||
{
|
|
||||||
name: '@storybook/addon-docs',
|
|
||||||
options: {
|
|
||||||
vueDocgenOptions: {
|
|
||||||
alias: {
|
|
||||||
'@': path.resolve(__dirname, '../'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'@storybook/addon-links',
|
|
||||||
'@storybook/addon-essentials',
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Fix Storybook issue with PostCSS@8
|
|
||||||
* @see https://github.com/storybookjs/storybook/issues/12668#issuecomment-773958085
|
|
||||||
*/
|
|
||||||
name: '@storybook/addon-postcss',
|
|
||||||
options: {
|
|
||||||
postcssLoaderOptions: {
|
|
||||||
implementation: require('postcss'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
webpackFinal: config => {
|
|
||||||
const newConfig = {
|
|
||||||
...config,
|
|
||||||
resolve: {
|
|
||||||
...config.resolve,
|
|
||||||
modules: custom.resolvedModules.map(i => i.value),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
newConfig.module.rules.push({
|
|
||||||
test: /\.scss$/,
|
|
||||||
use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
|
|
||||||
include: path.resolve(__dirname, '../app/javascript'),
|
|
||||||
});
|
|
||||||
|
|
||||||
return newConfig;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
import { addDecorator } from '@storybook/vue';
|
|
||||||
import Vue from 'vue';
|
|
||||||
import Vuex from 'vuex';
|
|
||||||
import VueI18n from 'vue-i18n';
|
|
||||||
import Vuelidate from 'vuelidate';
|
|
||||||
import Multiselect from 'vue-multiselect';
|
|
||||||
import VueDOMPurifyHTML from 'vue-dompurify-html';
|
|
||||||
import FluentIcon from 'shared/components/FluentIcon/DashboardIcon';
|
|
||||||
|
|
||||||
import WootUiKit from '../app/javascript/dashboard/components';
|
|
||||||
import i18n from '../app/javascript/dashboard/i18n';
|
|
||||||
import { domPurifyConfig } from 'shared/helpers/HTMLSanitizer';
|
|
||||||
|
|
||||||
import '../app/javascript/dashboard/assets/scss/storybook.scss';
|
|
||||||
|
|
||||||
Vue.use(VueI18n);
|
|
||||||
Vue.use(Vuelidate);
|
|
||||||
Vue.use(WootUiKit);
|
|
||||||
Vue.use(Vuex);
|
|
||||||
Vue.use(VueDOMPurifyHTML, domPurifyConfig);
|
|
||||||
|
|
||||||
Vue.component('multiselect', Multiselect);
|
|
||||||
Vue.component('fluent-icon', FluentIcon);
|
|
||||||
|
|
||||||
const store = new Vuex.Store({});
|
|
||||||
const i18nConfig = new VueI18n({
|
|
||||||
locale: 'en',
|
|
||||||
messages: i18n,
|
|
||||||
});
|
|
||||||
|
|
||||||
addDecorator(() => ({
|
|
||||||
template: '<story/>',
|
|
||||||
i18n: i18nConfig,
|
|
||||||
store,
|
|
||||||
beforeCreate: function() {
|
|
||||||
this.$root._i18n = this.$i18n;
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
export const parameters = {
|
|
||||||
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
||||||
controls: {
|
|
||||||
matchers: {
|
|
||||||
color: /(background|color)$/i,
|
|
||||||
date: /Date$/,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
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'
|
||||||
@@ -64,7 +64,9 @@ gem 'activerecord-import'
|
|||||||
gem 'dotenv-rails', '>= 3.0.0'
|
gem 'dotenv-rails', '>= 3.0.0'
|
||||||
gem 'foreman'
|
gem 'foreman'
|
||||||
gem 'puma'
|
gem 'puma'
|
||||||
gem 'webpacker'
|
gem 'vite_rails'
|
||||||
|
# for legacy no cors support
|
||||||
|
gem 'vite_plugin_legacy'
|
||||||
# metrics on heroku
|
# metrics on heroku
|
||||||
gem 'barnes'
|
gem 'barnes'
|
||||||
|
|
||||||
@@ -96,12 +98,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,12 +113,12 @@ 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.18.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.18.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'
|
||||||
|
|
||||||
@@ -165,7 +167,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,12 +202,10 @@ 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
|
||||||
# Cypress in rails.
|
|
||||||
gem 'cypress-on-rails'
|
|
||||||
# fast cleaning of database
|
# fast cleaning of database
|
||||||
gem 'database_cleaner'
|
gem 'database_cleaner'
|
||||||
# mock http calls
|
# mock http calls
|
||||||
@@ -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', '>= 6.1.3'
|
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
|
||||||
|
|||||||
+97
-87
@@ -103,8 +103,8 @@ GEM
|
|||||||
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)
|
||||||
@@ -169,27 +169,31 @@ 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.3.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)
|
||||||
cypress-on-rails (1.16.0)
|
csv-safe (3.3.1)
|
||||||
rack
|
csv (~> 3.0)
|
||||||
database_cleaner (2.0.2)
|
database_cleaner (2.0.2)
|
||||||
database_cleaner-active_record (>= 2, < 3)
|
database_cleaner-active_record (>= 2, < 3)
|
||||||
database_cleaner-active_record (2.1.0)
|
database_cleaner-active_record (2.1.0)
|
||||||
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)
|
||||||
@@ -216,6 +220,7 @@ GEM
|
|||||||
railties (>= 6.1)
|
railties (>= 6.1)
|
||||||
down (5.4.0)
|
down (5.4.0)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
|
dry-cli (1.1.0)
|
||||||
ecma-re-validator (0.4.0)
|
ecma-re-validator (0.4.0)
|
||||||
regexp_parser (~> 2.2)
|
regexp_parser (~> 2.2)
|
||||||
elastic-apm (4.6.2)
|
elastic-apm (4.6.2)
|
||||||
@@ -224,7 +229,7 @@ GEM
|
|||||||
ruby2_keywords
|
ruby2_keywords
|
||||||
email_reply_trimmer (0.1.13)
|
email_reply_trimmer (0.1.13)
|
||||||
erubi (1.13.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 +256,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 +267,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 +300,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 +318,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,7 +358,7 @@ 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)
|
||||||
http (5.1.1)
|
http (5.1.1)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
@@ -416,15 +421,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)
|
||||||
@@ -434,6 +439,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)
|
||||||
@@ -450,7 +456,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,7 +466,7 @@ GEM
|
|||||||
mini_magick (4.12.0)
|
mini_magick (4.12.0)
|
||||||
mini_mime (1.1.5)
|
mini_mime (1.1.5)
|
||||||
mini_portile2 (2.8.7)
|
mini_portile2 (2.8.7)
|
||||||
minitest (5.24.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)
|
||||||
@@ -473,7 +479,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.12)
|
net-imap (0.4.14)
|
||||||
date
|
date
|
||||||
net-protocol
|
net-protocol
|
||||||
net-pop (0.1.2)
|
net-pop (0.1.2)
|
||||||
@@ -489,14 +495,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.6)
|
nokogiri (1.16.7)
|
||||||
mini_portile2 (~> 2.8.2)
|
mini_portile2 (~> 2.8.2)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.6-arm64-darwin)
|
nokogiri (1.16.7-arm64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.6-x86_64-darwin)
|
nokogiri (1.16.7-x86_64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.6-x86_64-linux)
|
nokogiri (1.16.7-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)
|
||||||
@@ -515,7 +521,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)
|
||||||
@@ -544,13 +550,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.8.0)
|
racc (1.8.1)
|
||||||
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)
|
||||||
@@ -563,7 +569,7 @@ GEM
|
|||||||
rack-protection (3.2.0)
|
rack-protection (3.2.0)
|
||||||
base64 (>= 0.1.0)
|
base64 (>= 0.1.0)
|
||||||
rack (~> 2.2, >= 2.2.4)
|
rack (~> 2.2, >= 2.2.4)
|
||||||
rack-proxy (0.7.6)
|
rack-proxy (0.7.7)
|
||||||
rack
|
rack
|
||||||
rack-test (2.1.0)
|
rack-test (2.1.0)
|
||||||
rack (>= 1.3)
|
rack (>= 1.3)
|
||||||
@@ -627,20 +633,20 @@ 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.13.0)
|
rspec-core (3.13.0)
|
||||||
rspec-support (~> 3.13.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-expectations (3.13.1)
|
rspec-expectations (3.13.2)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.13.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-mocks (3.13.1)
|
rspec-mocks (3.13.1)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.13.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-rails (6.1.3)
|
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.13)
|
rspec-core (~> 3.13)
|
||||||
rspec-expectations (~> 3.13)
|
rspec-expectations (~> 3.13)
|
||||||
rspec-mocks (~> 3.13)
|
rspec-mocks (~> 3.13)
|
||||||
@@ -702,24 +708,24 @@ GEM
|
|||||||
activerecord (>= 4)
|
activerecord (>= 4)
|
||||||
activesupport (>= 4)
|
activesupport (>= 4)
|
||||||
selectize-rails (0.12.6)
|
selectize-rails (0.12.6)
|
||||||
semantic_range (3.0.0)
|
sentry-rails (5.19.0)
|
||||||
sentry-rails (5.18.0)
|
|
||||||
railties (>= 5.0)
|
railties (>= 5.0)
|
||||||
sentry-ruby (~> 5.18.0)
|
sentry-ruby (~> 5.19.0)
|
||||||
sentry-ruby (5.18.0)
|
sentry-ruby (5.19.0)
|
||||||
bigdecimal
|
bigdecimal
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
sentry-sidekiq (5.18.0)
|
sentry-sidekiq (5.19.0)
|
||||||
sentry-ruby (~> 5.18.0)
|
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)
|
||||||
@@ -788,10 +794,19 @@ 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)
|
||||||
|
vite_plugin_legacy (3.0.2)
|
||||||
|
vite_ruby (~> 3.0, >= 3.0.4)
|
||||||
|
vite_rails (3.0.17)
|
||||||
|
railties (>= 5.1, < 8)
|
||||||
|
vite_ruby (~> 3.0, >= 3.2.2)
|
||||||
|
vite_ruby (3.8.0)
|
||||||
|
dry-cli (>= 0.7, < 2)
|
||||||
|
rack-proxy (~> 0.6, >= 0.6.1)
|
||||||
|
zeitwerk (~> 2.2)
|
||||||
warden (1.2.9)
|
warden (1.2.9)
|
||||||
rack (>= 2.0.9)
|
rack (>= 2.0.9)
|
||||||
web-console (4.2.1)
|
web-console (4.2.1)
|
||||||
@@ -802,16 +817,11 @@ GEM
|
|||||||
web-push (3.0.1)
|
web-push (3.0.1)
|
||||||
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)
|
||||||
webpacker (5.4.4)
|
webrick (1.8.2)
|
||||||
activesupport (>= 5.2)
|
|
||||||
rack-proxy (>= 0.6.1)
|
|
||||||
railties (>= 5.2)
|
|
||||||
semantic_range (>= 2.3.0)
|
|
||||||
webrick (1.8.1)
|
|
||||||
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)
|
||||||
@@ -819,7 +829,7 @@ GEM
|
|||||||
working_hours (1.4.1)
|
working_hours (1.4.1)
|
||||||
activesupport (>= 3.2)
|
activesupport (>= 3.2)
|
||||||
tzinfo
|
tzinfo
|
||||||
zeitwerk (2.6.16)
|
zeitwerk (2.6.17)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
arm64-darwin-20
|
arm64-darwin-20
|
||||||
@@ -854,7 +864,6 @@ DEPENDENCIES
|
|||||||
climate_control
|
climate_control
|
||||||
commonmarker
|
commonmarker
|
||||||
csv-safe
|
csv-safe
|
||||||
cypress-on-rails
|
|
||||||
database_cleaner
|
database_cleaner
|
||||||
ddtrace
|
ddtrace
|
||||||
debug (~> 1.8)
|
debug (~> 1.8)
|
||||||
@@ -873,9 +882,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
|
||||||
@@ -895,14 +904,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
|
||||||
@@ -922,7 +931,7 @@ DEPENDENCIES
|
|||||||
responders (>= 3.1.1)
|
responders (>= 3.1.1)
|
||||||
rest-client
|
rest-client
|
||||||
reverse_markdown
|
reverse_markdown
|
||||||
rspec-rails (>= 6.1.3)
|
rspec-rails (>= 6.1.5)
|
||||||
rspec_junit_formatter
|
rspec_junit_formatter
|
||||||
rubocop
|
rubocop
|
||||||
rubocop-performance
|
rubocop-performance
|
||||||
@@ -931,11 +940,11 @@ DEPENDENCIES
|
|||||||
scout_apm
|
scout_apm
|
||||||
scss_lint
|
scss_lint
|
||||||
seed_dump
|
seed_dump
|
||||||
sentry-rails (>= 5.18.0)
|
sentry-rails (>= 5.19.0)
|
||||||
sentry-ruby
|
sentry-ruby
|
||||||
sentry-sidekiq (>= 5.18.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)
|
||||||
@@ -952,15 +961,16 @@ DEPENDENCIES
|
|||||||
tzinfo-data
|
tzinfo-data
|
||||||
uglifier
|
uglifier
|
||||||
valid_email2
|
valid_email2
|
||||||
|
vite_plugin_legacy
|
||||||
|
vite_rails
|
||||||
web-console (>= 4.2.1)
|
web-console (>= 4.2.1)
|
||||||
web-push (>= 3.0.1)
|
web-push (>= 3.0.1)
|
||||||
webmock
|
webmock
|
||||||
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,4 +1,4 @@
|
|||||||
backend: bin/rails s -p 3000
|
backend: bin/rails s -p 3000
|
||||||
frontend: export NODE_OPTIONS=--openssl-legacy-provider && bin/webpack-dev-server
|
|
||||||
# https://github.com/mperham/sidekiq/issues/3090#issuecomment-389748695
|
# https://github.com/mperham/sidekiq/issues/3090#issuecomment-389748695
|
||||||
worker: dotenv bundle exec sidekiq -C config/sidekiq.yml
|
worker: dotenv bundle exec sidekiq -C config/sidekiq.yml
|
||||||
|
vite: bin/vite dev
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
backend: RAILS_ENV=test bin/rails s -p 5050
|
backend: RAILS_ENV=test bin/rails s -p 5050
|
||||||
frontend: export NODE_OPTIONS=--openssl-legacy-provider && bin/webpack-dev-server
|
vite: bin/vite dev
|
||||||
worker: RAILS_ENV=test dotenv bundle exec sidekiq -C config/sidekiq.yml
|
worker: RAILS_ENV=test dotenv bundle exec sidekiq -C config/sidekiq.yml
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
|
## 🚨 Note: This branch is unstable. For the stable branch's source code, please use the branch [3.x](https://github.com/chatwoot/chatwoot/tree/3.x)
|
||||||
|
|
||||||
|
|
||||||
<img src="https://user-images.githubusercontent.com/2246121/282256557-1570674b-d142-4198-9740-69404cc6a339.png#gh-light-mode-only" width="100%" alt="Chat dashboard dark mode"/>
|
<img src="https://user-images.githubusercontent.com/2246121/282256557-1570674b-d142-4198-9740-69404cc6a339.png#gh-light-mode-only" width="100%" alt="Chat dashboard dark mode"/>
|
||||||
<img src="https://user-images.githubusercontent.com/2246121/282256632-87f6a01b-6467-4e0e-8a93-7bbf66d03a17.png#gh-dark-mode-only" width="100%" alt="Chat dashboard"/>
|
<img src="https://user-images.githubusercontent.com/2246121/282256632-87f6a01b-6467-4e0e-8a93-7bbf66d03a17.png#gh-dark-mode-only" width="100%" alt="Chat dashboard"/>
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
# Chatwoot
|
# Chatwoot
|
||||||
|
|
||||||
Customer engagement suite, an open-source alternative to Intercom, Zendesk, Salesforce Service Cloud etc.
|
Customer engagement suite, an open-source alternative to Intercom, Zendesk, Salesforce Service Cloud etc.
|
||||||
<p>
|
<p>
|
||||||
@@ -98,7 +101,7 @@ Chatwoot now supports 1-Click deployment to DigitalOcean as a kubernetes app.
|
|||||||
|
|
||||||
### Other deployment options
|
### Other deployment options
|
||||||
|
|
||||||
For other supported options, checkout our [deployment page](https://chatwoot.com/deploy).
|
For other supported options, checkout our [deployment page](https://chatwoot.com/deploy).
|
||||||
|
|
||||||
## Security
|
## Security
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
3.9.0
|
3.13.0
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
2.8.0
|
3.0.0
|
||||||
|
|||||||
@@ -2,5 +2,4 @@
|
|||||||
//= link administrate/application.css
|
//= link administrate/application.css
|
||||||
//= link administrate/application.js
|
//= link administrate/application.js
|
||||||
//= link administrate-field-active_storage/application.css
|
//= link administrate-field-active_storage/application.css
|
||||||
//= link dashboardChart.js
|
|
||||||
//= link secretField.js
|
//= link secretField.js
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
// eslint-disable-next-line
|
|
||||||
function prepareData(data) {
|
|
||||||
var labels = [];
|
|
||||||
var dataSet = [];
|
|
||||||
data.forEach(item => {
|
|
||||||
labels.push(item[0]);
|
|
||||||
dataSet.push(item[1]);
|
|
||||||
});
|
|
||||||
return { labels, dataSet };
|
|
||||||
}
|
|
||||||
|
|
||||||
function getChartOptions() {
|
|
||||||
var fontFamily =
|
|
||||||
'PlusJakarta,-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
|
|
||||||
return {
|
|
||||||
responsive: true,
|
|
||||||
legend: { labels: { fontFamily } },
|
|
||||||
scales: {
|
|
||||||
xAxes: [
|
|
||||||
{
|
|
||||||
barPercentage: 1.26,
|
|
||||||
ticks: { fontFamily },
|
|
||||||
gridLines: { display: false },
|
|
||||||
},
|
|
||||||
],
|
|
||||||
yAxes: [
|
|
||||||
{
|
|
||||||
ticks: { fontFamily },
|
|
||||||
gridLines: { display: false },
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line
|
|
||||||
function drawSuperAdminDashboard(data) {
|
|
||||||
var ctx = document.getElementById('dashboard-chart').getContext('2d');
|
|
||||||
var chartData = prepareData(data);
|
|
||||||
// eslint-disable-next-line
|
|
||||||
new Chart(ctx, {
|
|
||||||
type: 'bar',
|
|
||||||
data: {
|
|
||||||
labels: chartData.labels,
|
|
||||||
datasets: [
|
|
||||||
{
|
|
||||||
label: 'Conversations',
|
|
||||||
data: chartData.dataSet,
|
|
||||||
backgroundColor: '#1f93ff',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
options: getChartOptions(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -86,8 +86,5 @@ $swift-ease-out-duration: .4s !default;
|
|||||||
$swift-ease-out-timing-function: cubic-bezier(.25, .8, .25, 1) !default;
|
$swift-ease-out-timing-function: cubic-bezier(.25, .8, .25, 1) !default;
|
||||||
$swift-ease-out: all $swift-ease-out-duration $swift-ease-out-timing-function !default;
|
$swift-ease-out: all $swift-ease-out-duration $swift-ease-out-timing-function !default;
|
||||||
|
|
||||||
// Ionicons
|
|
||||||
$ionicons-font-path: '~ionicons/fonts';
|
|
||||||
|
|
||||||
// Transitions
|
// Transitions
|
||||||
$transition-ease-in: all 0.250s ease-in;
|
$transition-ease-in: all 0.250s ease-in;
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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')
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -72,7 +72,17 @@ class DashboardController < ActionController::Base
|
|||||||
@application_pack = if request.path.include?('/auth') || request.path.include?('/login')
|
@application_pack = if request.path.include?('/auth') || request.path.include?('/login')
|
||||||
'v3app'
|
'v3app'
|
||||||
else
|
else
|
||||||
'application'
|
'dashboard'
|
||||||
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
|
||||||
|
|||||||
@@ -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?
|
||||||
|
|||||||
@@ -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,33 +1,5 @@
|
|||||||
<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,8 +8,9 @@ import UpgradeBanner from './components/app/UpgradeBanner.vue';
|
|||||||
import PaymentPendingBanner from './components/app/PaymentPendingBanner.vue';
|
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 { useRouter } from 'vue-router';
|
||||||
|
import { useStore } from 'dashboard/composables/store';
|
||||||
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 {
|
||||||
@@ -59,9 +32,12 @@ export default {
|
|||||||
UpgradeBanner,
|
UpgradeBanner,
|
||||||
PendingEmailVerificationBanner,
|
PendingEmailVerificationBanner,
|
||||||
},
|
},
|
||||||
|
setup() {
|
||||||
|
const router = useRouter();
|
||||||
|
const store = useStore();
|
||||||
|
|
||||||
mixins: [rtlMixin],
|
return { router, store };
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showAddAccountModal: false,
|
showAddAccountModal: false,
|
||||||
@@ -69,12 +45,11 @@ export default {
|
|||||||
reconnectService: 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',
|
||||||
@@ -105,7 +80,7 @@ export default {
|
|||||||
this.listenToThemeChanges();
|
this.listenToThemeChanges();
|
||||||
this.setLocale(window.chatwootConfig.selectedLocale);
|
this.setLocale(window.chatwootConfig.selectedLocale);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
unmounted() {
|
||||||
if (this.reconnectService) {
|
if (this.reconnectService) {
|
||||||
this.reconnectService.disconnect();
|
this.reconnectService.disconnect();
|
||||||
}
|
}
|
||||||
@@ -130,10 +105,10 @@ 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(this.store, pubsubToken);
|
||||||
this.reconnectService = new ReconnectService(this.$store, router);
|
this.reconnectService = new ReconnectService(this.store, this.router);
|
||||||
|
window.reconnectService = this.reconnectService;
|
||||||
|
|
||||||
verifyServiceWorkerExistence(registration =>
|
verifyServiceWorkerExistence(registration =>
|
||||||
registration.pushManager.getSubscription().then(subscription => {
|
registration.pushManager.getSubscription().then(subscription => {
|
||||||
@@ -147,8 +122,50 @@ 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>
|
||||||
|
<router-view v-slot="{ Component }">
|
||||||
|
<transition name="fade" mode="out-in">
|
||||||
|
<component :is="Component" />
|
||||||
|
</transition>
|
||||||
|
</router-view>
|
||||||
|
<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';
|
||||||
|
|
||||||
|
.v-popper--theme-tooltip .v-popper__inner {
|
||||||
|
background: black !important;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
padding: 4px 8px !important;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-popper--theme-tooltip .v-popper__arrow-container {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multiselect__input {
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
|
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
|
||||||
|
|||||||
@@ -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(() => {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 76 KiB |
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="800" height="800" viewBox="0 0 800 800" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M800 0H600V200H400V400H200V600H0V800H200H400H600H800V600V400V200V0Z" fill="#2773E4" fill-opacity="0.42"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 262 B |
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="600" height="600" viewBox="0 0 600 600" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M200 0H0V200V400V600H200V400H400V200H600V0H400H200Z" fill="#2773E4" fill-opacity="0.42"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 246 B |
@@ -31,23 +31,6 @@
|
|||||||
transform: translateX($space-medium);
|
transform: translateX($space-medium);
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-list-enter-active,
|
|
||||||
.menu-list-leave-active {
|
|
||||||
transition: opacity 0.3s var(--ease-out-cubic),
|
|
||||||
transform 0.2s var(--ease-out-cubic);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-list-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
position: absolute;
|
|
||||||
transform: translateX($space-small);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-list-enter {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateX(-$space-small);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-up-enter-active {
|
.slide-up-enter-active {
|
||||||
transition: all 0.3s var(--ease-in-cubic);
|
transition: all 0.3s var(--ease-in-cubic);
|
||||||
}
|
}
|
||||||
@@ -65,7 +48,8 @@
|
|||||||
.menu-slide-enter-active,
|
.menu-slide-enter-active,
|
||||||
.menu-slide-leave-active {
|
.menu-slide-leave-active {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
transition: transform 0.25s var(--ease-in-cubic),
|
transition:
|
||||||
|
transform 0.25s var(--ease-in-cubic),
|
||||||
opacity 0.15s var(--ease-in-cubic);
|
opacity 0.15s var(--ease-in-cubic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@import '~vue2-datepicker/scss/index';
|
@import 'vue-datepicker-next/scss/index';
|
||||||
|
|
||||||
.date-picker {
|
.date-picker {
|
||||||
// To be removed one SLA reports date picker is created
|
// To be removed one SLA reports date picker is created
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@import '~dashboard/assets/scss/variables';
|
@import 'dashboard/assets/scss/variables';
|
||||||
|
|
||||||
.formulate-input {
|
.formulate-input {
|
||||||
.formulate-input-errors {
|
.formulate-input-errors {
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
// scss-lint:disable SpaceAfterPropertyColon
|
// scss-lint:disable SpaceAfterPropertyColon
|
||||||
@import 'shared/assets/fonts/inter';
|
@import 'shared/assets/fonts/inter';
|
||||||
|
|
||||||
// Inter,
|
// Inter,
|
||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
font-family:
|
font-family:
|
||||||
'PlusJakarta',
|
'Inter',
|
||||||
-apple-system,
|
-apple-system,
|
||||||
system-ui,
|
system-ui,
|
||||||
BlinkMacSystemFont,
|
BlinkMacSystemFont,
|
||||||
@@ -23,7 +24,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.app-wrapper {
|
.app-wrapper {
|
||||||
@apply h-full flex-grow-0 min-h-0 w-full;
|
@apply h-screen flex-grow-0 min-h-0 w-full;
|
||||||
|
|
||||||
.button--fixed-top {
|
.button--fixed-top {
|
||||||
@apply fixed ltr:right-2 rtl:left-2 top-2 flex flex-row;
|
@apply fixed ltr:right-2 rtl:left-2 top-2 flex flex-row;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
@import '~dashboard/assets/scss/variables';
|
@import 'dashboard/assets/scss/variables';
|
||||||
@import '~widget/assets/scss/mixins';
|
@import 'widget/assets/scss/mixins';
|
||||||
|
|
||||||
$spinner-before-border-color: rgba(255, 255, 255, 0.7);
|
$spinner-before-border-color: rgba(255, 255, 255, 0.7);
|
||||||
|
|
||||||
|
|||||||
@@ -89,9 +89,6 @@ $swift-ease-out-duration: .4s !default;
|
|||||||
$swift-ease-out-function: cubic-bezier(0.37, 0, 0.63, 1) !default;
|
$swift-ease-out-function: cubic-bezier(0.37, 0, 0.63, 1) !default;
|
||||||
$swift-ease-out: all $swift-ease-out-duration $swift-ease-out-function !default;
|
$swift-ease-out: all $swift-ease-out-duration $swift-ease-out-function !default;
|
||||||
|
|
||||||
// Ionicons
|
|
||||||
$ionicons-font-path: '~ionicons/fonts';
|
|
||||||
|
|
||||||
// Transitions
|
// Transitions
|
||||||
$transition-ease-in: all 0.250s ease-in;
|
$transition-ease-in: all 0.250s ease-in;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
@import 'tailwindcss/components';
|
@import 'tailwindcss/components';
|
||||||
@import 'tailwindcss/utilities';
|
@import 'tailwindcss/utilities';
|
||||||
|
|
||||||
@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';
|
||||||
@@ -31,10 +33,13 @@
|
|||||||
|
|
||||||
@import 'plugins/multiselect';
|
@import 'plugins/multiselect';
|
||||||
@import 'plugins/dropdown';
|
@import 'plugins/dropdown';
|
||||||
@import '~shared/assets/stylesheets/ionicons';
|
|
||||||
|
|
||||||
.tooltip {
|
.tooltip {
|
||||||
@apply bg-slate-900 text-white py-1 px-2 z-40 text-xs rounded-md dark:bg-slate-200 dark:text-slate-900;
|
@apply bg-slate-900 text-white py-1 px-2 z-40 text-xs rounded-md dark:bg-slate-200 dark:text-slate-900 max-w-96;
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
@apply h-full w-full;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hide {
|
.hide {
|
||||||
@@ -213,6 +218,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;
|
||||||
|
|||||||
@@ -222,6 +222,7 @@
|
|||||||
|
|
||||||
.multiselect__input {
|
.multiselect__input {
|
||||||
@apply h-[2.875rem] min-h-[2.875rem];
|
@apply h-[2.875rem] min-h-[2.875rem];
|
||||||
|
margin-bottom: 0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.multiselect__single {
|
.multiselect__single {
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
@import 'shared/assets/fonts/inter';
|
|
||||||
@import 'shared/assets/fonts/plus-jakarta';
|
|
||||||
@import 'shared/assets/stylesheets/animations';
|
|
||||||
@import 'shared/assets/stylesheets/colors';
|
|
||||||
@import 'shared/assets/stylesheets/spacing';
|
|
||||||
@import 'shared/assets/stylesheets/font-size';
|
|
||||||
@import 'shared/assets/stylesheets/font-weights';
|
|
||||||
@import 'shared/assets/stylesheets/shadows';
|
|
||||||
@import 'shared/assets/stylesheets/border-radius';
|
|
||||||
@import 'variables';
|
|
||||||
|
|
||||||
@import 'vue-multiselect/dist/vue-multiselect.min.css';
|
|
||||||
@import '~shared/assets/stylesheets/ionicons';
|
|
||||||
|
|
||||||
@import 'mixins';
|
|
||||||
@import 'helper-classes';
|
|
||||||
|
|
||||||
@import 'typography';
|
|
||||||
@import 'layout';
|
|
||||||
@import 'animations';
|
|
||||||
|
|
||||||
@import 'widgets/buttons';
|
|
||||||
@import 'widgets/base';
|
|
||||||
|
|
||||||
@import 'plugins/multiselect';
|
|
||||||
|
|
||||||
@import 'widget/assets/scss/reset';
|
|
||||||
@import 'tailwindcss/base';
|
|
||||||
@import 'tailwindcss/components';
|
|
||||||
@import 'tailwindcss/utilities';
|
|
||||||
@import 'widget/assets/scss/utilities';
|
|
||||||
|
|
||||||
html,
|
|
||||||
body {
|
|
||||||
font-family: 'PlusJakarta', sans-serif;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
@@ -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,30 +0,0 @@
|
|||||||
import { action } from '@storybook/addon-actions';
|
|
||||||
import AccordionItemComponent from './AccordionItem';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
title: 'Components/Generic/Accordion',
|
|
||||||
component: AccordionItemComponent,
|
|
||||||
argTypes: {
|
|
||||||
title: {
|
|
||||||
control: {
|
|
||||||
type: 'string',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const Template = (args, { argTypes }) => ({
|
|
||||||
props: Object.keys(argTypes),
|
|
||||||
components: { AccordionItem: AccordionItemComponent },
|
|
||||||
template: `
|
|
||||||
<accordion-item v-bind="$props" @click="onClick">
|
|
||||||
This is a sample content you can pass as a slot
|
|
||||||
</accordion-item>
|
|
||||||
`,
|
|
||||||
});
|
|
||||||
|
|
||||||
export const AccordionItem = Template.bind({});
|
|
||||||
AccordionItem.args = {
|
|
||||||
onClick: action('Added'),
|
|
||||||
title: 'Title of the accordion item',
|
|
||||||
};
|
|
||||||
@@ -1,11 +1,45 @@
|
|||||||
|
<script setup>
|
||||||
|
import EmojiOrIcon from 'shared/components/EmojiOrIcon.vue';
|
||||||
|
import { defineEmits } from 'vue';
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
compact: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
emoji: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
isOpen: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['toggle']);
|
||||||
|
|
||||||
|
const onToggle = () => {
|
||||||
|
emit('toggle');
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="-mt-px text-sm">
|
<div class="-mt-px text-sm">
|
||||||
<button
|
<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"
|
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')"
|
@click.stop="onToggle"
|
||||||
>
|
>
|
||||||
<div class="flex justify-between mb-0.5">
|
<div class="flex justify-between mb-0.5">
|
||||||
<emoji-or-icon class="inline-block w-5" :icon="icon" :emoji="emoji" />
|
<EmojiOrIcon class="inline-block w-5" :icon="icon" :emoji="emoji" />
|
||||||
<h5
|
<h5
|
||||||
class="text-slate-800 text-sm dark:text-slate-100 mb-0 py-0 pr-2 pl-0"
|
class="text-slate-800 text-sm dark:text-slate-100 mb-0 py-0 pr-2 pl-0"
|
||||||
>
|
>
|
||||||
@@ -29,35 +63,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
import EmojiOrIcon from 'shared/components/EmojiOrIcon.vue';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
EmojiOrIcon,
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
compact: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
icon: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
emoji: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
isOpen: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -1,17 +1,3 @@
|
|||||||
<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>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -27,6 +13,19 @@ 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"
|
||||||
|
>
|
||||||
|
<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 {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -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(() => {
|
||||||
@@ -61,14 +61,14 @@ const hasAppliedFiltersOrActiveFolders = computed(() => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
<div v-if="hasAppliedFilters && !hasActiveFolders">
|
<template v-if="hasAppliedFilters && !hasActiveFolders">
|
||||||
<woot-button
|
<woot-button
|
||||||
v-tooltip.top-end="$t('FILTER.CUSTOM_VIEWS.ADD.SAVE_BUTTON')"
|
v-tooltip.top-end="$t('FILTER.CUSTOM_VIEWS.ADD.SAVE_BUTTON')"
|
||||||
size="tiny"
|
size="tiny"
|
||||||
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,17 +76,17 @@ 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>
|
</template>
|
||||||
<div v-if="hasActiveFolders">
|
<template v-if="hasActiveFolders">
|
||||||
<woot-button
|
<woot-button
|
||||||
v-tooltip.top-end="$t('FILTER.CUSTOM_VIEWS.EDIT.EDIT_BUTTON')"
|
v-tooltip.top-end="$t('FILTER.CUSTOM_VIEWS.EDIT.EDIT_BUTTON')"
|
||||||
size="tiny"
|
size="tiny"
|
||||||
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,9 +94,9 @@ 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>
|
</template>
|
||||||
<woot-button
|
<woot-button
|
||||||
v-else
|
v-else
|
||||||
v-tooltip.right="$t('FILTER.TOOLTIP_LABEL')"
|
v-tooltip.right="$t('FILTER.TOOLTIP_LABEL')"
|
||||||
@@ -104,11 +104,11 @@ 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"
|
@change-filter="onBasicFilterChange"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,34 +1,11 @@
|
|||||||
<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 'highlight.js/lib/common';
|
||||||
|
|
||||||
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,
|
||||||
@@ -53,33 +30,53 @@ export default {
|
|||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
title: this.codepenTitle,
|
title: this.codepenTitle,
|
||||||
private: true,
|
private: true,
|
||||||
[lang]: this.script,
|
[lang]: this.scrubbedScript,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
scrubbedScript() {
|
||||||
|
// remove trailing and leading extra lines and not spaces
|
||||||
|
const scrubbed = this.script.replace(/^\s*[\r\n]/gm, '');
|
||||||
|
const lines = scrubbed.split('\n');
|
||||||
|
|
||||||
|
// remove extra indentations
|
||||||
|
const minIndent = lines.reduce((min, line) => {
|
||||||
|
if (line.trim().length === 0) return min;
|
||||||
|
const indent = line.match(/^\s*/)[0].length;
|
||||||
|
return Math.min(min, indent);
|
||||||
|
}, Infinity);
|
||||||
|
|
||||||
|
return lines.map(line => line.slice(minIndent)).join('\n');
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async onCopy(e) {
|
async onCopy(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
await copyTextToClipboard(this.script);
|
await copyTextToClipboard(this.scrubbedScript);
|
||||||
this.showAlert(this.$t('COMPONENTS.CODE.COPY_SUCCESSFUL'));
|
useAlert(this.$t('COMPONENTS.CODE.COPY_SUCCESSFUL'));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<template>
|
||||||
.code--container {
|
<div class="relative text-left">
|
||||||
position: relative;
|
<div class="top-1.5 absolute right-1.5 flex items-center gap-1">
|
||||||
text-align: left;
|
<form
|
||||||
|
v-if="enableCodePen"
|
||||||
.code--action-area {
|
class="flex items-center"
|
||||||
top: var(--space-small);
|
action="https://codepen.io/pen/define"
|
||||||
position: absolute;
|
method="POST"
|
||||||
right: var(--space-small);
|
target="_blank"
|
||||||
}
|
>
|
||||||
|
<input type="hidden" name="data" :value="codepenScriptValue" />
|
||||||
.code--codeopen-form {
|
<button type="submit" class="button secondary tiny">
|
||||||
display: inline-block;
|
{{ $t('COMPONENTS.CODE.CODEPEN') }}
|
||||||
}
|
</button>
|
||||||
}
|
</form>
|
||||||
</style>
|
<button type="button" class="button secondary tiny" @click="onCopy">
|
||||||
|
{{ $t('COMPONENTS.CODE.BUTTON_TEXT') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<highlightjs v-if="script" :language="lang" :code="scrubbedScript" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -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 {
|
||||||
@@ -37,6 +14,7 @@ export default {
|
|||||||
'toggleContextMenu',
|
'toggleContextMenu',
|
||||||
'markAsUnread',
|
'markAsUnread',
|
||||||
'assignPriority',
|
'assignPriority',
|
||||||
|
'isConversationSelected',
|
||||||
],
|
],
|
||||||
props: {
|
props: {
|
||||||
source: {
|
source: {
|
||||||
@@ -59,10 +37,6 @@ export default {
|
|||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
isConversationSelected: {
|
|
||||||
type: Function,
|
|
||||||
default: () => {},
|
|
||||||
},
|
|
||||||
showAssignee: {
|
showAssignee: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
@@ -70,3 +44,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
|
||||||
|
@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>
|
||||||
|
|||||||
@@ -1,147 +1,13 @@
|
|||||||
<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';
|
||||||
|
import { emitter } from 'shared/helpers/mitt';
|
||||||
|
|
||||||
const DATE_FORMAT = 'yyyy-MM-dd';
|
const DATE_FORMAT = 'yyyy-MM-dd';
|
||||||
|
|
||||||
@@ -150,7 +16,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 +28,13 @@ 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 },
|
||||||
},
|
},
|
||||||
|
emits: ['update', 'delete', 'copy'],
|
||||||
|
setup() {
|
||||||
|
return { v$: useVuelidate() };
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isEditing: false,
|
isEditing: false,
|
||||||
@@ -225,13 +93,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 +114,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 +129,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)
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -270,10 +137,10 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.editedValue = this.formattedValue;
|
this.editedValue = this.formattedValue;
|
||||||
this.$emitter.on(BUS_EVENTS.FOCUS_CUSTOM_ATTRIBUTE, this.onFocusAttribute);
|
emitter.on(BUS_EVENTS.FOCUS_CUSTOM_ATTRIBUTE, this.onFocusAttribute);
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
this.$emitter.off(BUS_EVENTS.FOCUS_CUSTOM_ATTRIBUTE, this.onFocusAttribute);
|
emitter.off(BUS_EVENTS.FOCUS_CUSTOM_ATTRIBUTE, this.onFocusAttribute);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onFocusAttribute(focusAttributeKey) {
|
onFocusAttribute(focusAttributeKey) {
|
||||||
@@ -287,7 +154,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onClickAway() {
|
onClickAway() {
|
||||||
this.$v.$reset();
|
this.v$.$reset();
|
||||||
this.isEditing = false;
|
this.isEditing = false;
|
||||||
},
|
},
|
||||||
onEdit() {
|
onEdit() {
|
||||||
@@ -307,8 +174,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 +183,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 +193,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'
|
||||||
|
)
|
||||||
|
"
|
||||||
|
@select="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,26 @@
|
|||||||
|
<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>
|
||||||
|
|
||||||
|
<!-- eslint-disable-next-line vue/no-root-v-if -->
|
||||||
|
<template>
|
||||||
|
<div v-if="shouldShowContent">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -1,35 +1,11 @@
|
|||||||
<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 'vue-datepicker-next';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
DatePicker,
|
DatePicker,
|
||||||
},
|
},
|
||||||
|
emits: ['close', 'chooseTime'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -47,7 +23,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,8 +40,31 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
|
||||||
.modal-content {
|
<template>
|
||||||
@apply pt-2 px-5 pb-6;
|
<div class="flex flex-col">
|
||||||
}
|
<woot-modal-header :header-title="$t('CONVERSATION.CUSTOM_SNOOZE.TITLE')" />
|
||||||
</style>
|
<form
|
||||||
|
class="modal-content w-full pt-2 px-5 pb-6"
|
||||||
|
@submit.prevent="chooseTime"
|
||||||
|
>
|
||||||
|
<DatePicker
|
||||||
|
v-model:value="snoozeTime"
|
||||||
|
type="datetime"
|
||||||
|
inline
|
||||||
|
input-class="mx-input reset-base"
|
||||||
|
:lang="lang"
|
||||||
|
:disabled-date="disabledDate"
|
||||||
|
:disabled-time="disabledTime"
|
||||||
|
/>
|
||||||
|
<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>
|
||||||
|
|||||||
@@ -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,34 +1,28 @@
|
|||||||
|
<script setup>
|
||||||
|
import { ref, defineEmits } from 'vue';
|
||||||
|
import { useIntersectionObserver } from '@vueuse/core';
|
||||||
|
|
||||||
|
const { options } = defineProps({
|
||||||
|
options: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({ root: document, rootMargin: '100px 0 100px 0)' }),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['observed']);
|
||||||
|
const observedElement = ref('');
|
||||||
|
|
||||||
|
useIntersectionObserver(
|
||||||
|
observedElement,
|
||||||
|
([{ isIntersecting }]) => {
|
||||||
|
if (isIntersecting) {
|
||||||
|
emit('observed');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
options
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div ref="observedElement" class="h-6 w-full" />
|
<div ref="observedElement" class="h-6 w-full" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
options: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({ root: document, rootMargin: '100px 0 100px 0)' }),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.intersectionObserver = null;
|
|
||||||
this.registerInfiniteLoader();
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
this.unobserveInfiniteLoadObserver();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
registerInfiniteLoader() {
|
|
||||||
this.intersectionObserver = new IntersectionObserver(entries => {
|
|
||||||
if (entries && entries[0].isIntersecting) {
|
|
||||||
this.$emit('observed');
|
|
||||||
}
|
|
||||||
}, this.options);
|
|
||||||
this.intersectionObserver.observe(this.$refs.observedElement);
|
|
||||||
},
|
|
||||||
unobserveInfiniteLoadObserver() {
|
|
||||||
this.intersectionObserver.unobserve(this.$refs.observedElement);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -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,3 +1,71 @@
|
|||||||
|
<script setup>
|
||||||
|
// [TODO] Use Teleport to move the modal to the end of the body
|
||||||
|
import { ref, computed, defineEmits, onMounted } from 'vue';
|
||||||
|
import { useEventListener } from '@vueuse/core';
|
||||||
|
|
||||||
|
const { modalType, closeOnBackdropClick, onClose } = defineProps({
|
||||||
|
closeOnBackdropClick: { type: Boolean, default: true },
|
||||||
|
showCloseButton: { type: Boolean, default: true },
|
||||||
|
onClose: { type: Function, required: true },
|
||||||
|
fullWidth: { type: Boolean, default: false },
|
||||||
|
modalType: { type: String, default: 'centered' },
|
||||||
|
size: { type: String, default: '' },
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['close']);
|
||||||
|
const show = defineModel('show', { type: Boolean, default: false });
|
||||||
|
|
||||||
|
const modalClassName = computed(() => {
|
||||||
|
const modalClassNameMap = {
|
||||||
|
centered: '',
|
||||||
|
'right-aligned': 'right-aligned',
|
||||||
|
};
|
||||||
|
|
||||||
|
return `modal-mask skip-context-menu ${modalClassNameMap[modalType] || ''}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
// [TODO] Revisit this logic to use outside click directive
|
||||||
|
const mousedDownOnBackdrop = ref(false);
|
||||||
|
|
||||||
|
const handleMouseDown = () => {
|
||||||
|
mousedDownOnBackdrop.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const close = () => {
|
||||||
|
show.value = false;
|
||||||
|
emit('close');
|
||||||
|
onClose();
|
||||||
|
};
|
||||||
|
|
||||||
|
const onMouseUp = () => {
|
||||||
|
if (mousedDownOnBackdrop.value) {
|
||||||
|
mousedDownOnBackdrop.value = false;
|
||||||
|
if (closeOnBackdropClick) {
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onKeydown = e => {
|
||||||
|
if (show.value && e.code === 'Escape') {
|
||||||
|
close();
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
useEventListener(document.body, 'mouseup', onMouseUp);
|
||||||
|
useEventListener(document, 'keydown', onKeydown);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (onClose && typeof onClose === 'function') {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.warn(
|
||||||
|
"[DEPRECATED] The 'onClose' prop is deprecated. Please use the 'close' event instead."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<transition name="modal-fade">
|
<transition name="modal-fade">
|
||||||
<div
|
<div
|
||||||
@@ -7,8 +75,8 @@
|
|||||||
@mousedown="handleMouseDown"
|
@mousedown="handleMouseDown"
|
||||||
>
|
>
|
||||||
<div
|
<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="{
|
: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,
|
'rounded-xl w-[37.5rem]': !fullWidth,
|
||||||
'items-center rounded-none flex h-full justify-center w-full':
|
'items-center rounded-none flex h-full justify-center w-full':
|
||||||
fullWidth,
|
fullWidth,
|
||||||
@@ -31,83 +99,6 @@
|
|||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
closeOnBackdropClick: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
show: Boolean,
|
|
||||||
showCloseButton: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
onClose: {
|
|
||||||
type: Function,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
fullWidth: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
modalType: {
|
|
||||||
type: String,
|
|
||||||
default: 'centered',
|
|
||||||
},
|
|
||||||
size: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
mousedDownOnBackdrop: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
modalClassName() {
|
|
||||||
const modalClassNameMap = {
|
|
||||||
centered: '',
|
|
||||||
'right-aligned': 'right-aligned',
|
|
||||||
};
|
|
||||||
|
|
||||||
return `modal-mask skip-context-menu ${
|
|
||||||
modalClassNameMap[this.modalType] || ''
|
|
||||||
}`;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
document.addEventListener('keydown', e => {
|
|
||||||
if (this.show && e.code === 'Escape') {
|
|
||||||
this.onClose();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
document.body.addEventListener('mouseup', this.onMouseUp);
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
document.body.removeEventListener('mouseup', this.onMouseUp);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleMouseDown() {
|
|
||||||
this.mousedDownOnBackdrop = true;
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
this.onClose();
|
|
||||||
},
|
|
||||||
onMouseUp() {
|
|
||||||
if (this.mousedDownOnBackdrop) {
|
|
||||||
this.mousedDownOnBackdrop = false;
|
|
||||||
if (this.closeOnBackdropClick) {
|
|
||||||
this.onClose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<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,7 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onBeforeUnmount } from 'vue';
|
import { ref, computed, onBeforeUnmount } from 'vue';
|
||||||
import { useI18n } from 'dashboard/composables/useI18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'dashboard/composables/route';
|
import { useRoute } from 'vue-router';
|
||||||
import { useEmitter } from 'dashboard/composables/emitter';
|
import { useEmitter } from 'dashboard/composables/emitter';
|
||||||
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -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,16 +1,6 @@
|
|||||||
<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';
|
||||||
|
import { emitter } from 'shared/helpers/mitt';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -21,8 +11,19 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onMenuItemClick() {
|
onMenuItemClick() {
|
||||||
this.$emitter.emit(BUS_EVENTS.TOGGLE_SIDEMENU);
|
emitter.emit(BUS_EVENTS.TOGGLE_SIDEMENU);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</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,11 @@
|
|||||||
<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';
|
import { emitter } from 'shared/helpers/mitt';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
WootSnackbar,
|
WootSnackbar,
|
||||||
},
|
},
|
||||||
mixins: [alertMixin],
|
|
||||||
props: {
|
props: {
|
||||||
duration: {
|
duration: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -36,13 +20,13 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$emitter.on('newToastMessage', this.onNewToastMessage);
|
emitter.on('newToastMessage', this.onNewToastMessage);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
unmounted() {
|
||||||
this.$emitter.off('newToastMessage', this.onNewToastMessage);
|
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 +39,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,15 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!-- eslint-disable-next-line vue/no-root-v-if -->
|
||||||
|
<template>
|
||||||
|
<Banner
|
||||||
|
v-if="shouldShowBanner"
|
||||||
|
color-scheme="alert"
|
||||||
|
:banner-message="bannerMessage"
|
||||||
|
:action-button-label="actionButtonMessage"
|
||||||
|
has-action-button
|
||||||
|
@primary-action="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,21 @@ 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>
|
||||||
|
|
||||||
|
<!-- eslint-disable-next-line vue/no-root-v-if -->
|
||||||
|
<template>
|
||||||
|
<Banner
|
||||||
|
v-if="shouldShowBanner"
|
||||||
|
color-scheme="alert"
|
||||||
|
:banner-message="bannerMessage"
|
||||||
|
:action-button-label="actionButtonMessage"
|
||||||
|
action-button-icon="mail"
|
||||||
|
has-action-button
|
||||||
|
@primary-action="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,16 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!-- eslint-disable-next-line vue/no-root-v-if -->
|
||||||
|
<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,15 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!-- eslint-disable-next-line vue/no-root-v-if -->
|
||||||
|
<template>
|
||||||
|
<Banner
|
||||||
|
v-if="shouldShowBanner"
|
||||||
|
color-scheme="alert"
|
||||||
|
:banner-message="bannerMessage"
|
||||||
|
:action-button-label="actionButtonMessage"
|
||||||
|
has-action-button
|
||||||
|
@primary-action="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,
|
||||||
@@ -35,10 +27,24 @@ export default {
|
|||||||
default: 'primary',
|
default: 'primary',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
created() {
|
||||||
onClick(e) {
|
// eslint-disable-next-line
|
||||||
this.$emit('click', e);
|
console.warn(
|
||||||
},
|
'[DEPRECATED] This component has been deprecated and will be removed soon. Please use v3/components/Form/Button.vue instead'
|
||||||
|
);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<button :type="type" class="button nice" :class="variant">
|
||||||
|
<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';
|
||||||
|
|
||||||
@@ -54,13 +40,22 @@ export default {
|
|||||||
return `button nice gap-2 ${this.buttonClass || ' '}`;
|
return `button nice gap-2 ${this.buttonClass || ' '}`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
onClick() {
|
|
||||||
this.$emit('click');
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<button
|
||||||
|
:type="type"
|
||||||
|
data-testid="submit_button"
|
||||||
|
:disabled="disabled"
|
||||||
|
:class="computedClass"
|
||||||
|
>
|
||||||
|
<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 'vue-i18n';
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user