MT#61580 Review all the console in CSC repo

Review all instances of the console object (such as console.info, console.error, console.warn ...)
in the CSC repository

Change-Id: I360164516748cc7412c1fa2023db3445f01f53ac
mr13.3
nidrissi-zouggari 3 months ago
parent b6445fbf18
commit 61ffb5a1ed

@ -115,9 +115,6 @@ export default {
hDateset = kamailioDatesetToHuman(this.timeSet.times) hDateset = kamailioDatesetToHuman(this.timeSet.times)
} catch (e) { } catch (e) {
this.invalidDateset = true this.invalidDateset = true
// eslint-disable-next-line no-console
console.info(e)
return
} }
if (hDateset.length === 0) { if (hDateset.length === 0) {
this.selectedDate = null this.selectedDate = null

@ -321,9 +321,6 @@ export default {
} catch (e) { } catch (e) {
this.reset() this.reset()
this.invalidTimeset = true this.invalidTimeset = true
// eslint-disable-next-line no-console
console.info(e)
return
} }
if (humanTimeRanges.length === 0) { if (humanTimeRanges.length === 0) {

@ -186,7 +186,7 @@
"Enable regex matching for \\\"Received from IP\\\" and \\\"Destination\\\" fields.": "Enable regex matching for \\\"Received from IP\\\" and \\\"Destination\\\" fields.", "Enable regex matching for \\\"Received from IP\\\" and \\\"Destination\\\" fields.": "Enable regex matching for \\\"Received from IP\\\" and \\\"Destination\\\" fields.",
"Enable strict mode that requires all mail2fax emails to have the secret key as the very first line of the email + an empty line. The key is removed from the email once matched.": "Activez le mode strict qui exige que tous les e-mails de mail2fax aient la clé secrète comme toute première ligne de l'e-mail + une ligne vide. La clé est supprimée de l'e-mail une fois qu'elle a été trouvée.", "Enable strict mode that requires all mail2fax emails to have the secret key as the very first line of the email + an empty line. The key is removed from the email once matched.": "Activez le mode strict qui exige que tous les e-mails de mail2fax aient la clé secrète comme toute première ligne de l'e-mail + une ligne vide. La clé est supprimée de l'e-mail une fois qu'elle a été trouvée.",
"End time": "Date de fin", "End time": "Date de fin",
"English": "Français", "English": "Anglais",
"Enter a number to dial": "Enter a number to dial", "Enter a number to dial": "Enter a number to dial",
"Entity belongs to admin": "Cette entité appartient à ladministrateur", "Entity belongs to admin": "Cette entité appartient à ladministrateur",
"Expires": "Expire", "Expires": "Expire",

@ -69,6 +69,7 @@
<script> <script>
import useValidate from '@vuelidate/core' import useValidate from '@vuelidate/core'
import CscPageSticky from 'components/CscPageSticky' import CscPageSticky from 'components/CscPageSticky'
import { showGlobalError } from 'src/helpers/ui'
import { mapWaitingActions } from 'vue-wait' import { mapWaitingActions } from 'vue-wait'
import { required } from 'vuelidate/lib/validators' import { required } from 'vuelidate/lib/validators'
export default { export default {
@ -144,8 +145,7 @@ export default {
this.numberError = true this.numberError = true
this.numberErrorMessage = this.$t('This number is already in use.') this.numberErrorMessage = this.$t('This number is already in use.')
} else { } else {
// eslint-disable-next-line no-console showGlobalError(this.$t('An error occurred:', error.response.data.message))
console.error('An error occurred:', error)
} }
} }
} }

@ -131,8 +131,6 @@ export default {
copyToClipboard(copyData).then(() => { copyToClipboard(copyData).then(() => {
showToast(this.$t('Data is in the clipboard')) showToast(this.$t('Data is in the clipboard'))
}).catch(() => { }).catch(() => {
// eslint-disable-next-line no-console
console.error(copyData)
showGlobalError(this.$t('Unable to copy data to clipboard')) showGlobalError(this.$t('Unable to copy data to clipboard'))
}) })
} }

@ -59,8 +59,7 @@ export default {
context.dispatch('end') context.dispatch('end')
} }
} catch (error) { } catch (error) {
// eslint-disable-next-line no-console showGlobalError(error.message)
console.error(error.message)
} }
}, },
async toggleStateTransfer (context) { async toggleStateTransfer (context) {

@ -218,8 +218,6 @@ export default {
}).then(() => { }).then(() => {
context.commit('callQueueCreationSucceeded') context.commit('callQueueCreationSucceeded')
}).catch((err) => { }).catch((err) => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('callQueueCreationFailed', err.message) context.commit('callQueueCreationFailed', err.message)
}) })
}, },
@ -232,8 +230,6 @@ export default {
}).then(() => { }).then(() => {
context.commit('callQueueRemovalSucceeded') context.commit('callQueueRemovalSucceeded')
}).catch((err) => { }).catch((err) => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('callQueueRemovalFailed', err.message) context.commit('callQueueRemovalFailed', err.message)
}) })
}, },
@ -245,8 +241,6 @@ export default {
setCallQueueMaxLength(options).then((preferences) => { setCallQueueMaxLength(options).then((preferences) => {
context.commit('callQueueUpdateSucceeded', preferences) context.commit('callQueueUpdateSucceeded', preferences)
}).catch((err) => { }).catch((err) => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('callQueueUpdateFailed', err.message) context.commit('callQueueUpdateFailed', err.message)
}) })
}, },
@ -258,8 +252,6 @@ export default {
setCallQueueWrapUpTime(options).then((preferences) => { setCallQueueWrapUpTime(options).then((preferences) => {
context.commit('callQueueUpdateSucceeded', preferences) context.commit('callQueueUpdateSucceeded', preferences)
}).catch((err) => { }).catch((err) => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('callQueueUpdateFailed', err.message) context.commit('callQueueUpdateFailed', err.message)
}) })
}, },

@ -215,8 +215,6 @@ export default {
}).then(() => { }).then(() => {
context.commit('msConfigCreationSucceeded') context.commit('msConfigCreationSucceeded')
}).catch((err) => { }).catch((err) => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('msConfigCreationFailed', err.message) context.commit('msConfigCreationFailed', err.message)
}) })
}, },
@ -229,8 +227,6 @@ export default {
}).then(() => { }).then(() => {
context.commit('msConfigRemovalSucceeded') context.commit('msConfigRemovalSucceeded')
}).catch((err) => { }).catch((err) => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('msConfigRemovalFailed', err.message) context.commit('msConfigRemovalFailed', err.message)
}) })
}, },
@ -242,8 +238,6 @@ export default {
setSecretaryNumber(options).then((preferences) => { setSecretaryNumber(options).then((preferences) => {
context.commit('msConfigUpdateSucceeded', preferences) context.commit('msConfigUpdateSucceeded', preferences)
}).catch((err) => { }).catch((err) => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('msConfigUpdateFailed', err.message) context.commit('msConfigUpdateFailed', err.message)
}) })
}, },

@ -374,9 +374,7 @@ export default {
page page
}) })
resolve() resolve()
}).catch((err) => { }).catch(() => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('soundSetListSucceeded', { context.commit('soundSetListSucceeded', {
soundSets: [] soundSets: []
}) })
@ -458,9 +456,7 @@ export default {
context.commit('soundHandlesRequesting') context.commit('soundHandlesRequesting')
getAllSoundHandles().then((soundHandles) => { getAllSoundHandles().then((soundHandles) => {
context.commit('soundHandlesSucceeded', soundHandles) context.commit('soundHandlesSucceeded', soundHandles)
}).catch((err) => { }).catch(() => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('soundHandlesSucceeded', { context.commit('soundHandlesSucceeded', {
items: [] items: []
}) })
@ -473,9 +469,7 @@ export default {
soundSetId, soundSetId,
soundFiles soundFiles
}) })
}).catch((err) => { }).catch(() => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('soundFilesSucceeded', { context.commit('soundFilesSucceeded', {
soundSetId, soundSetId,
soundFiles: { soundFiles: {
@ -496,9 +490,7 @@ export default {
soundFile, soundFile,
soundFileUrl soundFileUrl
}) })
}).catch((err) => { }).catch(() => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('soundFileFailed', { context.commit('soundFileFailed', {
soundFile soundFile
}) })
@ -530,9 +522,7 @@ export default {
} }
}).then((res) => { }).then((res) => {
context.commit('soundFileUploadSucceeded', res) context.commit('soundFileUploadSucceeded', res)
}).catch((err) => { }).catch(() => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('soundFileUploadAborted', { context.commit('soundFileUploadAborted', {
soundFileId: toFileId({ soundFileId: toFileId({
soundSetId: options.soundSetId, soundSetId: options.soundSetId,
@ -545,9 +535,7 @@ export default {
context.commit('soundFileUpdateRequesting', options) context.commit('soundFileUpdateRequesting', options)
setLoopPlay(options).then((soundFile) => { setLoopPlay(options).then((soundFile) => {
context.commit('soundFileUpdateSucceeded', soundFile) context.commit('soundFileUpdateSucceeded', soundFile)
}).catch((err) => { }).catch(() => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('soundFileUpdateFailed', options) context.commit('soundFileUpdateFailed', options)
}) })
}, },
@ -555,9 +543,7 @@ export default {
context.commit('soundFileUpdateRequesting', options) context.commit('soundFileUpdateRequesting', options)
setUseParent(options).then((soundFile) => { setUseParent(options).then((soundFile) => {
context.commit('soundFileUpdateSucceeded', soundFile) context.commit('soundFileUpdateSucceeded', soundFile)
}).catch((err) => { }).catch(() => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('soundFileUpdateFailed', options) context.commit('soundFileUpdateFailed', options)
}) })
}, },
@ -565,9 +551,7 @@ export default {
context.commit('soundFileRemoveRequesting', options) context.commit('soundFileRemoveRequesting', options)
removeSoundFile(options.soundFileId).then(() => { removeSoundFile(options.soundFileId).then(() => {
context.commit('soundFileRemoveSucceeded', options) context.commit('soundFileRemoveSucceeded', options)
}).catch((err) => { }).catch(() => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('soundFileRemoveFailed', options) context.commit('soundFileRemoveFailed', options)
}) })
} }

@ -347,9 +347,7 @@ export default {
all: true all: true
}).then((subscribers) => { }).then((subscribers) => {
context.commit('subscribersSucceeded', subscribers) context.commit('subscribersSucceeded', subscribers)
}).catch((err) => { }).catch(() => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('subscribersSucceeded', { context.commit('subscribersSucceeded', {
items: [] items: []
}) })
@ -364,9 +362,7 @@ export default {
all: true all: true
}).then((numbers) => { }).then((numbers) => {
context.commit('numbersSucceeded', numbers) context.commit('numbersSucceeded', numbers)
}).catch((err) => { }).catch(() => {
// eslint-disable-next-line no-console
console.debug(err)
context.commit('numbersSucceeded', { context.commit('numbersSucceeded', {
items: [] items: []
}) })

@ -383,9 +383,8 @@ export default {
}) })
} }
} catch (err) { } catch (err) {
// eslint-disable-next-line no-console
console.debug(err)
await context.dispatch('logout') await context.dispatch('logout')
throw err
} }
} }
}, },

Loading…
Cancel
Save