From 34bc9f1d04f14dace36a08e89ad8bbe555c0fd10 Mon Sep 17 00:00:00 2001 From: Guilherme-NL Date: Mon, 6 Nov 2023 10:13:13 -0300 Subject: [PATCH] feat: format all js and jsx files --- app/assets/javascripts/actions/actionTypes.js | 2 +- app/assets/javascripts/actions/labels.js | 17 +- app/assets/javascripts/actions/note.js | 20 +- .../javascripts/actions/notifications.js | 55 +- .../javascripts/actions/pastIterations.js | 15 +- .../javascripts/actions/projectBoard.js | 44 +- app/assets/javascripts/actions/sprint.js | 10 +- app/assets/javascripts/actions/story.js | 50 +- app/assets/javascripts/actions/task.js | 31 +- app/assets/javascripts/actions/user.js | 4 +- app/assets/javascripts/central.js | 19 +- .../collections/activity_collection.js | 6 +- .../collections/note_collection.js | 8 +- .../collections/project_collection.js | 12 +- .../collections/story_collection.js | 64 +- .../collections/task_collection.js | 8 +- .../collections/user_collection.js | 10 +- .../components/Columns/ColumnItem.jsx | 60 +- .../components/Columns/EpicColumn.jsx | 40 +- .../javascripts/components/Columns/index.jsx | 45 +- .../javascripts/components/Markdown.jsx | 8 +- .../components/Notifications/Message.jsx | 4 +- .../components/Notifications/index.jsx | 27 +- .../description/DescriptionContent.jsx | 27 +- .../javascripts/components/forms/AsyncForm.js | 2 +- .../javascripts/components/forms/Checkbox.jsx | 9 +- .../components/jquery_wrappers/AtWhoInput.jsx | 16 +- .../components/jquery_wrappers/Popover.jsx | 18 +- .../jquery_wrappers/TaggedInput.jsx | 17 +- .../javascripts/components/notes/Note.jsx | 44 +- .../javascripts/components/notes/NoteForm.jsx | 53 +- .../components/projects/ProjectBoard.jsx | 52 +- .../components/projects/ProjectCard.jsx | 123 ++-- .../components/projects/ProjectList.jsx | 22 +- .../components/projects/ProjectLoading.jsx | 3 +- .../components/projects/ProjectSearch.jsx | 60 +- .../projects/SideBar/SideBarButton.jsx | 32 +- .../projects/SideBar/SideBarButtonInfo.jsx | 11 +- .../components/projects/SideBar/index.jsx | 103 +-- .../javascripts/components/search/Search.jsx | 30 +- .../components/search/SearchResults.jsx | 24 +- .../components/search/SearchTooltip.jsx | 88 ++- .../components/search/StorySearch.jsx | 52 +- .../components/shapes/attachment.js | 9 +- .../javascripts/components/shapes/column.js | 4 +- .../javascripts/components/shapes/history.js | 4 +- .../components/shapes/iteration.js | 2 +- .../javascripts/components/shapes/note.js | 5 +- .../components/shapes/pastIteration.js | 2 +- .../javascripts/components/shapes/project.js | 10 +- .../components/shapes/projectBoard.js | 7 +- .../components/shapes/sideBarButton.js | 2 +- .../javascripts/components/shapes/story.js | 6 +- .../javascripts/components/shapes/task.js | 2 +- .../sprint/SprintVelocitySimulation.jsx | 64 +- .../sprint/SprintVelocitySimulationForm.jsx | 24 +- .../History/HistoryChanges/HistoryChange.jsx | 15 +- .../stories/History/HistoryChanges/index.jsx | 6 +- .../stories/History/HistoryHeader.jsx | 7 +- .../stories/History/HistoryItem.jsx | 14 +- .../components/stories/History/index.jsx | 33 +- .../components/stories/Iteration.jsx | 14 +- .../javascripts/components/stories/Sprint.jsx | 62 +- .../components/stories/SprintHeader.jsx | 35 +- .../components/stories/Sprints.jsx | 49 +- .../components/stories/Stories.jsx | 12 +- .../components/stories/StoryLink.jsx | 26 +- .../components/story/AddStoryButton.jsx | 7 +- .../CollapsedStory/CollapsedStoryEstimate.jsx | 6 +- .../CollapsedStoryEstimateButton.jsx | 29 +- .../CollapsedStoryFocusButton.jsx | 21 +- .../CollapsedStory/CollapsedStoryInfo.jsx | 2 +- .../CollapsedStory/CollapsedStoryLabels.jsx | 22 +- .../CollapsedStoryStateActions.jsx | 59 +- .../CollapsedStoryStateButton.jsx | 7 +- .../CollapsedStory/CollapsedStoryTitle.jsx | 34 +- .../components/story/CollapsedStory/index.jsx | 56 +- .../ExpandedStory/ExpandedStoryControls.jsx | 18 +- .../ExpandedStoryDefault/index.jsx | 121 +-- .../ExpandedStoryContentArea.jsx | 20 +- .../ExpandedStoryDescriptionContent.jsx | 7 +- .../ExpandedStoryDescriptionTextArea.jsx | 10 +- .../ExpandedStoryDescription/index.jsx | 41 +- .../ExpandedStory/ExpandedStoryEstimate.jsx | 36 +- .../ExpandedStoryHistoryLocation.jsx | 20 +- .../ExpandedStory/ExpandedStoryLabels.jsx | 24 +- .../ExpandedStory/ExpandedStoryNotes.jsx | 23 +- .../ExpandedStory/ExpandedStoryOwnedBy.jsx | 7 +- .../ExpandedStoryReleaseDate.jsx | 14 +- .../ExpandedStoryRelease/index.jsx | 34 +- .../ExpandedStoryRequestedBy.jsx | 7 +- .../ExpandedStory/ExpandedStorySection.jsx | 17 +- .../ExpandedStory/ExpandedStoryState.jsx | 28 +- .../story/ExpandedStory/ExpandedStoryTask.jsx | 55 +- .../ExpandedStory/ExpandedStoryTitle.jsx | 13 +- .../ExpandedStory/ExpandedStoryToolTip.jsx | 19 +- .../story/ExpandedStory/ExpandedStoryType.jsx | 19 +- .../components/story/ExpandedStory/index.jsx | 26 +- .../components/story/StoryActionButton.jsx | 7 +- .../components/story/StoryControls.jsx | 29 +- .../components/story/StoryDatePicker.jsx | 22 +- .../components/story/StoryDescription.jsx | 13 +- .../components/story/StoryDescriptionIcon.jsx | 12 +- .../components/story/StoryEstimateButtons.jsx | 4 +- .../components/story/StoryHistoryLocation.jsx | 33 +- .../components/story/StoryIcon.jsx | 12 +- .../components/story/StoryItem.jsx | 42 +- .../components/story/StoryLabels.jsx | 14 +- .../components/story/StoryNotes.jsx | 13 +- .../components/story/StoryPopover.jsx | 78 +- .../components/story/StorySelect.jsx | 36 +- .../components/story/StoryStateButtons.jsx | 6 +- .../components/story/StoryTasks.jsx | 13 +- .../javascripts/components/story/StoryUrl.js | 4 +- .../components/story/note/Note.jsx | 22 +- .../components/story/note/NotesList.jsx | 20 +- .../story/select_user/SelectUser.jsx | 38 +- .../components/story/task/Task.jsx | 22 +- .../components/story/task/TasksList.jsx | 26 +- .../components/tag_groups/ColorPicker.jsx | 37 +- .../javascripts/components/tasks/Task.jsx | 10 +- .../javascripts/components/tasks/TaskForm.jsx | 53 +- .../beta/project_boards/ShowController.jsx | 7 +- .../controllers/projects/EditController.js | 10 +- .../controllers/projects/IndexController.jsx | 18 +- .../tag_groups/TagGroupsController.jsx | 31 +- .../controllers/tour/TourController.js | 34 +- app/assets/javascripts/global_listeners.js | 108 +-- .../javascripts/libs/backbone_plugins.js | 2 +- app/assets/javascripts/libs/beta/constants.js | 40 +- app/assets/javascripts/libs/cloudinary.js | 8 +- .../javascripts/libs/execute_attachinary.js | 4 +- app/assets/javascripts/libs/globals.js | 20 +- app/assets/javascripts/libs/index.js | 14 +- app/assets/javascripts/libs/jquery_plugins.js | 14 +- app/assets/javascripts/libs/precompile_ejs.js | 16 +- .../mixins/contextual_serach_operands.js | 8 +- .../mixins/shared_model_methods.js | 22 +- .../javascripts/mixins/tab_notification.js | 12 +- app/assets/javascripts/models/activity.js | 18 +- .../javascripts/models/beta/attachmentUrl.js | 14 +- app/assets/javascripts/models/beta/column.js | 22 +- app/assets/javascripts/models/beta/history.js | 25 +- .../javascripts/models/beta/iteration.js | 147 ++-- app/assets/javascripts/models/beta/label.js | 27 +- app/assets/javascripts/models/beta/note.js | 28 +- .../javascripts/models/beta/notification.js | 12 +- .../javascripts/models/beta/pastIteration.js | 10 +- app/assets/javascripts/models/beta/project.js | 19 +- .../javascripts/models/beta/projectBoard.js | 113 ++- app/assets/javascripts/models/beta/search.js | 8 +- app/assets/javascripts/models/beta/story.js | 162 ++--- app/assets/javascripts/models/beta/task.js | 42 +- app/assets/javascripts/models/beta/user.js | 3 +- app/assets/javascripts/models/iteration.js | 250 ++++--- app/assets/javascripts/models/note.js | 7 +- .../javascripts/models/pastIteration.js | 18 +- app/assets/javascripts/models/project.js | 687 +++++++++--------- app/assets/javascripts/models/projectBoard.js | 24 +- app/assets/javascripts/models/story.js | 126 ++-- app/assets/javascripts/models/task.js | 9 +- app/assets/javascripts/models/tour.js | 10 +- app/assets/javascripts/models/user.js | 34 +- app/assets/javascripts/pusherSockets.js | 28 +- app/assets/javascripts/reducers/history.js | 19 +- .../javascripts/reducers/notifications.js | 2 +- .../javascripts/reducers/pastIterations.js | 12 +- app/assets/javascripts/reducers/project.js | 12 +- .../javascripts/reducers/projectBoard.js | 122 ++-- app/assets/javascripts/reducers/stories.js | 74 +- app/assets/javascripts/reducers/users.js | 10 +- app/assets/javascripts/selectors/backlog.js | 45 +- app/assets/javascripts/selectors/columns.js | 26 +- app/assets/javascripts/selectors/done.js | 18 +- app/assets/javascripts/selectors/project.js | 2 +- .../javascripts/selectors/projectBoard.js | 2 +- app/assets/javascripts/selectors/stories.js | 4 +- .../javascripts/services/httpService.js | 4 +- app/assets/javascripts/services/promises.js | 8 +- .../javascripts/services/updateIfSameId.js | 4 +- app/assets/javascripts/services/urlService.js | 4 +- app/assets/javascripts/store/index.js | 13 +- app/assets/javascripts/views/column_view.js | 39 +- .../views/column_visibility_button_view.jsx | 51 +- app/assets/javascripts/views/epic_bar_view.js | 46 +- app/assets/javascripts/views/epic_view.js | 35 +- app/assets/javascripts/views/form_view.js | 63 +- app/assets/javascripts/views/history_view.js | 70 +- .../javascripts/views/iteration_view.jsx | 17 +- app/assets/javascripts/views/keycut_view.js | 18 +- app/assets/javascripts/views/note_view.js | 11 +- .../javascripts/views/project_search_view.js | 54 +- .../views/project_velocity_override_view.js | 43 +- .../views/project_velocity_view.js | 17 +- app/assets/javascripts/views/project_view.jsx | 156 ++-- .../views/search_results_bar_view.js | 20 +- app/assets/javascripts/views/story_view.jsx | 662 ++++++++++------- app/assets/javascripts/views/task_form.js | 37 +- app/assets/javascripts/views/task_view.js | 19 +- 199 files changed, 3758 insertions(+), 3319 deletions(-) diff --git a/app/assets/javascripts/actions/actionTypes.js b/app/assets/javascripts/actions/actionTypes.js index d6cf9dcfc..1061f2a26 100644 --- a/app/assets/javascripts/actions/actionTypes.js +++ b/app/assets/javascripts/actions/actionTypes.js @@ -1,4 +1,4 @@ -import keyMirror from "keymirror"; +import keyMirror from 'keymirror'; export default keyMirror({ REQUEST_PROJECT_BOARD: null, diff --git a/app/assets/javascripts/actions/labels.js b/app/assets/javascripts/actions/labels.js index df99f848c..9201ff8a6 100644 --- a/app/assets/javascripts/actions/labels.js +++ b/app/assets/javascripts/actions/labels.js @@ -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)); +}; diff --git a/app/assets/javascripts/actions/note.js b/app/assets/javascripts/actions/note.js index 9c1aef494..e54a0310f 100644 --- a/app/assets/javascripts/actions/note.js +++ b/app/assets/javascripts/actions/note.js @@ -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)); } - } + }; diff --git a/app/assets/javascripts/actions/notifications.js b/app/assets/javascripts/actions/notifications.js index 01490c60b..4b3515310 100644 --- a/app/assets/javascripts/actions/notifications.js +++ b/app/assets/javascripts/actions/notifications.js @@ -1,21 +1,22 @@ 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)); @@ -23,26 +24,28 @@ export const sendSuccessNotification = (message) => 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; @@ -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' + ), }) ) ); @@ -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)); - } + }; diff --git a/app/assets/javascripts/actions/pastIterations.js b/app/assets/javascripts/actions/pastIterations.js index 223733899..795f15b2e 100644 --- a/app/assets/javascripts/actions/pastIterations.js +++ b/app/assets/javascripts/actions/pastIterations.js @@ -1,29 +1,30 @@ import actionTypes from './actionTypes'; -export const receivePastIterations = (pastIterations) => ({ +export const receivePastIterations = pastIterations => ({ type: actionTypes.RECEIVE_PAST_ITERATIONS, - data: pastIterations + data: pastIterations, }); export const requestPastStories = iterationNumber => ({ type: actionTypes.REQUEST_PAST_STORIES, - iterationNumber + iterationNumber, }); export const receivePastStories = (stories, iterationNumber, from) => ({ type: actionTypes.RECEIVE_PAST_STORIES, iterationNumber, stories, - from + from, }); export const errorRequestPastStories = (error, iterationNumber) => ({ type: actionTypes.ERROR_REQUEST_PAST_STORIES, iterationNumber, - error -}); + error, +}); -export const fetchPastStories = (iterationNumber, startDate, endDate) => +export const fetchPastStories = + (iterationNumber, startDate, endDate) => async (dispatch, getState, { PastIteration }) => { const { project } = getState(); diff --git a/app/assets/javascripts/actions/projectBoard.js b/app/assets/javascripts/actions/projectBoard.js index 5ac486c54..70ab38b0b 100644 --- a/app/assets/javascripts/actions/projectBoard.js +++ b/app/assets/javascripts/actions/projectBoard.js @@ -1,15 +1,15 @@ -import actionTypes from "./actionTypes"; -import { receiveUsers } from "./user"; -import { receiveStories, toggleStory } from "./story"; -import { receivePastIterations } from "./pastIterations"; -import { storyScopes } from "../libs/beta/constants"; -import { sendErrorNotification } from "./notifications"; +import actionTypes from './actionTypes'; +import { receiveUsers } from './user'; +import { receiveStories, toggleStory } from './story'; +import { receivePastIterations } from './pastIterations'; +import { storyScopes } from '../libs/beta/constants'; +import { sendErrorNotification } from './notifications'; const requestProjectBoard = () => ({ type: actionTypes.REQUEST_PROJECT_BOARD, }); -const receiveProjectBoard = (projectId) => ({ +const receiveProjectBoard = projectId => ({ type: actionTypes.RECEIVE_PROJECT_BOARD, data: projectId, }); @@ -18,12 +18,12 @@ export const closeSearchSuccess = () => ({ type: actionTypes.CLOSE_SEARCH, }); -const errorRequestProjectBoard = (error) => ({ +const errorRequestProjectBoard = error => ({ type: actionTypes.ERROR_REQUEST_PROJECT_BOARD, error: error, }); -const receiveProject = (data) => ({ +const receiveProject = data => ({ type: actionTypes.RECEIVE_PROJECT, data, }); @@ -38,27 +38,27 @@ export const updateStorySuccess = (story, from) => ({ from, }); -export const searchStoriesSuccess = (keyWord) => ({ +export const searchStoriesSuccess = keyWord => ({ type: actionTypes.SEARCH_STORIES_SUCCESS, keyWord, }); -export const updateLoadingSearch = (loading) => ({ +export const updateLoadingSearch = loading => ({ type: actionTypes.LOADING_SEARCH, loading, }); -export const toggleColumnVisibility = (column) => ({ +export const toggleColumnVisibility = column => ({ type: actionTypes.TOGGLE_COLUMN_VISIBILITY, column, }); export const expandStoryIfNeeded = (dispatch, getHash) => { - const storyId = getHash("#story-"); + const storyId = getHash('#story-'); if (storyId) { dispatch(toggleStory(parseInt(storyId))); - window.history.pushState("", "/", window.location.pathname); + window.history.pushState('', '/', window.location.pathname); } }; @@ -67,7 +67,7 @@ export const sendErrorNotificationIfNeeded = (dispatch, code, condition) => { }; export const toggleColumn = - (column) => + column => (dispatch, getState, { ProjectBoard }) => { const { projectBoard } = getState(); @@ -77,7 +77,7 @@ export const toggleColumn = }; export const fetchProjectBoard = - (projectId) => + projectId => async (dispatch, getState, { ProjectBoard, UrlService }) => { dispatch(requestProjectBoard()); @@ -97,7 +97,7 @@ export const fetchProjectBoard = } }; -export const closeSearch = () => (dispatch) => { +export const closeSearch = () => dispatch => { dispatch(closeSearchSuccess()); dispatch(receiveStories([], storyScopes.SEARCH)); }; @@ -107,19 +107,19 @@ export const search = (dispatch, _, { Search }) => { Search.searchStories(keyWord, projectId, { onStart: () => dispatch(updateLoadingSearch(true)), - onSuccess: (result) => { + onSuccess: result => { dispatch(updateLoadingSearch(false)); dispatch(searchStoriesSuccess(keyWord)); - dispatch(receiveStories(result, "search")); + dispatch(receiveStories(result, 'search')); sendErrorNotificationIfNeeded( dispatch, - "projects.stories_not_found", + 'projects.stories_not_found', !result.length ); }, - onError: (error) => { + onError: error => { dispatch( - sendErrorNotification("messages.operations.error.default_error", { + sendErrorNotification('messages.operations.error.default_error', { custom: true, }) ); diff --git a/app/assets/javascripts/actions/sprint.js b/app/assets/javascripts/actions/sprint.js index a356cfc49..18c935514 100644 --- a/app/assets/javascripts/actions/sprint.js +++ b/app/assets/javascripts/actions/sprint.js @@ -1,10 +1,10 @@ import actionTypes from './actionTypes'; -export const simulateSprintVelocity = (simulatedSprintVelocity) => ({ +export const simulateSprintVelocity = simulatedSprintVelocity => ({ type: actionTypes.SIMULATE_SPRINT_VELOCITY, - simulatedSprintVelocity -}) + simulatedSprintVelocity, +}); export const revertSprintVelocity = () => ({ - type: actionTypes.REVERT_TO_CALCULATED_VELOCITY -}) + type: actionTypes.REVERT_TO_CALCULATED_VELOCITY, +}); diff --git a/app/assets/javascripts/actions/story.js b/app/assets/javascripts/actions/story.js index 7300468a3..0cdc7080b 100644 --- a/app/assets/javascripts/actions/story.js +++ b/app/assets/javascripts/actions/story.js @@ -1,12 +1,12 @@ -import actionTypes from "./actionTypes"; +import actionTypes from './actionTypes'; import { sendSuccessNotification, sendErrorNotification, sendDefaultErrorNotification, -} from "./notifications"; -import { wait } from "../services/promises"; -import { storyScopes } from "../libs/beta/constants"; -import { storiesWithScope } from "../reducers/stories"; +} from './notifications'; +import { wait } from '../services/promises'; +import { storyScopes } from '../libs/beta/constants'; +import { storiesWithScope } from '../reducers/stories'; export const createStory = (attributes, from) => ({ type: actionTypes.CREATE_STORY, @@ -20,12 +20,12 @@ export const addStory = (story, from) => ({ from, }); -export const loadHistory = (title) => ({ +export const loadHistory = title => ({ type: actionTypes.LOAD_HISTORY, title, }); -export const receiveHistory = (activities) => ({ +export const receiveHistory = activities => ({ type: actionTypes.RECEIVE_HISTORY, activities, }); @@ -112,7 +112,7 @@ export const closeEpicColumn = () => ({ }); export const fetchEpic = - (label) => + label => async (dispatch, getState, { Story }) => { try { const { projectId } = getState().projectBoard; @@ -130,10 +130,10 @@ export const confirmBeforeSaveIfNeeded = async ( needConfirmation, callback ) => { - const confirmStoryChange = (story) => + const confirmStoryChange = story => confirm( - I18n.t("story.definitive_sure", { - action: I18n.t("story.change_to", { + I18n.t('story.definitive_sure', { + action: I18n.t('story.change_to', { state: I18n.t(`story.state.${story.state}`), }), }) @@ -190,26 +190,26 @@ export const updateCollapsedStory = dispatch( sendSuccessNotification( - I18n.t("messages.operations.success.story.save", { + I18n.t('messages.operations.success.story.save', { story: updatedStory.title, }) ) ); }, - onError: (error) => { + onError: error => { dispatch(sendErrorNotification(error)); dispatch(storyFailure(story.id, error, from)); }, onCanceled: () => { dispatch( - sendErrorNotification("messages.operations.cancel.default_cancel", { + sendErrorNotification('messages.operations.cancel.default_cancel', { custom: true, }) ); dispatch( storyFailure( story.id, - I18n.t("messages.operations.cancel.default_cancel"), + I18n.t('messages.operations.cancel.default_cancel'), from ) ); @@ -262,27 +262,27 @@ export const saveStory = ); dispatch( sendSuccessNotification( - I18n.t("messages.operations.success.story.create", { + I18n.t('messages.operations.success.story.create', { story: story._editing.title, }) ) ); }, - onError: (error) => { + onError: error => { dispatch(sendErrorNotification(error)); dispatch(storyFailure(story.id, error, from)); }, onCanceled: () => { dispatch( sendErrorNotification( - "messages.operations.cancel.default_cancel", + 'messages.operations.cancel.default_cancel', { custom: true } ) ); dispatch( storyFailure( story.id, - I18n.t("messages.operations.cancel.default_cancel"), + I18n.t('messages.operations.cancel.default_cancel'), from ) ); @@ -307,27 +307,27 @@ export const saveStory = dispatch(updateStorySuccess(updatedStory, from)); dispatch( sendSuccessNotification( - I18n.t("messages.operations.success.story.save", { + I18n.t('messages.operations.success.story.save', { story: updatedStory.title, }) ) ); }, - onError: (error) => { + onError: error => { dispatch(sendErrorNotification(error)); dispatch(storyFailure(story.id, error, from)); }, onCanceled: () => { dispatch( sendErrorNotification( - "messages.operations.cancel.default_cancel", + 'messages.operations.cancel.default_cancel', { custom: true } ) ); dispatch( storyFailure( story.id, - I18n.t("messages.operations.cancel.default_cancel"), + I18n.t('messages.operations.cancel.default_cancel'), from ) ); @@ -357,7 +357,7 @@ export const deleteStory = return dispatch( sendSuccessNotification( - I18n.t("messages.operations.success.story.delete", { + I18n.t('messages.operations.success.story.delete', { story: storyTitle, }) ) @@ -368,7 +368,7 @@ export const deleteStory = } }; -export const highlight = (storyId) => (dispatch) => { +export const highlight = storyId => dispatch => { dispatch(updateHighlight(storyId, true)); setTimeout(() => dispatch(updateHighlight(storyId, false)), 400); }; diff --git a/app/assets/javascripts/actions/task.js b/app/assets/javascripts/actions/task.js index b371ab7e7..dc61ad8d7 100644 --- a/app/assets/javascripts/actions/task.js +++ b/app/assets/javascripts/actions/task.js @@ -4,54 +4,59 @@ import { setLoadingStory, storyFailure } from './story'; export const createTaskSuccess = (task, storyId) => ({ type: actionTypes.ADD_TASK, task, - storyId + storyId, }); export const deleteTaskSuccess = (task, storyId) => ({ type: actionTypes.REMOVE_TASK, task, - storyId + storyId, }); export const toggleTaskSuccess = (task, story) => ({ type: actionTypes.TOGGLE_TASK, task, - story + story, }); -export const createTask = (projectId, storyId, task) => +export const createTask = + (projectId, storyId, task) => async (dispatch, getState, { Task }) => { dispatch(setLoadingStory(storyId)); try { const newTask = await Task.post(projectId, storyId, task); return dispatch(createTaskSuccess(newTask, storyId)); - } - catch (error) { + } catch (error) { return dispatch(storyFailure(storyId, error)); } }; -export const deleteTask = (projectId, storyId, taskId) => +export const deleteTask = + (projectId, storyId, taskId) => async (dispatch, getState, { Task }) => { dispatch(setLoadingStory(storyId)); try { await Task.destroy(projectId, storyId, taskId); return dispatch(deleteTaskSuccess(taskId, storyId)); - } - catch (error) { + } catch (error) { return dispatch(storyFailure(storyId, error)); } }; -export const toggleTask = (projectId, story, task, status) => +export const toggleTask = + (projectId, story, task, status) => async (dispatch, getState, { Task }) => { try { - const updatedTask = await Task.toggle(projectId, story.id, task.id, status); + const updatedTask = await Task.toggle( + projectId, + story.id, + task.id, + status + ); return dispatch(toggleTaskSuccess(updatedTask, story)); - } - catch (error) { + } catch (error) { return dispatch(storyFailure(storyId, error)); } }; diff --git a/app/assets/javascripts/actions/user.js b/app/assets/javascripts/actions/user.js index e6dacfb16..7c855a454 100644 --- a/app/assets/javascripts/actions/user.js +++ b/app/assets/javascripts/actions/user.js @@ -1,6 +1,6 @@ import actionTypes from './actionTypes'; -export const receiveUsers = (users) => ({ +export const receiveUsers = users => ({ type: actionTypes.RECEIVE_USERS, - data: users + data: users, }); diff --git a/app/assets/javascripts/central.js b/app/assets/javascripts/central.js index 7bab01371..e8c8339bc 100644 --- a/app/assets/javascripts/central.js +++ b/app/assets/javascripts/central.js @@ -16,10 +16,16 @@ const Central = () => { data.project.current_flow = data.currentFlow; data.project.default_flow = data.defaultFlow; - var project = new Project(data.project); - var view = new ProjectView({ model: project, el: $('#project-stories') }); - var search = new ProjectSearchView({ model: project, el: $('#form_search') }); - var velocity = new ProjectVelocityView({ model: project, el: $('#velocity') }); + var project = new Project(data.project); + var view = new ProjectView({ model: project, el: $('#project-stories') }); + var search = new ProjectSearchView({ + model: project, + el: $('#form_search'), + }); + var velocity = new ProjectVelocityView({ + model: project, + el: $('#velocity'), + }); var title = document.title; project.users.reset(data.users); @@ -34,8 +40,7 @@ const Central = () => { }); document.addEventListener('visibilitychange', () => { - if (!document.hidden) - TabNotification.changeTitle(title, document.hidden); + if (!document.hidden) TabNotification.changeTitle(title, document.hidden); }); $(window).resize(view.scaleToViewport); @@ -51,6 +56,6 @@ const Central = () => { const tourController = new TourController(); tourController.initialize(); }, 200); -} +}; export default Central; diff --git a/app/assets/javascripts/collections/activity_collection.js b/app/assets/javascripts/collections/activity_collection.js index ba88d3980..51768f235 100644 --- a/app/assets/javascripts/collections/activity_collection.js +++ b/app/assets/javascripts/collections/activity_collection.js @@ -3,13 +3,13 @@ import Activity from '../models/activity'; const ActivityCollection = Backbone.Collection.extend({ model: Activity, - comparator: function(activity) { + comparator: function (activity) { return -new Date(activity.attributes.updated_at).getTime(); }, - url: function() { + url: function () { return this.story.url() + '/activities'; - } + }, }); export default ActivityCollection; diff --git a/app/assets/javascripts/collections/note_collection.js b/app/assets/javascripts/collections/note_collection.js index 3a5e7b922..f10287e08 100644 --- a/app/assets/javascripts/collections/note_collection.js +++ b/app/assets/javascripts/collections/note_collection.js @@ -3,15 +3,15 @@ import Note from '../models/note'; const NoteCollection = Backbone.Collection.extend({ model: Note, - url: function() { + url: function () { return this.story.url() + '/notes'; }, - saved: function() { - return this.reject(function(note) { + saved: function () { + return this.reject(function (note) { return note.isNew(); }); - } + }, }); export default NoteCollection; diff --git a/app/assets/javascripts/collections/project_collection.js b/app/assets/javascripts/collections/project_collection.js index fe224d9c9..23f8bfc27 100644 --- a/app/assets/javascripts/collections/project_collection.js +++ b/app/assets/javascripts/collections/project_collection.js @@ -1,26 +1,26 @@ -import Project from "models/project"; +import Project from 'models/project'; const ProjectCollection = Backbone.Collection.extend({ model: Project, - url: "/projects", + url: '/projects', archived() { return new this.constructor( - this.filter((project) => project.get("archived_at")) + this.filter(project => project.get('archived_at')) ); }, notArchived() { return new this.constructor( - this.filter((project) => !project.get("archived_at")) + this.filter(project => !project.get('archived_at')) ); }, nameContains(name) { return new this.constructor( this.filter( - (project) => - project.get("name").toLowerCase().indexOf(name.toLowerCase()) !== -1 + project => + project.get('name').toLowerCase().indexOf(name.toLowerCase()) !== -1 ) ); }, diff --git a/app/assets/javascripts/collections/story_collection.js b/app/assets/javascripts/collections/story_collection.js index 828d67b48..a4fa842d3 100644 --- a/app/assets/javascripts/collections/story_collection.js +++ b/app/assets/javascripts/collections/story_collection.js @@ -3,7 +3,7 @@ import Story from '../models/story'; const StoryCollection = Backbone.Collection.extend({ model: Story, - initialize: function() { + initialize: function () { _.bindAll(this, 'sort', 'addLabelsFromStory', 'resetLabels'); var triggerReset = _.bind(this.trigger, this, 'reset'); @@ -18,60 +18,58 @@ const StoryCollection = Backbone.Collection.extend({ this.labels = []; }, - saveSorting: function(columnName) { + saveSorting: function (columnName) { var column = this; - if(columnName) { + if (columnName) { column = this.column(columnName); } - var orderedIds = column.map( - function(model) { - return model.id; - } - ); + var orderedIds = column.map(function (model) { + return model.id; + }); Backbone.ajax({ method: 'PUT', url: this.url + '/sort', - data: { ordered_ids: orderedIds } + data: { ordered_ids: orderedIds }, }); }, - comparator: function(story) { + comparator: function (story) { return story.position(); }, - columnStoryIndex: function(story) { + columnStoryIndex: function (story) { return this.column(story.column).indexOf(story); }, - nextOnColumn: function(story) { - var index = this.columnStoryIndex(story) + 1; + nextOnColumn: function (story) { + var index = this.columnStoryIndex(story) + 1; return this.storyByIndexOnColumn(index, story.column); }, - previousOnColumn: function(story) { + previousOnColumn: function (story) { var index = this.columnStoryIndex(story) - 1; return this.storyByIndexOnColumn(index, story.column); }, - storyByIndexOnColumn: function(index, column) { - if(index >= this.length || index < 0) { + storyByIndexOnColumn: function (index, column) { + if (index >= this.length || index < 0) { return undefined; } return this.column(column)[index]; }, - previous: function(story) { + previous: function (story) { var index = this.indexOf(story) - 1; return this.storyByIndex(index); }, - next: function(story) { + next: function (story) { var index = this.indexOf(story) + 1; return this.storyByIndex(index); }, - storyByIndex: function(index) { - if(index < 0 || index >= this.length) { + storyByIndex: function (index) { + if (index < 0 || index >= this.length) { return undefined; } return this.at(index); @@ -79,37 +77,39 @@ const StoryCollection = Backbone.Collection.extend({ // Returns all the stories in the named column, either #done, #in_progress, // #backlog or #chilly_bin - column: function(column) { - return this.select(function(story) { + column: function (column) { + return this.select(function (story) { return story.column === column; }); }, // Returns an array of the stories in a set of columns. Pass an array // of the column names accepted by column(). - columns: function(columns) { + columns: function (columns) { var that = this; - return _.flatten(_.map(columns, function(column) { - return that.column(column); - })); + return _.flatten( + _.map(columns, function (column) { + return that.column(column); + }) + ); }, // Takes comma separated string of labels and adds them to the list of // availableLabels. Any that are already present are ignored. - addLabels: function(labels) { - return (this.labels = _.union(this.labels,labels)); + addLabels: function (labels) { + return (this.labels = _.union(this.labels, labels)); }, - addLabelsFromStory: function(story) { + addLabelsFromStory: function (story) { return this.addLabels(story.labels()); }, - resetLabels: function() { + resetLabels: function () { var collection = this; - collection.each(function(story) { + collection.each(function (story) { collection.addLabelsFromStory(story); }); - } + }, }); export default StoryCollection; diff --git a/app/assets/javascripts/collections/task_collection.js b/app/assets/javascripts/collections/task_collection.js index 6f2cb36e9..464777605 100644 --- a/app/assets/javascripts/collections/task_collection.js +++ b/app/assets/javascripts/collections/task_collection.js @@ -3,15 +3,15 @@ import Task from '../models/task'; const TaskCollection = Backbone.Collection.extend({ model: Task, - url: function() { + url: function () { return this.story.url() + '/tasks'; }, - saved: function() { - return this.reject(function(task) { + saved: function () { + return this.reject(function (task) { return task.isNew(); }); - } + }, }); export default TaskCollection; diff --git a/app/assets/javascripts/collections/user_collection.js b/app/assets/javascripts/collections/user_collection.js index bbeb0b842..cdc876f1b 100644 --- a/app/assets/javascripts/collections/user_collection.js +++ b/app/assets/javascripts/collections/user_collection.js @@ -3,15 +3,15 @@ import User from '../models/user'; const UserCollection = Backbone.Collection.extend({ model: User, - comparator: function(user) { + comparator: function (user) { return user.get('name'); }, - forSelect: function() { - return this.sort().map(function(user) { - return [user.get('name'),user.id]; + forSelect: function () { + return this.sort().map(function (user) { + return [user.get('name'), user.id]; }); - } + }, }); export default UserCollection; diff --git a/app/assets/javascripts/components/Columns/ColumnItem.jsx b/app/assets/javascripts/components/Columns/ColumnItem.jsx index b4c3ad2fe..961feec5b 100644 --- a/app/assets/javascripts/components/Columns/ColumnItem.jsx +++ b/app/assets/javascripts/components/Columns/ColumnItem.jsx @@ -3,37 +3,54 @@ import PropTypes from 'prop-types'; import { Droppable } from 'react-beautiful-dnd'; import { isDone } from '../../models/beta/column'; -export const Column = ({ title, children, renderAction, onClose, canClose, providedProps }) => ( +export const Column = ({ + title, + children, + renderAction, + onClose, + canClose, + providedProps, +}) => (

{title}

- { renderAction() } - { - canClose && ( - - ) - } + {renderAction()} + {canClose && ( + + )}
- { children } + {children}
); -const DroppableColumn = ({ title, children, renderAction, onClose, visible, canClose, columnId }) => ( +const DroppableColumn = ({ + title, + children, + renderAction, + onClose, + visible, + canClose, + columnId, +}) => visible && ( - + {provided => ( )} - ) -) + ); Column.propTypes = { title: PropTypes.string.isRequired, @@ -64,7 +80,7 @@ Column.defaultProps = { renderAction: () => null, visible: true, children: '', - providedProps: {} -} + providedProps: {}, +}; export default DroppableColumn; diff --git a/app/assets/javascripts/components/Columns/EpicColumn.jsx b/app/assets/javascripts/components/Columns/EpicColumn.jsx index 52e549235..601e1866a 100644 --- a/app/assets/javascripts/components/Columns/EpicColumn.jsx +++ b/app/assets/javascripts/components/Columns/EpicColumn.jsx @@ -1,19 +1,26 @@ import React from 'react'; import Column from './ColumnItem'; import Stories from '../stories/Stories'; -import PropTypes from "prop-types"; +import PropTypes from 'prop-types'; import StoryPropTypes from '../shapes/story'; -import { totalPoints, donePoints, remainingPoints } from '../../models/beta/story'; +import { + totalPoints, + donePoints, + remainingPoints, +} from '../../models/beta/story'; import { EPIC } from '../../models/beta/column'; import { closeEpicColumn } from '../../actions/story'; -import { connect } from "react-redux"; +import { connect } from 'react-redux'; -export const EpicColumnHeader = ({ stories }) => +export const EpicColumnHeader = ({ stories }) => (
- {I18n.t('projects.show.done')}: { donePoints(stories) } / {I18n.t('remaining')}: { remainingPoints(stories) } - - {I18n.t('projects.reports.points')}: { totalPoints(stories) } + {I18n.t('projects.show.done')}: {donePoints(stories)} /{' '} + {I18n.t('remaining')}: {remainingPoints(stories)} + + {I18n.t('projects.reports.points')}: {totalPoints(stories)} +
+); const EpicColumn = ({ stories, closeEpicColumn }) => ( ( visible >
- +
@@ -35,18 +40,15 @@ const EpicColumn = ({ stories, closeEpicColumn }) => ( EpicColumn.propTypes = { closeEpicColumn: PropTypes.func.isRequired, - stories: PropTypes.arrayOf(StoryPropTypes) -} + stories: PropTypes.arrayOf(StoryPropTypes), +}; EpicColumn.defaultProps = { - stories: [] -} + stories: [], +}; const mapDispatchToProps = { - closeEpicColumn + closeEpicColumn, }; -export default connect( - null, - mapDispatchToProps -)(EpicColumn); +export default connect(null, mapDispatchToProps)(EpicColumn); diff --git a/app/assets/javascripts/components/Columns/index.jsx b/app/assets/javascripts/components/Columns/index.jsx index d65043e35..e7e3a5aa3 100644 --- a/app/assets/javascripts/components/Columns/index.jsx +++ b/app/assets/javascripts/components/Columns/index.jsx @@ -1,11 +1,11 @@ -import React from "react"; -import Column from "./ColumnItem"; -import PropTypes from "prop-types"; -import Stories from "../stories/Stories"; -import Sprints from "../stories/Sprints"; -import AddStoryButton from "../story/AddStoryButton"; +import React from 'react'; +import Column from './ColumnItem'; +import PropTypes from 'prop-types'; +import Stories from '../stories/Stories'; +import Sprints from '../stories/Sprints'; +import AddStoryButton from '../story/AddStoryButton'; import { order } from '../../models/beta/column'; -import { status } from "../../libs/beta/constants"; +import { status } from '../../libs/beta/constants'; const Columns = ({ canClose, @@ -16,16 +16,16 @@ const Columns = ({ toggleColumn, createStory, visibleColumns, - reverse + reverse, }) => { const columns = [ { - title: I18n.t("projects.show.chilly_bin"), + title: I18n.t('projects.show.chilly_bin'), renderAction: () => ( createStory({ - state: status.UNSCHEDULED + state: status.UNSCHEDULED, }) } /> @@ -38,32 +38,27 @@ const Columns = ({ /> ), visible: visibleColumns.chillyBin, - onClose: () => toggleColumn("chillyBin") + onClose: () => toggleColumn('chillyBin'), }, { - title: `${I18n.t("projects.show.backlog")} / ${I18n.t( - "projects.show.in_progress" + title: `${I18n.t('projects.show.backlog')} / ${I18n.t( + 'projects.show.in_progress' )}`, renderAction: () => ( createStory({ - state: status.UNSTARTED + state: status.UNSTARTED, }) } /> ), - children: ( - - ), + children: , visible: visibleColumns.backlog, - onClose: () => toggleColumn("backlog") + onClose: () => toggleColumn('backlog'), }, { - title: I18n.t("projects.show.done"), + title: I18n.t('projects.show.done'), children: ( ), visible: visibleColumns.done, - onClose: () => toggleColumn("done") - } + onClose: () => toggleColumn('done'), + }, ]; return order(columns, reverse).map(column => ( @@ -99,7 +94,7 @@ Columns.propTypes = { toggleColumn: PropTypes.func.isRequired, createStory: PropTypes.func.isRequired, visibleColumns: PropTypes.object.isRequired, - reverse: PropTypes.bool.isRequired + reverse: PropTypes.bool.isRequired, }; export default Columns; diff --git a/app/assets/javascripts/components/Markdown.jsx b/app/assets/javascripts/components/Markdown.jsx index f99ecd742..428335575 100644 --- a/app/assets/javascripts/components/Markdown.jsx +++ b/app/assets/javascripts/components/Markdown.jsx @@ -8,16 +8,14 @@ const Markdown = ({ source }) => { const descriptionHTML = window.md.makeHtml(source); const descriptionComponent = Parser(descriptionHTML); - return ( -
{ descriptionComponent }
- ); + return
{descriptionComponent}
; } return null; -} +}; Markdown.propTypes = { - source: PropTypes.string + source: PropTypes.string, }; const MemoizedMarkdown = memoize(Markdown); diff --git a/app/assets/javascripts/components/Notifications/Message.jsx b/app/assets/javascripts/components/Notifications/Message.jsx index 4920a0186..467222a0e 100644 --- a/app/assets/javascripts/components/Notifications/Message.jsx +++ b/app/assets/javascripts/components/Notifications/Message.jsx @@ -17,14 +17,14 @@ const Message = ({ type, className, message, onRemove }) => {
- ) + ); }; Message.propTypes = { type: PropTypes.string, className: PropTypes.string, message: PropTypes.string.isRequired, - onRemove: PropTypes.func.isRequired + onRemove: PropTypes.func.isRequired, }; export default Message; diff --git a/app/assets/javascripts/components/Notifications/index.jsx b/app/assets/javascripts/components/Notifications/index.jsx index 213e16f00..8ef535a00 100644 --- a/app/assets/javascripts/components/Notifications/index.jsx +++ b/app/assets/javascripts/components/Notifications/index.jsx @@ -2,24 +2,23 @@ import React from 'react'; import Message from './Message'; import PropTypes from 'prop-types'; -const Notifications = ({ notifications, onRemove }) => +const Notifications = ({ notifications, onRemove }) => (
- { - notifications.map((notification) => - onRemove(notification.id)} - key={notification.id} - /> - ) - } + {notifications.map(notification => ( + onRemove(notification.id)} + key={notification.id} + /> + ))}
+); Notifications.propTypes = { notifications: PropTypes.array.isRequired, - onRemove: PropTypes.func.isRequired -} + onRemove: PropTypes.func.isRequired, +}; export default Notifications; diff --git a/app/assets/javascripts/components/description/DescriptionContent.jsx b/app/assets/javascripts/components/description/DescriptionContent.jsx index 1c4cafa8d..92d519235 100644 --- a/app/assets/javascripts/components/description/DescriptionContent.jsx +++ b/app/assets/javascripts/components/description/DescriptionContent.jsx @@ -5,7 +5,7 @@ import memoize from 'memoizee'; import StoryLink from 'components/stories/StoryLink'; const editButton = isReadonly => { - return( + return ( { type="button" /> ); -} +}; const replaceStoryLink = (domNode, linkedStories) => { if (!domNode.attribs || !domNode.attribs['data-story-id']) return; const id = domNode.attribs['data-story-id']; const story = linkedStories[id]; - return( ); -} + return ; +}; -const DescriptionContent = ({ description, isReadonly, linkedStories, onClick }) => { +const DescriptionContent = ({ + description, + isReadonly, + linkedStories, + onClick, +}) => { const descriptionHTML = window.md.makeHtml(description); const isEmpty = !description || !description.length; - description = Parser(descriptionHTML, { replace: domNode => - replaceStoryLink(domNode, linkedStories) + description = Parser(descriptionHTML, { + replace: domNode => replaceStoryLink(domNode, linkedStories), }); - return( - isEmpty ? editButton(isReadonly) :
{ description }
+ return isEmpty ? ( + editButton(isReadonly) + ) : ( +
{description}
); -} +}; export default memoize(DescriptionContent); diff --git a/app/assets/javascripts/components/forms/AsyncForm.js b/app/assets/javascripts/components/forms/AsyncForm.js index b15c872df..66ea0e7d1 100644 --- a/app/assets/javascripts/components/forms/AsyncForm.js +++ b/app/assets/javascripts/components/forms/AsyncForm.js @@ -18,7 +18,7 @@ class AsyncForm extends React.Component { render() { return this.props.children({ loading: this.state.loading, - handleSubmit: this._handleSubmit + handleSubmit: this._handleSubmit, }); } } diff --git a/app/assets/javascripts/components/forms/Checkbox.jsx b/app/assets/javascripts/components/forms/Checkbox.jsx index d62190725..7f443201c 100644 --- a/app/assets/javascripts/components/forms/Checkbox.jsx +++ b/app/assets/javascripts/components/forms/Checkbox.jsx @@ -1,16 +1,17 @@ import React from 'react'; -const Checkbox = ({ name, onChange, checked, disabled, children, label }) => +const Checkbox = ({ name, onChange, checked, disabled, children, label }) => ( +); export default Checkbox; diff --git a/app/assets/javascripts/components/jquery_wrappers/AtWhoInput.jsx b/app/assets/javascripts/components/jquery_wrappers/AtWhoInput.jsx index 008d51604..862f5801c 100644 --- a/app/assets/javascripts/components/jquery_wrappers/AtWhoInput.jsx +++ b/app/assets/javascripts/components/jquery_wrappers/AtWhoInput.jsx @@ -3,7 +3,9 @@ import React from 'react'; class AtWhoInput extends React.Component { constructor(props) { super(props); - this.saveTextareaRef = (textarea) => { this.textarea = textarea }; + this.saveTextareaRef = textarea => { + this.textarea = textarea; + }; } componentDidMount() { @@ -11,16 +13,18 @@ class AtWhoInput extends React.Component { } loadAtWho() { - $(this.textarea).atwho({ - at: "@", - data: this.props.usernames - }).on('inserted.atwho', this.props.onChange); + $(this.textarea) + .atwho({ + at: '@', + data: this.props.usernames, + }) + .on('inserted.atwho', this.props.onChange); } render() { return (