Skip to content

Commit

Permalink
getting the missing strings for notification for issue creation and s…
Browse files Browse the repository at this point in the history
…end solution
  • Loading branch information
alexanmtz committed Sep 19, 2024
1 parent 78fcaff commit ba823f5
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 8 deletions.
21 changes: 21 additions & 0 deletions frontend/src/actions/messages/messages.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineMessages } from 'react-intl'
import notification from '../../containers/notification'

const messages = defineMessages({
noDefined: {
Expand Down Expand Up @@ -161,6 +162,26 @@ const messages = defineMessages({
id: 'issue.solution.dialog.create.success',
defaultMessage: 'The solution for this issue was created successfully'
},
notificationTaskSolutionCreateNotificationError: {
id: 'issue.solution.dialog.get.error',
defaultMessage: 'We could not get the task solution'
},
notificationTaskSolutionCouldNotUpdate: {
id: 'issue.solution.dialog.update.error',
defaultMessage: 'We could not update the task solution'
},
notificationTaskSolutionCouldNotCreate: {
id: 'issue.solution.dialog.create.error',
defaultMessage: 'We could not create the task solution'
},
notificationCouldNotGetPullRequestData: {
id: 'issue.solution.dialog.fetch.error',
defaultMessage: 'We could not get the pull request data'
},
notificationPullRequestNotFound: {
id: 'issue.solution.dialog.pullRequest.notFound',
defaultMessage: 'Pull request not found'
},
notificationTaskSoluctionUpdateNotificationSuccess: {
id: 'issue.solution.dialog.update.success',
defaultMessage: 'The solution for this issue was updated successfully'
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/actions/taskActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const createTask = (task, history) => {
return dispatch(createTaskError(JSON.parse(response.data.error)))
}
dispatch(createTaskSuccess())
dispatch(addNotification('actions.task.create.notification.success'))
dispatch(addNotification('actions.issue.import.notification.success'))
history.push(`/task/${response.data.id}`)
return dispatch(fetchTask(response.data.id))
})
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/actions/taskSolutionActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ const UPDATE_TASK_SOLUTION_ERROR = 'UPDATE_TASK_SOLUTION_ERROR'
const CLEAN_PULL_REQUEST_DATA_STATE = 'CLEAN_PULL_REQUEST_DATA_STATE'

const ERRORS = {
'COULD_NOT_GET_TASK_SOLUTION': 'task.solution.dialog.get.error',
'COULD_NOT_UPDATE_TASK_SOLUTION': 'task.solution.dialog.update.error',
'COULD_NOT_CREATE_TASK_SOLUTION': 'task.solution.dialog.create.error',
'COULD_NOT_FETCH_PULL_REQUEST_DATA': 'task.solution.dialog.fetch.error',
'PULL_REQUEST_NOT_FOUND': 'task.solution.dialog.pullRequest.notFound'
'COULD_NOT_GET_TASK_SOLUTION': 'issue.solution.dialog.get.error',
'COULD_NOT_UPDATE_TASK_SOLUTION': 'issue.solution.dialog.update.error',
'COULD_NOT_CREATE_TASK_SOLUTION': 'issue.solution.dialog.create.error',
'COULD_NOT_FETCH_PULL_REQUEST_DATA': 'issue.solution.dialog.fetch.error',
'PULL_REQUEST_NOT_FOUND': 'issue.solution.dialog.pullRequest.notFound'
}

const getTaskSolutionRequested = () => {
Expand Down Expand Up @@ -110,7 +110,7 @@ const createTaskSolution = (taskSolution) => {
return dispatch => {
dispatch(createTaskSolutionRequested())
return axios.post(`${api.API_URL}/tasksolutions/create`, taskSolution).then(response => {
dispatch(addNotification('task.solution.dialog.create.success'))
dispatch(addNotification('issue.solution.dialog.create.success'))
dispatch(fetchTask(taskSolution.taskId))
return dispatch(createTaskSolutionSuccess(response.data))
}).catch(error => {
Expand Down Expand Up @@ -142,7 +142,7 @@ const updateTaskSolution = ({ taskSolutionId, pullRequestURL, userId, taskId })
return dispatch => {
dispatch(updateTaskSolutionRequested())
return axios.patch(`${api.API_URL}/tasksolutions/${taskSolutionId}`, { pullRequestURL: pullRequestURL, userId: userId, taskId: taskId }).then(response => {
dispatch(addNotification('task.solution.dialog.update.success'))
dispatch(addNotification('issue.solution.dialog.update.success'))
dispatch(fetchTask(taskId))
return dispatch(updateTaskSolutionSuccess(response.data))
}).catch(error => {
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/translations/generated/br.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,12 @@
"issue.payment.invoice.info.action": "",
"issue.payment.invoice.info.description": "",
"issue.payment.invoice.info.title": "",
"issue.solution.dialog.create.error": "",
"issue.solution.dialog.create.success": "",
"issue.solution.dialog.fetch.error": "",
"issue.solution.dialog.get.error": "",
"issue.solution.dialog.pullRequest.notFound": "",
"issue.solution.dialog.update.error": "",
"issue.solution.dialog.update.success": "",
"issues.description": "",
"issues.title": "",
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/translations/generated/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,12 @@
"issue.payment.invoice.info.action": "Update billing information before continue",
"issue.payment.invoice.info.description": "To update your billing information, please fill in or update your details in the Billing Information section of your account settings. This information will be used to generate your invoice",
"issue.payment.invoice.info.title": "Billing information on your invoice",
"issue.solution.dialog.create.error": "We could not create the task solution",
"issue.solution.dialog.create.success": "The solution for this issue was created successfully",
"issue.solution.dialog.fetch.error": "We could not get the pull request data",
"issue.solution.dialog.get.error": "We could not get the task solution",
"issue.solution.dialog.pullRequest.notFound": "Pull request not found",
"issue.solution.dialog.update.error": "We could not update the task solution",
"issue.solution.dialog.update.success": "The solution for this issue was updated successfully",
"issues.description": "Here you can see all the issues on our network, issues imported or you're working on.",
"issues.title": "Issues",
Expand Down

0 comments on commit ba823f5

Please sign in to comment.