Compare commits
178
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
347b4c5b4e | ||
|
|
7fe94dc1a2 | ||
|
|
cae097c5fa | ||
|
|
faf35738b3 | ||
|
|
341487b93e | ||
|
|
f569ed93ad | ||
|
|
eac292b11b | ||
|
|
75119d4a08 | ||
|
|
67d7ee0185 | ||
|
|
7e33e033cd | ||
|
|
02fa76f3df | ||
|
|
91d80004a6 | ||
|
|
b809cd2f15 | ||
|
|
ee773f31eb | ||
|
|
1f03fc4dc3 | ||
|
|
a42b99ada0 | ||
|
|
c6be04cdc1 | ||
|
|
14471cc20c | ||
|
|
6b42ff8d39 | ||
|
|
a88fef2e1d | ||
|
|
ee9f1d7adb | ||
|
|
b711bfd2ca | ||
|
|
42af4b1d01 | ||
|
|
9a7318a9db | ||
|
|
48fa7bf72b | ||
|
|
469e724e3a | ||
|
|
0c101b1f6b | ||
|
|
ad4ec9e93b | ||
|
|
5c560c7628 | ||
|
|
dbb164a37d | ||
|
|
fdcfed2cd7 | ||
|
|
b4f758f644 | ||
|
|
4df58501e3 | ||
|
|
693309202e | ||
|
|
ecd9cf0326 | ||
|
|
81d8d3862d | ||
|
|
c31325e982 | ||
|
|
28452b300d | ||
|
|
6784eb9b3d | ||
|
|
1baf5cbe19 | ||
|
|
c2e6ad6376 | ||
|
|
d908c880d2 | ||
|
|
fcc6e2b8b2 | ||
|
|
6cab741392 | ||
|
|
f3bc2476fc | ||
|
|
3214d06a83 | ||
|
|
8ea21eeefd | ||
|
|
fd28ed8d83 | ||
|
|
b5f5c5c1bc | ||
|
|
4ebfae8b44 | ||
|
|
d0824cc86a | ||
|
|
d2583d32e9 | ||
|
|
462ab5241c | ||
|
|
f984d745e7 | ||
|
|
ca13664ef9 | ||
|
|
304c938260 | ||
|
|
d5286c9535 | ||
|
|
855dd590ab | ||
|
|
7e70f7a68a | ||
|
|
84fd769570 | ||
|
|
661e905dbd | ||
|
|
270f26e471 | ||
|
|
53fce7be03 | ||
|
|
60a1e9b15d | ||
|
|
65312744c7 | ||
|
|
51b9fd8eca | ||
|
|
4dc7a653eb | ||
|
|
5ab913f7b5 | ||
|
|
c98c255ed0 | ||
|
|
446a219cd1 | ||
|
|
94829aea8d | ||
|
|
86cb4fd809 | ||
|
|
b434279422 | ||
|
|
d9900e50a0 | ||
|
|
97f1825a14 | ||
|
|
5ed84af2e3 | ||
|
|
df4de508e7 | ||
|
|
1230d1f251 | ||
|
|
62b36d4aec | ||
|
|
75c57ad039 | ||
|
|
6475a6a593 | ||
|
|
441cc065ae | ||
|
|
0b74be82a3 | ||
|
|
cbc2807296 | ||
|
|
c09e875c83 | ||
|
|
87313ecc35 | ||
|
|
8262123481 | ||
|
|
420be64c45 | ||
|
|
9acb0d86b5 | ||
|
|
2a5ecf84a1 | ||
|
|
286e3a449d | ||
|
|
e5ee6027b4 | ||
|
|
eb412b67bd | ||
|
|
6fb762f96c | ||
|
|
ab1ba1c4c7 | ||
|
|
d276025419 | ||
|
|
94b7154926 | ||
|
|
60951b45fd | ||
|
|
69ad953ae6 | ||
|
|
c4b076dbb2 | ||
|
|
dc49ae2515 | ||
|
|
b71a0da10d | ||
|
|
bb9e3a5495 | ||
|
|
647a65d481 | ||
|
|
99ec18c95b | ||
|
|
64ba23688b | ||
|
|
2fec2e5993 | ||
|
|
090316a078 | ||
|
|
fcd604dcde | ||
|
|
13b4fdb34c | ||
|
|
45d4d3660c | ||
|
|
0ea616a6ea | ||
|
|
6b8dd3c86a | ||
|
|
61d10044a0 | ||
|
|
4378506a35 | ||
|
|
1132556512 | ||
|
|
93f18315cc | ||
|
|
d89fa09359 | ||
|
|
07dd6448f4 | ||
|
|
661326ae51 | ||
|
|
18eb53acf4 | ||
|
|
1b02ebec68 | ||
|
|
5b9f997fa0 | ||
|
|
802f0694ed | ||
|
|
17500cc62d | ||
|
|
5140deb6f6 | ||
|
|
3e5ca9bca9 | ||
|
|
5ebe8c71ec | ||
|
|
8c78573d9d | ||
|
|
c553997af8 | ||
|
|
30a3a35281 | ||
|
|
e4ba80e2f0 | ||
|
|
b72848513f | ||
|
|
b8814a8bd5 | ||
|
|
3e993ead0f | ||
|
|
7343e53659 | ||
|
|
cb01a2bc66 | ||
|
|
4e4aa7f580 | ||
|
|
a6cc3617c0 | ||
|
|
3ea6429895 | ||
|
|
19d8f6bac5 | ||
|
|
cdb1dc6714 | ||
|
|
ef591f848a | ||
|
|
20dc4f169c | ||
|
|
01acbe3cda | ||
|
|
14ba73fc63 | ||
|
|
2573f37d90 | ||
|
|
d1c9af260c | ||
|
|
24ea968b00 | ||
|
|
58da92a252 | ||
|
|
a657b45bd1 | ||
|
|
6e207acb5a | ||
|
|
d7c10b4f2a | ||
|
|
b1893c7d96 | ||
|
|
ee4a0d4486 | ||
|
|
eea1ab3002 | ||
|
|
b7f3f72b9c | ||
|
|
b26862e3d8 | ||
|
|
811eb66615 | ||
|
|
257cd07ee6 | ||
|
|
b7f2c151bf | ||
|
|
97efd36bc5 | ||
|
|
a0bf6055fc | ||
|
|
c42dd8a23e | ||
|
|
cc8866a84e | ||
|
|
92c51a10de | ||
|
|
9edfb1e902 | ||
|
|
be6bc88f80 | ||
|
|
ea4477ccde | ||
|
|
a2857cac38 | ||
|
|
293a29ec98 | ||
|
|
ddada56753 | ||
|
|
578e2ee8db | ||
|
|
b683973e79 | ||
|
|
2cfca6008b | ||
|
|
d2f5311400 | ||
|
|
f6dbbf0d90 | ||
|
|
768fa9ab1b |
@@ -1,62 +0,0 @@
|
|||||||
version: '2'
|
|
||||||
plugins:
|
|
||||||
rubocop:
|
|
||||||
enabled: false
|
|
||||||
channel: rubocop-0-73
|
|
||||||
eslint:
|
|
||||||
enabled: false
|
|
||||||
csslint:
|
|
||||||
enabled: true
|
|
||||||
scss-lint:
|
|
||||||
enabled: true
|
|
||||||
brakeman:
|
|
||||||
enabled: false
|
|
||||||
checks:
|
|
||||||
similar-code:
|
|
||||||
enabled: false
|
|
||||||
method-count:
|
|
||||||
enabled: true
|
|
||||||
config:
|
|
||||||
threshold: 32
|
|
||||||
file-lines:
|
|
||||||
enabled: true
|
|
||||||
config:
|
|
||||||
threshold: 300
|
|
||||||
method-lines:
|
|
||||||
config:
|
|
||||||
threshold: 50
|
|
||||||
exclude_patterns:
|
|
||||||
- 'spec/'
|
|
||||||
- '**/specs/**/**'
|
|
||||||
- '**/spec/**/**'
|
|
||||||
- 'db/*'
|
|
||||||
- 'bin/**/*'
|
|
||||||
- 'db/**/*'
|
|
||||||
- 'config/**/*'
|
|
||||||
- 'public/**/*'
|
|
||||||
- 'vendor/**/*'
|
|
||||||
- 'node_modules/**/*'
|
|
||||||
- 'lib/tasks/auto_annotate_models.rake'
|
|
||||||
- 'app/test-matchers.js'
|
|
||||||
- 'docs/*'
|
|
||||||
- '**/*.md'
|
|
||||||
- '**/*.yml'
|
|
||||||
- 'app/javascript/dashboard/i18n/locale'
|
|
||||||
- '**/*.stories.js'
|
|
||||||
- 'stories/'
|
|
||||||
- 'app/javascript/dashboard/components/widgets/conversation/advancedFilterItems/index.js'
|
|
||||||
- 'app/javascript/shared/constants/countries.js'
|
|
||||||
- 'app/javascript/dashboard/components/widgets/conversation/advancedFilterItems/languages.js'
|
|
||||||
- 'app/javascript/dashboard/routes/dashboard/contacts/contactFilterItems/index.js'
|
|
||||||
- 'app/javascript/dashboard/routes/dashboard/settings/automation/constants.js'
|
|
||||||
- 'app/javascript/dashboard/components/widgets/FilterInput/FilterOperatorTypes.js'
|
|
||||||
- 'app/javascript/dashboard/routes/dashboard/settings/reports/constants.js'
|
|
||||||
- 'app/javascript/dashboard/store/captain/storeFactory.js'
|
|
||||||
- 'app/javascript/dashboard/i18n/index.js'
|
|
||||||
- 'app/javascript/widget/i18n/index.js'
|
|
||||||
- 'app/javascript/survey/i18n/index.js'
|
|
||||||
- 'app/javascript/shared/constants/locales.js'
|
|
||||||
- 'app/javascript/dashboard/helper/specs/macrosFixtures.js'
|
|
||||||
- 'app/javascript/dashboard/routes/dashboard/settings/macros/constants.js'
|
|
||||||
- '**/fixtures/**'
|
|
||||||
- '**/*/fixtures.js'
|
|
||||||
@@ -103,6 +103,7 @@ module.exports = {
|
|||||||
'⌘',
|
'⌘',
|
||||||
'📄',
|
'📄',
|
||||||
'🎉',
|
'🎉',
|
||||||
|
'🚀',
|
||||||
'💬',
|
'💬',
|
||||||
'👥',
|
'👥',
|
||||||
'📥',
|
'📥',
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
name: Auto-assign PR to Author
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-assign:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
steps:
|
||||||
|
- name: Auto-assign PR to author
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const { owner, repo } = context.repo;
|
||||||
|
const pull_number = context.payload.pull_request.number;
|
||||||
|
const author = context.payload.pull_request.user.login;
|
||||||
|
|
||||||
|
await github.rest.issues.addAssignees({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
issue_number: pull_number,
|
||||||
|
assignees: [author]
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`Assigned PR #${pull_number} to ${author}`);
|
||||||
@@ -6,6 +6,11 @@ name: Deploy Check
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
# If two pushes happen within a short time in the same PR, cancel the run of the oldest push
|
||||||
|
concurrency:
|
||||||
|
group: pr-${{ github.workflow }}-${{ github.head_ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deployment_check:
|
deployment_check:
|
||||||
name: Check Deployment
|
name: Check Deployment
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
|
|
||||||
|
# If two pushes happen within a short time in the same PR, cancel the run of the oldest push
|
||||||
|
concurrency:
|
||||||
|
group: pr-${{ github.workflow }}-${{ github.head_ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
log_lines_check:
|
log_lines_check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
|
|
||||||
|
# If two pushes happen within a short time in the same PR, cancel the run of the oldest push
|
||||||
|
concurrency:
|
||||||
|
group: pr-${{ github.workflow }}-${{ github.head_ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|||||||
@@ -94,3 +94,4 @@ yarn-debug.log*
|
|||||||
.vscode
|
.vscode
|
||||||
.claude/settings.local.json
|
.claude/settings.local.json
|
||||||
.cursor
|
.cursor
|
||||||
|
CLAUDE.local.md
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
*
|
||||||
|
!configs
|
||||||
|
!configs/**
|
||||||
|
!hooks
|
||||||
|
!hooks/**
|
||||||
|
!qlty.toml
|
||||||
|
!.gitignore
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ignored:
|
||||||
|
- DL3008
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
source-path=SCRIPTDIR
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
rules:
|
||||||
|
document-start: disable
|
||||||
|
quoted-strings:
|
||||||
|
required: only-when-needed
|
||||||
|
extra-allowed: ["{|}"]
|
||||||
|
key-duplicates: {}
|
||||||
|
octal-values:
|
||||||
|
forbid-implicit-octal: true
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
# This file was automatically generated by `qlty init`.
|
||||||
|
# You can modify it to suit your needs.
|
||||||
|
# We recommend you to commit this file to your repository.
|
||||||
|
#
|
||||||
|
# This configuration is used by both Qlty CLI and Qlty Cloud.
|
||||||
|
#
|
||||||
|
# Qlty CLI -- Code quality toolkit for developers
|
||||||
|
# Qlty Cloud -- Fully automated Code Health Platform
|
||||||
|
#
|
||||||
|
# Try Qlty Cloud: https://qlty.sh
|
||||||
|
#
|
||||||
|
# For a guide to configuration, visit https://qlty.sh/d/config
|
||||||
|
# Or for a full reference, visit https://qlty.sh/d/qlty-toml
|
||||||
|
config_version = "0"
|
||||||
|
|
||||||
|
exclude_patterns = [
|
||||||
|
"*_min.*",
|
||||||
|
"*-min.*",
|
||||||
|
"*.min.*",
|
||||||
|
"**/.yarn/**",
|
||||||
|
"**/*.d.ts",
|
||||||
|
"**/assets/**",
|
||||||
|
"**/bower_components/**",
|
||||||
|
"**/build/**",
|
||||||
|
"**/cache/**",
|
||||||
|
"**/config/**",
|
||||||
|
"**/db/**",
|
||||||
|
"**/deps/**",
|
||||||
|
"**/dist/**",
|
||||||
|
"**/extern/**",
|
||||||
|
"**/external/**",
|
||||||
|
"**/generated/**",
|
||||||
|
"**/Godeps/**",
|
||||||
|
"**/gradlew/**",
|
||||||
|
"**/mvnw/**",
|
||||||
|
"**/node_modules/**",
|
||||||
|
"**/protos/**",
|
||||||
|
"**/seed/**",
|
||||||
|
"**/target/**",
|
||||||
|
"**/templates/**",
|
||||||
|
"**/testdata/**",
|
||||||
|
"**/vendor/**", "spec/", "**/specs/**/**", "**/spec/**/**", "db/*", "bin/**/*", "db/**/*", "config/**/*", "public/**/*", "vendor/**/*", "node_modules/**/*", "lib/tasks/auto_annotate_models.rake", "app/test-matchers.js", "docs/*", "**/*.md", "**/*.yml", "app/javascript/dashboard/i18n/locale", "**/*.stories.js", "stories/", "app/javascript/dashboard/components/widgets/conversation/advancedFilterItems/index.js", "app/javascript/shared/constants/countries.js", "app/javascript/dashboard/components/widgets/conversation/advancedFilterItems/languages.js", "app/javascript/dashboard/routes/dashboard/contacts/contactFilterItems/index.js", "app/javascript/dashboard/routes/dashboard/settings/automation/constants.js", "app/javascript/dashboard/components/widgets/FilterInput/FilterOperatorTypes.js", "app/javascript/dashboard/routes/dashboard/settings/reports/constants.js", "app/javascript/dashboard/store/captain/storeFactory.js", "app/javascript/dashboard/i18n/index.js", "app/javascript/widget/i18n/index.js", "app/javascript/survey/i18n/index.js", "app/javascript/shared/constants/locales.js", "app/javascript/dashboard/helper/specs/macrosFixtures.js", "app/javascript/dashboard/routes/dashboard/settings/macros/constants.js", "**/fixtures/**", "**/*/fixtures.js",
|
||||||
|
]
|
||||||
|
|
||||||
|
test_patterns = [
|
||||||
|
"**/test/**",
|
||||||
|
"**/spec/**",
|
||||||
|
"**/*.test.*",
|
||||||
|
"**/*.spec.*",
|
||||||
|
"**/*_test.*",
|
||||||
|
"**/*_spec.*",
|
||||||
|
"**/test_*.*",
|
||||||
|
"**/spec_*.*",
|
||||||
|
]
|
||||||
|
|
||||||
|
[smells]
|
||||||
|
mode = "comment"
|
||||||
|
|
||||||
|
[smells.boolean_logic]
|
||||||
|
threshold = 4
|
||||||
|
|
||||||
|
[smells.file_complexity]
|
||||||
|
threshold = 66
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
[smells.return_statements]
|
||||||
|
threshold = 4
|
||||||
|
|
||||||
|
[smells.nested_control_flow]
|
||||||
|
threshold = 4
|
||||||
|
|
||||||
|
[smells.function_parameters]
|
||||||
|
threshold = 4
|
||||||
|
|
||||||
|
[smells.function_complexity]
|
||||||
|
threshold = 5
|
||||||
|
|
||||||
|
[smells.duplication]
|
||||||
|
enabled = true
|
||||||
|
threshold = 20
|
||||||
|
|
||||||
|
[[source]]
|
||||||
|
name = "default"
|
||||||
|
default = true
|
||||||
+1
-1
@@ -283,7 +283,7 @@ Rails/RedundantActiveRecordAllMethod:
|
|||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Layout/TrailingEmptyLines:
|
Layout/TrailingEmptyLines:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Style/SafeNavigationChainLength:
|
Style/SafeNavigationChainLength:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|||||||
@@ -56,3 +56,20 @@
|
|||||||
## Ruby Best Practices
|
## Ruby Best Practices
|
||||||
|
|
||||||
- Use compact `module/class` definitions; avoid nested styles
|
- Use compact `module/class` definitions; avoid nested styles
|
||||||
|
|
||||||
|
## Enterprise Edition Notes
|
||||||
|
|
||||||
|
- Chatwoot has an Enterprise overlay under `enterprise/` that extends/overrides OSS code.
|
||||||
|
- When you add or modify core functionality, always check for corresponding files in `enterprise/` and keep behavior compatible.
|
||||||
|
- Follow the Enterprise development practices documented here:
|
||||||
|
- https://chatwoot.help/hc/handbook/articles/developing-enterprise-edition-features-38
|
||||||
|
|
||||||
|
Practical checklist for any change impacting core logic or public APIs
|
||||||
|
- Search for related files in both trees before editing (e.g., `rg -n "FooService|ControllerName|ModelName" app enterprise`).
|
||||||
|
- If adding new endpoints, services, or models, consider whether Enterprise needs:
|
||||||
|
- An override (e.g., `enterprise/app/...`), or
|
||||||
|
- An extension point (e.g., `prepend_mod_with`, hooks, configuration) to avoid hard forks.
|
||||||
|
- Avoid hardcoding instance- or plan-specific behavior in OSS; prefer configuration, feature flags, or extension points consumed by Enterprise.
|
||||||
|
- Keep request/response contracts stable across OSS and Enterprise; update both sets of routes/controllers when introducing new APIs.
|
||||||
|
- When renaming/moving shared code, mirror the change in `enterprise/` to prevent drift.
|
||||||
|
- Tests: Add Enterprise-specific specs under `spec/enterprise`, mirroring OSS spec layout where applicable.
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ 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.
|
||||||
# ref application.rb
|
# ref application.rb
|
||||||
gem 'ddtrace', require: false
|
gem 'datadog', '~> 2.0', require: false
|
||||||
gem 'elastic-apm', require: false
|
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
|
||||||
@@ -121,6 +121,8 @@ gem 'sentry-sidekiq', '>= 5.19.0', require: false
|
|||||||
gem 'sidekiq', '>= 7.3.1'
|
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'
|
||||||
|
# for sidekiq healthcheck
|
||||||
|
gem 'sidekiq_alive'
|
||||||
|
|
||||||
##-- Push notification service --##
|
##-- Push notification service --##
|
||||||
gem 'fcm'
|
gem 'fcm'
|
||||||
@@ -177,6 +179,10 @@ gem 'reverse_markdown'
|
|||||||
|
|
||||||
gem 'iso-639'
|
gem 'iso-639'
|
||||||
gem 'ruby-openai'
|
gem 'ruby-openai'
|
||||||
|
gem 'ai-agents', '>= 0.4.3'
|
||||||
|
|
||||||
|
# TODO: Move this gem as a dependency of ai-agents
|
||||||
|
gem 'ruby_llm-schema'
|
||||||
|
|
||||||
gem 'shopify_api'
|
gem 'shopify_api'
|
||||||
|
|
||||||
|
|||||||
+107
-70
@@ -25,35 +25,35 @@ GIT
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (7.1.5.1)
|
actioncable (7.1.5.2)
|
||||||
actionpack (= 7.1.5.1)
|
actionpack (= 7.1.5.2)
|
||||||
activesupport (= 7.1.5.1)
|
activesupport (= 7.1.5.2)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
zeitwerk (~> 2.6)
|
zeitwerk (~> 2.6)
|
||||||
actionmailbox (7.1.5.1)
|
actionmailbox (7.1.5.2)
|
||||||
actionpack (= 7.1.5.1)
|
actionpack (= 7.1.5.2)
|
||||||
activejob (= 7.1.5.1)
|
activejob (= 7.1.5.2)
|
||||||
activerecord (= 7.1.5.1)
|
activerecord (= 7.1.5.2)
|
||||||
activestorage (= 7.1.5.1)
|
activestorage (= 7.1.5.2)
|
||||||
activesupport (= 7.1.5.1)
|
activesupport (= 7.1.5.2)
|
||||||
mail (>= 2.7.1)
|
mail (>= 2.7.1)
|
||||||
net-imap
|
net-imap
|
||||||
net-pop
|
net-pop
|
||||||
net-smtp
|
net-smtp
|
||||||
actionmailer (7.1.5.1)
|
actionmailer (7.1.5.2)
|
||||||
actionpack (= 7.1.5.1)
|
actionpack (= 7.1.5.2)
|
||||||
actionview (= 7.1.5.1)
|
actionview (= 7.1.5.2)
|
||||||
activejob (= 7.1.5.1)
|
activejob (= 7.1.5.2)
|
||||||
activesupport (= 7.1.5.1)
|
activesupport (= 7.1.5.2)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
net-imap
|
net-imap
|
||||||
net-pop
|
net-pop
|
||||||
net-smtp
|
net-smtp
|
||||||
rails-dom-testing (~> 2.2)
|
rails-dom-testing (~> 2.2)
|
||||||
actionpack (7.1.5.1)
|
actionpack (7.1.5.2)
|
||||||
actionview (= 7.1.5.1)
|
actionview (= 7.1.5.2)
|
||||||
activesupport (= 7.1.5.1)
|
activesupport (= 7.1.5.2)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
racc
|
racc
|
||||||
rack (>= 2.2.4)
|
rack (>= 2.2.4)
|
||||||
@@ -61,38 +61,38 @@ GEM
|
|||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.2)
|
rails-dom-testing (~> 2.2)
|
||||||
rails-html-sanitizer (~> 1.6)
|
rails-html-sanitizer (~> 1.6)
|
||||||
actiontext (7.1.5.1)
|
actiontext (7.1.5.2)
|
||||||
actionpack (= 7.1.5.1)
|
actionpack (= 7.1.5.2)
|
||||||
activerecord (= 7.1.5.1)
|
activerecord (= 7.1.5.2)
|
||||||
activestorage (= 7.1.5.1)
|
activestorage (= 7.1.5.2)
|
||||||
activesupport (= 7.1.5.1)
|
activesupport (= 7.1.5.2)
|
||||||
globalid (>= 0.6.0)
|
globalid (>= 0.6.0)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (7.1.5.1)
|
actionview (7.1.5.2)
|
||||||
activesupport (= 7.1.5.1)
|
activesupport (= 7.1.5.2)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.11)
|
erubi (~> 1.11)
|
||||||
rails-dom-testing (~> 2.2)
|
rails-dom-testing (~> 2.2)
|
||||||
rails-html-sanitizer (~> 1.6)
|
rails-html-sanitizer (~> 1.6)
|
||||||
active_record_query_trace (1.8)
|
active_record_query_trace (1.8)
|
||||||
activejob (7.1.5.1)
|
activejob (7.1.5.2)
|
||||||
activesupport (= 7.1.5.1)
|
activesupport (= 7.1.5.2)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (7.1.5.1)
|
activemodel (7.1.5.2)
|
||||||
activesupport (= 7.1.5.1)
|
activesupport (= 7.1.5.2)
|
||||||
activerecord (7.1.5.1)
|
activerecord (7.1.5.2)
|
||||||
activemodel (= 7.1.5.1)
|
activemodel (= 7.1.5.2)
|
||||||
activesupport (= 7.1.5.1)
|
activesupport (= 7.1.5.2)
|
||||||
timeout (>= 0.4.0)
|
timeout (>= 0.4.0)
|
||||||
activerecord-import (2.1.0)
|
activerecord-import (2.1.0)
|
||||||
activerecord (>= 4.2)
|
activerecord (>= 4.2)
|
||||||
activestorage (7.1.5.1)
|
activestorage (7.1.5.2)
|
||||||
actionpack (= 7.1.5.1)
|
actionpack (= 7.1.5.2)
|
||||||
activejob (= 7.1.5.1)
|
activejob (= 7.1.5.2)
|
||||||
activerecord (= 7.1.5.1)
|
activerecord (= 7.1.5.2)
|
||||||
activesupport (= 7.1.5.1)
|
activesupport (= 7.1.5.2)
|
||||||
marcel (~> 1.0)
|
marcel (~> 1.0)
|
||||||
activesupport (7.1.5.1)
|
activesupport (7.1.5.2)
|
||||||
base64
|
base64
|
||||||
benchmark (>= 0.3)
|
benchmark (>= 0.3)
|
||||||
bigdecimal
|
bigdecimal
|
||||||
@@ -126,6 +126,8 @@ GEM
|
|||||||
jbuilder (~> 2)
|
jbuilder (~> 2)
|
||||||
rails (>= 4.2, < 7.2)
|
rails (>= 4.2, < 7.2)
|
||||||
selectize-rails (~> 0.6)
|
selectize-rails (~> 0.6)
|
||||||
|
ai-agents (0.4.3)
|
||||||
|
ruby_llm (~> 1.3)
|
||||||
annotate (3.2.0)
|
annotate (3.2.0)
|
||||||
activerecord (>= 3.2, < 8.0)
|
activerecord (>= 3.2, < 8.0)
|
||||||
rake (>= 10.4, < 14.0)
|
rake (>= 10.4, < 14.0)
|
||||||
@@ -153,10 +155,10 @@ GEM
|
|||||||
barnes (0.0.9)
|
barnes (0.0.9)
|
||||||
multi_json (~> 1)
|
multi_json (~> 1)
|
||||||
statsd-ruby (~> 1.1)
|
statsd-ruby (~> 1.1)
|
||||||
base64 (0.2.0)
|
base64 (0.3.0)
|
||||||
bcrypt (3.1.20)
|
bcrypt (3.1.20)
|
||||||
benchmark (0.4.0)
|
benchmark (0.4.1)
|
||||||
bigdecimal (3.1.9)
|
bigdecimal (3.2.2)
|
||||||
bindex (0.8.1)
|
bindex (0.8.1)
|
||||||
bootsnap (1.16.0)
|
bootsnap (1.16.0)
|
||||||
msgpack (~> 1.2)
|
msgpack (~> 1.2)
|
||||||
@@ -172,6 +174,8 @@ GEM
|
|||||||
bundler (>= 1.2.0, < 3)
|
bundler (>= 1.2.0, < 3)
|
||||||
thor (~> 1.0)
|
thor (~> 1.0)
|
||||||
byebug (11.1.3)
|
byebug (11.1.3)
|
||||||
|
childprocess (5.1.0)
|
||||||
|
logger (~> 1.5)
|
||||||
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)
|
||||||
@@ -190,10 +194,14 @@ GEM
|
|||||||
activerecord (>= 5.a)
|
activerecord (>= 5.a)
|
||||||
database_cleaner-core (~> 2.0.0)
|
database_cleaner-core (~> 2.0.0)
|
||||||
database_cleaner-core (2.0.1)
|
database_cleaner-core (2.0.1)
|
||||||
date (3.4.1)
|
datadog (2.19.0)
|
||||||
ddtrace (0.48.0)
|
datadog-ruby_core_source (~> 3.4, >= 3.4.1)
|
||||||
ffi (~> 1.0)
|
libdatadog (~> 18.1.0.1.0)
|
||||||
|
libddwaf (~> 1.24.1.0.3)
|
||||||
|
logger
|
||||||
msgpack
|
msgpack
|
||||||
|
datadog-ruby_core_source (3.4.1)
|
||||||
|
date (3.4.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)
|
||||||
@@ -355,6 +363,7 @@ GEM
|
|||||||
grpc (1.72.0-x86_64-linux)
|
grpc (1.72.0-x86_64-linux)
|
||||||
google-protobuf (>= 3.25, < 5.0)
|
google-protobuf (>= 3.25, < 5.0)
|
||||||
googleapis-common-protos-types (~> 1.0)
|
googleapis-common-protos-types (~> 1.0)
|
||||||
|
gserver (0.0.1)
|
||||||
haikunator (1.1.1)
|
haikunator (1.1.1)
|
||||||
hairtrigger (1.0.0)
|
hairtrigger (1.0.0)
|
||||||
activerecord (>= 6.0, < 8)
|
activerecord (>= 6.0, < 8)
|
||||||
@@ -433,10 +442,22 @@ GEM
|
|||||||
json (>= 1.8)
|
json (>= 1.8)
|
||||||
rexml
|
rexml
|
||||||
language_server-protocol (3.17.0.5)
|
language_server-protocol (3.17.0.5)
|
||||||
launchy (2.5.2)
|
launchy (3.1.1)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
letter_opener (1.8.1)
|
childprocess (~> 5.0)
|
||||||
launchy (>= 2.2, < 3)
|
logger (~> 1.6)
|
||||||
|
letter_opener (1.10.0)
|
||||||
|
launchy (>= 2.2, < 4)
|
||||||
|
libdatadog (18.1.0.1.0)
|
||||||
|
libdatadog (18.1.0.1.0-x86_64-linux)
|
||||||
|
libddwaf (1.24.1.0.3)
|
||||||
|
ffi (~> 1.0)
|
||||||
|
libddwaf (1.24.1.0.3-arm64-darwin)
|
||||||
|
ffi (~> 1.0)
|
||||||
|
libddwaf (1.24.1.0.3-x86_64-darwin)
|
||||||
|
ffi (~> 1.0)
|
||||||
|
libddwaf (1.24.1.0.3-x86_64-linux)
|
||||||
|
ffi (~> 1.0)
|
||||||
line-bot-api (1.28.0)
|
line-bot-api (1.28.0)
|
||||||
lint_roller (1.1.0)
|
lint_roller (1.1.0)
|
||||||
liquid (5.4.0)
|
liquid (5.4.0)
|
||||||
@@ -471,7 +492,7 @@ GEM
|
|||||||
mime-types-data (3.2023.0218.1)
|
mime-types-data (3.2023.0218.1)
|
||||||
mini_magick (4.12.0)
|
mini_magick (4.12.0)
|
||||||
mini_mime (1.1.5)
|
mini_mime (1.1.5)
|
||||||
mini_portile2 (2.8.8)
|
mini_portile2 (2.8.9)
|
||||||
minitest (5.25.5)
|
minitest (5.25.5)
|
||||||
mock_redis (0.36.0)
|
mock_redis (0.36.0)
|
||||||
ruby2_keywords
|
ruby2_keywords
|
||||||
@@ -502,14 +523,14 @@ GEM
|
|||||||
newrelic_rpm (9.6.0)
|
newrelic_rpm (9.6.0)
|
||||||
base64
|
base64
|
||||||
nio4r (2.7.3)
|
nio4r (2.7.3)
|
||||||
nokogiri (1.18.8)
|
nokogiri (1.18.9)
|
||||||
mini_portile2 (~> 2.8.2)
|
mini_portile2 (~> 2.8.2)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.8-arm64-darwin)
|
nokogiri (1.18.9-arm64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.8-x86_64-darwin)
|
nokogiri (1.18.9-x86_64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.8-x86_64-linux-gnu)
|
nokogiri (1.18.9-x86_64-linux-gnu)
|
||||||
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)
|
||||||
@@ -563,7 +584,7 @@ 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 (6.0.0)
|
public_suffix (6.0.2)
|
||||||
puma (6.4.3)
|
puma (6.4.3)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
pundit (2.3.0)
|
pundit (2.3.0)
|
||||||
@@ -592,20 +613,20 @@ GEM
|
|||||||
rackup (1.0.1)
|
rackup (1.0.1)
|
||||||
rack (< 3)
|
rack (< 3)
|
||||||
webrick
|
webrick
|
||||||
rails (7.1.5.1)
|
rails (7.1.5.2)
|
||||||
actioncable (= 7.1.5.1)
|
actioncable (= 7.1.5.2)
|
||||||
actionmailbox (= 7.1.5.1)
|
actionmailbox (= 7.1.5.2)
|
||||||
actionmailer (= 7.1.5.1)
|
actionmailer (= 7.1.5.2)
|
||||||
actionpack (= 7.1.5.1)
|
actionpack (= 7.1.5.2)
|
||||||
actiontext (= 7.1.5.1)
|
actiontext (= 7.1.5.2)
|
||||||
actionview (= 7.1.5.1)
|
actionview (= 7.1.5.2)
|
||||||
activejob (= 7.1.5.1)
|
activejob (= 7.1.5.2)
|
||||||
activemodel (= 7.1.5.1)
|
activemodel (= 7.1.5.2)
|
||||||
activerecord (= 7.1.5.1)
|
activerecord (= 7.1.5.2)
|
||||||
activestorage (= 7.1.5.1)
|
activestorage (= 7.1.5.2)
|
||||||
activesupport (= 7.1.5.1)
|
activesupport (= 7.1.5.2)
|
||||||
bundler (>= 1.15.0)
|
bundler (>= 1.15.0)
|
||||||
railties (= 7.1.5.1)
|
railties (= 7.1.5.2)
|
||||||
rails-dom-testing (2.2.0)
|
rails-dom-testing (2.2.0)
|
||||||
activesupport (>= 5.0.0)
|
activesupport (>= 5.0.0)
|
||||||
minitest
|
minitest
|
||||||
@@ -613,9 +634,9 @@ GEM
|
|||||||
rails-html-sanitizer (1.6.1)
|
rails-html-sanitizer (1.6.1)
|
||||||
loofah (~> 2.21)
|
loofah (~> 2.21)
|
||||||
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
||||||
railties (7.1.5.1)
|
railties (7.1.5.2)
|
||||||
actionpack (= 7.1.5.1)
|
actionpack (= 7.1.5.2)
|
||||||
activesupport (= 7.1.5.1)
|
activesupport (= 7.1.5.2)
|
||||||
irb
|
irb
|
||||||
rackup (>= 1.0.0)
|
rackup (>= 1.0.0)
|
||||||
rake (>= 12.2)
|
rake (>= 12.2)
|
||||||
@@ -713,6 +734,16 @@ GEM
|
|||||||
ruby2ruby (2.5.0)
|
ruby2ruby (2.5.0)
|
||||||
ruby_parser (~> 3.1)
|
ruby_parser (~> 3.1)
|
||||||
sexp_processor (~> 4.6)
|
sexp_processor (~> 4.6)
|
||||||
|
ruby_llm (1.5.1)
|
||||||
|
base64
|
||||||
|
event_stream_parser (~> 1)
|
||||||
|
faraday (>= 1.10.0)
|
||||||
|
faraday-multipart (>= 1)
|
||||||
|
faraday-net_http (>= 1)
|
||||||
|
faraday-retry (>= 1)
|
||||||
|
marcel (~> 1.0)
|
||||||
|
zeitwerk (~> 2)
|
||||||
|
ruby_llm-schema (0.1.0)
|
||||||
ruby_parser (3.20.0)
|
ruby_parser (3.20.0)
|
||||||
sexp_processor (~> 4.16)
|
sexp_processor (~> 4.16)
|
||||||
sass (3.7.4)
|
sass (3.7.4)
|
||||||
@@ -770,6 +801,9 @@ GEM
|
|||||||
fugit (~> 1.8)
|
fugit (~> 1.8)
|
||||||
globalid (>= 1.0.1)
|
globalid (>= 1.0.1)
|
||||||
sidekiq (>= 6)
|
sidekiq (>= 6)
|
||||||
|
sidekiq_alive (2.5.0)
|
||||||
|
gserver (~> 0.0.1)
|
||||||
|
sidekiq (>= 5, < 9)
|
||||||
signet (0.17.0)
|
signet (0.17.0)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
faraday (>= 0.17.5, < 3.a)
|
faraday (>= 0.17.5, < 3.a)
|
||||||
@@ -808,7 +842,7 @@ GEM
|
|||||||
stripe (8.5.0)
|
stripe (8.5.0)
|
||||||
telephone_number (1.4.20)
|
telephone_number (1.4.20)
|
||||||
test-prof (1.2.1)
|
test-prof (1.2.1)
|
||||||
thor (1.3.1)
|
thor (1.4.0)
|
||||||
tilt (2.3.0)
|
tilt (2.3.0)
|
||||||
time_diff (0.3.0)
|
time_diff (0.3.0)
|
||||||
activesupport
|
activesupport
|
||||||
@@ -891,6 +925,7 @@ DEPENDENCIES
|
|||||||
administrate (>= 0.20.1)
|
administrate (>= 0.20.1)
|
||||||
administrate-field-active_storage (>= 1.0.3)
|
administrate-field-active_storage (>= 1.0.3)
|
||||||
administrate-field-belongs_to_search (>= 0.9.0)
|
administrate-field-belongs_to_search (>= 0.9.0)
|
||||||
|
ai-agents (>= 0.4.3)
|
||||||
annotate
|
annotate
|
||||||
attr_extras
|
attr_extras
|
||||||
audited (~> 5.4, >= 5.4.1)
|
audited (~> 5.4, >= 5.4.1)
|
||||||
@@ -907,7 +942,7 @@ DEPENDENCIES
|
|||||||
commonmarker
|
commonmarker
|
||||||
csv-safe
|
csv-safe
|
||||||
database_cleaner
|
database_cleaner
|
||||||
ddtrace
|
datadog (~> 2.0)
|
||||||
debug (~> 1.8)
|
debug (~> 1.8)
|
||||||
devise (>= 4.9.4)
|
devise (>= 4.9.4)
|
||||||
devise-secure_password!
|
devise-secure_password!
|
||||||
@@ -984,6 +1019,7 @@ DEPENDENCIES
|
|||||||
rubocop-rails
|
rubocop-rails
|
||||||
rubocop-rspec
|
rubocop-rspec
|
||||||
ruby-openai
|
ruby-openai
|
||||||
|
ruby_llm-schema
|
||||||
scout_apm
|
scout_apm
|
||||||
scss_lint
|
scss_lint
|
||||||
seed_dump
|
seed_dump
|
||||||
@@ -994,6 +1030,7 @@ DEPENDENCIES
|
|||||||
shoulda-matchers
|
shoulda-matchers
|
||||||
sidekiq (>= 7.3.1)
|
sidekiq (>= 7.3.1)
|
||||||
sidekiq-cron (>= 1.12.0)
|
sidekiq-cron (>= 1.12.0)
|
||||||
|
sidekiq_alive
|
||||||
simplecov (= 0.17.1)
|
simplecov (= 0.17.1)
|
||||||
slack-ruby-client (~> 2.5.2)
|
slack-ruby-client (~> 2.5.2)
|
||||||
spring
|
spring
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
3.13.0
|
4.4.0
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
3.2.0
|
3.4.3
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
# We don't want to update the name of the identified original contact.
|
# We don't want to update the name of the identified original contact.
|
||||||
|
|
||||||
class ContactIdentifyAction
|
class ContactIdentifyAction
|
||||||
|
include UrlHelper
|
||||||
pattr_initialize [:contact!, :params!, { retain_original_contact_name: false, discard_invalid_attrs: false }]
|
pattr_initialize [:contact!, :params!, { retain_original_contact_name: false, discard_invalid_attrs: false }]
|
||||||
|
|
||||||
def perform
|
def perform
|
||||||
@@ -104,7 +105,14 @@ class ContactIdentifyAction
|
|||||||
# TODO: replace reject { |_k, v| v.blank? } with compact_blank when rails is upgraded
|
# TODO: replace reject { |_k, v| v.blank? } with compact_blank when rails is upgraded
|
||||||
@contact.discard_invalid_attrs if discard_invalid_attrs
|
@contact.discard_invalid_attrs if discard_invalid_attrs
|
||||||
@contact.save!
|
@contact.save!
|
||||||
Avatar::AvatarFromUrlJob.perform_later(@contact, params[:avatar_url]) if params[:avatar_url].present? && !@contact.avatar.attached?
|
enqueue_avatar_job
|
||||||
|
end
|
||||||
|
|
||||||
|
def enqueue_avatar_job
|
||||||
|
return unless params[:avatar_url].present? && !@contact.avatar.attached?
|
||||||
|
return unless url_valid?(params[:avatar_url])
|
||||||
|
|
||||||
|
Avatar::AvatarFromUrlJob.perform_later(@contact, params[:avatar_url])
|
||||||
end
|
end
|
||||||
|
|
||||||
def merge_contact(base_contact, merge_contact)
|
def merge_contact(base_contact, merge_contact)
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
class Api::V1::Accounts::AssignmentPolicies::InboxesController < Api::V1::Accounts::BaseController
|
||||||
|
before_action :fetch_assignment_policy
|
||||||
|
before_action -> { check_authorization(AssignmentPolicy) }
|
||||||
|
|
||||||
|
def index
|
||||||
|
@inboxes = @assignment_policy.inboxes
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def fetch_assignment_policy
|
||||||
|
@assignment_policy = Current.account.assignment_policies.find(
|
||||||
|
params[:assignment_policy_id]
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
def permitted_params
|
||||||
|
params.permit(:assignment_policy_id)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
class Api::V1::Accounts::AssignmentPoliciesController < Api::V1::Accounts::BaseController
|
||||||
|
before_action :fetch_assignment_policy, only: [:show, :update, :destroy]
|
||||||
|
before_action :check_authorization
|
||||||
|
|
||||||
|
def index
|
||||||
|
@assignment_policies = Current.account.assignment_policies
|
||||||
|
end
|
||||||
|
|
||||||
|
def show; end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@assignment_policy = Current.account.assignment_policies.create!(assignment_policy_params)
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
@assignment_policy.update!(assignment_policy_params)
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@assignment_policy.destroy!
|
||||||
|
head :ok
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def fetch_assignment_policy
|
||||||
|
@assignment_policy = Current.account.assignment_policies.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def assignment_policy_params
|
||||||
|
params.require(:assignment_policy).permit(
|
||||||
|
:name, :description, :assignment_order, :conversation_priority,
|
||||||
|
:fair_distribution_limit, :fair_distribution_window, :enabled
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -30,7 +30,14 @@ class Api::V1::Accounts::CallbacksController < Api::V1::Accounts::BaseController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def facebook_pages
|
def facebook_pages
|
||||||
@page_details = mark_already_existing_facebook_pages(fb_object.get_connections('me', 'accounts'))
|
pages = []
|
||||||
|
fb_pages = fb_object.get_connections('me', 'accounts')
|
||||||
|
pages.concat(fb_pages)
|
||||||
|
while fb_pages.respond_to?(:next_page) && (next_page = fb_pages.next_page)
|
||||||
|
fb_pages = next_page
|
||||||
|
pages.concat(fb_pages)
|
||||||
|
end
|
||||||
|
@page_details = mark_already_existing_facebook_pages(pages)
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_instagram_id(page_access_token, facebook_channel)
|
def set_instagram_id(page_access_token, facebook_channel)
|
||||||
|
|||||||
@@ -29,6 +29,6 @@ class Api::V1::Accounts::CampaignsController < Api::V1::Accounts::BaseController
|
|||||||
|
|
||||||
def campaign_params
|
def campaign_params
|
||||||
params.require(:campaign).permit(:title, :description, :message, :enabled, :trigger_only_during_business_hours, :inbox_id, :sender_id,
|
params.require(:campaign).permit(:title, :description, :message, :enabled, :trigger_only_during_business_hours, :inbox_id, :sender_id,
|
||||||
:scheduled_at, audience: [:type, :id], trigger_rules: {})
|
:scheduled_at, audience: [:type, :id], trigger_rules: {}, template_params: {})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
|
|||||||
def resolved_contacts
|
def resolved_contacts
|
||||||
return @resolved_contacts if @resolved_contacts
|
return @resolved_contacts if @resolved_contacts
|
||||||
|
|
||||||
@resolved_contacts = Current.account.contacts.resolved_contacts
|
@resolved_contacts = Current.account.contacts.resolved_contacts(use_crm_v2: Current.account.feature_enabled?('crm_v2'))
|
||||||
|
|
||||||
@resolved_contacts = @resolved_contacts.tagged_with(params[:labels], any: true) if params[:labels].present?
|
@resolved_contacts = @resolved_contacts.tagged_with(params[:labels], any: true) if params[:labels].present?
|
||||||
@resolved_contacts
|
@resolved_contacts
|
||||||
|
|||||||
@@ -1,32 +1,23 @@
|
|||||||
class Api::V1::Accounts::Google::AuthorizationsController < Api::V1::Accounts::BaseController
|
class Api::V1::Accounts::Google::AuthorizationsController < Api::V1::Accounts::OauthAuthorizationController
|
||||||
include GoogleConcern
|
include GoogleConcern
|
||||||
before_action :check_authorization
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
email = params[:authorization][:email]
|
|
||||||
redirect_url = google_client.auth_code.authorize_url(
|
redirect_url = google_client.auth_code.authorize_url(
|
||||||
{
|
{
|
||||||
redirect_uri: "#{base_url}/google/callback",
|
redirect_uri: "#{base_url}/google/callback",
|
||||||
scope: 'email profile https://mail.google.com/',
|
scope: scope,
|
||||||
response_type: 'code',
|
response_type: 'code',
|
||||||
prompt: 'consent', # the oauth flow does not return a refresh token, this is supposed to fix it
|
prompt: 'consent', # the oauth flow does not return a refresh token, this is supposed to fix it
|
||||||
access_type: 'offline', # the default is 'online'
|
access_type: 'offline', # the default is 'online'
|
||||||
|
state: state,
|
||||||
client_id: GlobalConfigService.load('GOOGLE_OAUTH_CLIENT_ID', nil)
|
client_id: GlobalConfigService.load('GOOGLE_OAUTH_CLIENT_ID', nil)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if redirect_url
|
if redirect_url
|
||||||
cache_key = "google::#{email.downcase}"
|
|
||||||
::Redis::Alfred.setex(cache_key, Current.account.id, 5.minutes)
|
|
||||||
render json: { success: true, url: redirect_url }
|
render json: { success: true, url: redirect_url }
|
||||||
else
|
else
|
||||||
render json: { success: false }, status: :unprocessable_entity
|
render json: { success: false }, status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def check_authorization
|
|
||||||
raise Pundit::NotAuthorizedError unless Current.account_user.administrator?
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
class Api::V1::Accounts::Inboxes::AssignmentPoliciesController < Api::V1::Accounts::BaseController
|
||||||
|
before_action :fetch_inbox
|
||||||
|
before_action :fetch_assignment_policy, only: [:create]
|
||||||
|
before_action -> { check_authorization(AssignmentPolicy) }
|
||||||
|
before_action :validate_assignment_policy, only: [:show, :destroy]
|
||||||
|
|
||||||
|
def show
|
||||||
|
@assignment_policy = @inbox.assignment_policy
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
# There should be only one assignment policy for an inbox.
|
||||||
|
# If there is a new request to add an assignment policy, we will
|
||||||
|
# delete the old one and attach the new policy
|
||||||
|
remove_inbox_assignment_policy
|
||||||
|
@inbox_assignment_policy = @inbox.create_inbox_assignment_policy!(assignment_policy: @assignment_policy)
|
||||||
|
@assignment_policy = @inbox.assignment_policy
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
remove_inbox_assignment_policy
|
||||||
|
head :ok
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def remove_inbox_assignment_policy
|
||||||
|
@inbox.inbox_assignment_policy&.destroy
|
||||||
|
end
|
||||||
|
|
||||||
|
def fetch_inbox
|
||||||
|
@inbox = Current.account.inboxes.find(permitted_params[:inbox_id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def fetch_assignment_policy
|
||||||
|
@assignment_policy = Current.account.assignment_policies.find(permitted_params[:assignment_policy_id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def permitted_params
|
||||||
|
params.permit(:assignment_policy_id, :inbox_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
def validate_assignment_policy
|
||||||
|
return render_not_found_error(I18n.t('errors.assignment_policy.not_found')) unless @inbox.assignment_policy
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -69,6 +69,17 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
|
|||||||
render status: :ok, json: { message: I18n.t('messages.inbox_deletetion_response') }
|
render status: :ok, json: { message: I18n.t('messages.inbox_deletetion_response') }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def sync_templates
|
||||||
|
unless @inbox.channel.is_a?(Channel::Whatsapp)
|
||||||
|
return render status: :unprocessable_entity, json: { error: 'Template sync is only available for WhatsApp channels' }
|
||||||
|
end
|
||||||
|
|
||||||
|
Channels::Whatsapp::TemplatesSyncJob.perform_later(@inbox.channel)
|
||||||
|
render status: :ok, json: { message: 'Template sync initiated successfully' }
|
||||||
|
rescue StandardError => e
|
||||||
|
render status: :internal_server_error, json: { error: e.message }
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def fetch_inbox
|
def fetch_inbox
|
||||||
@@ -81,11 +92,15 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create_channel
|
def create_channel
|
||||||
return unless %w[web_widget api email line telegram whatsapp sms].include?(permitted_params[:channel][:type])
|
return unless allowed_channel_types.include?(permitted_params[:channel][:type])
|
||||||
|
|
||||||
account_channels_method.create!(permitted_params(channel_type_from_params::EDITABLE_ATTRS)[:channel].except(:type))
|
account_channels_method.create!(permitted_params(channel_type_from_params::EDITABLE_ATTRS)[:channel].except(:type))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def allowed_channel_types
|
||||||
|
%w[web_widget api email line telegram whatsapp sms]
|
||||||
|
end
|
||||||
|
|
||||||
def update_inbox_working_hours
|
def update_inbox_working_hours
|
||||||
@inbox.update_working_hours(params.permit(working_hours: Inbox::OFFISABLE_ATTRS)[:working_hours]) if params[:working_hours]
|
@inbox.update_working_hours(params.permit(working_hours: Inbox::OFFISABLE_ATTRS)[:working_hours]) if params[:working_hours]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
class Api::V1::Accounts::Instagram::AuthorizationsController < Api::V1::Accounts::BaseController
|
class Api::V1::Accounts::Instagram::AuthorizationsController < Api::V1::Accounts::OauthAuthorizationController
|
||||||
include InstagramConcern
|
include InstagramConcern
|
||||||
include Instagram::IntegrationHelper
|
include Instagram::IntegrationHelper
|
||||||
before_action :check_authorization
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
# https://developers.facebook.com/docs/instagram-platform/instagram-api-with-instagram-login/business-login#step-1--get-authorization
|
# https://developers.facebook.com/docs/instagram-platform/instagram-api-with-instagram-login/business-login#step-1--get-authorization
|
||||||
@@ -21,10 +20,4 @@ class Api::V1::Accounts::Instagram::AuthorizationsController < Api::V1::Accounts
|
|||||||
render json: { success: false }, status: :unprocessable_entity
|
render json: { success: false }, status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def check_authorization
|
|
||||||
raise Pundit::NotAuthorizedError unless Current.account_user.administrator?
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ class Api::V1::Accounts::Integrations::LinearController < Api::V1::Accounts::Bas
|
|||||||
before_action :fetch_hook, only: [:destroy]
|
before_action :fetch_hook, only: [:destroy]
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
revoke_linear_token
|
||||||
@hook.destroy!
|
@hook.destroy!
|
||||||
head :ok
|
head :ok
|
||||||
end
|
end
|
||||||
@@ -27,7 +28,7 @@ class Api::V1::Accounts::Integrations::LinearController < Api::V1::Accounts::Bas
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create_issue
|
def create_issue
|
||||||
issue = linear_processor_service.create_issue(permitted_params)
|
issue = linear_processor_service.create_issue(permitted_params, Current.user)
|
||||||
if issue[:error]
|
if issue[:error]
|
||||||
render json: { error: issue[:error] }, status: :unprocessable_entity
|
render json: { error: issue[:error] }, status: :unprocessable_entity
|
||||||
else
|
else
|
||||||
@@ -44,7 +45,7 @@ class Api::V1::Accounts::Integrations::LinearController < Api::V1::Accounts::Bas
|
|||||||
def link_issue
|
def link_issue
|
||||||
issue_id = permitted_params[:issue_id]
|
issue_id = permitted_params[:issue_id]
|
||||||
title = permitted_params[:title]
|
title = permitted_params[:title]
|
||||||
issue = linear_processor_service.link_issue(conversation_link, issue_id, title)
|
issue = linear_processor_service.link_issue(conversation_link, issue_id, title, Current.user)
|
||||||
if issue[:error]
|
if issue[:error]
|
||||||
render json: { error: issue[:error] }, status: :unprocessable_entity
|
render json: { error: issue[:error] }, status: :unprocessable_entity
|
||||||
else
|
else
|
||||||
@@ -120,4 +121,15 @@ class Api::V1::Accounts::Integrations::LinearController < Api::V1::Accounts::Bas
|
|||||||
def fetch_hook
|
def fetch_hook
|
||||||
@hook = Integrations::Hook.where(account: Current.account).find_by(app_id: 'linear')
|
@hook = Integrations::Hook.where(account: Current.account).find_by(app_id: 'linear')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def revoke_linear_token
|
||||||
|
return unless @hook&.access_token
|
||||||
|
|
||||||
|
begin
|
||||||
|
linear_client = Linear.new(@hook.access_token)
|
||||||
|
linear_client.revoke_token
|
||||||
|
rescue StandardError => e
|
||||||
|
Rails.logger.error "Failed to revoke Linear token: #{e.message}"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
class Api::V1::Accounts::Integrations::NotionController < Api::V1::Accounts::BaseController
|
||||||
|
before_action :fetch_hook, only: [:destroy]
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@hook.destroy!
|
||||||
|
head :ok
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def fetch_hook
|
||||||
|
@hook = Integrations::Hook.where(account: Current.account).find_by(app_id: 'notion')
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,28 +1,19 @@
|
|||||||
class Api::V1::Accounts::Microsoft::AuthorizationsController < Api::V1::Accounts::BaseController
|
class Api::V1::Accounts::Microsoft::AuthorizationsController < Api::V1::Accounts::OauthAuthorizationController
|
||||||
include MicrosoftConcern
|
include MicrosoftConcern
|
||||||
before_action :check_authorization
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
email = params[:authorization][:email]
|
|
||||||
redirect_url = microsoft_client.auth_code.authorize_url(
|
redirect_url = microsoft_client.auth_code.authorize_url(
|
||||||
{
|
{
|
||||||
redirect_uri: "#{base_url}/microsoft/callback",
|
redirect_uri: "#{base_url}/microsoft/callback",
|
||||||
scope: 'offline_access https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/SMTP.Send openid profile',
|
scope: scope,
|
||||||
|
state: state,
|
||||||
prompt: 'consent'
|
prompt: 'consent'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if redirect_url
|
if redirect_url
|
||||||
cache_key = "microsoft::#{email.downcase}"
|
|
||||||
::Redis::Alfred.setex(cache_key, Current.account.id, 5.minutes)
|
|
||||||
render json: { success: true, url: redirect_url }
|
render json: { success: true, url: redirect_url }
|
||||||
else
|
else
|
||||||
render json: { success: false }, status: :unprocessable_entity
|
render json: { success: false }, status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def check_authorization
|
|
||||||
raise Pundit::NotAuthorizedError unless Current.account_user.administrator?
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
class Api::V1::Accounts::Notion::AuthorizationsController < Api::V1::Accounts::OauthAuthorizationController
|
||||||
|
include NotionConcern
|
||||||
|
|
||||||
|
def create
|
||||||
|
redirect_url = notion_client.auth_code.authorize_url(
|
||||||
|
{
|
||||||
|
redirect_uri: "#{base_url}/notion/callback",
|
||||||
|
response_type: 'code',
|
||||||
|
owner: 'user',
|
||||||
|
state: state,
|
||||||
|
client_id: GlobalConfigService.load('NOTION_CLIENT_ID', nil)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if redirect_url
|
||||||
|
render json: { success: true, url: redirect_url }
|
||||||
|
else
|
||||||
|
render json: { success: false }, status: :unprocessable_entity
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
class Api::V1::Accounts::OauthAuthorizationController < Api::V1::Accounts::BaseController
|
||||||
|
before_action :check_authorization
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def scope
|
||||||
|
''
|
||||||
|
end
|
||||||
|
|
||||||
|
def state
|
||||||
|
Current.account.to_sgid(expires_in: 15.minutes).to_s
|
||||||
|
end
|
||||||
|
|
||||||
|
def base_url
|
||||||
|
ENV.fetch('FRONTEND_URL', 'http://localhost:3000')
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def check_authorization
|
||||||
|
raise Pundit::NotAuthorizedError unless Current.account_user.administrator?
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -26,9 +26,8 @@ class Api::V1::Accounts::PortalsController < Api::V1::Accounts::BaseController
|
|||||||
@portal.update!(portal_params.merge(live_chat_widget_params)) if params[:portal].present?
|
@portal.update!(portal_params.merge(live_chat_widget_params)) if params[:portal].present?
|
||||||
# @portal.custom_domain = parsed_custom_domain
|
# @portal.custom_domain = parsed_custom_domain
|
||||||
process_attached_logo if params[:blob_id].present?
|
process_attached_logo if params[:blob_id].present?
|
||||||
rescue StandardError => e
|
rescue ActiveRecord::RecordInvalid => e
|
||||||
Rails.logger.error e
|
render_record_invalid(e)
|
||||||
render json: { error: @portal.errors.messages }.to_json, status: :unprocessable_entity
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -47,6 +46,20 @@ class Api::V1::Accounts::PortalsController < Api::V1::Accounts::BaseController
|
|||||||
head :ok
|
head :ok
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def send_instructions
|
||||||
|
email = permitted_params[:email]
|
||||||
|
return render_could_not_create_error(I18n.t('portals.send_instructions.email_required')) if email.blank?
|
||||||
|
return render_could_not_create_error(I18n.t('portals.send_instructions.invalid_email_format')) unless valid_email?(email)
|
||||||
|
return render_could_not_create_error(I18n.t('portals.send_instructions.custom_domain_not_configured')) if @portal.custom_domain.blank?
|
||||||
|
|
||||||
|
PortalInstructionsMailer.send_cname_instructions(
|
||||||
|
portal: @portal,
|
||||||
|
recipient_email: email
|
||||||
|
).deliver_later
|
||||||
|
|
||||||
|
render json: { message: I18n.t('portals.send_instructions.instructions_sent_successfully') }, status: :ok
|
||||||
|
end
|
||||||
|
|
||||||
def process_attached_logo
|
def process_attached_logo
|
||||||
blob_id = params[:blob_id]
|
blob_id = params[:blob_id]
|
||||||
blob = ActiveStorage::Blob.find_by(id: blob_id)
|
blob = ActiveStorage::Blob.find_by(id: blob_id)
|
||||||
@@ -60,12 +73,12 @@ class Api::V1::Accounts::PortalsController < Api::V1::Accounts::BaseController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def permitted_params
|
def permitted_params
|
||||||
params.permit(:id)
|
params.permit(:id, :email)
|
||||||
end
|
end
|
||||||
|
|
||||||
def portal_params
|
def portal_params
|
||||||
params.require(:portal).permit(
|
params.require(:portal).permit(
|
||||||
:account_id, :color, :custom_domain, :header_text, :homepage_link,
|
:id, :account_id, :color, :custom_domain, :header_text, :homepage_link,
|
||||||
:name, :page_title, :slug, :archived, { config: [:default_locale, { allowed_locales: [] }] }
|
:name, :page_title, :slug, :archived, { config: [:default_locale, { allowed_locales: [] }] }
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@@ -88,4 +101,10 @@ class Api::V1::Accounts::PortalsController < Api::V1::Accounts::BaseController
|
|||||||
domain = URI.parse(@portal.custom_domain)
|
domain = URI.parse(@portal.custom_domain)
|
||||||
domain.is_a?(URI::HTTP) ? domain.host : @portal.custom_domain
|
domain.is_a?(URI::HTTP) ? domain.host : @portal.custom_domain
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def valid_email?(email)
|
||||||
|
ValidEmail2::Address.new(email).valid?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Api::V1::Accounts::PortalsController.prepend_mod_with('Api::V1::Accounts::PortalsController')
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
class Api::V1::Accounts::Whatsapp::AuthorizationsController < Api::V1::Accounts::BaseController
|
||||||
|
before_action :validate_feature_enabled!
|
||||||
|
before_action :fetch_and_validate_inbox, if: -> { params[:inbox_id].present? }
|
||||||
|
|
||||||
|
# POST /api/v1/accounts/:account_id/whatsapp/authorization
|
||||||
|
# Handles both initial authorization and reauthorization
|
||||||
|
# If inbox_id is present in params, it performs reauthorization
|
||||||
|
def create
|
||||||
|
validate_embedded_signup_params!
|
||||||
|
channel = process_embedded_signup
|
||||||
|
render_success_response(channel.inbox)
|
||||||
|
rescue StandardError => e
|
||||||
|
render_error_response(e)
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def process_embedded_signup
|
||||||
|
service = Whatsapp::EmbeddedSignupService.new(
|
||||||
|
account: Current.account,
|
||||||
|
params: params.permit(:code, :business_id, :waba_id, :phone_number_id).to_h.symbolize_keys,
|
||||||
|
inbox_id: params[:inbox_id]
|
||||||
|
)
|
||||||
|
service.perform
|
||||||
|
end
|
||||||
|
|
||||||
|
def fetch_and_validate_inbox
|
||||||
|
@inbox = Current.account.inboxes.find(params[:inbox_id])
|
||||||
|
validate_reauthorization_required
|
||||||
|
end
|
||||||
|
|
||||||
|
def validate_reauthorization_required
|
||||||
|
return if @inbox.channel.reauthorization_required? || can_upgrade_to_embedded_signup?
|
||||||
|
|
||||||
|
render json: {
|
||||||
|
success: false,
|
||||||
|
message: I18n.t('inbox.reauthorization.not_required')
|
||||||
|
}, status: :unprocessable_entity
|
||||||
|
end
|
||||||
|
|
||||||
|
def can_upgrade_to_embedded_signup?
|
||||||
|
channel = @inbox.channel
|
||||||
|
return false unless channel.provider == 'whatsapp_cloud'
|
||||||
|
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
def render_success_response(inbox)
|
||||||
|
response = {
|
||||||
|
success: true,
|
||||||
|
id: inbox.id,
|
||||||
|
name: inbox.name,
|
||||||
|
channel_type: 'whatsapp'
|
||||||
|
}
|
||||||
|
response[:message] = I18n.t('inbox.reauthorization.success') if params[:inbox_id].present?
|
||||||
|
render json: response
|
||||||
|
end
|
||||||
|
|
||||||
|
def render_error_response(error)
|
||||||
|
Rails.logger.error "[WHATSAPP AUTHORIZATION] Embedded signup error: #{error.message}"
|
||||||
|
Rails.logger.error error.backtrace.join("\n")
|
||||||
|
render json: {
|
||||||
|
success: false,
|
||||||
|
error: error.message
|
||||||
|
}, status: :unprocessable_entity
|
||||||
|
end
|
||||||
|
|
||||||
|
def validate_feature_enabled!
|
||||||
|
return if Current.account.feature_whatsapp_embedded_signup?
|
||||||
|
|
||||||
|
render json: {
|
||||||
|
success: false,
|
||||||
|
error: 'WhatsApp embedded signup is not enabled for this account'
|
||||||
|
}, status: :forbidden
|
||||||
|
end
|
||||||
|
|
||||||
|
def validate_embedded_signup_params!
|
||||||
|
missing_params = []
|
||||||
|
missing_params << 'code' if params[:code].blank?
|
||||||
|
missing_params << 'business_id' if params[:business_id].blank?
|
||||||
|
missing_params << 'waba_id' if params[:waba_id].blank?
|
||||||
|
|
||||||
|
return if missing_params.empty?
|
||||||
|
|
||||||
|
raise ArgumentError, "Required parameters are missing: #{missing_params.join(', ')}"
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -14,7 +14,7 @@ module GoogleConcern
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def base_url
|
def scope
|
||||||
ENV.fetch('FRONTEND_URL', 'http://localhost:3000')
|
'email profile https://mail.google.com/'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ module MicrosoftConcern
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def base_url
|
def scope
|
||||||
ENV.fetch('FRONTEND_URL', 'http://localhost:3000')
|
'offline_access https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/SMTP.Send openid profile email'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
module NotionConcern
|
||||||
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
def notion_client
|
||||||
|
app_id = GlobalConfigService.load('NOTION_CLIENT_ID', nil)
|
||||||
|
app_secret = GlobalConfigService.load('NOTION_CLIENT_SECRET', nil)
|
||||||
|
|
||||||
|
::OAuth2::Client.new(app_id, app_secret, {
|
||||||
|
site: 'https://api.notion.com',
|
||||||
|
authorize_url: 'https://api.notion.com/v1/oauth/authorize',
|
||||||
|
token_url: 'https://api.notion.com/v1/oauth/token',
|
||||||
|
auth_scheme: :basic_auth
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def scope
|
||||||
|
''
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -67,6 +67,8 @@ class DashboardController < ActionController::Base
|
|||||||
FB_APP_ID: GlobalConfigService.load('FB_APP_ID', ''),
|
FB_APP_ID: GlobalConfigService.load('FB_APP_ID', ''),
|
||||||
INSTAGRAM_APP_ID: GlobalConfigService.load('INSTAGRAM_APP_ID', ''),
|
INSTAGRAM_APP_ID: GlobalConfigService.load('INSTAGRAM_APP_ID', ''),
|
||||||
FACEBOOK_API_VERSION: GlobalConfigService.load('FACEBOOK_API_VERSION', 'v17.0'),
|
FACEBOOK_API_VERSION: GlobalConfigService.load('FACEBOOK_API_VERSION', 'v17.0'),
|
||||||
|
WHATSAPP_APP_ID: GlobalConfigService.load('WHATSAPP_APP_ID', ''),
|
||||||
|
WHATSAPP_CONFIGURATION_ID: GlobalConfigService.load('WHATSAPP_CONFIGURATION_ID', ''),
|
||||||
IS_ENTERPRISE: ChatwootApp.enterprise?,
|
IS_ENTERPRISE: ChatwootApp.enterprise?,
|
||||||
AZURE_APP_ID: GlobalConfigService.load('AZURE_APP_ID', ''),
|
AZURE_APP_ID: GlobalConfigService.load('AZURE_APP_ID', ''),
|
||||||
GIT_SHA: GIT_HASH
|
GIT_SHA: GIT_HASH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class MicrosoftController < ApplicationController
|
|||||||
after_action :set_version_header
|
after_action :set_version_header
|
||||||
|
|
||||||
def identity_association
|
def identity_association
|
||||||
microsoft_indentity
|
microsoft_identity
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
@@ -11,7 +11,7 @@ class MicrosoftController < ApplicationController
|
|||||||
response.headers['Content-Length'] = { associatedApplications: [{ applicationId: @identity_json }] }.to_json.length
|
response.headers['Content-Length'] = { associatedApplications: [{ applicationId: @identity_json }] }.to_json.length
|
||||||
end
|
end
|
||||||
|
|
||||||
def microsoft_indentity
|
def microsoft_identity
|
||||||
@identity_json = GlobalConfigService.load('AZURE_APP_ID', nil)
|
@identity_json = GlobalConfigService.load('AZURE_APP_ID', nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
class Notion::CallbacksController < OauthCallbackController
|
||||||
|
include NotionConcern
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def provider_name
|
||||||
|
'notion'
|
||||||
|
end
|
||||||
|
|
||||||
|
def oauth_client
|
||||||
|
notion_client
|
||||||
|
end
|
||||||
|
|
||||||
|
def handle_response
|
||||||
|
hook = account.hooks.new(
|
||||||
|
access_token: parsed_body['access_token'],
|
||||||
|
status: 'enabled',
|
||||||
|
app_id: 'notion',
|
||||||
|
settings: {
|
||||||
|
token_type: parsed_body['token_type'],
|
||||||
|
workspace_name: parsed_body['workspace_name'],
|
||||||
|
workspace_id: parsed_body['workspace_id'],
|
||||||
|
workspace_icon: parsed_body['workspace_icon'],
|
||||||
|
bot_id: parsed_body['bot_id'],
|
||||||
|
owner: parsed_body['owner']
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
hook.save!
|
||||||
|
redirect_to notion_redirect_uri
|
||||||
|
end
|
||||||
|
|
||||||
|
def notion_redirect_uri
|
||||||
|
"#{ENV.fetch('FRONTEND_URL', nil)}/app/accounts/#{account.id}/settings/integrations/notion"
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -6,7 +6,6 @@ class OauthCallbackController < ApplicationController
|
|||||||
)
|
)
|
||||||
|
|
||||||
handle_response
|
handle_response
|
||||||
::Redis::Alfred.delete(cache_key)
|
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
ChatwootExceptionTracker.new(e).capture_exception
|
ChatwootExceptionTracker.new(e).capture_exception
|
||||||
redirect_to '/'
|
redirect_to '/'
|
||||||
@@ -64,10 +63,6 @@ class OauthCallbackController < ApplicationController
|
|||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
end
|
end
|
||||||
|
|
||||||
def cache_key
|
|
||||||
"#{provider_name}::#{users_data['email'].downcase}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def create_channel_with_inbox
|
def create_channel_with_inbox
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
channel_email = Channel::Email.create!(email: users_data['email'], account: account)
|
channel_email = Channel::Email.create!(email: users_data['email'], account: account)
|
||||||
@@ -86,12 +81,17 @@ class OauthCallbackController < ApplicationController
|
|||||||
decoded_token[0]
|
decoded_token[0]
|
||||||
end
|
end
|
||||||
|
|
||||||
def account_id
|
def account_from_signed_id
|
||||||
::Redis::Alfred.get(cache_key)
|
raise ActionController::BadRequest, 'Missing state variable' if params[:state].blank?
|
||||||
|
|
||||||
|
account = GlobalID::Locator.locate_signed(params[:state])
|
||||||
|
raise 'Invalid or expired state' if account.nil?
|
||||||
|
|
||||||
|
account
|
||||||
end
|
end
|
||||||
|
|
||||||
def account
|
def account
|
||||||
@account ||= Account.find(account_id)
|
@account ||= account_from_signed_id
|
||||||
end
|
end
|
||||||
|
|
||||||
# Fallback name, for when name field is missing from users_data
|
# Fallback name, for when name field is missing from users_data
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
class Platform::Api::V1::AccountsController < PlatformController
|
class Platform::Api::V1::AccountsController < PlatformController
|
||||||
|
def index
|
||||||
|
@resources = @platform_app.platform_app_permissibles
|
||||||
|
.where(permissible_type: 'Account')
|
||||||
|
.includes(:permissible)
|
||||||
|
.map(&:permissible)
|
||||||
|
end
|
||||||
|
|
||||||
def show; end
|
def show; end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -7,13 +7,19 @@ class Public::Api::V1::Portals::ArticlesController < Public::Api::V1::Portals::B
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
@articles = @portal.articles.published.includes(:category, :author)
|
@articles = @portal.articles.published.includes(:category, :author)
|
||||||
|
|
||||||
|
@articles = @articles.where(locale: permitted_params[:locale]) if permitted_params[:locale].present?
|
||||||
|
|
||||||
@articles_count = @articles.count
|
@articles_count = @articles.count
|
||||||
|
|
||||||
search_articles
|
search_articles
|
||||||
order_by_sort_param
|
order_by_sort_param
|
||||||
limit_results
|
limit_results
|
||||||
end
|
end
|
||||||
|
|
||||||
def show; end
|
def show
|
||||||
|
@og_image_url = helpers.set_og_image_url(@portal.name, @article.title)
|
||||||
|
end
|
||||||
|
|
||||||
def tracking_pixel
|
def tracking_pixel
|
||||||
@article = @portal.articles.find_by(slug: permitted_params[:article_slug])
|
@article = @portal.articles.find_by(slug: permitted_params[:article_slug])
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ class Public::Api::V1::Portals::CategoriesController < Public::Api::V1::Portals:
|
|||||||
@categories = @portal.categories.order(position: :asc)
|
@categories = @portal.categories.order(position: :asc)
|
||||||
end
|
end
|
||||||
|
|
||||||
def show; end
|
def show
|
||||||
|
@og_image_url = helpers.set_og_image_url(@portal.name, @category.name)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ class Public::Api::V1::PortalsController < Public::Api::V1::Portals::BaseControl
|
|||||||
before_action :redirect_to_portal_with_locale, only: [:show]
|
before_action :redirect_to_portal_with_locale, only: [:show]
|
||||||
layout 'portal'
|
layout 'portal'
|
||||||
|
|
||||||
def show; end
|
def show
|
||||||
|
@og_image_url = helpers.set_og_image_url('', @portal.header_text)
|
||||||
|
end
|
||||||
|
|
||||||
def sitemap
|
def sitemap
|
||||||
@help_center_url = @portal.custom_domain || ChatwootApp.help_center_root
|
@help_center_url = @portal.custom_domain || ChatwootApp.help_center_root
|
||||||
|
|||||||
@@ -17,7 +17,12 @@ class SlackUploadsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def blob_url
|
def blob_url
|
||||||
url_for(@blob.representation(resize_to_fill: [250, nil]))
|
# Only generate representations for images
|
||||||
|
if @blob.content_type.start_with?('image/')
|
||||||
|
url_for(@blob.representation(resize_to_fill: [250, nil]))
|
||||||
|
else
|
||||||
|
url_for(@blob)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def avatar_url
|
def avatar_url
|
||||||
|
|||||||
@@ -39,7 +39,10 @@ class SuperAdmin::AppConfigsController < SuperAdmin::ApplicationController
|
|||||||
'email' => ['MAILER_INBOUND_EMAIL_DOMAIN'],
|
'email' => ['MAILER_INBOUND_EMAIL_DOMAIN'],
|
||||||
'linear' => %w[LINEAR_CLIENT_ID LINEAR_CLIENT_SECRET],
|
'linear' => %w[LINEAR_CLIENT_ID LINEAR_CLIENT_SECRET],
|
||||||
'slack' => %w[SLACK_CLIENT_ID SLACK_CLIENT_SECRET],
|
'slack' => %w[SLACK_CLIENT_ID SLACK_CLIENT_SECRET],
|
||||||
'instagram' => %w[INSTAGRAM_APP_ID INSTAGRAM_APP_SECRET INSTAGRAM_VERIFY_TOKEN INSTAGRAM_API_VERSION ENABLE_INSTAGRAM_CHANNEL_HUMAN_AGENT]
|
'instagram' => %w[INSTAGRAM_APP_ID INSTAGRAM_APP_SECRET INSTAGRAM_VERIFY_TOKEN INSTAGRAM_API_VERSION ENABLE_INSTAGRAM_CHANNEL_HUMAN_AGENT],
|
||||||
|
'whatsapp_embedded' => %w[WHATSAPP_APP_ID WHATSAPP_APP_SECRET WHATSAPP_CONFIGURATION_ID WHATSAPP_API_VERSION],
|
||||||
|
'notion' => %w[NOTION_CLIENT_ID NOTION_CLIENT_SECRET],
|
||||||
|
'google' => %w[GOOGLE_OAUTH_CLIENT_ID GOOGLE_OAUTH_CLIENT_SECRET GOOGLE_OAUTH_REDIRECT_URI]
|
||||||
}
|
}
|
||||||
|
|
||||||
@allowed_configs = mapping.fetch(@config, %w[ENABLE_ACCOUNT_SIGNUP FIREBASE_PROJECT_ID FIREBASE_CREDENTIALS])
|
@allowed_configs = mapping.fetch(@config, %w[ENABLE_ACCOUNT_SIGNUP FIREBASE_PROJECT_ID FIREBASE_CREDENTIALS])
|
||||||
|
|||||||
@@ -7,8 +7,9 @@
|
|||||||
class SuperAdmin::ApplicationController < Administrate::ApplicationController
|
class SuperAdmin::ApplicationController < Administrate::ApplicationController
|
||||||
include ActionView::Helpers::TagHelper
|
include ActionView::Helpers::TagHelper
|
||||||
include ActionView::Context
|
include ActionView::Context
|
||||||
|
include SuperAdmin::NavigationHelper
|
||||||
|
|
||||||
helper_method :render_vue_component
|
helper_method :render_vue_component, :settings_open?, :settings_pages
|
||||||
# authenticiation done via devise : SuperAdmin Model
|
# authenticiation done via devise : SuperAdmin Model
|
||||||
before_action :authenticate_super_admin!
|
before_action :authenticate_super_admin!
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,11 @@ class Twilio::CallbackController < ApplicationController
|
|||||||
*Array.new(10) { |i| :"MediaUrl#{i}" },
|
*Array.new(10) { |i| :"MediaUrl#{i}" },
|
||||||
*Array.new(10) { |i| :"MediaContentType#{i}" },
|
*Array.new(10) { |i| :"MediaContentType#{i}" },
|
||||||
:MessagingServiceSid,
|
:MessagingServiceSid,
|
||||||
:NumMedia
|
:NumMedia,
|
||||||
|
:Latitude,
|
||||||
|
:Longitude,
|
||||||
|
:MessageType,
|
||||||
|
:ProfileName
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,7 +4,16 @@ class Webhooks::InstagramController < ActionController::API
|
|||||||
def events
|
def events
|
||||||
Rails.logger.info('Instagram webhook received events')
|
Rails.logger.info('Instagram webhook received events')
|
||||||
if params['object'].casecmp('instagram').zero?
|
if params['object'].casecmp('instagram').zero?
|
||||||
::Webhooks::InstagramEventsJob.perform_later(params.to_unsafe_hash[:entry])
|
entry_params = params.to_unsafe_hash[:entry]
|
||||||
|
|
||||||
|
if contains_echo_event?(entry_params)
|
||||||
|
# Add delay to prevent race condition where echo arrives before send message API completes
|
||||||
|
# This avoids duplicate messages when echo comes early during API processing
|
||||||
|
::Webhooks::InstagramEventsJob.set(wait: 2.seconds).perform_later(entry_params)
|
||||||
|
else
|
||||||
|
::Webhooks::InstagramEventsJob.perform_later(entry_params)
|
||||||
|
end
|
||||||
|
|
||||||
render json: :ok
|
render json: :ok
|
||||||
else
|
else
|
||||||
Rails.logger.warn("Message is not received from the instagram webhook event: #{params['object']}")
|
Rails.logger.warn("Message is not received from the instagram webhook event: #{params['object']}")
|
||||||
@@ -14,6 +23,16 @@ class Webhooks::InstagramController < ActionController::API
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def contains_echo_event?(entry_params)
|
||||||
|
return false unless entry_params.is_a?(Array)
|
||||||
|
|
||||||
|
entry_params.any? do |entry|
|
||||||
|
# Check messaging array for echo events
|
||||||
|
messaging_events = entry[:messaging] || []
|
||||||
|
messaging_events.any? { |messaging| messaging.dig(:message, :is_echo).present? }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def valid_token?(token)
|
def valid_token?(token)
|
||||||
# Validates against both IG_VERIFY_TOKEN (Instagram channel via Facebook page) and
|
# Validates against both IG_VERIFY_TOKEN (Instagram channel via Facebook page) and
|
||||||
# INSTAGRAM_VERIFY_TOKEN (Instagram channel via direct Instagram login)
|
# INSTAGRAM_VERIFY_TOKEN (Instagram channel via direct Instagram login)
|
||||||
|
|||||||
@@ -15,7 +15,13 @@ class NotificationFinder
|
|||||||
end
|
end
|
||||||
|
|
||||||
def unread_count
|
def unread_count
|
||||||
@notifications.where(read_at: nil).count
|
if type_included?('read')
|
||||||
|
# If we're including read notifications, filter to unread
|
||||||
|
@notifications.where(read_at: nil).count
|
||||||
|
else
|
||||||
|
# Already filtered to unread notifications, just count
|
||||||
|
@notifications.count
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def count
|
def count
|
||||||
@@ -27,7 +33,7 @@ class NotificationFinder
|
|||||||
def set_up
|
def set_up
|
||||||
find_all_notifications
|
find_all_notifications
|
||||||
filter_snoozed_notifications
|
filter_snoozed_notifications
|
||||||
fitler_read_notifications
|
filter_read_notifications
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_all_notifications
|
def find_all_notifications
|
||||||
@@ -38,7 +44,7 @@ class NotificationFinder
|
|||||||
@notifications = @notifications.where(snoozed_until: nil) unless type_included?('snoozed')
|
@notifications = @notifications.where(snoozed_until: nil) unless type_included?('snoozed')
|
||||||
end
|
end
|
||||||
|
|
||||||
def fitler_read_notifications
|
def filter_read_notifications
|
||||||
@notifications = @notifications.where(read_at: nil) unless type_included?('read')
|
@notifications = @notifications.where(read_at: nil) unless type_included?('read')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
module MessageFormatHelper
|
module MessageFormatHelper
|
||||||
include RegexHelper
|
|
||||||
|
|
||||||
def transform_user_mention_content(message_content)
|
def transform_user_mention_content(message_content)
|
||||||
# attachment message without content, message_content is nil
|
# attachment message without content, message_content is nil
|
||||||
message_content.presence ? message_content.gsub(MENTION_REGEX, '\1') : ''
|
return '' unless message_content.presence
|
||||||
|
|
||||||
|
# Use CommonMarker to convert markdown to plain text for notifications
|
||||||
|
# This handles all markdown formatting (links, bold, italic, etc.) not just mentions
|
||||||
|
# Converts: [@👍 customer support](mention://team/1/%F0%9F%91%8D%20customer%20support)
|
||||||
|
# To: @👍 customer support
|
||||||
|
CommonMarker.render_doc(message_content).to_plaintext.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_message_content(message_content)
|
def render_message_content(message_content)
|
||||||
|
|||||||
@@ -1,4 +1,21 @@
|
|||||||
module PortalHelper
|
module PortalHelper
|
||||||
|
def set_og_image_url(portal_name, title)
|
||||||
|
cdn_url = GlobalConfig.get('OG_IMAGE_CDN_URL')['OG_IMAGE_CDN_URL']
|
||||||
|
return if cdn_url.blank?
|
||||||
|
|
||||||
|
client_ref = GlobalConfig.get('OG_IMAGE_CLIENT_REF')['OG_IMAGE_CLIENT_REF']
|
||||||
|
|
||||||
|
uri = URI.parse(cdn_url)
|
||||||
|
uri.path = '/og'
|
||||||
|
uri.query = URI.encode_www_form(
|
||||||
|
clientRef: client_ref,
|
||||||
|
title: title,
|
||||||
|
portalName: portal_name
|
||||||
|
)
|
||||||
|
|
||||||
|
uri.to_s
|
||||||
|
end
|
||||||
|
|
||||||
def generate_portal_bg_color(portal_color, theme)
|
def generate_portal_bg_color(portal_color, theme)
|
||||||
base_color = theme == 'dark' ? 'black' : 'white'
|
base_color = theme == 'dark' ? 'black' : 'white'
|
||||||
"color-mix(in srgb, #{portal_color} 20%, #{base_color})"
|
"color-mix(in srgb, #{portal_color} 20%, #{base_color})"
|
||||||
|
|||||||
@@ -18,12 +18,25 @@ module ReportingEventHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def last_non_human_activity(conversation)
|
def last_non_human_activity(conversation)
|
||||||
# check if a handoff event already exists
|
# Try to get either a handoff or reopened event first
|
||||||
handoff_event = ReportingEvent.where(conversation_id: conversation.id, name: 'conversation_bot_handoff').last
|
# These will always take precedence over any other activity
|
||||||
|
# Also, any of these events can happen at any time in the course of a conversation lifecycle.
|
||||||
|
# So we pick the latest event
|
||||||
|
event = ReportingEvent.where(
|
||||||
|
conversation_id: conversation.id,
|
||||||
|
name: %w[conversation_bot_handoff conversation_opened]
|
||||||
|
).order(event_end_time: :desc).first
|
||||||
|
|
||||||
# if a handoff exists, last non human activity is when the handoff ended,
|
return event.event_end_time if event&.event_end_time
|
||||||
# otherwise it's when the conversation was created
|
|
||||||
handoff_event&.event_end_time || conversation.created_at
|
# Fallback to bot resolved event
|
||||||
|
# Because this will be closest to the most accurate activity instead of conversation.created_at
|
||||||
|
bot_event = ReportingEvent.where(conversation_id: conversation.id, name: 'conversation_bot_resolved').last
|
||||||
|
|
||||||
|
return bot_event.event_end_time if bot_event&.event_end_time
|
||||||
|
|
||||||
|
# If no events found, return conversation creation time
|
||||||
|
conversation.created_at
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
+38
-9
@@ -1,5 +1,7 @@
|
|||||||
# TODO: Move this values to features.yml itself
|
# TODO: Move this values to features.yml itself
|
||||||
# No need to replicate the same values in two places
|
# No need to replicate the same values in two places
|
||||||
|
|
||||||
|
# ------- Premium Features ------- #
|
||||||
captain:
|
captain:
|
||||||
name: 'Captain'
|
name: 'Captain'
|
||||||
description: 'Enable AI-powered conversations with your customers.'
|
description: 'Enable AI-powered conversations with your customers.'
|
||||||
@@ -32,6 +34,15 @@ disable_branding:
|
|||||||
enabled: <%= (ChatwootHub.pricing_plan != 'community') %>
|
enabled: <%= (ChatwootHub.pricing_plan != 'community') %>
|
||||||
icon: 'icon-sailbot-fill'
|
icon: 'icon-sailbot-fill'
|
||||||
enterprise: true
|
enterprise: true
|
||||||
|
|
||||||
|
# ------- Product Features ------- #
|
||||||
|
help_center:
|
||||||
|
name: 'Help Center'
|
||||||
|
description: 'Allow agents to create help center articles and publish them in a portal.'
|
||||||
|
enabled: true
|
||||||
|
icon: 'icon-book-2-line'
|
||||||
|
|
||||||
|
# ------- Communication Channels ------- #
|
||||||
live_chat:
|
live_chat:
|
||||||
name: 'Live Chat'
|
name: 'Live Chat'
|
||||||
description: 'Improve your customer experience using a live chat on your website.'
|
description: 'Improve your customer experience using a live chat on your website.'
|
||||||
@@ -42,6 +53,12 @@ email:
|
|||||||
description: 'Manage your email customer interactions from Chatwoot.'
|
description: 'Manage your email customer interactions from Chatwoot.'
|
||||||
enabled: true
|
enabled: true
|
||||||
icon: 'icon-mail-send-fill'
|
icon: 'icon-mail-send-fill'
|
||||||
|
config_key: 'email'
|
||||||
|
sms:
|
||||||
|
name: 'SMS'
|
||||||
|
description: 'Manage your SMS customer interactions from Chatwoot.'
|
||||||
|
enabled: true
|
||||||
|
icon: 'icon-message-line'
|
||||||
messenger:
|
messenger:
|
||||||
name: 'Messenger'
|
name: 'Messenger'
|
||||||
description: 'Stay connected with your customers on Facebook & Instagram.'
|
description: 'Stay connected with your customers on Facebook & Instagram.'
|
||||||
@@ -69,34 +86,46 @@ line:
|
|||||||
description: 'Manage your Line customer interactions from Chatwoot.'
|
description: 'Manage your Line customer interactions from Chatwoot.'
|
||||||
enabled: true
|
enabled: true
|
||||||
icon: 'icon-line-line'
|
icon: 'icon-line-line'
|
||||||
sms:
|
|
||||||
name: 'SMS'
|
# ------- OAuth & Authentication ------- #
|
||||||
description: 'Manage your SMS customer interactions from Chatwoot.'
|
google:
|
||||||
|
name: 'Google'
|
||||||
|
description: 'Configuration for setting up Google OAuth Integration'
|
||||||
enabled: true
|
enabled: true
|
||||||
icon: 'icon-message-line'
|
icon: 'icon-google'
|
||||||
help_center:
|
config_key: 'google'
|
||||||
name: 'Help Center'
|
|
||||||
description: 'Allow agents to create help center articles and publish them in a portal.'
|
|
||||||
enabled: true
|
|
||||||
icon: 'icon-book-2-line'
|
|
||||||
microsoft:
|
microsoft:
|
||||||
name: 'Microsoft'
|
name: 'Microsoft'
|
||||||
description: 'Configuration for setting up Microsoft Email'
|
description: 'Configuration for setting up Microsoft Email'
|
||||||
enabled: true
|
enabled: true
|
||||||
icon: 'icon-microsoft'
|
icon: 'icon-microsoft'
|
||||||
config_key: 'microsoft'
|
config_key: 'microsoft'
|
||||||
|
|
||||||
|
# ------- Third-party Integrations ------- #
|
||||||
linear:
|
linear:
|
||||||
name: 'Linear'
|
name: 'Linear'
|
||||||
description: 'Configuration for setting up Linear Integration'
|
description: 'Configuration for setting up Linear Integration'
|
||||||
enabled: true
|
enabled: true
|
||||||
icon: 'icon-linear'
|
icon: 'icon-linear'
|
||||||
config_key: 'linear'
|
config_key: 'linear'
|
||||||
|
notion:
|
||||||
|
name: 'Notion'
|
||||||
|
description: 'Configuration for setting up Notion Integration'
|
||||||
|
enabled: true
|
||||||
|
icon: 'icon-notion'
|
||||||
|
config_key: 'notion'
|
||||||
slack:
|
slack:
|
||||||
name: 'Slack'
|
name: 'Slack'
|
||||||
description: 'Configuration for setting up Slack Integration'
|
description: 'Configuration for setting up Slack Integration'
|
||||||
enabled: true
|
enabled: true
|
||||||
icon: 'icon-slack'
|
icon: 'icon-slack'
|
||||||
config_key: 'slack'
|
config_key: 'slack'
|
||||||
|
whatsapp_embedded:
|
||||||
|
name: 'WhatsApp Embedded'
|
||||||
|
description: 'Configuration for setting up WhatsApp Embedded Integration'
|
||||||
|
enabled: true
|
||||||
|
icon: 'icon-whatsapp-line'
|
||||||
|
config_key: 'whatsapp_embedded'
|
||||||
shopify:
|
shopify:
|
||||||
name: 'Shopify'
|
name: 'Shopify'
|
||||||
description: 'Configuration for setting up Shopify Integration'
|
description: 'Configuration for setting up Shopify Integration'
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
module SuperAdmin::FeaturesHelper
|
module SuperAdmin::FeaturesHelper
|
||||||
def self.available_features
|
def self.available_features
|
||||||
YAML.load(ERB.new(Rails.root.join('enterprise/app/helpers/super_admin/features.yml').read).result).with_indifferent_access
|
YAML.load(ERB.new(Rails.root.join('app/helpers/super_admin/features.yml').read).result).with_indifferent_access
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.plan_details
|
def self.plan_details
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
module SuperAdmin::NavigationHelper
|
||||||
|
def settings_open?
|
||||||
|
params[:controller].in? %w[super_admin/settings super_admin/app_configs]
|
||||||
|
end
|
||||||
|
|
||||||
|
def settings_pages
|
||||||
|
features = SuperAdmin::FeaturesHelper.available_features.select do |_feature, attrs|
|
||||||
|
attrs['config_key'].present? && attrs['enabled']
|
||||||
|
end
|
||||||
|
|
||||||
|
# Add general at the beginning
|
||||||
|
general_feature = [['general', { 'config_key' => 'general', 'name' => 'General' }]]
|
||||||
|
|
||||||
|
general_feature + features.to_a
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import AddAccountModal from '../dashboard/components/layout/sidebarComponents/AddAccountModal.vue';
|
import AddAccountModal from './components/app/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';
|
||||||
import UpdateBanner from './components/app/UpdateBanner.vue';
|
import UpdateBanner from './components/app/UpdateBanner.vue';
|
||||||
@@ -136,8 +136,7 @@ export default {
|
|||||||
<div
|
<div
|
||||||
v-if="!authUIFlags.isFetching && !accountUIFlags.isFetchingItem"
|
v-if="!authUIFlags.isFetching && !accountUIFlags.isFetchingItem"
|
||||||
id="app"
|
id="app"
|
||||||
class="flex-grow-0 w-full h-full min-h-0 app-wrapper"
|
class="flex flex-col w-full h-screen min-h-0"
|
||||||
:class="{ 'app-rtl--wrapper': isRTL }"
|
|
||||||
:dir="isRTL ? 'rtl' : 'ltr'"
|
:dir="isRTL ? 'rtl' : 'ltr'"
|
||||||
>
|
>
|
||||||
<UpdateBanner :latest-chatwoot-version="latestChatwootVersion" />
|
<UpdateBanner :latest-chatwoot-version="latestChatwootVersion" />
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/* global axios */
|
||||||
|
import ApiClient from '../ApiClient';
|
||||||
|
|
||||||
|
class CaptainScenarios extends ApiClient {
|
||||||
|
constructor() {
|
||||||
|
super('captain/assistants', { accountScoped: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
get({ assistantId, page = 1, searchKey } = {}) {
|
||||||
|
return axios.get(`${this.url}/${assistantId}/scenarios`, {
|
||||||
|
params: { page, searchKey },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
show({ assistantId, id }) {
|
||||||
|
return axios.get(`${this.url}/${assistantId}/scenarios/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
create({ assistantId, ...data } = {}) {
|
||||||
|
return axios.post(`${this.url}/${assistantId}/scenarios`, {
|
||||||
|
scenario: data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
update({ assistantId, id }, data = {}) {
|
||||||
|
return axios.put(`${this.url}/${assistantId}/scenarios/${id}`, {
|
||||||
|
scenario: data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
delete({ assistantId, id }) {
|
||||||
|
return axios.delete(`${this.url}/${assistantId}/scenarios/${id}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default new CaptainScenarios();
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/* global axios */
|
||||||
|
import ApiClient from '../ApiClient';
|
||||||
|
|
||||||
|
class CaptainTools extends ApiClient {
|
||||||
|
constructor() {
|
||||||
|
super('captain/assistants/tools', { accountScoped: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
get(params = {}) {
|
||||||
|
return axios.get(this.url, {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default new CaptainTools();
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/* global axios */
|
||||||
|
import ApiClient from '../ApiClient';
|
||||||
|
|
||||||
|
class WhatsappChannel extends ApiClient {
|
||||||
|
constructor() {
|
||||||
|
super('whatsapp', { accountScoped: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
createEmbeddedSignup(params) {
|
||||||
|
return axios.post(`${this.baseUrl()}/whatsapp/authorization`, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
reauthorizeWhatsApp({ inboxId, ...params }) {
|
||||||
|
return axios.post(`${this.baseUrl()}/whatsapp/authorization`, {
|
||||||
|
...params,
|
||||||
|
inbox_id: inboxId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default new WhatsappChannel();
|
||||||
@@ -21,6 +21,14 @@ class PortalsAPI extends ApiClient {
|
|||||||
deleteLogo(portalSlug) {
|
deleteLogo(portalSlug) {
|
||||||
return axios.delete(`${this.url}/${portalSlug}/logo`);
|
return axios.delete(`${this.url}/${portalSlug}/logo`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendCnameInstructions(portalSlug, email) {
|
||||||
|
return axios.post(`${this.url}/${portalSlug}/send_instructions`, { email });
|
||||||
|
}
|
||||||
|
|
||||||
|
sslStatus(portalSlug) {
|
||||||
|
return axios.get(`${this.url}/${portalSlug}/ssl_status`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default PortalsAPI;
|
export default PortalsAPI;
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ class Inboxes extends CacheEnabledApiClient {
|
|||||||
agent_bot: botId,
|
agent_bot: botId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
syncTemplates(inboxId) {
|
||||||
|
return axios.post(`${this.url}/${inboxId}/sync_templates`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new Inboxes();
|
export default new Inboxes();
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/* global axios */
|
||||||
|
import ApiClient from './ApiClient';
|
||||||
|
|
||||||
|
class NotionOAuthClient extends ApiClient {
|
||||||
|
constructor() {
|
||||||
|
super('notion', { accountScoped: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
generateAuthorization() {
|
||||||
|
return axios.post(`${this.url}/authorization`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default new NotionOAuthClient();
|
||||||
@@ -12,6 +12,7 @@ describe('#InboxesAPI', () => {
|
|||||||
expect(inboxesAPI).toHaveProperty('getCampaigns');
|
expect(inboxesAPI).toHaveProperty('getCampaigns');
|
||||||
expect(inboxesAPI).toHaveProperty('getAgentBot');
|
expect(inboxesAPI).toHaveProperty('getAgentBot');
|
||||||
expect(inboxesAPI).toHaveProperty('setAgentBot');
|
expect(inboxesAPI).toHaveProperty('setAgentBot');
|
||||||
|
expect(inboxesAPI).toHaveProperty('syncTemplates');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('API calls', () => {
|
describe('API calls', () => {
|
||||||
@@ -40,5 +41,12 @@ describe('#InboxesAPI', () => {
|
|||||||
inboxesAPI.deleteInboxAvatar(2);
|
inboxesAPI.deleteInboxAvatar(2);
|
||||||
expect(axiosMock.delete).toHaveBeenCalledWith('/api/v1/inboxes/2/avatar');
|
expect(axiosMock.delete).toHaveBeenCalledWith('/api/v1/inboxes/2/avatar');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('#syncTemplates', () => {
|
||||||
|
inboxesAPI.syncTemplates(2);
|
||||||
|
expect(axiosMock.post).toHaveBeenCalledWith(
|
||||||
|
'/api/v1/inboxes/2/sync_templates'
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,101 +0,0 @@
|
|||||||
.slide-fade-enter-active {
|
|
||||||
transition: all 0.3s var(--ease-in-cubic);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-fade-leave-active {
|
|
||||||
transition: all 0.3s var(--ease-out-cubic);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-fade-enter,
|
|
||||||
.slide-fade-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateX(10px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-fade-enter {
|
|
||||||
transform: translateX($space-micro);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-fade-leave-to {
|
|
||||||
transform: translateX($space-medium);
|
|
||||||
}
|
|
||||||
|
|
||||||
.conversations-list-enter-active,
|
|
||||||
.conversations-list-leave-active {
|
|
||||||
transition: all 0.25s var(--ease-out-cubic);
|
|
||||||
}
|
|
||||||
|
|
||||||
.conversations-list-enter,
|
|
||||||
.conversations-list-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateX($space-medium);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-up-enter-active {
|
|
||||||
transition: all 0.3s var(--ease-in-cubic);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-up-leave-active {
|
|
||||||
transition: all 0.3s var(--ease-out-cubic);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-up-enter,
|
|
||||||
.slide-up-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(-$space-medium);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-slide-enter-active,
|
|
||||||
.menu-slide-leave-active {
|
|
||||||
transform: translateY(0);
|
|
||||||
transition:
|
|
||||||
transform 0.25s var(--ease-in-cubic),
|
|
||||||
opacity 0.15s var(--ease-in-cubic);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-slide-enter,
|
|
||||||
.menu-slide-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY($space-small);
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-fade-enter-active {
|
|
||||||
transition: all 0.3s var(--ease-in-sine);
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-fade-leave-active {
|
|
||||||
transition: all 0.1s var(--ease-out-sine);
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-fade-enter,
|
|
||||||
.toast-fade-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(-$space-small);
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-fade-enter-active {
|
|
||||||
transition: all 0.3s var(--ease-in-sine);
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-fade-leave-active {
|
|
||||||
transition: all 0.1s var(--ease-out-sine);
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-fade-enter,
|
|
||||||
.modal-fade-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.network-notification-fade-enter-active {
|
|
||||||
transition: all 0.1s var(--ease-in-sine);
|
|
||||||
}
|
|
||||||
|
|
||||||
.network-notification-fade-leave-active {
|
|
||||||
transition: all 0.1s var(--ease-out-sine);
|
|
||||||
}
|
|
||||||
|
|
||||||
.network-notification-fade-enter,
|
|
||||||
.network-notification-fade-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(-$space-small);
|
|
||||||
}
|
|
||||||
+5
@@ -201,3 +201,8 @@ code {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Table
|
||||||
|
table {
|
||||||
|
@apply border-spacing-0 text-sm w-full;
|
||||||
|
}
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
@import 'dashboard/assets/scss/variables';
|
|
||||||
|
|
||||||
.formulate-input {
|
|
||||||
.formulate-input-errors {
|
|
||||||
list-style-type: none;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formulate-input-error {
|
|
||||||
color: var(--r-400);
|
|
||||||
display: block;
|
|
||||||
font-size: var(--font-size-small);
|
|
||||||
font-weight: $font-weight-normal;
|
|
||||||
margin-bottom: $space-one;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.integration-hooks {
|
|
||||||
.formulate-input[data-type='checkbox'] {
|
|
||||||
.formulate-input-wrapper {
|
|
||||||
@apply flex;
|
|
||||||
|
|
||||||
.formulate-input-element {
|
|
||||||
@apply pr-2;
|
|
||||||
|
|
||||||
input {
|
|
||||||
@apply mb-0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.formulate-input-element-decorator {
|
|
||||||
@apply hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
// loader class
|
|
||||||
.spinner {
|
|
||||||
@include color-spinner();
|
|
||||||
@apply inline-block h-6 py-0 px-6 relative align-middle w-6;
|
|
||||||
|
|
||||||
&.message {
|
|
||||||
@apply bg-white dark:bg-slate-800 rounded-full left-0 my-3 mx-auto p-4 top-0;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
@apply -ml-3 -mt-3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.small {
|
|
||||||
@apply h-4 w-4;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
@apply h-4 -mt-2 w-4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
// scss-lint:disable SpaceAfterPropertyColon
|
|
||||||
@import 'shared/assets/fonts/inter';
|
|
||||||
|
|
||||||
// Inter,
|
|
||||||
html,
|
|
||||||
body {
|
|
||||||
font-family:
|
|
||||||
'Inter',
|
|
||||||
-apple-system,
|
|
||||||
system-ui,
|
|
||||||
BlinkMacSystemFont,
|
|
||||||
'Segoe UI',
|
|
||||||
Roboto,
|
|
||||||
'Helvetica Neue',
|
|
||||||
Tahoma,
|
|
||||||
Arial,
|
|
||||||
sans-serif !important;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
height: 100%;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-wrapper {
|
|
||||||
@apply h-screen flex-grow-0 min-h-0 w-full;
|
|
||||||
|
|
||||||
.button--fixed-top {
|
|
||||||
@apply fixed ltr:right-2 rtl:left-2 top-2 flex flex-row;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner + .app-wrapper {
|
|
||||||
// Reduce the height of the dashboard to make room for the banner.
|
|
||||||
// And causing the top right green-action button to be pushed down when scrolling.
|
|
||||||
@apply h-[calc(100%-48px)];
|
|
||||||
|
|
||||||
.button--fixed-top {
|
|
||||||
@apply top-14;
|
|
||||||
}
|
|
||||||
|
|
||||||
.off-canvas-content {
|
|
||||||
.button--fixed-top {
|
|
||||||
@apply top-2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
@import 'dashboard/assets/scss/variables';
|
|
||||||
|
|
||||||
$spinner-before-border-color: rgba(255, 255, 255, 0.7);
|
|
||||||
|
|
||||||
// input form
|
|
||||||
@mixin ghost-input() {
|
|
||||||
box-shadow: none;
|
|
||||||
border-color: transparent;
|
|
||||||
|
|
||||||
&:active,
|
|
||||||
&:hover,
|
|
||||||
&:focus {
|
|
||||||
border-color: transparent;
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin color-spinner() {
|
|
||||||
@keyframes spinner {
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
animation: spinner .9s linear infinite;
|
|
||||||
border: 2px solid $spinner-before-border-color;
|
|
||||||
border-radius: 50%;
|
|
||||||
border-top-color: lighten($color-woot, 10%);
|
|
||||||
box-sizing: border-box;
|
|
||||||
content: '';
|
|
||||||
height: $space-medium;
|
|
||||||
left: 50%;
|
|
||||||
margin-left: -$space-one;
|
|
||||||
margin-top: -$space-one;
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
width: $space-medium;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// --------------------------------------------------------
|
|
||||||
// arrows
|
|
||||||
// --------------------------------------------------------
|
|
||||||
// $direction: top, left, right, bottom, top-left, top-right, bottom-left, bottom-right
|
|
||||||
// $color: hex, rgb or rbga
|
|
||||||
// $size: px or em
|
|
||||||
// @example
|
|
||||||
// .element{
|
|
||||||
// @include arrow(top, #000, 50px);
|
|
||||||
// }
|
|
||||||
@mixin arrow($direction, $color, $size) {
|
|
||||||
display: block;
|
|
||||||
height: 0;
|
|
||||||
width: 0;
|
|
||||||
content: '';
|
|
||||||
|
|
||||||
@if $direction == 'top' {
|
|
||||||
border-bottom: $size solid $color;
|
|
||||||
border-left: $size solid transparent;
|
|
||||||
border-right: $size solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
@else if $direction == 'right' {
|
|
||||||
border-bottom: $size solid transparent;
|
|
||||||
border-left: $size solid $color;
|
|
||||||
border-top: $size solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
@else if $direction == 'bottom' {
|
|
||||||
border-left: $size solid transparent;
|
|
||||||
border-right: $size solid transparent;
|
|
||||||
border-top: $size solid $color;
|
|
||||||
}
|
|
||||||
|
|
||||||
@else if $direction == 'left' {
|
|
||||||
border-bottom: $size solid transparent;
|
|
||||||
border-right: $size solid $color;
|
|
||||||
border-top: $size solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
@else if $direction == 'top-left' {
|
|
||||||
border-right: $size solid transparent;
|
|
||||||
border-top: $size solid $color;
|
|
||||||
}
|
|
||||||
|
|
||||||
@else if $direction == 'top-right' {
|
|
||||||
border-left: $size solid transparent;
|
|
||||||
border-top: $size solid $color;
|
|
||||||
}
|
|
||||||
|
|
||||||
@else if $direction == 'bottom-left' {
|
|
||||||
border-bottom: $size solid $color;
|
|
||||||
border-right: $size solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
@else if $direction == 'bottom-right' {
|
|
||||||
border-bottom: $size solid $color;
|
|
||||||
border-left: $size solid transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
.app-rtl--wrapper {
|
|
||||||
direction: rtl;
|
|
||||||
|
|
||||||
// Woot Tabs
|
|
||||||
.tabs-title {
|
|
||||||
&:first-child {
|
|
||||||
margin-left: var(--space-small);
|
|
||||||
margin-right: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
margin-left: unset;
|
|
||||||
margin-right: var(--space-small);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// woot tables
|
|
||||||
table,
|
|
||||||
thead,
|
|
||||||
th {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Table footer
|
|
||||||
.footer {
|
|
||||||
.page-meta {
|
|
||||||
direction: initial;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wizard box
|
|
||||||
.wizard-box {
|
|
||||||
direction: initial;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Conversation details
|
|
||||||
.conversation-details-wrap {
|
|
||||||
.conversation-panel {
|
|
||||||
// Message text
|
|
||||||
.text-content {
|
|
||||||
p {
|
|
||||||
unicode-bidi: plaintext;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul {
|
|
||||||
padding-left: unset;
|
|
||||||
padding-right: var(--space-two);
|
|
||||||
}
|
|
||||||
|
|
||||||
li {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Message items and actions
|
|
||||||
li {
|
|
||||||
&.right {
|
|
||||||
.sender--info {
|
|
||||||
padding: var(--space-small) var(--space-smaller)
|
|
||||||
var(--space-smaller) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.context-menu-wrap {
|
|
||||||
margin-left: 0;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Conversation footer
|
|
||||||
.conversation-footer {
|
|
||||||
.preview-item {
|
|
||||||
direction: initial;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Custom attributes section in conversation sidebar
|
|
||||||
.conversation-sidebar-wrap .checkbox-wrap {
|
|
||||||
.checkbox {
|
|
||||||
margin-left: var(--space-small);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Conversation list
|
|
||||||
.conversations-list-wrap {
|
|
||||||
border-right: 0;
|
|
||||||
|
|
||||||
.conversation {
|
|
||||||
.conversation--meta {
|
|
||||||
left: $space-normal;
|
|
||||||
right: unset;
|
|
||||||
|
|
||||||
.unread {
|
|
||||||
margin-left: unset;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.assignee-label {
|
|
||||||
margin-left: 0;
|
|
||||||
margin-right: var(--space-one);
|
|
||||||
}
|
|
||||||
|
|
||||||
.show-more--button {
|
|
||||||
margin: unset;
|
|
||||||
transform: rotate(180deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Basic filter dropdown
|
|
||||||
.basic-filter {
|
|
||||||
left: 0;
|
|
||||||
right: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bulk actions
|
|
||||||
.bulk-action__container {
|
|
||||||
.triangle {
|
|
||||||
left: var(--triangle-position);
|
|
||||||
right: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bulk-action__agents {
|
|
||||||
left: var(--space-small);
|
|
||||||
right: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.labels-container {
|
|
||||||
left: var(--space-small);
|
|
||||||
right: unset;
|
|
||||||
|
|
||||||
.label-checkbox {
|
|
||||||
margin: 0 0 0 var(--space-one);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.actions-container {
|
|
||||||
left: var(--space-small);
|
|
||||||
right: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bulk-action__teams {
|
|
||||||
left: var(--space-small);
|
|
||||||
right: unset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Contact notes
|
|
||||||
.card.note-wrap {
|
|
||||||
.time-stamp {
|
|
||||||
unicode-bidi: plaintext;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Toggle switch
|
|
||||||
.toggle-button {
|
|
||||||
&.small {
|
|
||||||
span {
|
|
||||||
&.active {
|
|
||||||
transform: translate(var(--space-minus-small), var(--space-zero));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
--minus-space-one-point-five: -0.9375rem;
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
transform: translate(
|
|
||||||
var(--minus-space-one-point-five),
|
|
||||||
var(--space-zero)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modal
|
|
||||||
.modal-container {
|
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
.modal-footer {
|
|
||||||
button {
|
|
||||||
margin-left: 0;
|
|
||||||
margin-right: var(--space-small);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Other changes
|
|
||||||
.colorpicker--chrome {
|
|
||||||
direction: initial;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mention--box {
|
|
||||||
direction: initial;
|
|
||||||
}
|
|
||||||
|
|
||||||
.contact--form .input-group {
|
|
||||||
direction: initial;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
// Font sizes
|
|
||||||
$font-size-nano: 0.5rem;
|
|
||||||
$font-size-micro: 0.675rem;
|
|
||||||
$font-size-mini: 0.75rem;
|
|
||||||
$font-size-small: 0.875rem;
|
|
||||||
$font-size-default: 1rem;
|
|
||||||
$font-size-medium: 1.125rem;
|
|
||||||
$font-size-large: 1.375rem;
|
|
||||||
$font-size-big: 1.5rem;
|
|
||||||
$font-size-bigger: 1.75rem;
|
|
||||||
$font-size-mega: 2.125rem;
|
|
||||||
$font-size-giga: 2.5rem;
|
|
||||||
|
|
||||||
// spaces
|
|
||||||
$zero: 0;
|
|
||||||
$space-micro: 0.125rem;
|
|
||||||
$space-smaller: 0.25rem;
|
|
||||||
$space-small: 0.5rem;
|
|
||||||
$space-one: 0.675rem;
|
|
||||||
$space-slab: 0.75rem;
|
|
||||||
$space-normal: 1rem;
|
|
||||||
$space-two: 1.25rem;
|
|
||||||
$space-medium: 1.5rem;
|
|
||||||
$space-large: 2rem;
|
|
||||||
$space-larger: 3rem;
|
|
||||||
$space-jumbo: 4rem;
|
|
||||||
$space-mega: 6.25rem;
|
|
||||||
|
|
||||||
// font-weight
|
|
||||||
$font-weight-feather: 100;
|
|
||||||
$font-weight-light: 300;
|
|
||||||
$font-weight-normal: 400;
|
|
||||||
$font-weight-medium: 500;
|
|
||||||
$font-weight-bold: 600;
|
|
||||||
$font-weight-black: 700;
|
|
||||||
|
|
||||||
//Navbar
|
|
||||||
$nav-bar-width: 14.375rem;
|
|
||||||
$header-height: 3.5rem;
|
|
||||||
|
|
||||||
$woot-logo-padding: $space-large $space-two;
|
|
||||||
|
|
||||||
// Colors
|
|
||||||
$color-woot: #1f93ff;
|
|
||||||
$color-gray: #6e6f73;
|
|
||||||
$color-light-gray: #999a9b;
|
|
||||||
|
|
||||||
$color-border: var(--s-75);
|
|
||||||
$color-border-light: var(--s-50);
|
|
||||||
$color-border-dark: var(--s-100);
|
|
||||||
|
|
||||||
$color-background: var(--s-50);
|
|
||||||
$color-background-light: var(--s-25);
|
|
||||||
|
|
||||||
$color-white: #fff;
|
|
||||||
$color-body: #3c4858;
|
|
||||||
$color-heading: #1f2d3d;
|
|
||||||
$color-extra-light-blue: #f5f7f9;
|
|
||||||
|
|
||||||
$primary-color: $color-woot;
|
|
||||||
$secondary-color: #5d7592;
|
|
||||||
$success-color: #44ce4b;
|
|
||||||
$warning-color: #ffc532;
|
|
||||||
$alert-color: #ff382d;
|
|
||||||
|
|
||||||
$masked-bg: rgba(0, 0, 0, .4);
|
|
||||||
|
|
||||||
// Color-palettes
|
|
||||||
|
|
||||||
$color-primary-light: #c7e3ff;
|
|
||||||
$color-primary-dark: darken($color-woot, 20%);
|
|
||||||
|
|
||||||
// Thumbnail
|
|
||||||
$thumbnail-radius: 2.5rem;
|
|
||||||
|
|
||||||
// chat-header
|
|
||||||
$conv-header-height: 2.5rem;
|
|
||||||
|
|
||||||
// Inbox List
|
|
||||||
|
|
||||||
$inbox-thumb-size: 3rem;
|
|
||||||
|
|
||||||
|
|
||||||
// Snackbar default
|
|
||||||
$woot-snackbar-bg: #323232;
|
|
||||||
$woot-snackbar-button: #ffeb3b;
|
|
||||||
|
|
||||||
$swift-ease-out-duration: .4s !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;
|
|
||||||
|
|
||||||
// Transitions
|
|
||||||
$transition-ease-in: all 0.250s ease-in;
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--dashboard-app-tabs-height: 2.4375rem;
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// scss-lint:disable SpaceAfterPropertyColon
|
||||||
@import 'tailwindcss/base';
|
@import 'tailwindcss/base';
|
||||||
@import 'tailwindcss/components';
|
@import 'tailwindcss/components';
|
||||||
@import 'tailwindcss/utilities';
|
@import 'tailwindcss/utilities';
|
||||||
@@ -8,54 +9,42 @@
|
|||||||
// Next Colors
|
// Next Colors
|
||||||
@import 'next-colors';
|
@import 'next-colors';
|
||||||
|
|
||||||
@import 'shared/assets/stylesheets/animations';
|
// Base styles for elements
|
||||||
@import 'shared/assets/stylesheets/colors';
|
@import 'base';
|
||||||
@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 'shared/assets/stylesheets/z-index';
|
|
||||||
|
|
||||||
@import 'variables';
|
|
||||||
|
|
||||||
@import 'mixins';
|
|
||||||
@import 'helper-classes';
|
|
||||||
@import 'formulate';
|
|
||||||
@import 'date-picker';
|
|
||||||
|
|
||||||
@import 'layout';
|
|
||||||
@import 'animations';
|
|
||||||
@import 'rtl';
|
|
||||||
|
|
||||||
@import 'widgets/base';
|
|
||||||
@import 'widgets/conversation-view';
|
|
||||||
@import 'widgets/tabs';
|
|
||||||
@import 'widgets/woot-tables';
|
|
||||||
|
|
||||||
|
// Plugins
|
||||||
@import 'plugins/multiselect';
|
@import 'plugins/multiselect';
|
||||||
@import 'plugins/dropdown';
|
@import 'plugins/date-picker';
|
||||||
|
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
font-family:
|
||||||
|
'Inter',
|
||||||
|
-apple-system,
|
||||||
|
system-ui,
|
||||||
|
BlinkMacSystemFont,
|
||||||
|
'Segoe UI',
|
||||||
|
Roboto,
|
||||||
|
'Helvetica Neue',
|
||||||
|
Tahoma,
|
||||||
|
Arial,
|
||||||
|
sans-serif !important;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.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 max-w-96;
|
@apply bg-n-solid-2 text-n-slate-12 py-1 px-2 z-40 text-xs rounded-md max-w-96;
|
||||||
}
|
}
|
||||||
|
|
||||||
#app {
|
#app {
|
||||||
@apply h-full w-full;
|
@apply h-full w-full;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hide {
|
|
||||||
@apply hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.n-blue-border {
|
|
||||||
@apply border-n-blue-border;
|
|
||||||
}
|
|
||||||
|
|
||||||
.n-blue-text {
|
|
||||||
@apply text-n-blue-text;
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom-dashed-border {
|
.custom-dashed-border {
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='none' rx='16' ry='16' stroke='%23E2E3E7' stroke-width='2' stroke-dasharray='6, 8' stroke-dashoffset='0' stroke-linecap='round'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='none' rx='16' ry='16' stroke='%23E2E3E7' stroke-width='2' stroke-dasharray='6, 8' stroke-dashoffset='0' stroke-linecap='round'/%3E%3C/svg%3E");
|
||||||
background-position: center;
|
background-position: center;
|
||||||
@@ -67,351 +56,6 @@
|
|||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='none' rx='16' ry='16' stroke='%23343434' stroke-width='2' stroke-dasharray='6, 8' stroke-dashoffset='0' stroke-linecap='round'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='none' rx='16' ry='16' stroke='%23343434' stroke-width='2' stroke-dasharray='6, 8' stroke-dashoffset='0' stroke-linecap='round'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
|
||||||
// scss-lint:disable PropertySortOrder
|
|
||||||
@layer base {
|
|
||||||
:root {
|
|
||||||
--color-amber-25: 254 253 251;
|
|
||||||
--color-amber-50: 255 249 237;
|
|
||||||
--color-amber-75: 255 243 208;
|
|
||||||
--color-amber-100: 255 236 183;
|
|
||||||
--color-amber-200: 255 224 161;
|
|
||||||
--color-amber-300: 245 208 140;
|
|
||||||
--color-amber-400: 228 187 120;
|
|
||||||
--color-amber-500: 214 163 92;
|
|
||||||
--color-amber-600: 214 163 92;
|
|
||||||
--color-amber-700: 255 186 26;
|
|
||||||
--color-amber-800: 145 89 48;
|
|
||||||
--color-amber-900: 79 52 34;
|
|
||||||
|
|
||||||
--color-ash-100: 235 235 239;
|
|
||||||
--color-ash-200: 228 228 233;
|
|
||||||
--color-ash-25: 252 252 253;
|
|
||||||
--color-ash-300: 221 221 227;
|
|
||||||
--color-ash-400: 211 212 219;
|
|
||||||
--color-ash-50: 249 249 251;
|
|
||||||
--color-ash-500: 185 187 198;
|
|
||||||
--color-ash-600: 139 141 152;
|
|
||||||
--color-ash-700: 126 128 138;
|
|
||||||
--color-ash-75: 242 242 245;
|
|
||||||
--color-ash-800: 96 100 108;
|
|
||||||
--color-ash-900: 28 32 36;
|
|
||||||
|
|
||||||
--color-primary-25: 251 253 255;
|
|
||||||
--color-primary-50: 245 249 255;
|
|
||||||
--color-primary-75: 233 243 255;
|
|
||||||
--color-primary-100: 218 236 255;
|
|
||||||
--color-primary-200: 201 226 255;
|
|
||||||
--color-primary-300: 181 213 255;
|
|
||||||
--color-primary-400: 155 195 252;
|
|
||||||
--color-primary-500: 117 171 247;
|
|
||||||
--color-primary-600: 39 129 246;
|
|
||||||
--color-primary-700: 16 115 233;
|
|
||||||
--color-primary-800: 8 109 224;
|
|
||||||
--color-primary-900: 11 50 101;
|
|
||||||
|
|
||||||
--color-ruby-100: 255 220 225;
|
|
||||||
--color-ruby-200: 255 206 214;
|
|
||||||
--color-ruby-25: 255 252 253;
|
|
||||||
--color-ruby-300: 248 191 200;
|
|
||||||
--color-ruby-400: 239 172 184;
|
|
||||||
--color-ruby-50: 255 247 248;
|
|
||||||
--color-ruby-500: 229 146 163;
|
|
||||||
--color-ruby-600: 229 70 102;
|
|
||||||
--color-ruby-700: 220 59 93;
|
|
||||||
--color-ruby-75: 254 234 237;
|
|
||||||
--color-ruby-800: 202 36 77;
|
|
||||||
--color-ruby-900: 100 23 43;
|
|
||||||
|
|
||||||
--color-teal-100: 224 248 243;
|
|
||||||
--color-teal-200: 204 243 234;
|
|
||||||
--color-teal-25: 250 254 253;
|
|
||||||
--color-teal-300: 184 234 224;
|
|
||||||
--color-teal-400: 161 222 210;
|
|
||||||
--color-teal-50: 243 251 249;
|
|
||||||
--color-teal-500: 83 185 171;
|
|
||||||
--color-teal-600: 18 165 148;
|
|
||||||
--color-teal-700: 13 155 138;
|
|
||||||
--color-teal-75: 236 249 255;
|
|
||||||
--color-teal-800: 0 133 115;
|
|
||||||
--color-teal-900: 13 61 56;
|
|
||||||
|
|
||||||
--color-green-25: 251 254 252;
|
|
||||||
--color-green-50: 244 251 246;
|
|
||||||
--color-green-75: 230 246 235;
|
|
||||||
--color-green-100: 214 241 223;
|
|
||||||
--color-green-200: 196 232 209;
|
|
||||||
--color-green-300: 173 221 192;
|
|
||||||
--color-green-400: 142 206 170;
|
|
||||||
--color-green-500: 91 185 139;
|
|
||||||
--color-green-600: 48 164 108;
|
|
||||||
--color-green-700: 43 154 102;
|
|
||||||
--color-green-800: 33 131 88;
|
|
||||||
--color-green-900: 25 59 45;
|
|
||||||
|
|
||||||
--color-mint-25: 249 254 253;
|
|
||||||
--color-mint-50: 242 251 249;
|
|
||||||
--color-mint-75: 221 249 242;
|
|
||||||
--color-mint-100: 200 244 233;
|
|
||||||
--color-mint-200: 179 236 222;
|
|
||||||
--color-mint-300: 156 224 208;
|
|
||||||
--color-mint-400: 126 207 189;
|
|
||||||
--color-mint-500: 76 187 165;
|
|
||||||
--color-mint-600: 134 234 212;
|
|
||||||
--color-mint-700: 125 224 203;
|
|
||||||
--color-mint-800: 2 120 100;
|
|
||||||
--color-mint-900: 22 67 60;
|
|
||||||
|
|
||||||
--color-sky-25: 249 254 255;
|
|
||||||
--color-sky-50: 241 250 253;
|
|
||||||
--color-sky-75: 225 246 253;
|
|
||||||
--color-sky-100: 209 240 250;
|
|
||||||
--color-sky-200: 190 231 245;
|
|
||||||
--color-sky-300: 169 218 237;
|
|
||||||
--color-sky-400: 141 202 227;
|
|
||||||
--color-sky-500: 96 179 215;
|
|
||||||
--color-sky-600: 124 226 254;
|
|
||||||
--color-sky-700: 116 218 248;
|
|
||||||
--color-sky-800: 0 116 158;
|
|
||||||
--color-sky-900: 29 62 86;
|
|
||||||
|
|
||||||
--color-indigo-25: 253 253 254;
|
|
||||||
--color-indigo-50: 247 249 255;
|
|
||||||
--color-indigo-75: 237 242 254;
|
|
||||||
--color-indigo-100: 225 233 255;
|
|
||||||
--color-indigo-200: 210 222 255;
|
|
||||||
--color-indigo-300: 193 208 255;
|
|
||||||
--color-indigo-400: 171 189 249;
|
|
||||||
--color-indigo-500: 141 164 239;
|
|
||||||
--color-indigo-600: 62 99 221;
|
|
||||||
--color-indigo-700: 51 88 212;
|
|
||||||
--color-indigo-800: 58 91 199;
|
|
||||||
--color-indigo-900: 31 45 92;
|
|
||||||
|
|
||||||
--color-iris-25: 253 253 255;
|
|
||||||
--color-iris-50: 248 248 255;
|
|
||||||
--color-iris-75: 240 241 254;
|
|
||||||
--color-iris-100: 230 231 255;
|
|
||||||
--color-iris-200: 218 220 255;
|
|
||||||
--color-iris-300: 203 205 255;
|
|
||||||
--color-iris-400: 184 186 248;
|
|
||||||
--color-iris-500: 155 158 240;
|
|
||||||
--color-iris-600: 91 91 214;
|
|
||||||
--color-iris-700: 81 81 205;
|
|
||||||
--color-iris-800: 87 83 198;
|
|
||||||
--color-iris-900: 39 41 98;
|
|
||||||
|
|
||||||
--color-violet-25: 253 252 254;
|
|
||||||
--color-violet-50: 250 248 255;
|
|
||||||
--color-violet-75: 244 240 254;
|
|
||||||
--color-violet-100: 235 228 255;
|
|
||||||
--color-violet-200: 225 217 255;
|
|
||||||
--color-violet-300: 212 202 254;
|
|
||||||
--color-violet-400: 194 181 245;
|
|
||||||
--color-violet-500: 170 153 236;
|
|
||||||
--color-violet-600: 110 86 207;
|
|
||||||
--color-violet-700: 101 77 196;
|
|
||||||
--color-violet-800: 101 80 185;
|
|
||||||
--color-violet-900: 47 38 95;
|
|
||||||
|
|
||||||
--color-pink-25: 255 252 254;
|
|
||||||
--color-pink-50: 254 247 251;
|
|
||||||
--color-pink-75: 254 233 245;
|
|
||||||
--color-pink-100: 251 220 239;
|
|
||||||
--color-pink-200: 246 206 231;
|
|
||||||
--color-pink-300: 239 191 221;
|
|
||||||
--color-pink-400: 231 172 208;
|
|
||||||
--color-pink-500: 221 147 194;
|
|
||||||
--color-pink-600: 214 64 159;
|
|
||||||
--color-pink-700: 207 56 151;
|
|
||||||
--color-pink-800: 194 41 138;
|
|
||||||
--color-pink-900: 101 18 73;
|
|
||||||
|
|
||||||
--color-orange-25: 254 252 251;
|
|
||||||
--color-orange-50: 255 247 237;
|
|
||||||
--color-orange-75: 255 239 214;
|
|
||||||
--color-orange-100: 255 223 181;
|
|
||||||
--color-orange-200: 255 209 154;
|
|
||||||
--color-orange-300: 255 193 130;
|
|
||||||
--color-orange-400: 245 174 115;
|
|
||||||
--color-orange-500: 236 148 85;
|
|
||||||
--color-orange-600: 247 107 21;
|
|
||||||
--color-orange-700: 239 95 0;
|
|
||||||
--color-orange-800: 204 78 0;
|
|
||||||
--color-orange-900: 88 45 29;
|
|
||||||
}
|
|
||||||
|
|
||||||
// scss-lint:disable QualifyingElement
|
|
||||||
body.dark {
|
|
||||||
--color-amber-25: 31 19 0;
|
|
||||||
--color-amber-50: 37 24 4;
|
|
||||||
--color-amber-75: 48 32 11;
|
|
||||||
--color-amber-100: 57 39 15;
|
|
||||||
--color-amber-200: 67 46 18;
|
|
||||||
--color-amber-300: 83 57 22;
|
|
||||||
--color-amber-400: 111 77 29;
|
|
||||||
--color-amber-500: 169 118 42;
|
|
||||||
--color-amber-600: 169 118 42;
|
|
||||||
--color-amber-700: 255 203 71;
|
|
||||||
--color-amber-800: 255 204 77;
|
|
||||||
--color-amber-900: 255 231 179;
|
|
||||||
|
|
||||||
--color-ash-100: 46 48 53;
|
|
||||||
--color-ash-200: 53 55 60;
|
|
||||||
--color-ash-25: 24 24 26;
|
|
||||||
--color-ash-300: 60 63 68;
|
|
||||||
--color-ash-400: 70 75 80;
|
|
||||||
--color-ash-50: 27 27 31;
|
|
||||||
--color-ash-500: 90 97 101;
|
|
||||||
--color-ash-600: 105 110 119;
|
|
||||||
--color-ash-700: 120 127 133;
|
|
||||||
--color-ash-75: 39 40 45;
|
|
||||||
--color-ash-800: 173 177 184;
|
|
||||||
--color-ash-900: 237 238 240;
|
|
||||||
|
|
||||||
--color-primary-25: 10 17 28;
|
|
||||||
--color-primary-50: 15 24 38;
|
|
||||||
--color-primary-75: 15 39 72;
|
|
||||||
--color-primary-100: 10 49 99;
|
|
||||||
--color-primary-200: 18 61 117;
|
|
||||||
--color-primary-300: 29 74 134;
|
|
||||||
--color-primary-400: 40 89 156;
|
|
||||||
--color-primary-500: 48 106 186;
|
|
||||||
--color-primary-600: 39 129 246;
|
|
||||||
--color-primary-700: 21 116 231;
|
|
||||||
--color-primary-800: 126 182 255;
|
|
||||||
--color-primary-900: 205 227 255;
|
|
||||||
|
|
||||||
--color-ruby-100: 78 19 37;
|
|
||||||
--color-ruby-200: 94 26 46;
|
|
||||||
--color-ruby-25: 25 17 19;
|
|
||||||
--color-ruby-300: 111 37 57;
|
|
||||||
--color-ruby-400: 136 52 71;
|
|
||||||
--color-ruby-50: 30 21 23;
|
|
||||||
--color-ruby-500: 179 68 90;
|
|
||||||
--color-ruby-600: 229 70 102;
|
|
||||||
--color-ruby-700: 236 90 114;
|
|
||||||
--color-ruby-75: 58 20 30;
|
|
||||||
--color-ruby-800: 255 148 157;
|
|
||||||
--color-ruby-900: 254 210 225;
|
|
||||||
|
|
||||||
--color-teal-100: 2 59 55;
|
|
||||||
--color-teal-200: 8 72 67;
|
|
||||||
--color-teal-25: 13 21 20;
|
|
||||||
--color-teal-300: 28 105 97;
|
|
||||||
--color-teal-400: 28 105 97;
|
|
||||||
--color-teal-50: 17 28 27;
|
|
||||||
--color-teal-500: 32 126 115;
|
|
||||||
--color-teal-600: 41 163 131;
|
|
||||||
--color-teal-700: 14 179 158;
|
|
||||||
--color-teal-75: 13 45 42;
|
|
||||||
--color-teal-800: 11 216 182;
|
|
||||||
--color-teal-900: 173 240 221;
|
|
||||||
|
|
||||||
--color-green-25: 14 21 18;
|
|
||||||
--color-green-50: 18 27 23;
|
|
||||||
--color-green-75: 19 45 33;
|
|
||||||
--color-green-100: 17 59 41;
|
|
||||||
--color-green-200: 23 73 51;
|
|
||||||
--color-green-300: 32 87 62;
|
|
||||||
--color-green-400: 40 104 74;
|
|
||||||
--color-green-500: 47 124 87;
|
|
||||||
--color-green-600: 48 164 108;
|
|
||||||
--color-green-700: 51 176 116;
|
|
||||||
--color-green-800: 61 214 140;
|
|
||||||
--color-green-900: 177 241 203;
|
|
||||||
|
|
||||||
--color-mint-25: 14 21 21;
|
|
||||||
--color-mint-50: 15 27 27;
|
|
||||||
--color-mint-75: 9 44 43;
|
|
||||||
--color-mint-100: 0 58 56;
|
|
||||||
--color-mint-200: 0 71 68;
|
|
||||||
--color-mint-300: 16 86 80;
|
|
||||||
--color-mint-400: 30 104 95;
|
|
||||||
--color-mint-500: 39 127 112;
|
|
||||||
--color-mint-600: 134 234 212;
|
|
||||||
--color-mint-700: 168 245 229;
|
|
||||||
--color-mint-800: 88 213 186;
|
|
||||||
--color-mint-900: 196 245 225;
|
|
||||||
|
|
||||||
--color-sky-25: 14 21 21;
|
|
||||||
--color-sky-50: 15 27 27;
|
|
||||||
--color-sky-75: 9 44 43;
|
|
||||||
--color-sky-100: 0 58 56;
|
|
||||||
--color-sky-200: 0 71 68;
|
|
||||||
--color-sky-300: 16 86 80;
|
|
||||||
--color-sky-400: 30 104 95;
|
|
||||||
--color-sky-500: 39 127 112;
|
|
||||||
--color-sky-600: 134 234 212;
|
|
||||||
--color-sky-700: 168 245 229;
|
|
||||||
--color-sky-800: 88 213 186;
|
|
||||||
--color-sky-900: 196 245 225;
|
|
||||||
|
|
||||||
--color-indigo-25: 17 19 31;
|
|
||||||
--color-indigo-50: 20 23 38;
|
|
||||||
--color-indigo-75: 24 36 73;
|
|
||||||
--color-indigo-100: 29 46 98;
|
|
||||||
--color-indigo-200: 37 57 116;
|
|
||||||
--color-indigo-300: 48 67 132;
|
|
||||||
--color-indigo-400: 58 79 151;
|
|
||||||
--color-indigo-500: 67 93 177;
|
|
||||||
--color-indigo-600: 62 99 221;
|
|
||||||
--color-indigo-700: 84 114 228;
|
|
||||||
--color-indigo-800: 158 177 255;
|
|
||||||
--color-indigo-900: 214 225 255;
|
|
||||||
|
|
||||||
--color-iris-25: 19 19 30;
|
|
||||||
--color-iris-50: 23 22 37;
|
|
||||||
--color-iris-75: 32 34 72;
|
|
||||||
--color-iris-100: 38 42 101;
|
|
||||||
--color-iris-200: 48 51 116;
|
|
||||||
--color-iris-300: 61 62 130;
|
|
||||||
--color-iris-400: 74 74 149;
|
|
||||||
--color-iris-500: 89 88 177;
|
|
||||||
--color-iris-600: 91 91 214;
|
|
||||||
--color-iris-700: 110 106 222;
|
|
||||||
--color-iris-800: 177 169 255;
|
|
||||||
--color-iris-900: 224 223 254;
|
|
||||||
|
|
||||||
--color-violet-25: 20 18 31;
|
|
||||||
--color-violet-50: 27 21 37;
|
|
||||||
--color-violet-75: 41 31 67;
|
|
||||||
--color-violet-100: 51 37 91;
|
|
||||||
--color-violet-200: 60 46 105;
|
|
||||||
--color-violet-300: 71 56 118;
|
|
||||||
--color-violet-400: 86 70 139;
|
|
||||||
--color-violet-500: 105 88 173;
|
|
||||||
--color-violet-600: 110 86 207;
|
|
||||||
--color-violet-700: 125 102 217;
|
|
||||||
--color-violet-800: 186 167 255;
|
|
||||||
--color-violet-900: 226 221 254;
|
|
||||||
|
|
||||||
--color-pink-25: 25 17 23;
|
|
||||||
--color-pink-50: 33 18 29;
|
|
||||||
--color-pink-75: 55 23 47;
|
|
||||||
--color-pink-100: 75 20 61;
|
|
||||||
--color-pink-200: 89 28 71;
|
|
||||||
--color-pink-300: 105 41 85;
|
|
||||||
--color-pink-400: 131 56 105;
|
|
||||||
--color-pink-500: 168 72 133;
|
|
||||||
--color-pink-600: 214 64 159;
|
|
||||||
--color-pink-700: 222 81 168;
|
|
||||||
--color-pink-800: 255 141 204;
|
|
||||||
--color-pink-900: 253 209 234;
|
|
||||||
--color-orange-25: 23 18 14;
|
|
||||||
--color-orange-50: 30 22 15;
|
|
||||||
--color-orange-75: 51 30 11;
|
|
||||||
--color-orange-100: 70 33 0;
|
|
||||||
--color-orange-200: 86 40 0;
|
|
||||||
--color-orange-300: 102 53 12;
|
|
||||||
--color-orange-400: 126 69 29;
|
|
||||||
--color-orange-500: 163 88 41;
|
|
||||||
--color-orange-600: 247 107 21;
|
|
||||||
--color-orange-700: 255 128 31;
|
|
||||||
--color-orange-800: 255 160 87;
|
|
||||||
--color-orange-900: 255 224 194;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@layer utilities {
|
@layer utilities {
|
||||||
/* Hide scrollbar for Chrome, Safari and Opera */
|
/* Hide scrollbar for Chrome, Safari and Opera */
|
||||||
.no-scrollbar::-webkit-scrollbar {
|
.no-scrollbar::-webkit-scrollbar {
|
||||||
|
|||||||
+8
-8
@@ -30,11 +30,11 @@
|
|||||||
|
|
||||||
.mx-input:disabled,
|
.mx-input:disabled,
|
||||||
.mx-input[readonly] {
|
.mx-input[readonly] {
|
||||||
@apply bg-white dark:bg-slate-900 cursor-pointer;
|
@apply bg-n-background cursor-pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx-icon-calendar {
|
.mx-icon-calendar {
|
||||||
@apply dark:text-slate-500;
|
@apply text-n-slate-10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +43,17 @@
|
|||||||
|
|
||||||
.cell {
|
.cell {
|
||||||
&.disabled {
|
&.disabled {
|
||||||
@apply bg-slate-25 dark:bg-slate-900 text-slate-200 dark:text-slate-300;
|
@apply bg-n-slate-2 dark:bg-n-background text-n-slate-10;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover,
|
&:hover,
|
||||||
&.hover-in-range,
|
&.hover-in-range,
|
||||||
&.in-range {
|
&.in-range {
|
||||||
@apply bg-slate-75 dark:bg-slate-700 text-slate-900 dark:text-slate-100;
|
@apply bg-n-slate-3 dark:bg-n-solid-3 text-n-slate-12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx-calendar+.mx-calendar {
|
.mx-calendar + .mx-calendar {
|
||||||
@apply border-l border-n-weak;
|
@apply border-l border-n-weak;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mx-time {
|
.mx-time {
|
||||||
@apply border-0 bg-white dark:bg-slate-800;
|
@apply border-0 bg-n-background dark:bg-n-solid-2;
|
||||||
|
|
||||||
.mx-time-header {
|
.mx-time-header {
|
||||||
@apply border-0;
|
@apply border-0;
|
||||||
@@ -70,11 +70,11 @@
|
|||||||
|
|
||||||
.mx-time-item {
|
.mx-time-item {
|
||||||
&.disabled {
|
&.disabled {
|
||||||
@apply bg-slate-25 dark:bg-slate-900;
|
@apply bg-n-slate-2 dark:bg-n-background;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@apply bg-slate-75 dark:bg-slate-700;
|
@apply bg-n-slate-3 dark:bg-n-solid-3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
.dropdown-pane {
|
|
||||||
@apply border rounded-lg hidden relative invisible shadow-lg border-n-strong dark:border-n-strong box-content p-2 w-fit z-[9999];
|
|
||||||
|
|
||||||
&.dropdown-pane--open {
|
|
||||||
@apply bg-n-alpha-3 backdrop-blur-[100px] absolute block visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -17,6 +17,10 @@
|
|||||||
@apply mb-4;
|
@apply mb-4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.invalid .multiselect__tags {
|
||||||
|
@apply border-0 outline outline-1 outline-n-ruby-8 dark:outline-n-ruby-8 hover:outline-n-ruby-9 dark:hover:outline-n-ruby-9 disabled:outline-n-ruby-8 dark:disabled:outline-n-ruby-8;
|
||||||
|
}
|
||||||
|
|
||||||
&.multiselect--disabled {
|
&.multiselect--disabled {
|
||||||
@apply opacity-50 rounded-lg cursor-not-allowed pointer-events-auto;
|
@apply opacity-50 rounded-lg cursor-not-allowed pointer-events-auto;
|
||||||
|
|
||||||
@@ -47,7 +51,7 @@
|
|||||||
@apply max-w-full;
|
@apply max-w-full;
|
||||||
|
|
||||||
.multiselect__option {
|
.multiselect__option {
|
||||||
@apply text-sm font-normal;
|
@apply text-sm font-normal flex justify-between items-center;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
@apply inline-block overflow-hidden text-ellipsis whitespace-nowrap w-fit;
|
@apply inline-block overflow-hidden text-ellipsis whitespace-nowrap w-fit;
|
||||||
@@ -58,7 +62,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
@apply bottom-0 flex items-center justify-center text-center;
|
@apply bottom-0 flex items-center justify-center text-center relative px-1 leading-tight;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.multiselect__option--highlight {
|
&.multiselect__option--highlight {
|
||||||
@@ -74,7 +78,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.multiselect__option--highlight::after {
|
&.multiselect__option--highlight::after {
|
||||||
@apply bg-transparent;
|
@apply bg-transparent text-n-slate-12;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.multiselect__option--selected {
|
&.multiselect__option--selected {
|
||||||
@@ -124,8 +128,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.multiselect__input {
|
.multiselect__input {
|
||||||
@include ghost-input;
|
@apply text-sm h-[2.875rem] mb-0 p-0 shadow-none border-transparent hover:border-transparent hover:shadow-none focus:border-transparent focus:shadow-none active:border-transparent active:shadow-none;
|
||||||
@apply text-sm h-[2.875rem] mb-0 p-0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.multiselect__single {
|
.multiselect__single {
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
// to be removed
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
// to be removed
|
|
||||||
@@ -1,261 +0,0 @@
|
|||||||
// scss-lint:disable MergeableSelector
|
|
||||||
|
|
||||||
@tailwind utilities;
|
|
||||||
@layer utilities {
|
|
||||||
.custom-gradient {
|
|
||||||
background-image: linear-gradient(
|
|
||||||
-180deg,
|
|
||||||
transparent 3%,
|
|
||||||
rgb(76 81 85) 130%
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bubble-with-types {
|
|
||||||
@apply py-2 text-sm font-normal bg-woot-500 dark:bg-woot-500 relative px-4 m-0 text-white dark:text-white;
|
|
||||||
|
|
||||||
.message-text__wrap {
|
|
||||||
@apply relative;
|
|
||||||
|
|
||||||
.link {
|
|
||||||
@apply text-white dark:text-white underline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.image,
|
|
||||||
.video {
|
|
||||||
@apply cursor-pointer relative;
|
|
||||||
|
|
||||||
.modal-container {
|
|
||||||
@apply text-center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-image {
|
|
||||||
@apply max-h-[76vh] max-w-[76vw];
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-video {
|
|
||||||
@apply max-h-[76vh] max-w-[76vw];
|
|
||||||
}
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
@apply custom-gradient bottom-0 h-[20%] content-[''] left-0 absolute w-full opacity-80;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.conversation-panel {
|
|
||||||
@apply flex-shrink flex-grow basis-px flex flex-col overflow-y-auto relative h-full m-0 pb-4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.conversation-panel > li {
|
|
||||||
@apply flex flex-shrink-0 flex-grow-0 flex-auto max-w-full mt-0 mr-0 mb-1 ml-0 relative first:mt-auto last:mb-0;
|
|
||||||
|
|
||||||
&.unread--toast {
|
|
||||||
+ .right {
|
|
||||||
@apply mb-1;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ .left {
|
|
||||||
@apply mb-0;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
@apply shadow-lg rounded-full bg-woot-500 dark:bg-woot-500 text-white dark:text-white text-xs font-medium my-2.5 mx-auto px-2.5 py-1.5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.bubble {
|
|
||||||
@apply bubble-with-types text-left break-words;
|
|
||||||
|
|
||||||
.aplayer {
|
|
||||||
@apply shadow-none;
|
|
||||||
font-family: inherit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.left {
|
|
||||||
.bubble {
|
|
||||||
@apply rounded-r-lg rounded-l mr-auto break-words;
|
|
||||||
|
|
||||||
&:not(.is-unsupported) {
|
|
||||||
@apply border border-slate-50 dark:border-slate-700 bg-white dark:bg-slate-700 text-black-900 dark:text-slate-50;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.is-image {
|
|
||||||
@apply rounded-lg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.link {
|
|
||||||
@apply text-woot-600 dark:text-woot-600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.file {
|
|
||||||
.attachment-name {
|
|
||||||
@apply text-slate-700 dark:text-woot-300;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-wrap {
|
|
||||||
@apply text-woot-600 dark:text-woot-600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.download {
|
|
||||||
@apply text-woot-600 dark:text-woot-600;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ .right {
|
|
||||||
@apply mt-2.5;
|
|
||||||
|
|
||||||
.bubble {
|
|
||||||
@apply rounded-tr-lg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ .unread--toast {
|
|
||||||
+ .right {
|
|
||||||
@apply mt-2.5;
|
|
||||||
|
|
||||||
.bubble {
|
|
||||||
@apply rounded-tr-lg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ .left {
|
|
||||||
@apply mt-0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.right {
|
|
||||||
@apply justify-end;
|
|
||||||
|
|
||||||
.wrap {
|
|
||||||
@apply flex items-end mr-4 text-right;
|
|
||||||
|
|
||||||
.sender--info {
|
|
||||||
@apply pt-2 pb-1 pr-0 pl-2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.bubble {
|
|
||||||
@apply ml-auto break-words rounded-l-lg rounded-r;
|
|
||||||
|
|
||||||
&.is-private {
|
|
||||||
@apply text-black-900 dark:text-white relative border border-solid bg-yellow-100 dark:bg-yellow-700 border-yellow-200 dark:border-yellow-600/25;
|
|
||||||
|
|
||||||
blockquote {
|
|
||||||
@apply border-slate-400 dark:border-slate-400 text-slate-800 dark:text-slate-300;
|
|
||||||
|
|
||||||
p {
|
|
||||||
@apply text-slate-600 dark:text-slate-300;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.is-image {
|
|
||||||
@apply rounded-lg;
|
|
||||||
|
|
||||||
.message__mail-head {
|
|
||||||
@apply px-4 py-2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ .left {
|
|
||||||
@apply mt-2.5;
|
|
||||||
|
|
||||||
.bubble {
|
|
||||||
@apply rounded-tl-lg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ .unread--toast {
|
|
||||||
+ .left {
|
|
||||||
@apply rounded-lg;
|
|
||||||
|
|
||||||
.bubble {
|
|
||||||
@apply rounded-tl-lg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ .right {
|
|
||||||
@apply mt-0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.center {
|
|
||||||
@apply items-center justify-center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrap {
|
|
||||||
max-width: Min(31rem, 84%);
|
|
||||||
@apply my-0 mx-4;
|
|
||||||
|
|
||||||
.sender--name {
|
|
||||||
@apply text-xs mb-1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sender--thumbnail {
|
|
||||||
@apply h-3 mr-3 mt-0.5 w-3 rounded-full;
|
|
||||||
}
|
|
||||||
|
|
||||||
.activity-wrap {
|
|
||||||
@apply flex justify-center text-sm my-1 mx-0 py-1 pr-0.5 pl-2.5 bg-slate-50 dark:bg-slate-600 text-slate-800 dark:text-slate-100 rounded-md border border-slate-100 dark:border-slate-600 border-solid;
|
|
||||||
|
|
||||||
.is-text {
|
|
||||||
@apply inline-flex items-center text-start 2xl:flex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.activity-wrap .message-text__wrap {
|
|
||||||
.text-content p {
|
|
||||||
@apply mb-0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.conversation-footer {
|
|
||||||
@apply flex relative flex-col;
|
|
||||||
}
|
|
||||||
|
|
||||||
.left .bubble .text-content {
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4,
|
|
||||||
h5,
|
|
||||||
h6 {
|
|
||||||
@apply text-slate-800 dark:text-slate-100;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
@apply text-woot-500 dark:text-woot-500 underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
p:last-child {
|
|
||||||
@apply mb-0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.right .bubble .text-content {
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4,
|
|
||||||
h5,
|
|
||||||
h6 {
|
|
||||||
@apply text-white dark:text-white;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
@apply text-white dark:text-white underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
p:last-child {
|
|
||||||
@apply mb-0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
.tabs--container {
|
|
||||||
@apply flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabs--container--with-border {
|
|
||||||
@apply border-b border-b-n-weak;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabs--container--compact.tab--chat-type {
|
|
||||||
.tabs-title {
|
|
||||||
a {
|
|
||||||
@apply py-2 text-sm;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabs {
|
|
||||||
@apply border-r-0 border-l-0 border-t-0 flex min-w-[6.25rem] py-0 px-4 list-none mb-0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabs--with-scroll {
|
|
||||||
@apply overflow-hidden py-0 px-1;
|
|
||||||
max-width: calc(100% - 64px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabs--scroll-button {
|
|
||||||
@apply items-center rounded-none cursor-pointer flex h-auto justify-center min-w-[2rem];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tab chat type
|
|
||||||
.tab--chat-type {
|
|
||||||
@apply flex;
|
|
||||||
|
|
||||||
.tabs-title {
|
|
||||||
a {
|
|
||||||
@apply text-base font-medium py-3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabs-title {
|
|
||||||
@apply flex-shrink-0 my-0 mx-2;
|
|
||||||
|
|
||||||
.badge {
|
|
||||||
@apply bg-n-alpha-black2 dark:bg-n-solid-3 rounded-md text-n-slate-11 h-5 flex items-center justify-center text-xxs font-semibold my-0 mx-1 px-1 py-0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
@apply ml-0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
@apply mr-0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover,
|
|
||||||
&:focus {
|
|
||||||
a {
|
|
||||||
@apply text-n-slate-12;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
@apply flex items-center flex-row border-b py-2.5 select-none cursor-pointer border-transparent text-n-slate-11 text-sm top-[1px] relative;
|
|
||||||
transition: border-color 0.15s $swift-ease-out-function;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.is-active {
|
|
||||||
a {
|
|
||||||
@apply border-b border-n-brand text-n-blue-text;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge {
|
|
||||||
@apply bg-n-brand/10 dark:bg-n-brand/20 text-n-blue-text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
table {
|
|
||||||
@apply border-spacing-0 text-sm w-full;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.woot-table {
|
|
||||||
thead {
|
|
||||||
th {
|
|
||||||
@apply font-semibold tracking-[1px] text-left px-2.5 uppercase text-slate-900 dark:text-slate-200;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tbody {
|
|
||||||
tr {
|
|
||||||
@apply border-b border-slate-50 dark:border-slate-800/30;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
@apply p-2.5 text-slate-700 dark:text-slate-100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tr {
|
|
||||||
.show-if-hover {
|
|
||||||
transition: opacity 0.2s $swift-ease-out-function;
|
|
||||||
@apply opacity-0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
.show-if-hover {
|
|
||||||
@apply opacity-100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.agent-name {
|
|
||||||
@apply block font-medium capitalize;
|
|
||||||
}
|
|
||||||
|
|
||||||
.woot-thumbnail {
|
|
||||||
@apply rounded-full h-[3.125rem] w-[3.125rem];
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-wrapper {
|
|
||||||
@apply flex justify-start flex-row min-w-[12.5rem] gap-1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.ve-table {
|
|
||||||
.ve-table-container.ve-table-border-around {
|
|
||||||
@apply border-slate-200 dark:border-slate-700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ve-table-content {
|
|
||||||
.ve-table-header .ve-table-header-tr .ve-table-header-th {
|
|
||||||
@apply bg-slate-50 dark:bg-slate-800 text-slate-800 dark:text-slate-100 border-slate-100 dark:border-slate-700/50;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ve-table-body .ve-table-body-tr .ve-table-body-td {
|
|
||||||
@apply bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-100 border-slate-75 dark:border-slate-800;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ve-table-body.ve-table-row-hover .ve-table-body-tr:hover td {
|
|
||||||
@apply bg-slate-50 dark:bg-slate-700 text-slate-800 dark:text-slate-100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-pagination {
|
|
||||||
.ve-pagination-total {
|
|
||||||
@apply text-slate-600 dark:text-slate-200;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ve-pagination-goto {
|
|
||||||
@apply text-slate-600 dark:text-slate-200;
|
|
||||||
|
|
||||||
.ve-pagination-goto-input {
|
|
||||||
@apply bg-white dark:bg-slate-900 text-slate-600 dark:text-slate-200;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.ve-pagination-li {
|
|
||||||
@apply bg-white dark:bg-slate-900 text-slate-600 dark:text-slate-200 border-slate-75 dark:border-slate-700;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -76,8 +76,8 @@ const campaignStatus = computed(() => {
|
|||||||
const inboxName = computed(() => props.inbox?.name || '');
|
const inboxName = computed(() => props.inbox?.name || '');
|
||||||
|
|
||||||
const inboxIcon = computed(() => {
|
const inboxIcon = computed(() => {
|
||||||
const { phone_number: phoneNumber, channel_type: type } = props.inbox;
|
const { medium, channel_type: type } = props.inbox;
|
||||||
return getInboxIconByType(type, phoneNumber);
|
return getInboxIconByType(type, medium);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
<script setup>
|
||||||
|
import { ONE_OFF_CAMPAIGN_EMPTY_STATE_CONTENT } from './CampaignEmptyStateContent';
|
||||||
|
|
||||||
|
import EmptyStateLayout from 'dashboard/components-next/EmptyStateLayout.vue';
|
||||||
|
import CampaignCard from 'dashboard/components-next/Campaigns/CampaignCard/CampaignCard.vue';
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
subtitle: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<EmptyStateLayout :title="title" :subtitle="subtitle">
|
||||||
|
<template #empty-state-item>
|
||||||
|
<div class="flex flex-col gap-4 p-px">
|
||||||
|
<CampaignCard
|
||||||
|
v-for="campaign in ONE_OFF_CAMPAIGN_EMPTY_STATE_CONTENT"
|
||||||
|
:key="campaign.id"
|
||||||
|
:title="campaign.title"
|
||||||
|
:message="campaign.message"
|
||||||
|
:is-enabled="campaign.enabled"
|
||||||
|
:status="campaign.campaign_status"
|
||||||
|
:sender="campaign.sender"
|
||||||
|
:inbox="campaign.inbox"
|
||||||
|
:scheduled-at="campaign.scheduled_at"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</EmptyStateLayout>
|
||||||
|
</template>
|
||||||
+2
-2
@@ -40,9 +40,9 @@ const handleSubmit = campaignDetails => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="w-[25rem] z-50 min-w-0 absolute top-10 ltr:right-0 rtl:left-0 bg-n-alpha-3 backdrop-blur-[100px] p-6 rounded-xl border border-slate-50 dark:border-slate-900 shadow-md flex flex-col gap-6 max-h-[85vh] overflow-y-auto"
|
class="w-[25rem] z-50 min-w-0 absolute top-10 ltr:right-0 rtl:left-0 bg-n-alpha-3 backdrop-blur-[100px] p-6 rounded-xl border border-n-weak shadow-md flex flex-col gap-6 max-h-[85vh] overflow-y-auto"
|
||||||
>
|
>
|
||||||
<h3 class="text-base font-medium text-slate-900 dark:text-slate-50">
|
<h3 class="text-base font-medium text-n-slate-12">
|
||||||
{{ t(`CAMPAIGN.LIVE_CHAT.CREATE.TITLE`) }}
|
{{ t(`CAMPAIGN.LIVE_CHAT.CREATE.TITLE`) }}
|
||||||
</h3>
|
</h3>
|
||||||
<LiveChatCampaignForm
|
<LiveChatCampaignForm
|
||||||
|
|||||||
+1
-1
@@ -306,7 +306,7 @@ defineExpose({ prepareCampaignDetails, isSubmitDisabled });
|
|||||||
variant="faded"
|
variant="faded"
|
||||||
color="slate"
|
color="slate"
|
||||||
:label="t('CAMPAIGN.LIVE_CHAT.CREATE.FORM.BUTTONS.CANCEL')"
|
:label="t('CAMPAIGN.LIVE_CHAT.CREATE.FORM.BUTTONS.CANCEL')"
|
||||||
class="w-full bg-n-alpha-2 n-blue-text hover:bg-n-alpha-3"
|
class="w-full bg-n-alpha-2 text-n-blue-text hover:bg-n-alpha-3"
|
||||||
@click="handleCancel"
|
@click="handleCancel"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
+2
-2
@@ -39,9 +39,9 @@ const handleClose = () => emit('close');
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="w-[25rem] z-50 min-w-0 absolute top-10 ltr:right-0 rtl:left-0 bg-n-alpha-3 backdrop-blur-[100px] p-6 rounded-xl border border-slate-50 dark:border-slate-900 shadow-md flex flex-col gap-6"
|
class="w-[25rem] z-50 min-w-0 absolute top-10 ltr:right-0 rtl:left-0 bg-n-alpha-3 backdrop-blur-[100px] p-6 rounded-xl border border-n-weak shadow-md flex flex-col gap-6"
|
||||||
>
|
>
|
||||||
<h3 class="text-base font-medium text-slate-900 dark:text-slate-50">
|
<h3 class="text-base font-medium text-n-slate-12">
|
||||||
{{ t(`CAMPAIGN.SMS.CREATE.TITLE`) }}
|
{{ t(`CAMPAIGN.SMS.CREATE.TITLE`) }}
|
||||||
</h3>
|
</h3>
|
||||||
<SMSCampaignForm @submit="handleSubmit" @cancel="handleClose" />
|
<SMSCampaignForm @submit="handleSubmit" @cancel="handleClose" />
|
||||||
|
|||||||
+1
-1
@@ -174,7 +174,7 @@ const handleSubmit = async () => {
|
|||||||
color="slate"
|
color="slate"
|
||||||
type="button"
|
type="button"
|
||||||
:label="t('CAMPAIGN.SMS.CREATE.FORM.BUTTONS.CANCEL')"
|
:label="t('CAMPAIGN.SMS.CREATE.FORM.BUTTONS.CANCEL')"
|
||||||
class="w-full bg-n-alpha-2 n-blue-text hover:bg-n-alpha-3"
|
class="w-full bg-n-alpha-2 text-n-blue-text hover:bg-n-alpha-3"
|
||||||
@click="handleCancel"
|
@click="handleCancel"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
<script setup>
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useStore } from 'dashboard/composables/store';
|
||||||
|
import { useAlert, useTrack } from 'dashboard/composables';
|
||||||
|
import { CAMPAIGN_TYPES } from 'shared/constants/campaign.js';
|
||||||
|
import { CAMPAIGNS_EVENTS } from 'dashboard/helper/AnalyticsHelper/events.js';
|
||||||
|
|
||||||
|
import WhatsAppCampaignForm from 'dashboard/components-next/Campaigns/Pages/CampaignPage/WhatsAppCampaign/WhatsAppCampaignForm.vue';
|
||||||
|
|
||||||
|
const emit = defineEmits(['close']);
|
||||||
|
|
||||||
|
const store = useStore();
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const addCampaign = async campaignDetails => {
|
||||||
|
try {
|
||||||
|
await store.dispatch('campaigns/create', campaignDetails);
|
||||||
|
|
||||||
|
useTrack(CAMPAIGNS_EVENTS.CREATE_CAMPAIGN, {
|
||||||
|
type: CAMPAIGN_TYPES.ONE_OFF,
|
||||||
|
});
|
||||||
|
|
||||||
|
useAlert(t('CAMPAIGN.WHATSAPP.CREATE.FORM.API.SUCCESS_MESSAGE'));
|
||||||
|
} catch (error) {
|
||||||
|
const errorMessage =
|
||||||
|
error?.response?.message ||
|
||||||
|
t('CAMPAIGN.WHATSAPP.CREATE.FORM.API.ERROR_MESSAGE');
|
||||||
|
useAlert(errorMessage);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = campaignDetails => {
|
||||||
|
addCampaign(campaignDetails);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleClose = () => emit('close');
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="w-[25rem] z-50 min-w-0 absolute top-10 ltr:right-0 rtl:left-0 bg-n-alpha-3 backdrop-blur-[100px] rounded-xl border border-n-weak shadow-md max-h-[80vh] overflow-y-auto"
|
||||||
|
>
|
||||||
|
<div class="p-6 flex flex-col gap-6">
|
||||||
|
<h3 class="text-base font-medium text-n-slate-12 flex-shrink-0">
|
||||||
|
{{ t(`CAMPAIGN.WHATSAPP.CREATE.TITLE`) }}
|
||||||
|
</h3>
|
||||||
|
<WhatsAppCampaignForm @submit="handleSubmit" @cancel="handleClose" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
+266
@@ -0,0 +1,266 @@
|
|||||||
|
<script setup>
|
||||||
|
import { reactive, computed, watch, ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useVuelidate } from '@vuelidate/core';
|
||||||
|
import { required, minLength } from '@vuelidate/validators';
|
||||||
|
import { useMapGetter } from 'dashboard/composables/store';
|
||||||
|
|
||||||
|
import Input from 'dashboard/components-next/input/Input.vue';
|
||||||
|
import Button from 'dashboard/components-next/button/Button.vue';
|
||||||
|
import ComboBox from 'dashboard/components-next/combobox/ComboBox.vue';
|
||||||
|
import TagMultiSelectComboBox from 'dashboard/components-next/combobox/TagMultiSelectComboBox.vue';
|
||||||
|
import WhatsAppTemplateParser from 'dashboard/components-next/whatsapp/WhatsAppTemplateParser.vue';
|
||||||
|
|
||||||
|
const emit = defineEmits(['submit', 'cancel']);
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const formState = {
|
||||||
|
uiFlags: useMapGetter('campaigns/getUIFlags'),
|
||||||
|
labels: useMapGetter('labels/getLabels'),
|
||||||
|
inboxes: useMapGetter('inboxes/getWhatsAppInboxes'),
|
||||||
|
getFilteredWhatsAppTemplates: useMapGetter(
|
||||||
|
'inboxes/getFilteredWhatsAppTemplates'
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
const initialState = {
|
||||||
|
title: '',
|
||||||
|
inboxId: null,
|
||||||
|
templateId: null,
|
||||||
|
scheduledAt: null,
|
||||||
|
selectedAudience: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
const state = reactive({ ...initialState });
|
||||||
|
const templateParserRef = ref(null);
|
||||||
|
|
||||||
|
const rules = {
|
||||||
|
title: { required, minLength: minLength(1) },
|
||||||
|
inboxId: { required },
|
||||||
|
templateId: { required },
|
||||||
|
scheduledAt: { required },
|
||||||
|
selectedAudience: { required },
|
||||||
|
};
|
||||||
|
|
||||||
|
const v$ = useVuelidate(rules, state);
|
||||||
|
|
||||||
|
const isCreating = computed(() => formState.uiFlags.value.isCreating);
|
||||||
|
|
||||||
|
const currentDateTime = computed(() => {
|
||||||
|
// Added to disable the scheduled at field from being set to the current time
|
||||||
|
const now = new Date();
|
||||||
|
const localTime = new Date(now.getTime() - now.getTimezoneOffset() * 60000);
|
||||||
|
return localTime.toISOString().slice(0, 16);
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapToOptions = (items, valueKey, labelKey) =>
|
||||||
|
items?.map(item => ({
|
||||||
|
value: item[valueKey],
|
||||||
|
label: item[labelKey],
|
||||||
|
})) ?? [];
|
||||||
|
|
||||||
|
const audienceList = computed(() =>
|
||||||
|
mapToOptions(formState.labels.value, 'id', 'title')
|
||||||
|
);
|
||||||
|
|
||||||
|
const inboxOptions = computed(() =>
|
||||||
|
mapToOptions(formState.inboxes.value, 'id', 'name')
|
||||||
|
);
|
||||||
|
|
||||||
|
const templateOptions = computed(() => {
|
||||||
|
if (!state.inboxId) return [];
|
||||||
|
const templates = formState.getFilteredWhatsAppTemplates.value(state.inboxId);
|
||||||
|
return templates.map(template => {
|
||||||
|
// Create a more user-friendly label from template name
|
||||||
|
const friendlyName = template.name
|
||||||
|
.replace(/_/g, ' ')
|
||||||
|
.replace(/\b\w/g, l => l.toUpperCase());
|
||||||
|
|
||||||
|
return {
|
||||||
|
value: template.id,
|
||||||
|
label: `${friendlyName} (${template.language || 'en'})`,
|
||||||
|
template: template,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const selectedTemplate = computed(() => {
|
||||||
|
if (!state.templateId) return null;
|
||||||
|
return templateOptions.value.find(option => option.value === state.templateId)
|
||||||
|
?.template;
|
||||||
|
});
|
||||||
|
|
||||||
|
const getErrorMessage = (field, errorKey) => {
|
||||||
|
const baseKey = 'CAMPAIGN.WHATSAPP.CREATE.FORM';
|
||||||
|
return v$.value[field].$error ? t(`${baseKey}.${errorKey}.ERROR`) : '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const formErrors = computed(() => ({
|
||||||
|
title: getErrorMessage('title', 'TITLE'),
|
||||||
|
inbox: getErrorMessage('inboxId', 'INBOX'),
|
||||||
|
template: getErrorMessage('templateId', 'TEMPLATE'),
|
||||||
|
scheduledAt: getErrorMessage('scheduledAt', 'SCHEDULED_AT'),
|
||||||
|
audience: getErrorMessage('selectedAudience', 'AUDIENCE'),
|
||||||
|
}));
|
||||||
|
|
||||||
|
const hasRequiredTemplateParams = computed(() => {
|
||||||
|
return templateParserRef.value?.v$?.$invalid === false || true;
|
||||||
|
});
|
||||||
|
|
||||||
|
const isSubmitDisabled = computed(
|
||||||
|
() => v$.value.$invalid || !hasRequiredTemplateParams.value
|
||||||
|
);
|
||||||
|
|
||||||
|
const formatToUTCString = localDateTime =>
|
||||||
|
localDateTime ? new Date(localDateTime).toISOString() : null;
|
||||||
|
|
||||||
|
const resetState = () => {
|
||||||
|
Object.assign(state, initialState);
|
||||||
|
v$.value.$reset();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCancel = () => emit('cancel');
|
||||||
|
|
||||||
|
const prepareCampaignDetails = () => {
|
||||||
|
// Find the selected template to get its content
|
||||||
|
const currentTemplate = selectedTemplate.value;
|
||||||
|
const parserData = templateParserRef.value;
|
||||||
|
|
||||||
|
// Extract template content - this should be the template message body
|
||||||
|
const templateContent = parserData?.renderedTemplate || '';
|
||||||
|
|
||||||
|
// Prepare template_params object with the same structure as used in contacts
|
||||||
|
const templateParams = {
|
||||||
|
name: currentTemplate?.name || '',
|
||||||
|
namespace: currentTemplate?.namespace || '',
|
||||||
|
category: currentTemplate?.category || 'UTILITY',
|
||||||
|
language: currentTemplate?.language || 'en_US',
|
||||||
|
processed_params: parserData?.processedParams || {},
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: state.title,
|
||||||
|
message: templateContent,
|
||||||
|
template_params: templateParams,
|
||||||
|
inbox_id: state.inboxId,
|
||||||
|
scheduled_at: formatToUTCString(state.scheduledAt),
|
||||||
|
audience: state.selectedAudience?.map(id => ({
|
||||||
|
id,
|
||||||
|
type: 'Label',
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
const isFormValid = await v$.value.$validate();
|
||||||
|
if (!isFormValid) return;
|
||||||
|
|
||||||
|
emit('submit', prepareCampaignDetails());
|
||||||
|
resetState();
|
||||||
|
handleCancel();
|
||||||
|
};
|
||||||
|
|
||||||
|
// Reset template selection when inbox changes
|
||||||
|
watch(
|
||||||
|
() => state.inboxId,
|
||||||
|
() => {
|
||||||
|
state.templateId = null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<form class="flex flex-col gap-4" @submit.prevent="handleSubmit">
|
||||||
|
<Input
|
||||||
|
v-model="state.title"
|
||||||
|
:label="t('CAMPAIGN.WHATSAPP.CREATE.FORM.TITLE.LABEL')"
|
||||||
|
:placeholder="t('CAMPAIGN.WHATSAPP.CREATE.FORM.TITLE.PLACEHOLDER')"
|
||||||
|
:message="formErrors.title"
|
||||||
|
:message-type="formErrors.title ? 'error' : 'info'"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<label for="inbox" class="mb-0.5 text-sm font-medium text-n-slate-12">
|
||||||
|
{{ t('CAMPAIGN.WHATSAPP.CREATE.FORM.INBOX.LABEL') }}
|
||||||
|
</label>
|
||||||
|
<ComboBox
|
||||||
|
id="inbox"
|
||||||
|
v-model="state.inboxId"
|
||||||
|
:options="inboxOptions"
|
||||||
|
:has-error="!!formErrors.inbox"
|
||||||
|
:placeholder="t('CAMPAIGN.WHATSAPP.CREATE.FORM.INBOX.PLACEHOLDER')"
|
||||||
|
:message="formErrors.inbox"
|
||||||
|
class="[&>div>button]:bg-n-alpha-black2 [&>div>button:not(.focused)]:dark:outline-n-weak [&>div>button:not(.focused)]:hover:!outline-n-slate-6"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<label for="template" class="mb-0.5 text-sm font-medium text-n-slate-12">
|
||||||
|
{{ t('CAMPAIGN.WHATSAPP.CREATE.FORM.TEMPLATE.LABEL') }}
|
||||||
|
</label>
|
||||||
|
<ComboBox
|
||||||
|
id="template"
|
||||||
|
v-model="state.templateId"
|
||||||
|
:options="templateOptions"
|
||||||
|
:has-error="!!formErrors.template"
|
||||||
|
:placeholder="t('CAMPAIGN.WHATSAPP.CREATE.FORM.TEMPLATE.PLACEHOLDER')"
|
||||||
|
:message="formErrors.template"
|
||||||
|
class="[&>div>button]:bg-n-alpha-black2 [&>div>button:not(.focused)]:dark:outline-n-weak [&>div>button:not(.focused)]:hover:!outline-n-slate-6"
|
||||||
|
/>
|
||||||
|
<p class="mt-1 text-xs text-n-slate-11">
|
||||||
|
{{ t('CAMPAIGN.WHATSAPP.CREATE.FORM.TEMPLATE.INFO') }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Template Parser -->
|
||||||
|
<WhatsAppTemplateParser
|
||||||
|
v-if="selectedTemplate"
|
||||||
|
ref="templateParserRef"
|
||||||
|
:template="selectedTemplate"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<label for="audience" class="mb-0.5 text-sm font-medium text-n-slate-12">
|
||||||
|
{{ t('CAMPAIGN.WHATSAPP.CREATE.FORM.AUDIENCE.LABEL') }}
|
||||||
|
</label>
|
||||||
|
<TagMultiSelectComboBox
|
||||||
|
v-model="state.selectedAudience"
|
||||||
|
:options="audienceList"
|
||||||
|
:label="t('CAMPAIGN.WHATSAPP.CREATE.FORM.AUDIENCE.LABEL')"
|
||||||
|
:placeholder="t('CAMPAIGN.WHATSAPP.CREATE.FORM.AUDIENCE.PLACEHOLDER')"
|
||||||
|
:has-error="!!formErrors.audience"
|
||||||
|
:message="formErrors.audience"
|
||||||
|
class="[&>div>button]:bg-n-alpha-black2"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Input
|
||||||
|
v-model="state.scheduledAt"
|
||||||
|
:label="t('CAMPAIGN.WHATSAPP.CREATE.FORM.SCHEDULED_AT.LABEL')"
|
||||||
|
type="datetime-local"
|
||||||
|
:min="currentDateTime"
|
||||||
|
:placeholder="t('CAMPAIGN.WHATSAPP.CREATE.FORM.SCHEDULED_AT.PLACEHOLDER')"
|
||||||
|
:message="formErrors.scheduledAt"
|
||||||
|
:message-type="formErrors.scheduledAt ? 'error' : 'info'"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div class="flex gap-3 justify-between items-center w-full">
|
||||||
|
<Button
|
||||||
|
variant="faded"
|
||||||
|
color="slate"
|
||||||
|
type="button"
|
||||||
|
:label="t('CAMPAIGN.WHATSAPP.CREATE.FORM.BUTTONS.CANCEL')"
|
||||||
|
class="w-full bg-n-alpha-2 text-n-blue-text hover:bg-n-alpha-3"
|
||||||
|
@click="handleCancel"
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
:label="t('CAMPAIGN.WHATSAPP.CREATE.FORM.BUTTONS.CREATE')"
|
||||||
|
class="w-full"
|
||||||
|
type="submit"
|
||||||
|
:is-loading="isCreating"
|
||||||
|
:disabled="isCreating || isSubmitDisabled"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</template>
|
||||||
@@ -98,6 +98,7 @@ const onClickViewDetails = () => emit('showContact', props.id);
|
|||||||
:src="thumbnail"
|
:src="thumbnail"
|
||||||
:size="48"
|
:size="48"
|
||||||
:status="availabilityStatus"
|
:status="availabilityStatus"
|
||||||
|
hide-offline-status
|
||||||
rounded-full
|
rounded-full
|
||||||
/>
|
/>
|
||||||
<div class="flex flex-col gap-0.5 flex-1">
|
<div class="flex flex-col gap-0.5 flex-1">
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed, useSlots } from 'vue';
|
import { computed, useSlots, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import { vOnClickOutside } from '@vueuse/components';
|
||||||
|
|
||||||
import Button from 'dashboard/components-next/button/Button.vue';
|
import Button from 'dashboard/components-next/button/Button.vue';
|
||||||
import Breadcrumb from 'dashboard/components-next/breadcrumb/Breadcrumb.vue';
|
import Breadcrumb from 'dashboard/components-next/breadcrumb/Breadcrumb.vue';
|
||||||
import ComposeConversation from 'dashboard/components-next/NewConversation/ComposeConversation.vue';
|
import ComposeConversation from 'dashboard/components-next/NewConversation/ComposeConversation.vue';
|
||||||
|
import VoiceCallButton from 'dashboard/components-next/Contacts/VoiceCallButton.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
selectedContact: {
|
selectedContact: {
|
||||||
@@ -24,6 +26,8 @@ const { t } = useI18n();
|
|||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
|
const isContactSidebarOpen = ref(false);
|
||||||
|
|
||||||
const contactId = computed(() => route.params.contactId);
|
const contactId = computed(() => route.params.contactId);
|
||||||
|
|
||||||
const selectedContactName = computed(() => {
|
const selectedContactName = computed(() => {
|
||||||
@@ -56,6 +60,15 @@ const handleBreadcrumbClick = () => {
|
|||||||
const toggleBlock = () => {
|
const toggleBlock = () => {
|
||||||
emit('toggleBlock', isContactBlocked.value);
|
emit('toggleBlock', isContactBlocked.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleConversationSidebarToggle = () => {
|
||||||
|
isContactSidebarOpen.value = !isContactSidebarOpen.value;
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeMobileSidebar = () => {
|
||||||
|
if (!isContactSidebarOpen.value) return;
|
||||||
|
isContactSidebarOpen.value = false;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -67,7 +80,9 @@ const toggleBlock = () => {
|
|||||||
>
|
>
|
||||||
<header class="sticky top-0 z-10 px-6 3xl:px-0">
|
<header class="sticky top-0 z-10 px-6 3xl:px-0">
|
||||||
<div class="w-full mx-auto max-w-[40.625rem]">
|
<div class="w-full mx-auto max-w-[40.625rem]">
|
||||||
<div class="flex items-center justify-between w-full h-20 gap-2">
|
<div
|
||||||
|
class="flex flex-col xs:flex-row items-start xs:items-center justify-between w-full py-7 gap-2"
|
||||||
|
>
|
||||||
<Breadcrumb
|
<Breadcrumb
|
||||||
:items="breadcrumbItems"
|
:items="breadcrumbItems"
|
||||||
@click="handleBreadcrumbClick"
|
@click="handleBreadcrumbClick"
|
||||||
@@ -85,6 +100,11 @@ const toggleBlock = () => {
|
|||||||
:disabled="isUpdating"
|
:disabled="isUpdating"
|
||||||
@click="toggleBlock"
|
@click="toggleBlock"
|
||||||
/>
|
/>
|
||||||
|
<VoiceCallButton
|
||||||
|
:phone="selectedContact?.phoneNumber"
|
||||||
|
:label="$t('CONTACT_PANEL.CALL')"
|
||||||
|
size="sm"
|
||||||
|
/>
|
||||||
<ComposeConversation :contact-id="contactId">
|
<ComposeConversation :contact-id="contactId">
|
||||||
<template #trigger="{ toggle }">
|
<template #trigger="{ toggle }">
|
||||||
<Button
|
<Button
|
||||||
@@ -105,11 +125,65 @@ const toggleBlock = () => {
|
|||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Desktop sidebar -->
|
||||||
<div
|
<div
|
||||||
v-if="slots.sidebar"
|
v-if="slots.sidebar"
|
||||||
class="overflow-y-auto justify-end min-w-52 w-full py-6 max-w-md border-l border-n-weak bg-n-solid-2"
|
class="hidden lg:block overflow-y-auto justify-end min-w-52 w-full py-6 max-w-md border-l border-n-weak bg-n-solid-2"
|
||||||
>
|
>
|
||||||
<slot name="sidebar" />
|
<slot name="sidebar" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Mobile sidebar container -->
|
||||||
|
<div
|
||||||
|
v-if="slots.sidebar"
|
||||||
|
class="lg:hidden fixed top-0 ltr:right-0 rtl:left-0 h-full z-50 flex justify-end transition-all duration-200 ease-in-out"
|
||||||
|
:class="isContactSidebarOpen ? 'w-full' : 'w-16'"
|
||||||
|
>
|
||||||
|
<!-- Toggle button -->
|
||||||
|
<div
|
||||||
|
v-on-click-outside="[
|
||||||
|
closeMobileSidebar,
|
||||||
|
{ ignore: ['#contact-sidebar-content'] },
|
||||||
|
]"
|
||||||
|
class="flex items-start p-1 w-fit h-fit relative order-1 xs:top-24 top-28 transition-all bg-n-solid-2 border border-n-weak duration-500 ease-in-out"
|
||||||
|
:class="[
|
||||||
|
isContactSidebarOpen
|
||||||
|
? 'justify-end ltr:rounded-l-full rtl:rounded-r-full ltr:rounded-r-none rtl:rounded-l-none'
|
||||||
|
: 'justify-center rounded-full ltr:mr-6 rtl:ml-6',
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
ghost
|
||||||
|
slate
|
||||||
|
sm
|
||||||
|
class="!rounded-full rtl:rotate-180"
|
||||||
|
:class="{ 'bg-n-alpha-2': isContactSidebarOpen }"
|
||||||
|
:icon="
|
||||||
|
isContactSidebarOpen
|
||||||
|
? 'i-lucide-panel-right-close'
|
||||||
|
: 'i-lucide-panel-right-open'
|
||||||
|
"
|
||||||
|
data-contact-sidebar-toggle
|
||||||
|
@click="handleConversationSidebarToggle"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Transition
|
||||||
|
enter-active-class="transition-transform duration-200 ease-in-out"
|
||||||
|
leave-active-class="transition-transform duration-200 ease-in-out"
|
||||||
|
enter-from-class="ltr:translate-x-full rtl:-translate-x-full"
|
||||||
|
enter-to-class="ltr:translate-x-0 rtl:-translate-x-0"
|
||||||
|
leave-from-class="ltr:translate-x-0 rtl:-translate-x-0"
|
||||||
|
leave-to-class="ltr:translate-x-full rtl:-translate-x-full"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="isContactSidebarOpen"
|
||||||
|
id="contact-sidebar-content"
|
||||||
|
class="order-2 w-[85%] sm:w-[50%] bg-n-solid-2 ltr:border-l rtl:border-r border-n-weak overflow-y-auto py-6 shadow-lg"
|
||||||
|
>
|
||||||
|
<slot name="sidebar" />
|
||||||
|
</div>
|
||||||
|
</Transition>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -218,10 +218,13 @@ const resetForm = () => {
|
|||||||
Object.assign(state, defaultState);
|
Object.assign(state, defaultState);
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(() => props.contactData, prepareStateBasedOnProps, {
|
watch(
|
||||||
immediate: true,
|
() => props.contactData?.id,
|
||||||
deep: true,
|
id => {
|
||||||
});
|
if (id) prepareStateBasedOnProps();
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
|
||||||
// Expose state to parent component for avatar upload
|
// Expose state to parent component for avatar upload
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|||||||
+57
-54
@@ -34,13 +34,13 @@ const emit = defineEmits([
|
|||||||
<template>
|
<template>
|
||||||
<header class="sticky top-0 z-10">
|
<header class="sticky top-0 z-10">
|
||||||
<div
|
<div
|
||||||
class="flex items-center justify-between w-full h-20 px-6 gap-2 mx-auto max-w-[60rem]"
|
class="flex items-start sm:items-center justify-between w-full py-6 px-6 gap-2 mx-auto max-w-[60rem]"
|
||||||
>
|
>
|
||||||
<span class="text-xl font-medium truncate text-n-slate-12">
|
<span class="text-xl font-medium truncate text-n-slate-12">
|
||||||
{{ headerTitle }}
|
{{ headerTitle }}
|
||||||
</span>
|
</span>
|
||||||
<div class="flex items-center flex-shrink-0 gap-4">
|
<div class="flex items-center flex-col sm:flex-row flex-shrink-0 gap-4">
|
||||||
<div v-if="showSearch" class="flex items-center gap-2">
|
<div v-if="showSearch" class="flex items-center gap-2 w-full">
|
||||||
<Input
|
<Input
|
||||||
:model-value="searchValue"
|
:model-value="searchValue"
|
||||||
type="search"
|
type="search"
|
||||||
@@ -48,6 +48,7 @@ const emit = defineEmits([
|
|||||||
:custom-input-class="[
|
:custom-input-class="[
|
||||||
'h-8 [&:not(.focus)]:!border-transparent bg-n-alpha-2 dark:bg-n-solid-1 ltr:!pl-8 !py-1 rtl:!pr-8',
|
'h-8 [&:not(.focus)]:!border-transparent bg-n-alpha-2 dark:bg-n-solid-1 ltr:!pl-8 !py-1 rtl:!pr-8',
|
||||||
]"
|
]"
|
||||||
|
class="w-full"
|
||||||
@input="emit('search', $event.target.value)"
|
@input="emit('search', $event.target.value)"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
@@ -58,64 +59,66 @@ const emit = defineEmits([
|
|||||||
</template>
|
</template>
|
||||||
</Input>
|
</Input>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center flex-shrink-0 gap-4">
|
||||||
<div v-if="!isLabelView && !isActiveView" class="relative">
|
<div class="flex items-center gap-2">
|
||||||
|
<div v-if="!isLabelView && !isActiveView" class="relative">
|
||||||
|
<Button
|
||||||
|
id="toggleContactsFilterButton"
|
||||||
|
:icon="
|
||||||
|
isSegmentsView ? 'i-lucide-pen-line' : 'i-lucide-list-filter'
|
||||||
|
"
|
||||||
|
color="slate"
|
||||||
|
size="sm"
|
||||||
|
class="relative w-8"
|
||||||
|
variant="ghost"
|
||||||
|
@click="emit('filter')"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="hasActiveFilters && !isSegmentsView"
|
||||||
|
class="absolute top-0 right-0 w-2 h-2 rounded-full bg-n-brand"
|
||||||
|
/>
|
||||||
|
</Button>
|
||||||
|
<slot name="filter" />
|
||||||
|
</div>
|
||||||
<Button
|
<Button
|
||||||
id="toggleContactsFilterButton"
|
v-if="
|
||||||
:icon="
|
hasActiveFilters &&
|
||||||
isSegmentsView ? 'i-lucide-pen-line' : 'i-lucide-list-filter'
|
!isSegmentsView &&
|
||||||
|
!isLabelView &&
|
||||||
|
!isActiveView
|
||||||
"
|
"
|
||||||
|
icon="i-lucide-save"
|
||||||
color="slate"
|
color="slate"
|
||||||
size="sm"
|
size="sm"
|
||||||
class="relative w-8"
|
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
@click="emit('filter')"
|
@click="emit('createSegment')"
|
||||||
>
|
/>
|
||||||
<div
|
<Button
|
||||||
v-if="hasActiveFilters && !isSegmentsView"
|
v-if="isSegmentsView && !isLabelView && !isActiveView"
|
||||||
class="absolute top-0 right-0 w-2 h-2 rounded-full bg-n-brand"
|
icon="i-lucide-trash"
|
||||||
/>
|
color="slate"
|
||||||
</Button>
|
size="sm"
|
||||||
<slot name="filter" />
|
variant="ghost"
|
||||||
|
@click="emit('deleteSegment')"
|
||||||
|
/>
|
||||||
|
<ContactSortMenu
|
||||||
|
:active-sort="activeSort"
|
||||||
|
:active-ordering="activeOrdering"
|
||||||
|
@update:sort="emit('update:sort', $event)"
|
||||||
|
/>
|
||||||
|
<ContactMoreActions
|
||||||
|
@add="emit('add')"
|
||||||
|
@import="emit('import')"
|
||||||
|
@export="emit('export')"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<div class="w-px h-4 bg-n-strong" />
|
||||||
v-if="
|
<ComposeConversation>
|
||||||
hasActiveFilters &&
|
<template #trigger="{ toggle }">
|
||||||
!isSegmentsView &&
|
<Button :label="buttonLabel" size="sm" @click="toggle" />
|
||||||
!isLabelView &&
|
</template>
|
||||||
!isActiveView
|
</ComposeConversation>
|
||||||
"
|
|
||||||
icon="i-lucide-save"
|
|
||||||
color="slate"
|
|
||||||
size="sm"
|
|
||||||
variant="ghost"
|
|
||||||
@click="emit('createSegment')"
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
v-if="isSegmentsView && !isLabelView && !isActiveView"
|
|
||||||
icon="i-lucide-trash"
|
|
||||||
color="slate"
|
|
||||||
size="sm"
|
|
||||||
variant="ghost"
|
|
||||||
@click="emit('deleteSegment')"
|
|
||||||
/>
|
|
||||||
<ContactSortMenu
|
|
||||||
:active-sort="activeSort"
|
|
||||||
:active-ordering="activeOrdering"
|
|
||||||
@update:sort="emit('update:sort', $event)"
|
|
||||||
/>
|
|
||||||
<ContactMoreActions
|
|
||||||
@add="emit('add')"
|
|
||||||
@import="emit('import')"
|
|
||||||
@export="emit('export')"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="w-px h-4 bg-n-strong" />
|
|
||||||
<ComposeConversation>
|
|
||||||
<template #trigger="{ toggle }">
|
|
||||||
<Button :label="buttonLabel" size="sm" @click="toggle" />
|
|
||||||
</template>
|
|
||||||
</ComposeConversation>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
+14
-11
@@ -291,17 +291,20 @@ defineExpose({
|
|||||||
@delete-segment="openDeleteSegmentDialog"
|
@delete-segment="openDeleteSegmentDialog"
|
||||||
>
|
>
|
||||||
<template #filter>
|
<template #filter>
|
||||||
<ContactsFilter
|
<div
|
||||||
v-if="showFiltersModal"
|
class="absolute mt-1 ltr:-right-52 rtl:-left-52 sm:ltr:right-0 sm:rtl:left-0 top-full"
|
||||||
v-model="appliedFilter"
|
>
|
||||||
:segment-name="activeSegmentName"
|
<ContactsFilter
|
||||||
:is-segment-view="hasActiveSegments"
|
v-if="showFiltersModal"
|
||||||
class="absolute mt-1 ltr:right-0 rtl:left-0 top-full"
|
v-model="appliedFilter"
|
||||||
@apply-filter="onApplyFilter"
|
:segment-name="activeSegmentName"
|
||||||
@update-segment="onUpdateSegment"
|
:is-segment-view="hasActiveSegments"
|
||||||
@close="closeAdvanceFiltersModal"
|
@apply-filter="onApplyFilter"
|
||||||
@clear-filters="clearFilters"
|
@update-segment="onUpdateSegment"
|
||||||
/>
|
@close="closeAdvanceFiltersModal"
|
||||||
|
@clear-filters="clearFilters"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</ContactsHeader>
|
</ContactsHeader>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -105,7 +105,7 @@ const handleOrderChange = value => {
|
|||||||
<div
|
<div
|
||||||
v-if="isMenuOpen"
|
v-if="isMenuOpen"
|
||||||
v-on-clickaway="() => (isMenuOpen = false)"
|
v-on-clickaway="() => (isMenuOpen = false)"
|
||||||
class="absolute top-full mt-1 ltr:right-0 rtl:left-0 flex flex-col gap-4 bg-n-alpha-3 backdrop-blur-[100px] border border-n-weak w-72 rounded-xl p-4"
|
class="absolute top-full mt-1 ltr:-right-32 rtl:-left-32 sm:ltr:right-0 sm:rtl:left-0 flex flex-col gap-4 bg-n-alpha-3 backdrop-blur-[100px] border border-n-weak w-72 rounded-xl p-4"
|
||||||
>
|
>
|
||||||
<div class="flex items-center justify-between gap-2">
|
<div class="flex items-center justify-between gap-2">
|
||||||
<span class="text-sm text-n-slate-12">
|
<span class="text-sm text-n-slate-12">
|
||||||
|
|||||||
@@ -96,10 +96,7 @@ const openFilter = () => {
|
|||||||
<slot name="default" />
|
<slot name="default" />
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<footer
|
<footer v-if="showPaginationFooter" class="sticky bottom-0 z-0 px-4 pb-4">
|
||||||
v-if="showPaginationFooter"
|
|
||||||
class="sticky bottom-0 z-10 px-4 pb-4"
|
|
||||||
>
|
|
||||||
<PaginationFooter
|
<PaginationFooter
|
||||||
current-page-info="CONTACTS_LAYOUT.PAGINATION_FOOTER.SHOWING"
|
current-page-info="CONTACTS_LAYOUT.PAGINATION_FOOTER.SHOWING"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ const onMergeContacts = async () => {
|
|||||||
variant="faded"
|
variant="faded"
|
||||||
color="slate"
|
color="slate"
|
||||||
:label="t('CONTACTS_LAYOUT.SIDEBAR.MERGE.BUTTONS.CANCEL')"
|
:label="t('CONTACTS_LAYOUT.SIDEBAR.MERGE.BUTTONS.CANCEL')"
|
||||||
class="w-full bg-n-alpha-2 n-blue-text hover:bg-n-alpha-3"
|
class="w-full bg-n-alpha-2 text-n-blue-text hover:bg-n-alpha-3"
|
||||||
@click="resetState"
|
@click="resetState"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
+3
-3
@@ -4,8 +4,8 @@ export default [
|
|||||||
city: 'Los Angeles',
|
city: 'Los Angeles',
|
||||||
country: 'United States',
|
country: 'United States',
|
||||||
description:
|
description:
|
||||||
"I'm Candice, a developer focusing on building web solutions. Currently, I’m working as a Product Developer at Chatwoot.",
|
"I'm Candice, a developer focusing on building web solutions. Currently, I’m working as a Product Developer at Lumora.",
|
||||||
companyName: 'Chatwoot',
|
companyName: 'Lumora',
|
||||||
countryCode: 'US',
|
countryCode: 'US',
|
||||||
socialProfiles: {
|
socialProfiles: {
|
||||||
github: 'candice-dev',
|
github: 'candice-dev',
|
||||||
@@ -16,7 +16,7 @@ export default [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
availabilityStatus: 'offline',
|
availabilityStatus: 'offline',
|
||||||
email: 'candice.matherson@chatwoot.com',
|
email: 'candice.matherson@lumora.com',
|
||||||
id: 22,
|
id: 22,
|
||||||
name: 'Candice Matherson',
|
name: 'Candice Matherson',
|
||||||
phoneNumber: '+14155552671',
|
phoneNumber: '+14155552671',
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user