Skip to content

Commit

Permalink
Merge pull request #283 from webreinvent/2.x-hotfix/v2.2.10
Browse files Browse the repository at this point in the history
2.x hotfix -> 2.x | v2.2.10 | Sidebar collapsed by default
  • Loading branch information
themodernpk authored May 6, 2024
2 parents cfacb66 + c1e86ff commit c0c5fe1
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Config/vaahcms.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$settings = [
'app_name' => 'VaahCMS',
'app_slug' => 'vaahcms',
'version' => '2.2.9',
'version' => '2.2.10',
'php_version_required' => '8.1',
'get_config_version' => false,
'website' => 'https://vaah.dev/cms',
Expand Down
18 changes: 18 additions & 0 deletions Database/Seeders/json/language_strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,12 @@
"name": "Is Logo compressed with Sidebar",
"content": "Is Logo compressed with Sidebar"
},
{
"locale_code_iso_639": "en",
"category": "general-setting",
"name": "Is Sidebar collapsed",
"content": "Is Sidebar collapsed"
},
{
"locale_code_iso_639": "en",
"category": "general-setting",
Expand Down Expand Up @@ -6357,6 +6363,12 @@
"name": "Is Logo compressed with Sidebar",
"content": "¿El logotipo está comprimido con la barra lateral"
},
{
"locale_code_iso_639": "es",
"category": "general-setting",
"name": "Is Sidebar collapsed",
"content": "¿Está colapsada la barra lateral?"
},
{
"locale_code_iso_639": "es",
"category": "general-setting",
Expand Down Expand Up @@ -10114,6 +10126,12 @@
"name": "Is Logo compressed with Sidebar",
"content": "Le logo est-il compressé avec la barre latérale"
},
{
"locale_code_iso_639": "fr",
"category": "general-setting",
"name": "Is Sidebar collapsed",
"content": "La barre latérale est-elle réduite"
},
{
"locale_code_iso_639": "fr",
"category": "general-setting",
Expand Down
1 change: 1 addition & 0 deletions Database/Seeders/json/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{"category": "global", "key": "search_engine_visibility", "value": 1 },
{"category": "global", "key": "maintenance_mode", "value": 0 },
{"category": "global", "key": "is_logo_compressed", "value": 1 },
{"category": "global", "key": "is_sidebar_collapsed", "value": 1 },
{"category": "global", "key": "signup_page_visibility", "value": 0 },
{"category": "global", "key": "copyright_text", "value": "app_name" },
{"category": "global", "key": "copyright_link", "value": "app_url" },
Expand Down
1 change: 1 addition & 0 deletions Http/Controllers/Backend/Settings/GeneralController.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function getLanguageStrings() : array {
"assign_roles_on_registration" => trans("vaahcms-general-setting.assign_roles_on_registration"),
"allowed_file_types_for_upload" => trans("vaahcms-general-setting.allowed_file_types_for_upload"),
"is_logo_compressed_with_sidebar" => trans("vaahcms-general-setting.is_logo_compressed_with_sidebar"),
"is_sidebar_collapsed" => trans("vaahcms-general-setting.is_sidebar_collapsed"),
"copyright_text" => trans("vaahcms-general-setting.copyright_text"),
"copyright_year" => trans("vaahcms-general-setting.copyright_year"),
"maximum_number_of_login_attempts" => trans("vaahcms-general-setting.maximum_number_of_login_attempts"),
Expand Down
2 changes: 1 addition & 1 deletion Http/Controllers/JsonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function getPublicAssets(Request $request)


$data['backend_logo_url'] = vh_backend_logo();

$data['is_sidebar_collapsed'] = config('settings.global.is_sidebar_collapsed');

$response['success'] = true;
$response['data'] = $data;
Expand Down
4 changes: 3 additions & 1 deletion Resources/views/backend/vaahtwo/layouts/backend.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
{!! vh_config_css() !!}

</head>
<body class="@if(isset($data->body_class)){{$data->body_class}}@endif">
<body class="{{config('settings.global.is_sidebar_collapsed') == null ||
config('settings.global.is_sidebar_collapsed') ?'has-sidebar-small':''}}
@if(isset($data->body_class)){{$data->body_class}}@endif">

<div>

Expand Down
4 changes: 3 additions & 1 deletion Resources/views/backend/vaahtwo/layouts/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@

</head>

<body class="vaahtwo primevue @if(isset($data->body_class)){{$data->body_class}}@endif">
<body class="vaahtwo primevue {{config('settings.global.is_sidebar_collapsed') == null ||
config('settings.global.is_sidebar_collapsed') ?'has-sidebar-small':''}}
@if(isset($data->body_class)){{$data->body_class}}@endif">

@include("vaahcms::backend.vaahtwo.components.errors")
@include("vaahcms::backend.vaahtwo.components.flash")
Expand Down
21 changes: 20 additions & 1 deletion Vue/vaahtwo/pages/settings/general/components/SiteSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,32 @@ const store = useGeneralStore();
</div>
</div>

<div class="col-6 p-fluid">
<h5 class="p-1 text-xs mb-1">{{ store.assets.language_strings.is_sidebar_collapsed }}</h5>
<div class="p-inputgroup">
<SelectButton v-model="store.list.is_sidebar_collapsed"
optionLabel="name"
optionValue="value"
:options="store.trueFalseOptions"
data-testid="general-is_sidebar_collapsed"
class="p-button-sm"
aria-labelledby="single"
/>
<Button class="p-button-sm"
icon="pi pi-copy"
data-testid="general-copyright_custom_year_filed_copy"
@click="store.getCopy('is_sidebar_collapsed')"
/>
</div>
</div>

<div class="col-6 p-fluid">
<h5 class="p-1 text-xs mb-1">{{ store.assets.language_strings.is_logo_compressed_with_sidebar }}</h5>
<div class="p-inputgroup">
<SelectButton v-model="store.list.is_logo_compressed"
optionLabel="name"
optionValue="value"
:options="store.compressedLogoOptions"
:options="store.trueFalseOptions"
data-testid="general-is_logo_compressed"
class="p-button-sm"
aria-labelledby="single"
Expand Down
7 changes: 6 additions & 1 deletion Vue/vaahtwo/stores/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,15 @@ export const useRootStore = defineStore({
//-----------------------------------------------------------------------
setTopMenuItems(){
if (this.assets && this.assets.language_string && this.assets.language_string.dashboard) {

let navigation_label = this.assets.is_sidebar_collapsed == 1 ?
this.assets.language_string.dashboard.topnav_tooltip_view_full_navigation :
this.assets.language_string.dashboard.topnav_tooltip_view_less_navigation;

this.top_menu_items = [
{
label: '',
tooltip: this.assets.language_string.dashboard.topnav_tooltip_view_less_navigation,
tooltip: navigation_label,
icon: 'pi pi-align-justify',
command: () => {

Expand Down
2 changes: 1 addition & 1 deletion Vue/vaahtwo/stores/settings/store-general_setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const useGeneralStore = defineStore({

this.visibitlity_options = generateOptions('enable', 'disable');
this.maintenanceModeOptions = generateOptions('enable', 'disable');
this.compressedLogoOptions = generateOptions('true', 'false');
this.trueFalseOptions = generateOptions('true', 'false');
this.redirect_after_logout_options = [
{ name: this.assets.language_strings.backend, value: 'backend' },
{ name: this.assets.language_strings.frontend, value: 'frontend' },
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webreinvent/vaahcms",
"version": "2.2.9",
"version": "2.2.10",
"description": "VaahCMS is a laravel based open-source web application development platform shipped with headless content management system.",
"keywords": ["vaahcms", "headless", "hmvc", "laravel", "cms", "vue", "pinia"],
"homepage": "https://webreinvent.com",
Expand Down

0 comments on commit c0c5fe1

Please sign in to comment.