-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ability to manage softwares #856
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a BIG PR!
See some comments
app/Http/Controllers/Company/Adminland/AdminSoftwareController.php
Outdated
Show resolved
Hide resolved
import TextInput from '@/Shared/TextInput'; | ||
import Errors from '@/Shared/Errors'; | ||
import LoadingButton from '@/Shared/LoadingButton'; | ||
import Layout from '@/Shared/Layout'; | ||
import SelectBox from '@/Shared/Select'; | ||
import TextArea from '@/Shared/TextArea'; | ||
|
||
export default { | ||
components: { | ||
Layout, | ||
TextInput, | ||
Errors, | ||
LoadingButton, | ||
SelectBox, | ||
TextArea, | ||
}, | ||
|
||
props: { | ||
notifications: { | ||
type: Array, | ||
default: null, | ||
}, | ||
currencies: { | ||
type: Object, | ||
default: null, | ||
}, | ||
}, | ||
|
||
data() { | ||
return { | ||
form: { | ||
name: null, | ||
product_key: null, | ||
seats: null, | ||
licensed_to: null, | ||
licensed_to_email: null, | ||
purchase_amount: null, | ||
currency: null, | ||
website: null, | ||
purchased_date_year: null, | ||
purchased_date_month: null, | ||
purchased_date_day: null, | ||
errors: [], | ||
}, | ||
loadingState: '', | ||
showPurchaseInformation: false, | ||
showPurchaseDateInformation: false, | ||
}; | ||
}, | ||
|
||
methods: { | ||
submit() { | ||
this.loadingState = 'loading'; | ||
|
||
axios.post(`${this.$page.props.auth.company.id}/account/softwares`, this.form) | ||
.then(response => { | ||
localStorage.success = this.$t('account.software_new_success'); | ||
this.$inertia.visit(response.data.data); | ||
}) | ||
.catch(error => { | ||
this.loadingState = null; | ||
this.form.errors = error.response.data; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use vue3 useForm
method
import { useForm } from '@inertiajs/inertia-vue3';
...
data() {
return {
form: useForm({
name: null,
product_key: null,
seats: null,
licensed_to: null,
licensed_to_email: null,
purchase_amount: null,
currency: null,
website: null,
purchased_date_year: null,
purchased_date_month: null,
purchased_date_day: null,
}),
loadingState: '',
showPurchaseInformation: false,
showPurchaseDateInformation: false,
};
},
methods: {
submit() {
this.form.post(this.route('software.store', { company: this.$page.props.auth.company.id }), {
onFinish: () => {
localStorage.success = this.$t('account.software_new_success');
this.$inertia.visit(response.data.data);
}
});
….php Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
…ife into 2021-05-07-software
Kudos, SonarCloud Quality Gate passed! |
🎉 This PR is included in version 0.3.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This pull request has been automatically locked since there |
You fool, don't forget these steps: