Merge branch 'master' of https://gitlab.com/mohit.panjvani/crater-web into namespace-changes

This commit is contained in:
jayvirsinh_gohil
2019-11-16 16:27:34 +05:30
21 changed files with 87 additions and 200630 deletions

View File

@ -15,10 +15,10 @@ class Listener
protected function check($event) protected function check($event)
{ {
// Do not apply to the same or newer versions // Do not apply to the same or newer versions
if (version_compare($event->old, static::VERSION, '>=')) { if (version_compare(static::VERSION, $event->old, '>')) {
return false;
}
return true; return true;
} }
return false;
}
} }

View File

@ -26,7 +26,7 @@ class Updater
if ($response instanceof RequestException) { if ($response instanceof RequestException) {
return [ return [
'success' => false, 'success' => false,
'errors' => 'Download Exception', 'error' => 'Download Exception',
'data' => [ 'data' => [
'path' => $path 'path' => $path
] ]
@ -85,7 +85,7 @@ class Updater
return [ return [
'success' => true, 'success' => true,
'errors' => false, 'error' => false,
'data' => [] 'data' => []
]; ];
} catch (\Exception $e) { } catch (\Exception $e) {
@ -98,7 +98,7 @@ class Updater
return [ return [
'success' => false, 'success' => false,
'errors' => 'Update error', 'error' => 'Update error',
'data' => [] 'data' => []
]; ];
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -374,7 +374,7 @@ import MultiSelect from 'vue-multiselect'
import { validationMixin } from 'vuelidate' import { validationMixin } from 'vuelidate'
import { mapActions, mapGetters } from 'vuex' import { mapActions, mapGetters } from 'vuex'
import AddressStub from '../../../stub/address' import AddressStub from '../../../stub/address'
const { required, minLength, email, numeric, alpha, url, maxLength } = require('vuelidate/lib/validators') const { required, minLength, email, numeric, url, maxLength } = require('vuelidate/lib/validators')
export default { export default {
components: { components: {
@ -421,8 +421,7 @@ export default {
formData: { formData: {
name: { name: {
required, required,
minLength: minLength(3), minLength: minLength(3)
alpha
}, },
email: { email: {
email email

View File

@ -142,7 +142,7 @@ export default {
required, required,
numeric, numeric,
minValue: minValue(0.1), minValue: minValue(0.1),
maxLength: maxLength(10) maxLength: maxLength(20)
}, },
description: { description: {
maxLength: maxLength(255) maxLength: maxLength(255)

View File

@ -672,9 +672,11 @@ export default {
check_update: 'Check for updates', check_update: 'Check for updates',
avail_update: 'New Update available', avail_update: 'New Update available',
next_version: 'Next version', next_version: 'Next version',
update: 'Update', update: 'Update Now',
update_progress: 'Update in progress...', update_progress: 'Update in progress...',
progress_text: 'It will just take a few minutes. Please do not refresh the screen or close the window before the update finishes' progress_text: 'It will just take a few minutes. Please do not refresh the screen or close the window before the update finishes',
update_success: 'App has been updated successfully',
latest_message: 'No update available! You are on the latest version.'
} }
}, },
wizard: { wizard: {
@ -780,15 +782,15 @@ export default {
price_greater_than_zero: 'Price must be greater than zero.', price_greater_than_zero: 'Price must be greater than zero.',
payment_greater_than_zero: 'Payment must be greater than zero.', payment_greater_than_zero: 'Payment must be greater than zero.',
payment_greater_than_due_amount: 'Entered Payment is more than due amount of this invoice.', payment_greater_than_due_amount: 'Entered Payment is more than due amount of this invoice.',
quantity_maxlength: 'Quantity should not be greater than 10 digits.', quantity_maxlength: 'Quantity should not be greater than 20 digits.',
price_maxlength: 'Price should not be greater than 10 digits.', price_maxlength: 'Price should not be greater than 20 digits.',
price_minvalue: 'Price should be greater than 0.', price_minvalue: 'Price should be greater than 0.',
amount_maxlength: 'Amount should not be greater than 10 digits.', amount_maxlength: 'Amount should not be greater than 20 digits.',
amount_minvalue: 'Amount should be greater than 0.', amount_minvalue: 'Amount should be greater than 0.',
description_maxlength: 'Description should not be greater than 255 characters.', description_maxlength: 'Description should not be greater than 255 characters.',
maximum_options_error: 'Maximum of {max} options selected. First remove a selected option to select another.', maximum_options_error: 'Maximum of {max} options selected. First remove a selected option to select another.',
notes_maxlength: 'Notes should not be greater than 255 characters.', notes_maxlength: 'Notes should not be greater than 255 characters.',
address_maxlength: 'Address should not be greater than 255 characters.', address_maxlength: 'Address should not be greater than 255 characters.',
ref_number_maxlength: 'Ref Number should not be greater than 10 digits' ref_number_maxlength: 'Ref Number should not be greater than 255 characters.'
} }
} }

View File

@ -774,15 +774,15 @@ export default {
price_greater_than_zero: 'El precio debe ser mayor que cero.', price_greater_than_zero: 'El precio debe ser mayor que cero.',
payment_greater_than_zero: 'El pago debe ser mayor que cero.', payment_greater_than_zero: 'El pago debe ser mayor que cero.',
payment_greater_than_due_amount: 'El pago ingresado es mayor al monto adeudado de esta factura.', payment_greater_than_due_amount: 'El pago ingresado es mayor al monto adeudado de esta factura.',
quantity_maxlength: 'La cantidad no debe ser mayor de 10 dígitos.', quantity_maxlength: 'La cantidad no debe ser mayor de 20 dígitos.',
price_maxlength: 'El precio no debe ser mayor de 10 dígitos.', price_maxlength: 'El precio no debe ser mayor de 20 dígitos.',
price_minvalue: 'El precio debe ser mayor que 0 dígitos', price_minvalue: 'El precio debe ser mayor que 0 dígitos',
amount_maxlength: 'La cantidad no debe ser mayor de 10 dígitos.', amount_maxlength: 'La cantidad no debe ser mayor de 20 dígitos.',
amount_minvalue: 'La cantidad debe ser mayor que 0 dígitos', amount_minvalue: 'La cantidad debe ser mayor que 0 dígitos',
description_maxlength: 'La descripción no debe tener más de 255 caracteres.', description_maxlength: 'La descripción no debe tener más de 255 caracteres.',
maximum_options_error: 'Máximo de {max} opciones seleccionadas. Primero elimine una opción seleccionada para seleccionar otra.', maximum_options_error: 'Máximo de {max} opciones seleccionadas. Primero elimine una opción seleccionada para seleccionar otra.',
notes_maxlength: 'Las notas no deben tener más de 255 caracteres.', notes_maxlength: 'Las notas no deben tener más de 255 caracteres.',
address_maxlength: 'La dirección no debe tener más de 255 caracteres.', address_maxlength: 'La dirección no debe tener más de 255 caracteres.',
ref_number_maxlength: 'El número de referencia no debe tener más de 10 dígitos.' ref_number_maxlength: 'El número de referencia no debe tener más de 255 caracteres.'
} }
} }

View File

@ -777,15 +777,15 @@ export default {
price_greater_than_zero: 'Le prix doit être supérieur à zéro.', price_greater_than_zero: 'Le prix doit être supérieur à zéro.',
payment_greater_than_zero: 'Le paiement doit être supérieur à zéro.', payment_greater_than_zero: 'Le paiement doit être supérieur à zéro.',
payment_greater_than_due_amount: 'Le paiement entré est plus que le montant dû de cette facture.', payment_greater_than_due_amount: 'Le paiement entré est plus que le montant dû de cette facture.',
quantity_maxlength: 'La quantité ne doit pas dépasser 10 chiffres.', quantity_maxlength: 'La quantité ne doit pas dépasser 20 chiffres.',
price_maxlength: 'Le prix ne doit pas dépasser 10 chiffres.', price_maxlength: 'Le prix ne doit pas dépasser 20 chiffres.',
price_minvalue: 'Le prix doit être supérieur à 0 chiffre', price_minvalue: 'Le prix doit être supérieur à 0 chiffre',
amount_maxlength: 'Le montant ne doit pas dépasser 10 chiffres.', amount_maxlength: 'Le montant ne doit pas dépasser 20 chiffres.',
amount_minvalue: 'Le montant doit être supérieur à 0 chiffre', amount_minvalue: 'Le montant doit être supérieur à 0 chiffre',
description_maxlength: 'La description ne doit pas dépasser 255 caractères.', description_maxlength: 'La description ne doit pas dépasser 255 caractères.',
maximum_options_error: 'Maximum de {max} options sélectionnées. Commencez par supprimer une option sélectionnée pour en sélectionner une autre.', maximum_options_error: 'Maximum de {max} options sélectionnées. Commencez par supprimer une option sélectionnée pour en sélectionner une autre.',
notes_maxlength: 'Les notes ne doivent pas dépasser 255 caractères.', notes_maxlength: 'Les notes ne doivent pas dépasser 255 caractères.',
address_maxlength: "L'adresse ne doit pas dépasser 255 caractères.", address_maxlength: "L'adresse ne doit pas dépasser 255 caractères.",
ref_number_maxlength: 'Le numéro de référence ne doit pas dépasser 10 chiffres.' ref_number_maxlength: 'Le numéro de référence ne doit pas dépasser 255 caractères.'
} }
} }

View File

@ -141,7 +141,6 @@
v-model="newEstimate.reference_number" v-model="newEstimate.reference_number"
:invalid="$v.newEstimate.reference_number.$error" :invalid="$v.newEstimate.reference_number.$error"
icon="hashtag" icon="hashtag"
type="number"
@input="$v.newEstimate.reference_number.$touch()" @input="$v.newEstimate.reference_number.$touch()"
/> />
<div v-if="$v.newEstimate.reference_number.$error" class="text-danger">{{ $tc('validation.ref_number_maxlength') }}</div> <div v-if="$v.newEstimate.reference_number.$error" class="text-danger">{{ $tc('validation.ref_number_maxlength') }}</div>
@ -383,7 +382,7 @@ export default {
maxLength: maxLength(255) maxLength: maxLength(255)
}, },
reference_number: { reference_number: {
maxLength: maxLength(10) maxLength: maxLength(255)
} }
}, },
selectedCustomer: { selectedCustomer: {

View File

@ -305,12 +305,12 @@ export default {
quantity: { quantity: {
required, required,
minValue: minValue(1), minValue: minValue(1),
maxLength: maxLength(10) maxLength: maxLength(20)
}, },
price: { price: {
required, required,
minValue: minValue(1), minValue: minValue(1),
maxLength: maxLength(10) maxLength: maxLength(20)
}, },
discount_val: { discount_val: {
between: between(0, this.maxDiscount) between: between(0, this.maxDiscount)

View File

@ -90,16 +90,16 @@
<label>{{ $t('expenses.amount') }}</label> <span class="text-danger"> * </span> <label>{{ $t('expenses.amount') }}</label> <span class="text-danger"> * </span>
<div class="base-input"> <div class="base-input">
<money <money
:class="{'invalid' : $v.formData.amount.$error}"
v-model="amount" v-model="amount"
v-bind="defaultCurrencyForInput" v-bind="defaultCurrencyForInput"
:class="{'invalid' : $v.formData.amount.$error}"
class="input-field" class="input-field"
/> />
</div> </div>
<div v-if="$v.formData.amount.$error"> <div v-if="$v.formData.amount.$error">
<span v-if="!$v.formData.amount.required" class="text-danger">{{ $t('validation.required') }} </span> <span v-if="!$v.formData.amount.required" class="text-danger">{{ $t('validation.required') }} </span>
<span v-if="!$v.formData.amount.maxLength" class="text-danger">{{ $t('validation.amount_maxlength') }}</span> <span v-if="!$v.formData.amount.maxLength" class="text-danger">{{ $t('validation.price_maxlength') }}</span>
<span v-if="!$v.formData.amount.maxValue" class="text-danger">{{ $t('validation.amount_minvalue') }}</span> <span v-if="!$v.formData.amount.minValue" class="text-danger">{{ $t('validation.price_minvalue') }}</span>
</div> </div>
</div> </div>
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
@ -198,8 +198,8 @@ export default {
}, },
amount: { amount: {
required, required,
maxLength: maxLength(10), minValue: minValue(0.1),
minValue: minValue(0.1) maxLength: maxLength(20)
}, },
notes: { notes: {
maxLength: maxLength(255) maxLength: maxLength(255)

View File

@ -141,7 +141,6 @@
v-model="newInvoice.reference_number" v-model="newInvoice.reference_number"
:invalid="$v.newInvoice.reference_number.$error" :invalid="$v.newInvoice.reference_number.$error"
icon="hashtag" icon="hashtag"
type="number"
@input="$v.newInvoice.reference_number.$touch()" @input="$v.newInvoice.reference_number.$touch()"
/> />
<div v-if="$v.newInvoice.reference_number.$error" class="text-danger">{{ $tc('validation.ref_number_maxlength') }}</div> <div v-if="$v.newInvoice.reference_number.$error" class="text-danger">{{ $tc('validation.ref_number_maxlength') }}</div>
@ -384,7 +383,7 @@ export default {
maxLength: maxLength(255) maxLength: maxLength(255)
}, },
reference_number: { reference_number: {
maxLength: maxLength(10) maxLength: maxLength(255)
} }
}, },
selectedCustomer: { selectedCustomer: {

View File

@ -306,12 +306,12 @@ export default {
quantity: { quantity: {
required, required,
minValue: minValue(1), minValue: minValue(1),
maxLength: maxLength(10) maxLength: maxLength(20)
}, },
price: { price: {
required, required,
minValue: minValue(1), minValue: minValue(1),
maxLength: maxLength(10) maxLength: maxLength(20)
}, },
discount_val: { discount_val: {
between: between(0, this.maxDiscount) between: between(0, this.maxDiscount)

View File

@ -92,7 +92,7 @@
<script> <script>
import { validationMixin } from 'vuelidate' import { validationMixin } from 'vuelidate'
import { mapActions, mapGetters } from 'vuex' import { mapActions, mapGetters } from 'vuex'
const { required, minLength, numeric, alpha, minValue, maxLength } = require('vuelidate/lib/validators') const { required, minLength, numeric, minValue, maxLength } = require('vuelidate/lib/validators')
export default { export default {
mixins: { mixins: {
@ -163,7 +163,7 @@ export default {
price: { price: {
required, required,
numeric, numeric,
maxLength: maxLength(10), maxLength: maxLength(20),
minValue: minValue(0.1) minValue: minValue(0.1)
}, },
description: { description: {

View File

@ -7,24 +7,24 @@
{{ $t('settings.update_app.description') }} {{ $t('settings.update_app.description') }}
</p> </p>
<label class="input-label">Current version</label><br> <label class="input-label">Current version</label><br>
<label class="version">1.0.0</label> <label class="version mb-4">{{ currentVersion }}</label>
<base-button :outline="true" :disabled="isCheckingforUpdate" size="large" color="theme" @click="checkUpdate" > <base-button :outline="true" :disabled="isCheckingforUpdate || isUpdating" size="large" color="theme" @click="checkUpdate" class="mb-4">
<font-awesome-icon :class="{'update': isCheckingforUpdate}" style="margin-right: 10px;" icon="sync-alt" /> <font-awesome-icon :class="{'update': isCheckingforUpdate}" style="margin-right: 10px;" icon="sync-alt" />
{{ $t('settings.update_app.check_update') }} {{ $t('settings.update_app.check_update') }}
</base-button> </base-button>
<hr> <hr>
<div v-show="!isUpdating" v-if="isUpdateAvailable" class="mt-4 content"> <div v-show="!isUpdating" v-if="isUpdateAvailable" class="mt-4 content">
<h3 class="page-title">{{ $t('settings.update_app.avail_update') }}</h3> <h3 class="page-title mb-3">{{ $t('settings.update_app.avail_update') }}</h3>
<label class="input-label">{{ $t('settings.update_app.next_version') }}</label><br> <label class="input-label">{{ $t('settings.update_app.next_version') }}</label><br>
<label class="version">{{ updateData.version }}</label> <label class="version">{{ updateData.version }}</label>
<p class="page-sub-title"> <p class="page-sub-title">
{{ description }} {{ description }}
</p> </p>
<base-button size="large" color="theme" @click="onUpdateApp"> <base-button size="large" icon="rocket" color="theme" @click="onUpdateApp">
{{ $t('settings.update_app.update') }} {{ $t('settings.update_app.update') }}
</base-button> </base-button>
</div> </div>
<div v-if="isUpdating"> <div v-if="isUpdating" class="mt-4 content">
<h3 class="page-title">{{ $t('settings.update_app.update_progress') }}</h3> <h3 class="page-title">{{ $t('settings.update_app.update_progress') }}</h3>
<p class="page-sub-title"> <p class="page-sub-title">
{{ $t('settings.update_app.progress_text') }} {{ $t('settings.update_app.progress_text') }}
@ -35,8 +35,8 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { mapActions, mapGetters } from 'vuex'
export default { export default {
data () { data () {
return { return {
@ -47,6 +47,7 @@ export default {
progress: 10, progress: 10,
interval: null, interval: null,
description: '', description: '',
currentVersion: '',
updateData: { updateData: {
isMinor: Boolean, isMinor: Boolean,
installed: '', installed: '',
@ -54,29 +55,49 @@ export default {
} }
} }
}, },
computed: {
},
watch: {
},
mounted () { mounted () {
window.axios.get('/api/settings/app/version').then((res) => {
this.currentVersion = res.data.version
})
}, },
methods: { methods: {
async onUpdateApp () { async onUpdateApp () {
try {
this.isUpdating = true this.isUpdating = true
const data = this.updateData this.updateData.installed = this.currentVersion
let response = await axios.post('/api/update', data) let res = await window.axios.post('/api/update', this.updateData)
this.isUpdating = false
if (res.data.success) {
this.isUpdateAvailable = false this.isUpdateAvailable = false
window.toastr['success'](this.$t('settings.update_app.update_success'))
this.currentVersion = this.updateData.version
} else {
console.log(res.data)
window.toastr['error'](res.data.error)
}
} catch (e) {
console.log(e)
window.toastr['error']('Something went wrong')
}
this.isUpdating = false
}, },
async checkUpdate () { async checkUpdate () {
try { try {
this.isCheckingforUpdate = true this.isCheckingforUpdate = true
let response = await axios.get('/api/check/update') let response = await window.axios.get('/api/check/update')
this.isCheckingforUpdate = false this.isCheckingforUpdate = false
if (!response.data.version) {
window.toastr['warning'](this.$t('settings.update_app.latest_message'))
return
}
if (response.data) { if (response.data) {
this.updateData.isMinor = response.data.is_minor this.updateData.isMinor = response.data.is_minor
this.updateData.version = response.data.version this.updateData.version = response.data.version.version
this.description = response.data.description this.description = response.data.description
this.isUpdateAvailable = true this.isUpdateAvailable = true
} }

View File

@ -67,8 +67,8 @@ export default {
data () { data () {
return { return {
loading: false, loading: false,
tab: 'step_3', tab: 'step_1',
step: 3 step: 1
} }
}, },
created () { created () {

View File

@ -52,7 +52,8 @@ import {
faCopy, faCopy,
faPaperPlane, faPaperPlane,
faEyeSlash, faEyeSlash,
faSyncAlt faSyncAlt,
faRocket
} from '@fortawesome/free-solid-svg-icons' } from '@fortawesome/free-solid-svg-icons'
import { far } from '@fortawesome/free-regular-svg-icons' import { far } from '@fortawesome/free-regular-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
@ -115,7 +116,8 @@ library.add(
faEllipsisH, faEllipsisH,
faCopy, faCopy,
faPaperPlane, faPaperPlane,
faSyncAlt faSyncAlt,
faRocket
) )
Vue.component('font-awesome-icon', FontAwesomeIcon) Vue.component('font-awesome-icon', FontAwesomeIcon)

View File

@ -1,3 +1,7 @@
.base-modal .modal-body {
overflow: visible !important;
}
.item-modal { .item-modal {
.card-footer { .card-footer {