Skip to content
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

Merged
merged 48 commits into from
Jun 8, 2021
Merged

feat: ability to manage softwares #856

merged 48 commits into from
Jun 8, 2021

Conversation

djaiss
Copy link
Member

@djaiss djaiss commented May 8, 2021

You fool, don't forget these steps:

  • Unit tests
  • Tests with Cypress
  • Documentation
  • Dummy data

@djaiss djaiss linked an issue May 8, 2021 that may be closed by this pull request
@djaiss djaiss marked this pull request as ready for review June 6, 2021 13:09
@djaiss djaiss requested a review from a team as a code owner June 6, 2021 13:09
@djaiss djaiss requested review from asbiin and removed request for a team June 6, 2021 13:09
Copy link
Contributor

@asbiin asbiin left a 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

Comment on lines 261 to 323
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;
});
Copy link
Contributor

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);
        }
      });

routes/web.php Outdated Show resolved Hide resolved
resources/lang/en/account.php Outdated Show resolved Hide resolved
resources/js/Pages/Adminland/Software/Show.vue Outdated Show resolved Hide resolved
resources/js/Pages/Adminland/Software/Create.vue Outdated Show resolved Hide resolved
phpstan.neon Outdated Show resolved Hide resolved
app/Http/ViewHelpers/Employee/EmployeeShowViewHelper.php Outdated Show resolved Hide resolved
app/Http/ViewHelpers/Adminland/AdminSoftwareViewHelper.php Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Jun 8, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 2 Security Hotspots
Code Smell A 16 Code Smells

77.6% 77.6% Coverage
7.6% 7.6% Duplication

@djaiss djaiss merged commit 98bb0ce into main Jun 8, 2021
@djaiss djaiss deleted the 2021-05-07-software branch June 8, 2021 02:18
@github-actions
Copy link
Contributor

🎉 This PR is included in version 0.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manage licenses of softwares
2 participants