Skip to content

Commit e4d6e0f

Browse files
authored
Merge pull request #122 from devaslanphp/dev
Update lang folder and docs
2 parents feb6d05 + b4c2824 commit e4d6e0f

File tree

525 files changed

+526
-110375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

525 files changed

+526
-110375
lines changed

app/View/Components/MainMenu.php

Lines changed: 1 addition & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -16,113 +16,7 @@ class MainMenu extends Component
1616
*/
1717
public function __construct()
1818
{
19-
/**
20-
* Menu array definition
21-
*
22-
* 'route name' => 'menu item label'
23-
*/
24-
$this->menu = [
25-
'home' => [
26-
'title' => 'Overview',
27-
'icon' => 'fa-table-columns',
28-
'always_shown' => true,
29-
'show_notification_indicator' => false,
30-
'permissions' => ['']
31-
],
32-
'analytics' => [
33-
'title' => 'Analytics',
34-
'icon' => 'fa-chart-bar',
35-
'always_shown' => false,
36-
'show_notification_indicator' => false,
37-
'permissions' => ['Can view Analytics page']
38-
],
39-
'tickets' => [
40-
'title' => 'Tickets',
41-
'icon' => 'fa-ticket',
42-
'always_shown' => false,
43-
'show_notification_indicator' => false,
44-
'permissions' => ['Can view Tickets page']
45-
],
46-
'kanban' => [
47-
'title' => 'Kanban Board',
48-
'icon' => 'fa-clipboard-check',
49-
'always_shown' => false,
50-
'show_notification_indicator' => false,
51-
'permissions' => ['Can view Kanban page']
52-
],
53-
'administration' => [
54-
'title' => 'Administration',
55-
'icon' => 'fa-cogs',
56-
'always_shown' => false,
57-
'show_notification_indicator' => false,
58-
'permissions' => [
59-
'View all users', 'View company users',
60-
'View all companies', 'View own companies',
61-
'Manage ticket statuses',
62-
'Manage ticket types',
63-
'Manage ticket priorities',
64-
'View activity log'
65-
],
66-
'children' => [
67-
[
68-
'title' => 'Manage companies',
69-
'route' => 'administration.companies',
70-
'icon' => 'fa-building',
71-
'always_shown' => false,
72-
'permissions' => ['View all companies', 'View own companies']
73-
],
74-
[
75-
'title' => 'Manage users',
76-
'route' => 'administration.users',
77-
'icon' => 'fa-users',
78-
'always_shown' => false,
79-
'permissions' => ['View all users', 'View company users']
80-
],
81-
[
82-
'title' => 'Manage user roles',
83-
'route' => 'administration.roles',
84-
'icon' => 'fa-user-lock',
85-
'always_shown' => false,
86-
'permissions' => ['Manage user roles']
87-
],
88-
[
89-
'title' => 'Manage statuses',
90-
'route' => 'administration.ticket-statuses',
91-
'icon' => 'fa-square-check',
92-
'always_shown' => false,
93-
'permissions' => ['Manage ticket statuses']
94-
],
95-
[
96-
'title' => 'Manage types',
97-
'route' => 'administration.ticket-types',
98-
'icon' => 'fa-copy',
99-
'always_shown' => false,
100-
'permissions' => ['Manage ticket types']
101-
],
102-
[
103-
'title' => 'Manage priorities',
104-
'route' => 'administration.ticket-priorities',
105-
'icon' => 'fa-arrow-up',
106-
'always_shown' => false,
107-
'permissions' => ['Manage ticket priorities']
108-
],
109-
[
110-
'title' => 'Activity logs',
111-
'route' => 'administration.activity-logs',
112-
'icon' => 'fa-bell',
113-
'always_shown' => false,
114-
'permissions' => ['View activity log']
115-
]
116-
]
117-
],
118-
'notifications' => [
119-
'title' => 'Notifications',
120-
'icon' => 'fa-bell',
121-
'always_shown' => true,
122-
'show_notification_indicator' => true,
123-
'permissions' => ['']
124-
],
125-
];
19+
$this->menu = config('system.main_menu');
12620
}
12721

12822
/**

config/system.php

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,156 @@
1515
'fr' => 'Français'
1616
],
1717

18+
/*
19+
|--------------------------------------------------------------------------
20+
| Main menu configuration
21+
|--------------------------------------------------------------------------
22+
|
23+
| This value is the definition of the application main menu
24+
| Used in the 'App\View\Components\MainMenu' blade component
25+
|
26+
| Parameters:
27+
| -----------
28+
| - 'title' The translatable title of the menu
29+
|
30+
| - 'route' The menu route name
31+
|
32+
| - 'icon' The Fontawesome icon class
33+
| (icons list: http://fontawesome.io/icons/)
34+
|
35+
| - 'always_shown' If equals to "true" the menu is always shown without
36+
| checking permissions, if "false" the 'permissions' parameter
37+
| is used to show or not the menu item
38+
|
39+
| - 'show_notification_indicator' If equals to "true" the menu item will
40+
| show an indicator if there is notifications not read
41+
|
42+
| - 'permissions' The permissions used to show or not the menu item
43+
|
44+
| - (Optional) 'children' The sub menu items
45+
| - 'children.title' The translatable title of the sub menu
46+
|
47+
| - 'children.route' The sub menu route name
48+
|
49+
| - 'children.icon' The Fontawesome icon class
50+
| (icons list: http://fontawesome.io/icons/)
51+
|
52+
| - 'children.always_shown' If equals to "true" the menu is always
53+
| shown without checking permissions, if "false"
54+
| the 'permissions' parameter is used to show or not
55+
| the menu item
56+
|
57+
| - 'children.permissions' The permissions used to show or not
58+
| the menu item
59+
|
60+
*/
61+
'main_menu' => [
62+
[
63+
'title' => 'Overview',
64+
'route' => 'home',
65+
'icon' => 'fa-table-columns',
66+
'always_shown' => true,
67+
'show_notification_indicator' => false,
68+
'permissions' => ['']
69+
],
70+
[
71+
'title' => 'Analytics',
72+
'route' => 'analytics',
73+
'icon' => 'fa-chart-bar',
74+
'always_shown' => false,
75+
'show_notification_indicator' => false,
76+
'permissions' => ['Can view Analytics page']
77+
],
78+
[
79+
'title' => 'Tickets',
80+
'route' => 'tickets',
81+
'icon' => 'fa-ticket',
82+
'always_shown' => false,
83+
'show_notification_indicator' => false,
84+
'permissions' => ['Can view Tickets page']
85+
],
86+
[
87+
'title' => 'Kanban Board',
88+
'route' => 'kanban',
89+
'icon' => 'fa-clipboard-check',
90+
'always_shown' => false,
91+
'show_notification_indicator' => false,
92+
'permissions' => ['Can view Kanban page']
93+
],
94+
[
95+
'title' => 'Administration',
96+
'route' => 'administration',
97+
'icon' => 'fa-cogs',
98+
'always_shown' => false,
99+
'show_notification_indicator' => false,
100+
'permissions' => [
101+
'View all users', 'View company users',
102+
'View all companies', 'View own companies',
103+
'Manage ticket statuses',
104+
'Manage ticket types',
105+
'Manage ticket priorities',
106+
'View activity log'
107+
],
108+
'children' => [
109+
[
110+
'title' => 'Manage companies',
111+
'route' => 'administration.companies',
112+
'icon' => 'fa-building',
113+
'always_shown' => false,
114+
'permissions' => ['View all companies', 'View own companies']
115+
],
116+
[
117+
'title' => 'Manage users',
118+
'route' => 'administration.users',
119+
'icon' => 'fa-users',
120+
'always_shown' => false,
121+
'permissions' => ['View all users', 'View company users']
122+
],
123+
[
124+
'title' => 'Manage user roles',
125+
'route' => 'administration.roles',
126+
'icon' => 'fa-user-lock',
127+
'always_shown' => false,
128+
'permissions' => ['Manage user roles']
129+
],
130+
[
131+
'title' => 'Manage statuses',
132+
'route' => 'administration.ticket-statuses',
133+
'icon' => 'fa-square-check',
134+
'always_shown' => false,
135+
'permissions' => ['Manage ticket statuses']
136+
],
137+
[
138+
'title' => 'Manage types',
139+
'route' => 'administration.ticket-types',
140+
'icon' => 'fa-copy',
141+
'always_shown' => false,
142+
'permissions' => ['Manage ticket types']
143+
],
144+
[
145+
'title' => 'Manage priorities',
146+
'route' => 'administration.ticket-priorities',
147+
'icon' => 'fa-arrow-up',
148+
'always_shown' => false,
149+
'permissions' => ['Manage ticket priorities']
150+
],
151+
[
152+
'title' => 'Activity logs',
153+
'route' => 'administration.activity-logs',
154+
'icon' => 'fa-bell',
155+
'always_shown' => false,
156+
'permissions' => ['View activity log']
157+
]
158+
]
159+
],
160+
[
161+
'title' => 'Notifications',
162+
'route' => 'notifications',
163+
'icon' => 'fa-bell',
164+
'always_shown' => true,
165+
'show_notification_indicator' => true,
166+
'permissions' => ['']
167+
],
168+
],
169+
18170
];

database/help_desk.pgsql.sql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,7 @@ TRUNCATE TABLE permissions CASCADE;
9595
TRUNCATE TABLE permissions CASCADE;
9696
TRUNCATE TABLE roles CASCADE;
9797
TRUNCATE TABLE role_has_permissions CASCADE;
98-
99-
TRUNCATE TABLE model_has_roles;
100-
INSERT INTO model_has_roles (role_id, model_type, model_id)
101-
VALUES (1, 'App\\Models\\User', 4),
102-
(2, 'App\\Models\\User', 5),
103-
(3, 'App\\Models\\User', 6);
98+
TRUNCATE TABLE model_has_roles CASCADE;
10499

105100
INSERT INTO permissions (id, name, guard_name, created_at, updated_at)
106101
VALUES (1, 'View all projects', 'web', '2022-09-25 14:51:10', '2022-09-25 14:51:10'),
@@ -148,6 +143,11 @@ VALUES (1, 'Super administrator', 'web', '2022-09-30 08:11:23', '2022-09-30 08:1
148143
(2, 'Employee', 'web', '2022-09-30 08:14:58', '2022-09-30 08:14:58'),
149144
(3, 'Customer', 'web', '2022-09-30 08:17:01', '2022-09-30 08:17:01');
150145

146+
INSERT INTO model_has_roles (role_id, model_type, model_id)
147+
VALUES (1, 'App\Models\User', 4),
148+
(2, 'App\Models\User', 5),
149+
(3, 'App\Models\User', 6);
150+
151151
INSERT INTO role_has_permissions (permission_id, role_id)
152152
VALUES (1, 1),
153153
(2, 1),
File renamed without changes.

docs/_sidebar.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Help Desk](logo.png)
1+
![Help Desk](_media/logo.png)
22

33
- [Help Desk](/?id=help-desk)
44
- [Features](/?id=features)
@@ -16,4 +16,11 @@
1616
- [Project structure](/getting-started?id=project-structure)
1717
- [Theme customization](/getting-started?id=theme-customization)
1818

19+
- [Configuration](/configuration?id=configuration)
20+
- [Locales](/configuration?id=locales)
21+
- [Main menu](/configuration?id=main-menu)
22+
23+
- [Permissions](/permissions?id=permissions)
24+
- [Seeder](/permissions?id=seeder)
25+
1926
- [Changelog](/changelog?id=changelog)

docs/configuration.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Configuration
2+
3+
> We are working to make the Help Desk application configurable as much as possible.
4+
5+
You can check the below section to see the section you can configure easily by using the file `config/system.php`.
6+
7+
## Locales
8+
9+
For now the Help Desk comes with two languages **English** and **French**, so if you are planing to add more languages to the application by adding `lang/**` files, you need to update the `config('system.locales')` configuration.
10+
11+
Below is the default configuration:
12+
13+
```php
14+
'locales' => [
15+
'en' => 'English',
16+
'fr' => 'Français'
17+
],
18+
```
19+
20+
### Example
21+
22+
If you want to add the **Arabic** language, you need to translate the `lang/fr.json` file into a new file name `lang/ar.json`, the update the configuration like the following:
23+
24+
```php
25+
'locales' => [
26+
'en' => 'English',
27+
'fr' => 'Français',
28+
'ar' => 'العربية'
29+
],
30+
```
31+
32+
## Main menu
33+
34+
The application main menu is configurable as well in the `config('system.main_menu')` configuration parameter.
35+
36+
You can check the configuration file `config/system.php`, there is the comment below that explains all the parameters you can use to configure your main menu:
37+
38+
```php
39+
/*
40+
|--------------------------------------------------------------------------
41+
| Main menu configuration
42+
|--------------------------------------------------------------------------
43+
|
44+
| This value is the definition of the application main menu
45+
| Used in the 'App\View\Components\MainMenu' blade component
46+
|
47+
| Parameters:
48+
| -----------
49+
| - 'title' The translatable title of the menu
50+
|
51+
| - 'route' The menu route name
52+
|
53+
| - 'icon' The Fontawesome icon class
54+
| (icons list: http://fontawesome.io/icons/)
55+
|
56+
| - 'always_shown' If equals to "true" the menu is always shown without
57+
| checking permissions, if "false" the 'permissions' parameter
58+
| is used to show or not the menu item
59+
|
60+
| - 'show_notification_indicator' If equals to "true" the menu item will
61+
| show an indicator if there is notifications not read
62+
|
63+
| - 'permissions' The permissions used to show or not the menu item
64+
|
65+
| - (Optional) 'children' The sub menu items
66+
| - 'children.title' The translatable title of the sub menu
67+
|
68+
| - 'children.route' The sub menu route name
69+
|
70+
| - 'children.icon' The Fontawesome icon class
71+
| (icons list: http://fontawesome.io/icons/)
72+
|
73+
| - 'children.always_shown' If equals to "true" the menu is always
74+
| shown without checking permissions, if "false"
75+
| the 'permissions' parameter is used to show or not
76+
| the menu item
77+
|
78+
| - 'children.permissions' The permissions used to show or not
79+
| the menu item
80+
|
81+
*/
82+
```

0 commit comments

Comments
 (0)