Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
687 changed files
with
12,307 additions
and
1,560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,8 @@ | ||
# pre-build stage | ||
ARG VARIANT=2.7 | ||
FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT} | ||
|
||
# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user. | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \ | ||
groupmod --gid $USER_GID vscode \ | ||
&& usermod --uid $USER_UID --gid $USER_GID vscode \ | ||
&& chmod -R $USER_UID:$USER_GID /home/vscode; \ | ||
fi | ||
|
||
# [Option] Install Node.js | ||
ARG INSTALL_NODE="true" | ||
ARG NODE_VERSION="lts/*" | ||
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi | ||
|
||
|
||
# tmux is for overmind | ||
# TODO : install foreman in future | ||
# packages: postgresql-server-dev-all | ||
# may be postgres in same machine | ||
|
||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends \ | ||
libssl-dev \ | ||
tar \ | ||
tzdata \ | ||
postgresql-client \ | ||
yarn \ | ||
git \ | ||
imagemagick \ | ||
tmux \ | ||
zsh | ||
|
||
# [Optional] Uncomment this line to install global node packages. | ||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1 | ||
|
||
# The below image is created out of the Dockerfile.base | ||
# It has the dependencies already installed so that codespace will boot up fast | ||
FROM ghcr.io/chatwoot/chatwoot_codespace:latest | ||
|
||
# Do the set up required for chatwoot app | ||
WORKDIR /workspace | ||
COPY . /workspace | ||
|
||
# TODO: figure out installing rvm | ||
# RUN rvm install | ||
COPY Gemfile Gemfile.lock ./ | ||
RUN gem install bundler | ||
RUN bundle install | ||
COPY package.json yarn.lock ./ | ||
RUN yarn install | ||
RUN yarn && gem install bundler && bundle install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# pre-build stage | ||
ARG VARIANT=2.7 | ||
FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT} | ||
|
||
# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user. | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \ | ||
groupmod --gid $USER_GID vscode \ | ||
&& usermod --uid $USER_UID --gid $USER_GID vscode \ | ||
&& chmod -R $USER_UID:$USER_GID /home/vscode; \ | ||
fi | ||
|
||
# [Option] Install Node.js | ||
ARG INSTALL_NODE="true" | ||
ARG NODE_VERSION="lts/*" | ||
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi | ||
|
||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends \ | ||
libssl-dev \ | ||
tar \ | ||
tzdata \ | ||
postgresql-client \ | ||
yarn \ | ||
git \ | ||
imagemagick \ | ||
tmux \ | ||
zsh | ||
|
||
|
||
# Install overmind | ||
RUN curl -L https://github.com/DarthSim/overmind/releases/download/v2.1.0/overmind-v2.1.0-linux-amd64.gz > overmind.gz \ | ||
&& gunzip overmind.gz \ | ||
&& sudo mv overmind /usr/local/bin \ | ||
&& chmod +x /usr/local/bin/overmind | ||
|
||
# Do the set up required for chatwoot app | ||
WORKDIR /workspace | ||
COPY . /workspace | ||
RUN yarn | ||
|
||
COPY Gemfile Gemfile.lock ./ | ||
RUN gem install bundler && bundle install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cp .env.example .env | ||
sed -i -e '/REDIS_URL/ s/=.*/=redis:\/\/localhost:6379/' .env | ||
sed -i -e '/POSTGRES_HOST/ s/=.*/=localhost/' .env | ||
sed -i -e '/SMTP_ADDRESS/ s/=.*/=localhost/' .env | ||
sed -i -e "/FRONTEND_URL/ s/=.*/=https:\/\/$CODESPACE_NAME-3000.githubpreview.dev/" .env | ||
sed -i -e "/WEBPACKER_DEV_SERVER_PUBLIC/ s/=.*/=https:\/\/$CODESPACE_NAME-3035.githubpreview.dev/" .env | ||
# uncomment the webpacker env variable | ||
sed -i -e '/WEBPACKER_DEV_SERVER_PUBLIC/s/^# //' .env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Publish Codespace Base Image | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-code-space-image: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build the Codespace Base Image | ||
run: | | ||
docker build . -t ghcr.io/chatwoot/chatwoot_codespace:latest -f .devcontainer/Dockerfile.base | ||
docker push ghcr.io/chatwoot/chatwoot_codespace:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.7.2 | ||
2.7.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class CsatSurveys::ResponseBuilder | ||
pattr_initialize [:message] | ||
|
||
def perform | ||
raise 'Invalid Message' unless message.input_csat? | ||
|
||
conversation = message.conversation | ||
rating = message.content_attributes.dig('submitted_values', 'csat_survey_response', 'rating') | ||
feedback_message = message.content_attributes.dig('submitted_values', 'csat_survey_response', 'feedback_message') | ||
|
||
return if rating.blank? | ||
|
||
process_csat_response(conversation, rating, feedback_message) | ||
end | ||
|
||
private | ||
|
||
def process_csat_response(conversation, rating, feedback_message) | ||
csat_survey_response = message.csat_survey_response || CsatSurveyResponse.new( | ||
message_id: message.id, account_id: message.account_id, conversation_id: message.conversation_id, | ||
contact_id: conversation.contact_id, assigned_agent: conversation.assignee | ||
) | ||
csat_survey_response.rating = rating | ||
csat_survey_response.feedback_message = feedback_message | ||
csat_survey_response.save! | ||
csat_survey_response | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.