Skip to content

Commit

Permalink
set default country and some styling
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Sep 8, 2021
1 parent 9a95426 commit 643c907
Show file tree
Hide file tree
Showing 7 changed files with 238 additions and 156 deletions.
6 changes: 4 additions & 2 deletions app/Http/Controllers/Wizard/Companies.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ public function update(Request $request)
$real_key = 'localisation.' . $key;
break;
case 'country':
$countries = trans('countries');
$value = array_search($value, $countries);
$real_key = 'company.' . $key;
break;
default:
Expand Down Expand Up @@ -99,6 +97,10 @@ public function update(Request $request)
}

setting()->set($real_key, $value);

if ($key == 'country') {
setting()->set('default.' . $key, $value);
}
}

// Save all settings
Expand Down
1 change: 1 addition & 0 deletions app/Jobs/Common/CreateCompany.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ protected function updateSettings(): void
'company.country' => $this->request->get('country'),
'default.currency' => $this->request->get('currency'),
'default.locale' => $this->request->get('locale', 'en-GB'),
'default.country' => $this->request->get('country'),
]);

if (!empty($this->request->settings)) {
Expand Down
209 changes: 106 additions & 103 deletions resources/assets/js/Wizard.vue
Original file line number Diff line number Diff line change
@@ -1,121 +1,124 @@
<template>
<router-view
:translations="translations"
:currencies="currencies"
:taxes="taxes"
:modules="modules.data"
:currency_codes="currency_codes"
:company="company"
:pageLoad="page_loaded"
></router-view>
<router-view
:translations="translations"
:currencies="currencies"
:taxes="taxes"
:modules="modules.data"
:currency_codes="currency_codes"
:company="company"
:countries="countries"
:pageLoad="page_loaded"
></router-view>
</template>

<script>
export default {
name: "Wizard",
created() {
this.translations = wizard_translations;
this.company = wizard_company;
this.currencies = wizard_currencies;
this.currency_codes = wizard_currency_codes;
this.taxes = wizard_taxes;
this.modules = wizard_modules;
Object.keys(this.currency_codes).map((key) => {
return this.currency_codes[key];
});
this.page_loaded = false;
},
data() {
return {
translations: {
company: {},
currencies: {},
taxes: {},
finish: {},
},
company: {},
currencies: [],
currency_codes: [],
taxes: [],
modules: {},
page_loaded: true
export default {
name: "Wizard",
created() {
this.translations = wizard_translations;
this.company = wizard_company;
this.countries = wizard_countries;
this.currencies = wizard_currencies;
this.currency_codes = wizard_currency_codes;
this.taxes = wizard_taxes;
this.modules = wizard_modules;
Object.keys(this.currency_codes).map((key) => {
return this.currency_codes[key];
});
this.page_loaded = false;
},
data() {
return {
translations: {
company: {},
currencies: {},
taxes: {},
finish: {},
},
company: {},
countries: {},
currencies: [],
currency_codes: [],
taxes: [],
modules: {},
page_loaded: true
};
},
};
},
};
</script>

<style>
.document-loading {
width: 1140px;
display: flex;
align-items: center;
justify-content: center;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 9999;
}
.document-loading div {
margin-top: unset;
margin-left: unset;
}
.current-tab {
background-color: #f6f9fc;
}
.current-tab-btn {
text-align: right;
padding: 0 40px;
}
.form-container {
flex-flow: row wrap;
}
.form-container .invalid-feedback {
position: absolute;
bottom: -18px;
}
.form-container .has-error {
position: relative;
margin-bottom: unset !important;
}
.form-container .has-error .form-control {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-right: 1px solid;
}
.el-step__icon {
-webkit-transition: unset;
transition: unset;
}
@media screen and (max-width: 991px) {
.form-container .has-error {
position: relative;
margin-bottom: 1.5rem !important;
.document-loading {
width: 1140px;
display: flex;
align-items: center;
justify-content: center;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 9999;
}
.document-loading div {
margin-top: unset;
margin-left: unset;
}
.current-tab {
background-color: #f6f9fc;
}
.current-tab-btn {
padding: 0 15px;
text-align: right;
padding: 0 40px;
}
.form-container {
flex-direction: column;
flex-flow: row wrap;
}
.form-container .invalid-feedback {
position: absolute;
bottom: -18px;
}
.form-container .form-group {
width: 100%;
.form-container .has-error {
position: relative;
margin-bottom: unset !important;
}
.form-container .has-error .form-control {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-right: 1px solid;
}
.el-step__icon {
-webkit-transition: unset;
transition: unset;
}
@media screen and (max-width: 991px) {
.form-container .has-error {
position: relative;
margin-bottom: 1.5rem !important;
}
.current-tab-btn {
padding: 0 15px;
}
.form-container {
flex-direction: column;
}
.form-container .form-group {
width: 100%;
}
}
}
</style>

0 comments on commit 643c907

Please sign in to comment.