Merge branch 'error-message' into 'master'

add error message

See merge request mohit.panjvani/crater-web!1424
This commit is contained in:
Mohit Panjwani
2022-01-13 11:52:23 +00:00
4 changed files with 22 additions and 5 deletions

View File

@ -89,7 +89,7 @@ class PaymentMethodsController extends Controller
} }
if ($paymentMethod->expenses()->exists()) { if ($paymentMethod->expenses()->exists()) {
return respondJson('payments_attached', 'Expenses Attached.'); return respondJson('expenses_attached', 'Expenses Attached.');
} }
$paymentMethod->delete(); $paymentMethod->delete();

View File

@ -861,9 +861,21 @@ async function installModule() {
} }
if (!requestResponse.data.success) { if (!requestResponse.data.success) {
let displayMsg = ref('')
if (
requestResponse.data.message === 'crater_version_is_not_supported'
) {
displayMsg.value = t('modules.version_not_supported', {
version: requestResponse.data.min_crater_version,
})
} else {
displayMsg.value = getErrorMessage(requestResponse.data.message)
}
notificationStore.showNotification({ notificationStore.showNotification({
type: 'error', type: 'error',
message: getErrorMessage(requestResponse.data.message), message: displayMsg.value,
}) })
isInstalling.value = false isInstalling.value = false

View File

@ -62,7 +62,11 @@ export const showError = (error) => {
break break
case 'payments_attached': case 'payments_attached':
showToaster('settings.payment_modes.already_in_use') showToaster('settings.payment_modes.payments_attached')
break
case 'expenses_attached':
showToaster('settings.payment_modes.expenses_attached')
break break
case 'role_attached_to_users': case 'role_attached_to_users':

View File

@ -686,7 +686,7 @@
"no_reviews_found": "There are no reviews for this module yet!", "no_reviews_found": "There are no reviews for this module yet!",
"module_not_purchased": "Module Not Purchased", "module_not_purchased": "Module Not Purchased",
"module_not_found": "Module Not Found", "module_not_found": "Module Not Found",
"version_not_supported": "This module version doesn't support the current version of Crater", "version_not_supported": "The minimum required version for this module does not match. Please upgrade your crater app to version: {version} to proceed.",
"last_updated": "Last Updated On", "last_updated": "Last Updated On",
"connect_installation": "Connect your installation", "connect_installation": "Connect your installation",
"api_token_description": "Login to {url} and connect this installation by entering the API Token. Your purchased modules will show up here after the connection is established.", "api_token_description": "Login to {url} and connect this installation by entering the API Token. Your purchased modules will show up here after the connection is established.",
@ -1146,7 +1146,8 @@
"payment_mode_added": "Payment Mode Added", "payment_mode_added": "Payment Mode Added",
"payment_mode_updated": "Payment Mode Updated", "payment_mode_updated": "Payment Mode Updated",
"payment_mode_confirm_delete": "You will not be able to recover this Payment Mode", "payment_mode_confirm_delete": "You will not be able to recover this Payment Mode",
"already_in_use": "Payment Mode is already in use", "payments_attached": "This payment method is already attached to payments. Please delete the attached payments to proceed with deletion.",
"expenses_attached": "This payment method is already attached to expenses. Please delete the attached expenses to proceed with deletion.",
"deleted_message": "Payment Mode deleted successfully" "deleted_message": "Payment Mode deleted successfully"
}, },
"expense_category": { "expense_category": {