Skip to content

Commit

Permalink
Merge branch '2.x-release/v2.2.9' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
themodernpk committed Mar 20, 2024
2 parents 90e1d90 + fa3c989 commit a9fb33f
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 26 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.8',
'version' => '2.2.9',
'php_version_required' => '8.1',
'get_config_version' => false,
'website' => 'https://vaah.dev/cms',
Expand Down
4 changes: 2 additions & 2 deletions Http/Controllers/Backend/RegistrationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getAssets(Request $request): JsonResponse

$data['actions'] = [];

$data['country_calling_code'] = vh_get_country_list();
$data['country_calling_code'] = vh_get_countries_calling_codes();
$data['countries'] = vh_get_country_list();
$data['timezones'] = vh_get_timezones();
$data['country_code'] = vh_get_country_list();
Expand Down Expand Up @@ -238,7 +238,7 @@ public function createItem(Request $request): JsonResponse
$response['errors'][] = trans("vaahcms-general.something_went_wrong");
}
}

return response()->json($response);
}
//----------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Http/Controllers/Backend/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function getAssets(Request $request): JsonResponse
$data['custom_fields'] = $custom_fields;
$data['fields'] = User::getUserSettings();
$data['totalRole'] = $roles_count;
$data['country_code'] = vh_get_country_list();
$data['country_calling_code'] = vh_get_countries_calling_codes();
$data['registration_statuses'] = Taxonomy::getTaxonomyByType('registrations');
$response['success'] = true;
$response['data'] = $data;
Expand Down
6 changes: 5 additions & 1 deletion Models/RegistrationBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ public function setEmailAttribute($value)
//-------------------------------------------------
public function setBirthAttribute($value)
{
$this->attributes['birth'] = Carbon::parse($value)->format('Y-m-d');
if (!empty($value)) {
$this->attributes['birth'] = Carbon::parse($value)->format('Y-m-d');
} else {
$this->attributes['birth'] = null;
}
}
//-------------------------------------------------
public function setPasswordAttribute($value)
Expand Down
9 changes: 4 additions & 5 deletions Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,13 @@ public static function itemAction($request, $id, $type): array
->update(['is_active' => null]);
break;
case 'trash':
self::where('id', $id)
->withTrashed()
self::find($id)
->delete();
break;
case 'restore':
self::where('id', $id)
->withTrashed()
->restore();
->onlyTrashed()
->first()->restore();
break;
case 'generate-new-token':

Expand All @@ -463,7 +462,7 @@ public static function itemAction($request, $id, $type): array
break;
}

return self::getItem($id);
return self::getItem($id,[], $type);
}
//-------------------------------------------------

Expand Down
10 changes: 6 additions & 4 deletions Models/UserBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ public static function getList($request,$excluded_columns = [])
return $response;
}
//-------------------------------------------------
public static function getItem($id,$excluded_columns = [])
public static function getItem($id,$excluded_columns = [], $type=null)
{

$item = self::where('id', $id)->with(['createdByUser',
Expand All @@ -1421,7 +1421,9 @@ public static function getItem($id,$excluded_columns = [])
}

$item = $item->first();

if ($type==="generate-new-token"){
$response['messages'][] = trans("vaahcms-general.action_successful") ;
}
$response['success'] = true;
$response['data'] = $item;

Expand Down Expand Up @@ -2022,7 +2024,7 @@ public static function storeAvatar($request,$user_id=null)
$user_id = \Auth::user()->id;
}

$user = self::find($user_id);
$user = self::withTrashed()->find($user_id);

$user->avatar_url = $request->url;
$user->save();
Expand All @@ -2046,7 +2048,7 @@ public static function removeAvatar($user_id=null)
$user_id = \Auth::user()->id;
}

$user = self::find($user_id);
$user = self::withTrashed()->find($user_id);
$user->avatar_url = null;
$user->save();

Expand Down
4 changes: 2 additions & 2 deletions Resources/assets/backend/vaahtwo/build/main.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Vue/vaahtwo/pages/registrations/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ watch(
/>
<!--/form_menu-->

<Button v-if="(store.item && store.item.id) || store.hasPermission('can-read-registrations')"
<Button v-if="(store.item && store.item.id) && store.hasPermission('can-read-registrations')"
class="p-button-sm"
icon="pi pi-eye"
v-tooltip.top="root.assets.language_strings.crud_actions.toolkit_text_view"
Expand Down Expand Up @@ -254,8 +254,8 @@ watch(
<VhField label="Country Code" v-if="!store.isHidden('country_calling_code')">
<Dropdown v-model="store.item.country_calling_code"
:options="store.assets.country_calling_code"
optionLabel='calling_code'
optionValue='calling_code'
optionLabel='name'
optionValue='slug'
placeholder="Enter your country code"
data-testid="register-country_calling_code"
class="w-full"
Expand Down
2 changes: 1 addition & 1 deletion Vue/vaahtwo/pages/roles/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ watch(
/>
<!--/form_menu-->

<Button v-if="(store.item && store.item.id) || store.hasPermission('can-read-roles')"
<Button v-if="(store.item && store.item.id) && store.hasPermission('can-read-roles')"
class="p-button-sm"
icon="pi pi-eye"
v-tooltip.top="root.assets.language_strings.crud_actions.toolkit_text_view"
Expand Down
6 changes: 3 additions & 3 deletions Vue/vaahtwo/pages/users/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ watch(
<VhField label="Country Code" v-if="!store.isHidden('country_calling_code') && store.assets">
<Dropdown class="w-full"
v-model="store.item.country_calling_code"
:options="store.assets.countries"
:options="store.assets.country_calling_code"
:editable="true"
optionLabel="calling_code"
optionValue="calling_code"
optionLabel="name"
optionValue="slug"
id="calling_code"
name="account-country_calling_code"
data-testid="account-country_calling_code"
Expand Down
2 changes: 1 addition & 1 deletion Vue/vaahtwo/stores/store-registrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ export const useRegistrationStore = defineStore({
case 'create-and-close':
case 'save-and-close':
this.setActiveItemAsEmpty();
this.$router.push({name: 'registrations.index'});
await this.$router.push({name: 'registrations.index'});
break;
case 'save-and-clone':
case 'create-and-clone':
Expand Down
1 change: 0 additions & 1 deletion Vue/vaahtwo/stores/store-users.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ export const useUserStore = defineStore({
if(this.assets && this.assets.language_strings) {
await this.getItemMenu();
}

await this.getFormMenu();
}
},
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.8",
"version": "2.2.9",
"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 a9fb33f

Please sign in to comment.