diff --git a/.eslintrc.js b/.eslintrc.js
index f3d050ab3..3c191b7b7 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,17 +1,6 @@
module.exports = {
- extends: [
- 'airbnb-base/legacy',
- 'prettier',
- 'plugin:vue/recommended',
- 'plugin:storybook/recommended',
- 'plugin:cypress/recommended',
- ],
- parserOptions: {
- parser: '@babel/eslint-parser',
- ecmaVersion: 2020,
- sourceType: 'module',
- },
- plugins: ['html', 'prettier', 'babel'],
+ extends: ['airbnb-base/legacy', 'prettier', 'plugin:vue/recommended'],
+ plugins: ['html', 'prettier'],
rules: {
'prettier/prettier': ['error'],
camelcase: 'off',
@@ -210,13 +199,6 @@ module.exports = {
'import/extensions': ['off'],
'no-console': 'error',
},
- settings: {
- 'import/resolver': {
- webpack: {
- config: 'config/webpack/resolve.js',
- },
- },
- },
env: {
browser: true,
node: true,
diff --git a/.github/workflows/run_foss_spec.yml b/.github/workflows/run_foss_spec.yml
index b0b2372ae..9382ccbf6 100644
--- a/.github/workflows/run_foss_spec.yml
+++ b/.github/workflows/run_foss_spec.yml
@@ -42,7 +42,9 @@ jobs:
steps:
- uses: actions/checkout@v4
+ - uses: pnpm/action-setup@v4
with:
+ version: 9
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
@@ -53,10 +55,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
- cache: yarn
+ cache: 'pnpm'
- - name: yarn
- run: yarn install
+ - name: Install pnpm dependencies
+ run: pnpm i
- name: Strip enterprise code
run: |
@@ -69,9 +71,6 @@ jobs:
- name: Seed database
run: bundle exec rake db:schema:load
- - name: yarn check-files
- run: yarn install --check-files
-
# Run rails tests
- name: Run backend tests
run: |
diff --git a/.gitignore b/.gitignore
index 028a97f09..5eb883db0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,6 +32,16 @@ master.key
public/uploads
public/packs*
+public/assets/administrate*
+public/assets/action*.js
+public/assets/activestorage*.js
+public/assets/trix*
+public/assets/belongs_to*.js
+public/assets/manifest*.js
+public/assets/manifest*.js
+public/assets/*.js.gz
+public/assets/secretField*
+public/assets/.sprockets-manifest-*.json
# VIM files
*.swp
@@ -75,4 +85,8 @@ yalc.lock
yarn-debug.log*
.yarn-integrity
-/storybook-static
\ No newline at end of file
+# Vite Ruby
+/public/vite*
+# Vite uses dotenv and suggests to ignore local-only env files. See
+# https://vitejs.dev/guide/env-and-mode.html#env-files
+*.local
diff --git a/.husky/pre-commit b/.husky/pre-commit
index adda426ad..2525dde4e 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,11 +1,11 @@
-#!/bin/sh
-. "$(dirname "$0")/_/husky.sh"
+# #!/bin/sh
+# . "$(dirname "$0")/_/husky.sh"
-# lint js and vue files
-npx --no-install lint-staged
+# # lint js and vue files
+# npx --no-install lint-staged
-# lint only staged ruby files
-git diff --name-only --cached | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop --force-exclusion -a
+# # lint only staged ruby files
+# git diff --name-only --cached | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop --force-exclusion -a
-# stage rubocop changes to files
-git diff --name-only --cached | xargs git add
+# # stage rubocop changes to files
+# git diff --name-only --cached | xargs git add
diff --git a/.storybook/main.js b/.storybook/main.js
deleted file mode 100644
index cb32634c2..000000000
--- a/.storybook/main.js
+++ /dev/null
@@ -1,56 +0,0 @@
-const path = require('path');
-const resolve = require('../config/webpack/resolve');
-
-// Chatwoot's webpack.config.js
-process.env.NODE_ENV = 'development';
-const custom = require('../config/webpack/environment');
-
-module.exports = {
- stories: [
- '../stories/**/*.stories.mdx',
- '../app/javascript/**/*.stories.@(js|jsx|ts|tsx)',
- ],
- addons: [
- {
- name: '@storybook/addon-docs',
- options: {
- vueDocgenOptions: {
- alias: {
- '@': path.resolve(__dirname, '../'),
- },
- },
- },
- },
- '@storybook/addon-links',
- '@storybook/addon-essentials',
- {
- /**
- * Fix Storybook issue with PostCSS@8
- * @see https://github.com/storybookjs/storybook/issues/12668#issuecomment-773958085
- */
- name: '@storybook/addon-postcss',
- options: {
- postcssLoaderOptions: {
- implementation: require('postcss'),
- },
- },
- },
- ],
- webpackFinal: config => {
- const newConfig = {
- ...config,
- resolve: {
- ...config.resolve,
- modules: custom.resolvedModules.map(i => i.value),
- },
- };
-
- newConfig.module.rules.push({
- test: /\.scss$/,
- use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
- include: path.resolve(__dirname, '../app/javascript'),
- });
-
- return newConfig;
- },
-};
diff --git a/.storybook/preview.js b/.storybook/preview.js
deleted file mode 100644
index 7c046d51a..000000000
--- a/.storybook/preview.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import { addDecorator } from '@storybook/vue';
-import Vue from 'vue';
-import Vuex from 'vuex';
-import VueI18n from 'vue-i18n';
-import Multiselect from 'vue-multiselect';
-import VueDOMPurifyHTML from 'vue-dompurify-html';
-import FluentIcon from 'shared/components/FluentIcon/DashboardIcon';
-
-import WootUiKit from '../app/javascript/dashboard/components';
-import i18n from '../app/javascript/dashboard/i18n';
-import { domPurifyConfig } from 'shared/helpers/HTMLSanitizer';
-
-import '../app/javascript/dashboard/assets/scss/storybook.scss';
-
-Vue.use(VueI18n);
-Vue.use(WootUiKit);
-Vue.use(Vuex);
-Vue.use(VueDOMPurifyHTML, domPurifyConfig);
-
-Vue.component('multiselect', Multiselect);
-Vue.component('fluent-icon', FluentIcon);
-
-const store = new Vuex.Store({});
-const i18nConfig = new VueI18n({
- locale: 'en',
- messages: i18n,
-});
-
-addDecorator(() => ({
- template: '
___
-# Chatwoot
+# Chatwoot
Customer engagement suite, an open-source alternative to Intercom, Zendesk, Salesforce Service Cloud etc.
@@ -98,7 +101,7 @@ Chatwoot now supports 1-Click deployment to DigitalOcean as a kubernetes app. ### Other deployment options -For other supported options, checkout our [deployment page](https://chatwoot.com/deploy). +For other supported options, checkout our [deployment page](https://chatwoot.com/deploy). ## Security diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 2cc9549bc..00c9417ba 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -2,5 +2,4 @@ //= link administrate/application.css //= link administrate/application.js //= link administrate-field-active_storage/application.css -//= link dashboardChart.js //= link secretField.js diff --git a/app/assets/javascripts/dashboardChart.js b/app/assets/javascripts/dashboardChart.js deleted file mode 100644 index 46f278b80..000000000 --- a/app/assets/javascripts/dashboardChart.js +++ /dev/null @@ -1,55 +0,0 @@ -// eslint-disable-next-line -function prepareData(data) { - var labels = []; - var dataSet = []; - data.forEach(item => { - labels.push(item[0]); - dataSet.push(item[1]); - }); - return { labels, dataSet }; -} - -function getChartOptions() { - var fontFamily = - 'PlusJakarta,-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif'; - return { - responsive: true, - legend: { labels: { fontFamily } }, - scales: { - xAxes: [ - { - barPercentage: 1.26, - ticks: { fontFamily }, - gridLines: { display: false }, - }, - ], - yAxes: [ - { - ticks: { fontFamily }, - gridLines: { display: false }, - }, - ], - }, - }; -} - -// eslint-disable-next-line -function drawSuperAdminDashboard(data) { - var ctx = document.getElementById('dashboard-chart').getContext('2d'); - var chartData = prepareData(data); - // eslint-disable-next-line - new Chart(ctx, { - type: 'bar', - data: { - labels: chartData.labels, - datasets: [ - { - label: 'Conversations', - data: chartData.dataSet, - backgroundColor: '#1f93ff', - }, - ], - }, - options: getChartOptions(), - }); -} diff --git a/app/assets/stylesheets/administrate/utilities/_variables.scss b/app/assets/stylesheets/administrate/utilities/_variables.scss index 3a1129c41..9123667e2 100644 --- a/app/assets/stylesheets/administrate/utilities/_variables.scss +++ b/app/assets/stylesheets/administrate/utilities/_variables.scss @@ -86,8 +86,5 @@ $swift-ease-out-duration: .4s !default; $swift-ease-out-timing-function: cubic-bezier(.25, .8, .25, 1) !default; $swift-ease-out: all $swift-ease-out-duration $swift-ease-out-timing-function !default; -// Ionicons -$ionicons-font-path: '~ionicons/fonts'; - // Transitions $transition-ease-in: all 0.250s ease-in; diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 332f1528f..6ddaab73b 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -72,7 +72,7 @@ class DashboardController < ActionController::Base @application_pack = if request.path.include?('/auth') || request.path.include?('/login') 'v3app' else - 'application' + 'dashboard' end end diff --git a/app/javascript/dashboard/App.vue b/app/javascript/dashboard/App.vue index da169d61f..977f8565c 100644 --- a/app/javascript/dashboard/App.vue +++ b/app/javascript/dashboard/App.vue @@ -1,6 +1,5 @@ @@ -34,7 +36,7 @@ export default {