Skip to content

Commit

Permalink
Merge branch 'master' into refactor/expanded-story-tasks-component
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcicero45 authored Oct 27, 2023
2 parents 696db89 + 46ccf22 commit 2d3d90b
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ PUSHER_APP_ID=1234
PUSHER_APP_KEY=123456
PUSHER_APP_SECRET=34214341
PUSHER_APP_CLUSTER=123
PUSHER_SOCKET_URL='ws://ws-123.pusher.com/app/123456'
PUSHER_HOST="127.0.0.1"
VITE_PUSHER_SOCKET_URL='ws://ws-123.pusher.com/app/123456'
PUSHER_HOST="pusherfake"
PUSHER_PORT="8888"
PUSHER_WS_HOST="127.0.0.1"
PUSHER_WS_PORT="45449"
VITE_PUSHER_WS_HOST="127.0.0.1"
VITE_PUSHER_WS_PORT="45449"
EARLY_V2_EMAIL="@codeminer42.com"
GOOGLE_ANALYTICS_ID=
GLOBAL_ALERT_TEXT=
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## What this PR do ?
<!--Give a brief description of the changes proposed in this PR.-->

## Related Issues
<!--Mention any related issues fixed or addressed by this PR.-->

## Screenshots (if applicable)
<!--Include screenshots or images showcasing the changes made.-->

## Additional Notes (if any)
<!--Any additional information or context that might be helpful for reviewers.-->
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ COPY Gemfile.lock Gemfile.lock
COPY yarn.lock yarn.lock
COPY .env.sample .env

ADD pusher-fake-entrypoint.sh /tmp/pusher-fake-entrypoint.sh

ENV PUSHER_APP_ID=1234 \
PUSHER_APP_KEY=123456 \
PUSHER_APP_SECRET=34214341 \
PUSHER_PORT=8888 \
PUSHER_WS_PORT=45449

EXPOSE $PUSHER_WS_PORT $PUSHER_PORT

CMD ["/tmp/pusher-fake-entrypoint.sh"]

RUN bundle install

WORKDIR /app
6 changes: 3 additions & 3 deletions app/assets/javascripts/pusherSockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const matchPusherUrl = url => {
};

export const subscribeToProjectChanges = (project, callback) => {
const pusherUrl = process.env.PUSHER_SOCKET_URL || '';
const pusherUrl = import.meta.env.VITE_PUSHER_SOCKET_URL || '';
const [
_,
pusherCluster,
Expand Down Expand Up @@ -38,8 +38,8 @@ const getProjectSocket = (apiKey, apiCluster) => {
})
: new Pusher(apiKey,{
cluster: apiCluster,
wsHost: process.env.PUSHER_WS_HOST,
wsPort: process.env.PUSHER_WS_PORT,
wsHost: import.meta.env.VITE_PUSHER_WS_HOST,
wsPort: import.meta.env.VITE_PUSHER_WS_PORT,
encrypted: false,
disableStats: true
})
Expand Down
5 changes: 3 additions & 2 deletions app/controllers/beta/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ class Beta::ProjectsController < ApplicationController
before_action :set_fluid_layout

def show
@project_id = params[:id]
@project = current_user.projects.friendly.find @project_id
project_slug = params[:id]
@project = current_user.projects.friendly.find project_slug
@project_id = @project.id

authorize @project, policy_class: Beta::ProjectPolicy
update_current_team
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ services:
- ./node_modules:/app/node_modules
command: sh -c "bundle binstubs bundler --force && ruby ./bin/vite dev"

pusherfake:
build: .
ports:
- "8888:8888" # Pusher-Fake web port
- "45449:45449" # Pusher-Fake socket port
volumes:
- .:/app
environment:
PUSHER_APP_ID: 1234
PUSHER_WS_PORT: 45449
PUSHER_PORT: 8888
PUSHER_APP_KEY: 123456
PUSHER_APP_SECRET: 34214341

adminer:
image: adminer:4.8.1
environment:
Expand Down
3 changes: 3 additions & 0 deletions pusher-fake-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

pusher-fake -i $PUSHER_APP_ID --socket-host 0.0.0.0 --socket-port $PUSHER_WS_PORT --web-host 0.0.0.0 --web-port $PUSHER_PORT -k $PUSHER_APP_KEY -s $PUSHER_APP_SECRET
4 changes: 4 additions & 0 deletions spec/javascripts/components/projects/project_board_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { shallow } from 'enzyme';
import { ProjectBoard } from 'components/projects/ProjectBoard';
import storyFactory from '../../support/factories/storyFactory';

jest.mock('../../../../app/assets/javascripts/pusherSockets', () => ({
subscribeToProjectChanges: jest.fn(),
}));

describe('<ProjectBoard />', () => {
const render = props => {
const defaultProps = {
Expand Down

0 comments on commit 2d3d90b

Please sign in to comment.