imports/vx/client/code/vxapp.js
/**
     * Client support for getting upload errors localized as string.
     *
     * @param {string} uploadType Upload type.
     * @return {string} Upload errors list (localized).
     */
Client support for getting upload errors localized as string.
@param {string} uploadType Upload type.
@return {string} Upload errors list (localized).
Client support for getting upload errors localized as string . @param { string } uploadType Upload type . @return { string } Upload errors list ( localized ) .
uploadErrors(uploadType) {
        const uploadStats = VXApp.findUploadStats(uploadType)
        if (!(uploadStats && uploadStats.messages && uploadStats.messages.length > 0)) {
            return
        }
        uploadStats.messages.sort(function(messageA, messageB) {
            if (messageA.index > messageB.index) return +1
            if (messageA.index < messageB.index) return -1
            return 0
        })
        const messagesLocalized = _.map(uploadStats.messages, message => {
            return Util.i18n("common.message_import_validation", {
                fieldIdentifier: Util.i18n(message.fieldIdKey, message.fieldIdVariables),
                value : message.value,
                text: Util.i18n(message.result.key, message.result.variables)
            })
        })
        return messagesLocalized.join("<br>")
    }
uploadErrors ( uploadType ) { const uploadStats = VXApp . findUploadStats ( uploadType ) if ( ! ( uploadStats && uploadStats . messages && uploadStats . messages . length > 0 ) ) { return } uploadStats . messages . sort ( function ( messageA , messageB ) { if ( messageA . index > messageB . index ) return + 1 if ( messageA . index < messageB . index ) return - 1 return 0 } ) const messagesLocalized = _ . map ( uploadStats . messages , message => { return Util . i18n ( "common.message_import_validation" , { fieldIdentifier : Util . i18n ( message . fieldIdKey , message . fieldIdVariables ) , value : message . value , text : Util . i18n ( message . result . key , message . result . variables ) } ) } ) return messagesLocalized . join ( "<br>" ) }
Client support for getting upload errors localized as string.
Client support for getting upload errors localized as string .