Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/word-wrap-1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielRMuller authored Jun 26, 2024
2 parents 3d0a7eb + 97e423d commit 4d81a86
Show file tree
Hide file tree
Showing 267 changed files with 7,243 additions and 7,628 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=
28 changes: 14 additions & 14 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
env:
jquery: true
extends:
- plugin:backbone/recommended
plugins:
- react
- backbone
parser: "babel-eslint"
rules:
eqeqeq: 1
backbone/initialize-on-top: 0
backbone/events-on-top: 0
backbone/no-silent: 0
strict: 0
{
"env": { "jquery": true },
"extends": ["plugin:backbone/recommended", "prettier"],
"plugins": ["react", "backbone", "prettier"],
"parser": "babel-eslint",
"rules": {
"eqeqeq": 1,
"backbone/initialize-on-top": 0,
"backbone/events-on-top": 0,
"backbone/no-silent": 0,
"strict": 0,
"prettier/prettier": "error"
}
}
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.-->
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"arrowParens": "avoid",
"semi": true,
"singleQuote": true
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

## [3.0.0] 2023-10-10

- Remove "Story attachments" feature
- Implement real-time updates in the beta board
- Refactor some components to be functional components

## [2.10.0] 2023-06-08

- Refactor Note Operations to use dry-monads
Expand Down Expand Up @@ -653,7 +659,6 @@
The format is based on [Keep a Changelog](http://keepachangelog.com)
and this project adheres to [Semantic Versioning](http://semver.org).

[unreleased]: https://github.com/Codeminer42/cm42-central/compare/v2.8.0...HEAD
[1.0.0]: https://github.com/Codeminer42/cm42-central/tree/v1.0.0
[1.1.0]: https://github.com/Codeminer42/cm42-central/tree/v1.1.0
[1.1.1]: https://github.com/Codeminer42/cm42-central/tree/v1.1.1
Expand Down Expand Up @@ -700,3 +705,4 @@ and this project adheres to [Semantic Versioning](http://semver.org).
[2.8.0]: https://github.com/Codeminer42/cm42-central/tree/v2.8.0
[2.9.0]: https://github.com/Codeminer42/cm42-central/tree/v2.9.0
[2.10.0]: https://github.com/Codeminer42/cm42-central/tree/v2.10.0
[3.0.0]: https://github.com/Codeminer42/cm42-central/tree/v3.0.0
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ The principles that we believe in are:
Installation
------------

**WARNING**: It is **NOT** recommended to create the database using the db:migrate command during the installation process. Some migrations in the project have become outdated due to Rails updates during the application's development. Therefore, if you create the database from scratch using these outdated migrations instead of loading the current schema, the application will not function as intended, and some tests will fail. Be aware!

First up, your system will need the
[prerequisites for running Ruby on Rails installed](https://guides.rubyonrails.org/getting_started.html)
Once you have these:
Expand Down Expand Up @@ -135,9 +137,7 @@ Or using docker:
# Prepare container
$ docker compose build
$ docker compose run --rm web yarn install
$ docker compose run --rm web bundle exec rake db:create
$ docker compose run --rm web bundle exec rake db:migrate
$ docker compose run --rm web bundle exec rake db:seed
$ docker compose run --rm web bundle exec rake db:setup

# Up container
$ docker compose up
Expand Down
6 changes: 2 additions & 4 deletions app/assets/javascripts/actions/actionTypes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import keyMirror from "keymirror";
import keyMirror from 'keymirror';

export default keyMirror({
REQUEST_PROJECT_BOARD: null,
Expand Down Expand Up @@ -34,8 +34,6 @@ export default keyMirror({
ADD_LABEL_TO_PROJECT: null,
ADD_LABEL: null,
DELETE_LABEL: null,
ADD_ATTACHMENT: null,
DELETE_ATTACHMENT: null,
ADD_NOTIFICATION: null,
REMOVE_NOTIFICATION: null,
SEARCH_STORIES_SUCCESS: null,
Expand All @@ -47,5 +45,5 @@ export default keyMirror({
TOGGLE_COLUMN_VISIBILITY: null,
REVERT_TO_CALCULATED_VELOCITY: null,
SIMULATE_SPRINT_VELOCITY: null,
OPTIMISTICALLY_UPDATE: null
OPTIMISTICALLY_UPDATE: null,
});
34 changes: 0 additions & 34 deletions app/assets/javascripts/actions/attachment.js

This file was deleted.

17 changes: 8 additions & 9 deletions app/assets/javascripts/actions/labels.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import actionTypes from './actionTypes';

export const addLabelToProject = (label) => ({
export const addLabelToProject = label => ({
type: actionTypes.ADD_LABEL_TO_PROJECT,
label
label,
});

export const addLabelSuccess = (storyId, label) => ({
type: actionTypes.ADD_LABEL,
storyId,
label
label,
});

export const removeLabel = (storyId, labelName) => ({
type: actionTypes.DELETE_LABEL,
storyId,
labelName
labelName,
});

export const addLabel = (storyId, label) =>
(dispatch) => {
dispatch(addLabelSuccess(storyId, label));
dispatch(addLabelToProject(label));
}
export const addLabel = (storyId, label) => dispatch => {
dispatch(addLabelSuccess(storyId, label));
dispatch(addLabelToProject(label));
};
20 changes: 10 additions & 10 deletions app/assets/javascripts/actions/note.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,37 @@ import { setLoadingStory, storyFailure } from './story';
export const deleteNoteSuccess = (storyId, noteId) => ({
type: actionTypes.DELETE_NOTE,
storyId,
noteId
noteId,
});

export const createNoteSuccess = (storyId, note) => ({
type: actionTypes.ADD_NOTE,
storyId,
note
note,
});

export const deleteNote = (projectId, storyId, noteId) =>
export const deleteNote =
(projectId, storyId, noteId) =>
async (dispatch, getState, { Note }) => {
dispatch(setLoadingStory(storyId));

try {
await Note.destroy(projectId, storyId, noteId);
return dispatch(deleteNoteSuccess(storyId, noteId));
}
catch (error) {
} catch (error) {
return dispatch(storyFailure(storyId, error));
}
}
};

export const createNote = (projectId, storyId, note) =>
export const createNote =
(projectId, storyId, note) =>
async (dispatch, getState, { Note }) => {
dispatch(setLoadingStory(storyId));

try {
const newNote = await Note.post(projectId, storyId, note);
return dispatch(createNoteSuccess(storyId, newNote));
}
catch (error) {
} catch (error) {
return dispatch(storyFailure(storyId, error));
}
}
};
55 changes: 29 additions & 26 deletions app/assets/javascripts/actions/notifications.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,51 @@
import actionTypes from './actionTypes';
import status from 'http-status';

export const addNotification = (notification) => ({
export const addNotification = notification => ({
type: actionTypes.ADD_NOTIFICATION,
notification
notification,
});

export const removeNotification = (id) => ({
export const removeNotification = id => ({
type: actionTypes.REMOVE_NOTIFICATION,
id
id,
});

export const sendSuccessNotification = (message) =>
export const sendSuccessNotification =
message =>
(dispatch, getState, { Notification }) => {
const newNotification = Notification.createNotification({
type: Notification.types.SUCCESS,
message
message,
});

dispatch(addNotification(newNotification));

setTimeout(() => {
dispatch(removeNotification(newNotification.id));
}, 4000);
}
};

export const sendErrorNotification = (error, { custom = false } = {}) => {
if (error.response) return sendServerErrorNotification(error);
if (custom) return sendCustomErrorNotification(error);
return sendDefaultErrorNotification();
}
};

export const sendCustomErrorNotification = code =>
export const sendCustomErrorNotification =
code =>
(dispatch, _, { Notification }) =>
dispatch(
addNotification(
Notification.createNotification({
type: Notification.types.ERROR,
message: I18n.t(code)
message: I18n.t(code),
})
)
);

const sendServerErrorNotification = (error) =>
const sendServerErrorNotification =
error =>
(dispatch, getState, { Notification }) => {
const type = Notification.types.ERROR;

Expand All @@ -56,7 +59,9 @@ const sendServerErrorNotification = (error) =>
addNotification(
Notification.createNotification({
type,
message: I18n.t('users.You are not authorized to perform this action')
message: I18n.t(
'users.You are not authorized to perform this action'
),
})
)
);
Expand All @@ -65,39 +70,37 @@ const sendServerErrorNotification = (error) =>
addNotification(
Notification.createNotification({
type,
message: I18n.t('not_found')
message: I18n.t('not_found'),
})
)
);
default:
return dispatch(
addDefaultErrorNotification(Notification)
);
return dispatch(addDefaultErrorNotification(Notification));
}
}
};

export const sendDefaultErrorNotification = () =>
export const sendDefaultErrorNotification =
() =>
(dispatch, getState, { Notification }) =>
dispatch(
addDefaultErrorNotification(Notification)
);
dispatch(addDefaultErrorNotification(Notification));

const addDefaultErrorNotification = Notification =>
addNotification(
Notification.createNotification({
type: Notification.types.ERROR,
message: I18n.t('messages.operations.error.default_error')
message: I18n.t('messages.operations.error.default_error'),
})
)
);

export const addValidationNotifications = (errors) =>
export const addValidationNotifications =
errors =>
(dispatch, getState, { Notification }) => {
const notifications = Object.keys(errors).map(error =>
Notification.createNotification({
type: Notification.types.ERROR,
message: `Error. ${error}: ${errors[error]}`
message: `Error. ${error}: ${errors[error]}`,
})
);

dispatch(addNotification(notifications));
}
};
Loading

0 comments on commit 4d81a86

Please sign in to comment.