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

2.x feature -> 2.x develop | update dashboard localization #239

Merged
merged 86 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
880270d
Updated: restricted action
we-vikram-wri231 Dec 30, 2023
06f45e8
Updated: restricted action in bulk action
we-vikram-wri231 Dec 30, 2023
f0a0697
Updated: restricted action
we-vikram-wri231 Dec 30, 2023
56e1d4c
Fixed: permission seeds of taxonomy section
we-vikram-wri231 Dec 30, 2023
65855d8
Updated: restricted action for bulk action
we-vikram-wri231 Dec 30, 2023
5db5249
Updated: Active all logic
we-vikram-wri231 Dec 30, 2023
04e11d4
Fixed: role permission active all logic
we-vikram-wri231 Dec 30, 2023
eaf3bac
Updated: language string of label
we-alam-a001 Jan 4, 2024
616a6e8
Updated: localization of dashboard page
we-alam-a001 Jan 4, 2024
2e507db
Updated: sidebar menu label extend and dashboard
we-alam-a001 Jan 4, 2024
dc686ff
Added: conditional if for language string
we-alam-a001 Jan 4, 2024
39accb1
Fixed: login error while language is fr
we-alam-a001 Jan 4, 2024
0e7a2c2
Updated: extend controller for label
we-alam-a001 Jan 4, 2024
f9aca85
Fixed: to show bold text
we-alam-a001 Jan 5, 2024
233ab41
Updated: sidebar menu label extend and dashboard
we-alam-a001 Jan 5, 2024
f677137
Merge remote-tracking branch 'origin/2.x-feature/update-dashbaord-loc…
we-alam-a001 Jan 5, 2024
ccf53dc
Updated: dashboard language string
we-alam-a001 Jan 5, 2024
0b79f93
Removed: unused line
we-alam-a001 Jan 5, 2024
cc2a2c5
Updated: restricted action
we-vikram-wri231 Dec 30, 2023
c81b95e
Updated: restricted action in bulk action
we-vikram-wri231 Dec 30, 2023
5dd3e50
Updated: restricted action
we-vikram-wri231 Dec 30, 2023
13fcb46
Fixed: permission seeds of taxonomy section
we-vikram-wri231 Dec 30, 2023
39ef299
Updated: restricted action for bulk action
we-vikram-wri231 Dec 30, 2023
1cc03d2
Updated: Active all logic
we-vikram-wri231 Dec 30, 2023
41c85d3
Fixed: role permission active all logic
we-vikram-wri231 Dec 30, 2023
e4d40d4
Merge remote-tracking branch 'origin/2.x-feature/added-restricted-act…
we-vikram-wri231 Jan 6, 2024
297c4cf
Updated: view role bulk function
we-vikram-wri231 Jan 6, 2024
d81f670
Updated: bulk all condition
we-vikram-wri231 Jan 6, 2024
aad4ff7
Updated: roles bulk actions
we-vikram-wri231 Jan 6, 2024
a62c2e8
Added: functions to get language string
we-alam-a001 Jan 8, 2024
020caf0
Added: run migrations and seeders after installed
we-alam-a001 Jan 9, 2024
eff4778
Updated: setup stores
we-alam-a001 Jan 9, 2024
005149d
Updated: run seeders method
we-alam-a001 Jan 9, 2024
c7b313b
Updated: run migrations and seeders after installed
we-alam-a001 Jan 9, 2024
bd05184
Updated: function in setup store
we-alam-a001 Jan 9, 2024
d87c98f
Added: run seeder functionality in localization
we-alam-a001 Jan 9, 2024
b872b31
Added: functions to get language string
we-alam-a001 Jan 9, 2024
94ad323
Merge remote-tracking branch 'origin/2.x-feature/generate-language-fi…
we-alam-a001 Jan 9, 2024
4330c01
Updated: naming of language strings
we-alam-a001 Jan 10, 2024
c455a89
Updated: naming convention
we-alam-a001 Jan 10, 2024
945a0ef
Updated: if condition in users actions
we-alam-a001 Jan 11, 2024
4cd6c72
Updated: if condition in users form and view
we-alam-a001 Jan 11, 2024
d588432
Updated: users assets language string
we-alam-a001 Jan 12, 2024
2b70394
Updated: conditions for language string error
we-alam-a001 Jan 12, 2024
afe5d1a
Updated: label of extend
we-alam-a001 Jan 12, 2024
e045755
Updated: condition when no strings provided
we-alam-a001 Jan 12, 2024
3aed7ca
Added: watch for looking store assets loaded
we-alam-a001 Jan 12, 2024
d89128d
Updated: users title
we-alam-a001 Jan 12, 2024
ff41a29
Merge pull request #241 from webreinvent/2.x-feature/added-restricted…
themodernpk Jan 12, 2024
6cae5b9
Updated: dashboard language strings
we-alam-a001 Jan 12, 2024
eeac38b
Fixed: registration not found error message
we-alam-a001 Jan 12, 2024
d6024b6
Added: functions to get language string
we-alam-a001 Jan 8, 2024
6348105
Added: run migrations and seeders after installed
we-alam-a001 Jan 9, 2024
c95e0b6
Updated: setup stores
we-alam-a001 Jan 9, 2024
e3ad41e
Updated: run seeders method
we-alam-a001 Jan 9, 2024
aa5b7e0
Updated: run migrations and seeders after installed
we-alam-a001 Jan 9, 2024
deb8967
Updated: function in setup store
we-alam-a001 Jan 9, 2024
899c146
Added: run seeder functionality in localization
we-alam-a001 Jan 9, 2024
6048d65
Updated: naming of language strings
we-alam-a001 Jan 10, 2024
958d731
Updated: naming convention
we-alam-a001 Jan 10, 2024
d3c0c36
Updated: if condition in users actions
we-alam-a001 Jan 11, 2024
3ad9956
Updated: if condition in users form and view
we-alam-a001 Jan 11, 2024
afc636e
Updated: users assets language string
we-alam-a001 Jan 12, 2024
bdf640f
Updated: conditions for language string error
we-alam-a001 Jan 12, 2024
9ec4791
Updated: label of extend
we-alam-a001 Jan 12, 2024
a5c02fd
Updated: condition when no strings provided
we-alam-a001 Jan 12, 2024
5469172
Added: watch for looking store assets loaded
we-alam-a001 Jan 12, 2024
a3f672b
Updated: users title
we-alam-a001 Jan 12, 2024
1e10a0b
Fixed: registration not found error message
we-alam-a001 Jan 12, 2024
6f6239e
Merge remote-tracking branch 'origin/2.x-feature/generate-language-fi…
we-vikram-wri231 Jan 13, 2024
4ec900d
Updated: page title strings
we-alam-a001 Jan 13, 2024
de3402c
Merge remote-tracking branch 'origin/2.x-feature/generate-language-fi…
we-alam-a001 Jan 13, 2024
b8f764f
Updated: style overflow
we-vikram-wri231 Jan 13, 2024
25923d0
Merge pull request #244 from webreinvent/2.x-feature/fixx-notificatio…
themodernpk Jan 15, 2024
fd0fca6
Merge pull request #243 from webreinvent/2.x-feature/generate-languag…
themodernpk Jan 15, 2024
1882ae5
Updated: language string of label
we-alam-a001 Jan 4, 2024
bf5827e
Updated: sidebar menu label extend and dashboard
we-alam-a001 Jan 4, 2024
5a0c3ca
Added: conditional if for language string
we-alam-a001 Jan 4, 2024
7cc0aa9
Fixed: login error while language is fr
we-alam-a001 Jan 4, 2024
4ffe099
Updated: extend controller for label
we-alam-a001 Jan 4, 2024
a69b94d
Fixed: to show bold text
we-alam-a001 Jan 5, 2024
72ca26a
Updated: dashboard language string
we-alam-a001 Jan 5, 2024
cc44817
Removed: unused line
we-alam-a001 Jan 5, 2024
91b5abc
Updated: dashboard language strings
we-alam-a001 Jan 12, 2024
6f99b4b
Merge remote-tracking branch 'origin/2.x-feature/update-dashbaord-loc…
we-alam-a001 Jan 16, 2024
97a2151
Updated: language strings after rebase
we-alam-a001 Jan 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Database/Seeders/json/language_strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@
"locale_code_iso_639": "en",
"category": "dashboard",
"name": "Welcome to VaahCms",
"content": "Welcome to VaahCms"
"content": "Welcome to Vaah<b>Cms</b>"
},
{
"locale_code_iso_639": "en",
Expand Down Expand Up @@ -870,7 +870,7 @@
"locale_code_iso_639": "en",
"category": "dashboard",
"name": "Run Jobs",
"content": "Enable Laravel Queues to run your jobs"
"content": "Enable <b>Laravel Queues</b> to run your jobs"
},
{
"locale_code_iso_639": "en",
Expand Down Expand Up @@ -3627,7 +3627,7 @@
"locale_code_iso_639": "es",
"category": "dashboard",
"name": "Welcome to VaahCms",
"content": "Bienvenido a VaahCms"
"content": "Bienvenido a Vaah<b>Cms</b>"
},
{
"locale_code_iso_639": "es",
Expand Down Expand Up @@ -3736,7 +3736,7 @@
"locale_code_iso_639": "es",
"category": "dashboard",
"name": "Run Jobs",
"content": "Habilite Laravel Queues para ejecutar sus trabajos"
"content": "Habilite <b>Laravel Queues</b> para ejecutar sus trabajos"
},
{
"locale_code_iso_639": "es",
Expand Down Expand Up @@ -6293,7 +6293,7 @@
"locale_code_iso_639": "fr",
"category": "login",
"name": "Email or Username Limit",
"content": "L'e-mail ou le nom d\\'utilisateur ne doit pas dépasser 150 caractères."
"content": "L\\'e-mail ou le nom d\\'utilisateur ne doit pas dépasser 150 caractères."
},
{
"locale_code_iso_639": "fr",
Expand Down Expand Up @@ -6493,7 +6493,7 @@
"locale_code_iso_639": "fr",
"category": "dashboard",
"name": "Welcome to VaahCms",
"content": "Bienvenue sur VaahCms"
"content": "Bienvenue sur Vaah<b>Cms</b>"
},
{
"locale_code_iso_639": "fr",
Expand Down Expand Up @@ -6601,7 +6601,7 @@
"locale_code_iso_639": "fr",
"category": "dashboard",
"name": "Run Jobs",
"content": "Activez les files d\\'attente Laravel pour exécuter vos tâches"
"content": "Activez les <b>files d\\'attente Laravel</b> pour exécuter vos tâches"
},
{
"locale_code_iso_639": "fr",
Expand Down
14 changes: 7 additions & 7 deletions Database/Seeders/json/permissions.json
Original file line number Diff line number Diff line change
Expand Up @@ -429,43 +429,43 @@
{
"name": "Has Access Of Taxonomies Section",
"module": "vaahcms",
"section": "user",
"section": "taxonomy",
"details": "This will allow user to see the link of taxonomy section."
},
{
"name": "Can Create Taxonomies",
"module": "vaahcms",
"section": "user",
"section": "taxonomy",
"details": "This will allow user to add anything in the taxonomy section."
},
{
"name": "Can Read Taxonomies",
"module": "vaahcms",
"section": "user",
"section": "taxonomy",
"details": "This will allow user to view anything in the taxonomy section."
},
{
"name": "Can Update Taxonomies",
"module": "vaahcms",
"section": "user",
"section": "taxonomy",
"details": "This will allow user to edit anything in the taxonomy section."
},
{
"name": "Can Delete Taxonomies",
"module": "vaahcms",
"section": "user",
"section": "taxonomy",
"details": "This will allow user to delete anything in the taxonomy section."
},
{
"name": "Can Manage Taxonomies",
"module": "vaahcms",
"section": "user",
"section": "taxonomy",
"details": "This will allow user to manage anything in the taxonomy section."
},
{
"name": "Can Manage Taxonomy Types",
"module": "vaahcms",
"section": "user",
"section": "taxonomy",
"details": "This will allow user to manage anything in the taxonomy type modal."
}
]
36 changes: 36 additions & 0 deletions Http/Controllers/Backend/Settings/LocalizationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Auth;
use WebReinvent\VaahCms\Database\Seeders\VaahCmsTableSeeder;
use WebReinvent\VaahCms\Models\Language;
use WebReinvent\VaahCms\Models\LanguageCategory;
use WebReinvent\VaahCms\Models\LanguageString;
Expand Down Expand Up @@ -230,4 +231,39 @@ public function postActions(Request $request, $action): JsonResponse
return response()->json($response);
}
//----------------------------------------------------------
public function runSeeds(Request $request): JsonResponse
{
if (!Auth::user()->hasPermission('has-access-of-setting-section')) {
$response['success'] = false;
$response['errors'][] = trans("vaahcms::messages.permission_denied");

return response()->json($response);
}

try {

$language_seeder = new VaahCmsTableSeeder();

$language_seeder->seedLanguages();
$language_seeder->seedLanguageCategories();
$language_seeder->seedLanguageStrings();

LanguageString::syncAndGenerateStrings($request);

$response['messages'][] = "Action was successful";

} catch (\Exception $e) {
$response = [];
$response['success'] = false;

if (env('APP_DEBUG')) {
$response['errors'][] = $e->getMessage();
$response['hint'][] = $e->getTrace();
} else {
$response['errors'][] = 'Something went wrong.';
}
}

return response()->json($response);
}
}
17 changes: 13 additions & 4 deletions Http/Controllers/Backend/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public function getAssets(Request $request): JsonResponse

//---------------------------------------------------

$data['language_string']['users'] = [
"users_title" => trans("vaahcms-user.users_title"),
$data['language_strings'] = [
"page_title" => trans("vaahcms-user.users_title"),
"view_role_active_all_roles" => trans("vaahcms-user.view_role_active_all_roles"),
"view_role_inactive_all_roles" => trans("vaahcms-user.view_role_inactive_all_roles"),
"view_generate_new_api_token" => trans("vaahcms-user.view_generate_new_api_token"),
Expand Down Expand Up @@ -268,7 +268,7 @@ public function updateItem(Request $request,$id): JsonResponse

if (!$item) {
$response['success'] = false;
$response['errors'] = trans('vaahcms-user.registration_not_found');
$response['errors'][] = trans('vaahcms-user.registration_not_found');
return response()->json($response);
}

Expand Down Expand Up @@ -301,6 +301,14 @@ public function deleteItem(Request $request,$id): JsonResponse
}

try {
$is_restricted = User::restrictedActions('delete', $id);

if(isset($is_restricted['success']) && !$is_restricted['success'])
{
$response['success'] = false;
$response['errors'] = $is_restricted['errors'];
return response()->json($response);
}
$response = User::deleteItem($request, $id);
} catch (\Exception $e) {
$response = [];
Expand Down Expand Up @@ -332,9 +340,10 @@ public function itemAction(Request $request,$id,$action): JsonResponse

$is_restricted = User::restrictedActions($action, $id);

if($is_restricted)
if(isset($is_restricted['success']) && !$is_restricted['success'])
{
$response = User::getItem($id);
$response['errors'] = $is_restricted['errors'];
return response()->json($response);
}

Expand Down
12 changes: 12 additions & 0 deletions Http/Controllers/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,19 @@ public function vaah(Request $request)
public function getItem(Request $request)
{
$response['success'] = true;
$response['data'] = [];
$response['data']['item'] = vh_action('getDashboardItems');
$response['data']['language_strings'] = [
"greeting" => trans("vaahcms-dashboard.welcome_to_vaahcms"),
'message' => trans("vaahcms-dashboard.welcome_message"),
'get_started' => trans("vaahcms-dashboard.get_started"),
'next_steps' => trans("vaahcms-dashboard.next_steps"),
'more_actions' => trans("vaahcms-dashboard.more_actions"),
'go_to_theme' => trans("vaahcms-dashboard.go_to_theme"),
'activate_theme' => trans("vaahcms-dashboard.activate_theme"),
'or' => trans("vaahcms-dashboard.or"),
'create_your_own_theme' => trans("vaahcms-dashboard.create_your_own_theme"),
];

return response()->json($response);

Expand Down
41 changes: 21 additions & 20 deletions Http/Controllers/ExtendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static function sidebarMenu()
{
$list[$n] = [
'icon' => "pi pi-box",
'label'=> trans("vaahcms-sidebar-menu.advanced"),
'label'=> trans("vaahcms-sidebar-menu.extend"),
'items'=> [],
];

Expand Down Expand Up @@ -330,32 +330,33 @@ public function getDashboardItems()
$data = array();

$data['card'] = [
"title" => "Users and Roles",
"title" => trans("vaahcms-dashboard.users_and_roles"),
"link_text" => trans("vaahcms-dashboard.view_details"),
"list" => [
[
"count" => User::count(),
"label" => 'Total User',
"label" => trans("vaahcms-dashboard.total_user"),
"icon" => "pi-users",
"type" => "info",
"link" => self::$link."/users/"
],
[
"count" => Role::count(),
"label" => 'Total Role',
"label" => trans("vaahcms-dashboard.total_role"),
"icon" => "pi-tags",
"type" => "info",
"link" => self::$link."/roles/"
],
[
"count" => Permission::count(),
"label" => 'Total Permission',
"label" => trans("vaahcms-dashboard.total_permission"),
"icon" => "pi-key",
"type" => "info",
"link" => self::$link."/permissions/"
],
[
"count" => User::where('is_active',1)->count(),
"label" => 'Active Users',
"label" => trans("vaahcms-dashboard.active_users"),
"icon" => "pi-user",
"type" => "success",
"link" => self::$link."/users?status=active"
Expand Down Expand Up @@ -389,23 +390,22 @@ public function getDashboardItems()

$data['expanded_item'] = [
[
'title' => 'Jobs',
'title' => trans("vaahcms-dashboard.jobs"),
'run_jobs' => trans("vaahcms-dashboard.run_jobs"),
'view_settings' => trans("vaahcms-dashboard.view_settings"),
'type' => 'content',
'description' => 'Tasks that is kept in the queue to be performed one after another.
Queues allow you to defer the processing of a time consuming task,
such as sending an e-mail, until a later time which drastically
speeds up web requests to your application.',
'description' => trans("vaahcms-dashboard.content_description"),
'is_job_enabled' => $is_job_enabled,
'footer' => [
[
'name' => 'Pending',
'name' => trans("vaahcms-dashboard.pending_jobs"),
'count' => Job::count(),
'type' => 'info',
'icon' => 'pi pi-envelope',
'link' => self::$link."/advanced/jobs/",
],
[
'name' => 'Failed',
'name' => trans("vaahcms-dashboard.failed_jobs"),
'count' => FailedJob::count(),
'type' => 'danger',
'icon' => 'pi pi-ban text-red-500',
Expand All @@ -414,25 +414,26 @@ public function getDashboardItems()
]
],
[
'title' => 'Laravel Logs',
'title' => trans("vaahcms-dashboard.laravel_logs"),
'view_log' => trans("vaahcms-dashboard.view_log"),
'type' => 'list',
'list' => $log_list,
'list_limit' => 5,
'link_text' => "View all recent logs",
'link_text' => trans("vaahcms-dashboard.view_all_recent_logs"),
'link' => self::$link."/advanced/logs/",
'empty_response_note' => "No Error Log Found",
'empty_response_note' => trans("vaahcms-dashboard.no_error_log_found"),
]
];


$data['expanded_header_links'] = [
[
'name' => 'Check Updates',
'name' => trans("vaahcms-dashboard.check_updates"),
'icon' => 'pi pi-refresh',
'link' => self::$link."/settings/update"
],
[
'name' => 'Getting Started',
'name' => trans("vaahcms-dashboard.getting_started"),
'icon' => 'pi pi-play',
'open_in_new_tab' => true,
'link' => 'https://docs.vaah.dev/vaahcms/installation.html'
Expand All @@ -446,7 +447,7 @@ public function getDashboardItems()

$data['next_steps'] = [
[
'name' => 'View your Site',
'name' => trans("vaahcms-dashboard.view_your_site"),
'icon' => 'pi pi-desktop',
'link' => url('/')
]
Expand All @@ -455,7 +456,7 @@ public function getDashboardItems()

$data['actions'] = [
[
'name' => 'Manage your Module',
'name' => trans("vaahcms-dashboard.manage_your_module"),
'icon' => 'pi pi-box',
'link' => self::$link."/modules"
]
Expand Down
Loading