shared-ritm 1.0.50 → 1.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +93 -0
  2. package/dist/index.css +1 -1
  3. package/dist/shared-ritm.es.js +1105 -1136
  4. package/dist/shared-ritm.umd.js +7 -7
  5. package/dist/types/api/services/ProjectsService.d.ts +0 -10
  6. package/dist/types/index.d.ts +1 -2
  7. package/package.json +56 -56
  8. package/src/App.vue +2404 -2404
  9. package/src/api/services/AuthService.ts +37 -37
  10. package/src/api/services/GanttService.ts +17 -17
  11. package/src/api/services/MetricsService.ts +74 -74
  12. package/src/api/services/ProjectsService.ts +15 -56
  13. package/src/api/services/RepairsService.ts +82 -82
  14. package/src/api/services/TasksService.ts +15 -15
  15. package/src/api/settings/ApiService.ts +124 -124
  16. package/src/api/types/Api_Repairs.ts +57 -57
  17. package/src/api/types/Api_Tasks.ts +99 -99
  18. package/src/common/app-button/AppButton.vue +1 -1
  19. package/src/common/app-icon/AppIcon.vue +104 -104
  20. package/src/common/app-input/AppInput.vue +128 -128
  21. package/src/common/app-input-search/AppInputSearch.vue +168 -170
  22. package/src/common/app-layout/AppLayout.vue +61 -62
  23. package/src/common/app-layout/components/AppLayoutHeader.vue +119 -119
  24. package/src/common/app-loader/index.vue +41 -43
  25. package/src/common/app-page-layout/AppPageLayout.vue +122 -122
  26. package/src/common/app-select/AppSelect.vue +154 -154
  27. package/src/common/app-sidebar/AppSidebar.vue +163 -163
  28. package/src/common/app-sidebar/components/SidebarMenu.vue +27 -27
  29. package/src/common/app-sidebar/components/SidebarMenuItem.vue +134 -134
  30. package/src/common/app-toggle/index.vue +23 -23
  31. package/src/common/app-wrapper/AppWrapper.vue +25 -25
  32. package/src/global.d.ts +1 -1
  33. package/src/icons/sidebar/projects-icon.vue +31 -31
  34. package/src/icons/sidebar/tasks_tasks-icon.vue +39 -39
  35. package/src/icons/sidebar/tasks_today-icon.vue +27 -27
  36. package/src/index.ts +34 -35
  37. package/src/main.ts +15 -15
  38. package/src/quasar-user-options.ts +17 -17
  39. package/src/shared/styles/general.css +77 -77
  40. package/src/shims-vue.d.ts +5 -5
@@ -1,124 +1,124 @@
1
- import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'
2
-
3
- export enum ApiServiceType {
4
- SERVICE_AUTH = 'SERVICE_AUTH',
5
- }
6
-
7
- export type ResponseApi<T> = {
8
- count: number
9
- current_page: number
10
- data: T
11
- per_page: number
12
- total: number
13
- total_pages: number
14
- }
15
-
16
- export default class ApiService {
17
- private axiosInstance: AxiosInstance
18
-
19
- constructor() {
20
- this.axiosInstance = axios.create({
21
- baseURL: process.env.VUE_APP_BACKEND,
22
- headers: {
23
- 'Content-Type': 'application/json',
24
- },
25
- })
26
-
27
- this.axiosInstance.interceptors.request.use(
28
- (config: InternalAxiosRequestConfig) => {
29
- const token = this.getToken()
30
- if (token && config.headers) {
31
- config.headers.Authorization = `Bearer ${token}`
32
- }
33
- return config
34
- },
35
- (error: AxiosError) => {
36
- return Promise.reject(error)
37
- },
38
- )
39
-
40
- this.axiosInstance.interceptors.response.use(
41
- (response: AxiosResponse) => {
42
- return response.data
43
- },
44
- (error: AxiosError) => {
45
- if (error.response?.status === 401 || error.response?.status === 403) {
46
- this.logout()
47
- }
48
- return Promise.reject(error)
49
- },
50
- )
51
- }
52
- private getToken() {
53
- return localStorage.getItem('token')
54
- }
55
-
56
- private removeToken() {
57
- localStorage.removeItem('token')
58
- }
59
-
60
- public logout(): void {
61
- this.removeToken()
62
- window.location.href = '/sign-in'
63
- }
64
-
65
- private handleError(error: AxiosError): void {
66
- if (error.response) {
67
- console.error('API Error:', error.response.status, error.response.data)
68
- } else if (error.request) {
69
- console.error('No response received:', error.request)
70
- } else {
71
- console.error('Error during request setup:', error.message)
72
- }
73
- }
74
-
75
- protected async get<T>(url: string, options?: AxiosRequestConfig) {
76
- try {
77
- const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
78
- return response?.data ?? (response as unknown as T)
79
- } catch (error) {
80
- const axiosError = error as AxiosError
81
- this.handleError(axiosError)
82
- throw error
83
- }
84
- }
85
-
86
- protected async delete<T>(url: string, options?: AxiosRequestConfig) {
87
- try {
88
- return await this.axiosInstance.delete<T>(url, options)
89
- } catch (error) {
90
- const axiosError = error as AxiosError
91
- this.handleError(axiosError)
92
- throw error
93
- }
94
- }
95
-
96
- protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
97
- try {
98
- const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
99
- return response.data
100
- } catch (error) {
101
- const axiosError = error as AxiosError
102
- this.handleError(axiosError)
103
- throw error
104
- }
105
- }
106
-
107
- // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
108
- // return axios
109
- // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
110
- // .catch((err: AxiosError) => processError401<T2>(err))
111
- // .then(extractData)
112
- // }
113
- //
114
- protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
115
- try {
116
- const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
117
- return response.data
118
- } catch (error) {
119
- const axiosError = error as AxiosError
120
- this.handleError(axiosError)
121
- throw error
122
- }
123
- }
124
- }
1
+ import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'
2
+
3
+ export enum ApiServiceType {
4
+ SERVICE_AUTH = 'SERVICE_AUTH',
5
+ }
6
+
7
+ export type ResponseApi<T> = {
8
+ count: number
9
+ current_page: number
10
+ data: T
11
+ per_page: number
12
+ total: number
13
+ total_pages: number
14
+ }
15
+
16
+ export default class ApiService {
17
+ private axiosInstance: AxiosInstance
18
+
19
+ constructor() {
20
+ this.axiosInstance = axios.create({
21
+ baseURL: process.env.VUE_APP_BACKEND,
22
+ headers: {
23
+ 'Content-Type': 'application/json',
24
+ },
25
+ })
26
+
27
+ this.axiosInstance.interceptors.request.use(
28
+ (config: InternalAxiosRequestConfig) => {
29
+ const token = this.getToken()
30
+ if (token && config.headers) {
31
+ config.headers.Authorization = `Bearer ${token}`
32
+ }
33
+ return config
34
+ },
35
+ (error: AxiosError) => {
36
+ return Promise.reject(error)
37
+ },
38
+ )
39
+
40
+ this.axiosInstance.interceptors.response.use(
41
+ (response: AxiosResponse) => {
42
+ return response.data
43
+ },
44
+ (error: AxiosError) => {
45
+ if (error.response?.status === 401 || error.response?.status === 403) {
46
+ this.logout()
47
+ }
48
+ return Promise.reject(error)
49
+ },
50
+ )
51
+ }
52
+ private getToken() {
53
+ return localStorage.getItem('token')
54
+ }
55
+
56
+ private removeToken() {
57
+ localStorage.removeItem('token')
58
+ }
59
+
60
+ public logout(): void {
61
+ this.removeToken()
62
+ window.location.href = '/sign-in'
63
+ }
64
+
65
+ private handleError(error: AxiosError): void {
66
+ if (error.response) {
67
+ console.error('API Error:', error.response.status, error.response.data)
68
+ } else if (error.request) {
69
+ console.error('No response received:', error.request)
70
+ } else {
71
+ console.error('Error during request setup:', error.message)
72
+ }
73
+ }
74
+
75
+ protected async get<T>(url: string, options?: AxiosRequestConfig) {
76
+ try {
77
+ const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
78
+ return response?.data ?? (response as unknown as T)
79
+ } catch (error) {
80
+ const axiosError = error as AxiosError
81
+ this.handleError(axiosError)
82
+ throw error
83
+ }
84
+ }
85
+
86
+ protected async delete<T>(url: string, options?: AxiosRequestConfig) {
87
+ try {
88
+ return await this.axiosInstance.delete<T>(url, options)
89
+ } catch (error) {
90
+ const axiosError = error as AxiosError
91
+ this.handleError(axiosError)
92
+ throw error
93
+ }
94
+ }
95
+
96
+ protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
97
+ try {
98
+ const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
99
+ return response.data
100
+ } catch (error) {
101
+ const axiosError = error as AxiosError
102
+ this.handleError(axiosError)
103
+ throw error
104
+ }
105
+ }
106
+
107
+ // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
108
+ // return axios
109
+ // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
110
+ // .catch((err: AxiosError) => processError401<T2>(err))
111
+ // .then(extractData)
112
+ // }
113
+ //
114
+ protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
115
+ try {
116
+ const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
117
+ return response.data
118
+ } catch (error) {
119
+ const axiosError = error as AxiosError
120
+ this.handleError(axiosError)
121
+ throw error
122
+ }
123
+ }
124
+ }
@@ -1,57 +1,57 @@
1
- export type Api_Team = {
2
- id: string
3
- display_name: string
4
- }
5
-
6
- export type Api_Equipment_Short_Dto = {
7
- id: string
8
- name: string
9
- }
10
-
11
- export type Api_Repairs = {
12
- id: string
13
- name: string
14
- }
15
-
16
- export type Api_Projects = {
17
- id: string
18
- name: string
19
- }
20
-
21
- export type OptionFilters = {
22
- teams?: Api_Team[]
23
- equipments?: Api_Equipment_Short_Dto[]
24
- }
25
-
26
- export type Api_Equipment_Full_Dto = {
27
- id: string
28
- model: null | string
29
- name: string
30
- registration_number: string
31
- repair_frequency: number
32
- repair_range: number
33
- }
34
-
35
- export type Api_Create_Repair_With_Equipments = {
36
- name: string
37
- display_name: string
38
- description: string
39
- equipment_id: string
40
- }
41
-
42
- export type Api_Update_Repair = {
43
- name?: string
44
- display_name?: string
45
- description: string
46
- }
47
-
48
- export type Api_Repair_Dto = {
49
- id: string
50
- name: string
51
- display_name: string
52
- description: string
53
- start_date: string
54
- end_date: string
55
- projects: Api_Projects[]
56
- equipments: Api_Equipment_Full_Dto[]
57
- }
1
+ export type Api_Team = {
2
+ id: string
3
+ display_name: string
4
+ }
5
+
6
+ export type Api_Equipment_Short_Dto = {
7
+ id: string
8
+ name: string
9
+ }
10
+
11
+ export type Api_Repairs = {
12
+ id: string
13
+ name: string
14
+ }
15
+
16
+ export type Api_Projects = {
17
+ id: string
18
+ name: string
19
+ }
20
+
21
+ export type OptionFilters = {
22
+ teams?: Api_Team[]
23
+ equipments?: Api_Equipment_Short_Dto[]
24
+ }
25
+
26
+ export type Api_Equipment_Full_Dto = {
27
+ id: string
28
+ model: null | string
29
+ name: string
30
+ registration_number: string
31
+ repair_frequency: number
32
+ repair_range: number
33
+ }
34
+
35
+ export type Api_Create_Repair_With_Equipments = {
36
+ name: string
37
+ display_name: string
38
+ description: string
39
+ equipment_id: string
40
+ }
41
+
42
+ export type Api_Update_Repair = {
43
+ name?: string
44
+ display_name?: string
45
+ description: string
46
+ }
47
+
48
+ export type Api_Repair_Dto = {
49
+ id: string
50
+ name: string
51
+ display_name: string
52
+ description: string
53
+ start_date: string
54
+ end_date: string
55
+ projects: Api_Projects[]
56
+ equipments: Api_Equipment_Full_Dto[]
57
+ }
@@ -1,99 +1,99 @@
1
- export type Api_Tasks_Responsible_Dto = {
2
- id: string
3
- first_name: string
4
- last_name: string
5
- patronymic: string
6
- full_name: string
7
- }
8
-
9
- export type Api_Tasks_Assigned_Dto = {
10
- id: string
11
- first_name: string
12
- last_name: string
13
- patronymic: null | string
14
- full_name: string
15
- }
16
-
17
- export type Api_Tasks_Status_Dto = {
18
- id: string
19
- name: string
20
- title: string
21
- }
22
- export type Api_Tasks_Project_Dto = {
23
- id: string
24
- name: string
25
- teams: string[]
26
- }
27
- export type Api_Tasks_Position_Dto = {
28
- id: string
29
- name: string
30
- display_name: string
31
- }
32
-
33
- export type Api_Tasks_Position_Assigned_Dto = {
34
- id: number
35
- user: {
36
- id: string
37
- full_name: string
38
- }
39
- position: Api_Tasks_Position_Dto
40
- }
41
-
42
- export type Api_Tasks_Teams_Dto = {
43
- id: string
44
- name: string
45
- display_name: string
46
- }
47
-
48
- export type Api_Tasks_Equipment_Dto = {
49
- id: string
50
- name: string
51
- model: string
52
- registration_number: string
53
- created_at: string
54
- updated_at: string
55
- repair_frequency: number
56
- repair_range: number
57
- }
58
-
59
- export type Api_Tasks_Task_Dto = {
60
- id: string
61
- name: string
62
- type: string
63
- project_id: string
64
- description: string
65
- subtask_counter: number
66
- subtasks: Api_Tasks_Task_Dto[]
67
- state_id: null | string
68
- start_date: string
69
- end_date: string
70
- deadline: string
71
- plan_date: string
72
- time_to_complete: null | string | number
73
- time_to_complete_sec: number
74
- priority: number
75
- work_zone_id: null | string
76
- location_id: null | string
77
- target: any
78
- status: Api_Tasks_Status_Dto
79
- project: Api_Tasks_Project_Dto
80
- position: Api_Tasks_Position_Dto[]
81
- assigned: Api_Tasks_Assigned_Dto[]
82
- instruments: any[]
83
- warehouse: any[]
84
- responsible: Api_Tasks_Responsible_Dto[]
85
- position_assigned: Api_Tasks_Position_Assigned_Dto[]
86
- comments: any[]
87
- files: any[]
88
- teams: Api_Tasks_Teams_Dto[]
89
- work_zone: string
90
- planned_start: null | string
91
- planned_end: null | string
92
- fact_start_date: string
93
- fact_end_date: null | string
94
- work_sec: number
95
- pause_sec: number
96
- repair_object: null | string
97
- isPause: boolean
98
- equipment: Api_Tasks_Equipment_Dto[]
99
- }
1
+ export type Api_Tasks_Responsible_Dto = {
2
+ id: string
3
+ first_name: string
4
+ last_name: string
5
+ patronymic: string
6
+ full_name: string
7
+ }
8
+
9
+ export type Api_Tasks_Assigned_Dto = {
10
+ id: string
11
+ first_name: string
12
+ last_name: string
13
+ patronymic: null | string
14
+ full_name: string
15
+ }
16
+
17
+ export type Api_Tasks_Status_Dto = {
18
+ id: string
19
+ name: string
20
+ title: string
21
+ }
22
+ export type Api_Tasks_Project_Dto = {
23
+ id: string
24
+ name: string
25
+ teams: string[]
26
+ }
27
+ export type Api_Tasks_Position_Dto = {
28
+ id: string
29
+ name: string
30
+ display_name: string
31
+ }
32
+
33
+ export type Api_Tasks_Position_Assigned_Dto = {
34
+ id: number
35
+ user: {
36
+ id: string
37
+ full_name: string
38
+ }
39
+ position: Api_Tasks_Position_Dto
40
+ }
41
+
42
+ export type Api_Tasks_Teams_Dto = {
43
+ id: string
44
+ name: string
45
+ display_name: string
46
+ }
47
+
48
+ export type Api_Tasks_Equipment_Dto = {
49
+ id: string
50
+ name: string
51
+ model: string
52
+ registration_number: string
53
+ created_at: string
54
+ updated_at: string
55
+ repair_frequency: number
56
+ repair_range: number
57
+ }
58
+
59
+ export type Api_Tasks_Task_Dto = {
60
+ id: string
61
+ name: string
62
+ type: string
63
+ project_id: string
64
+ description: string
65
+ subtask_counter: number
66
+ subtasks: Api_Tasks_Task_Dto[]
67
+ state_id: null | string
68
+ start_date: string
69
+ end_date: string
70
+ deadline: string
71
+ plan_date: string
72
+ time_to_complete: null | string | number
73
+ time_to_complete_sec: number
74
+ priority: number
75
+ work_zone_id: null | string
76
+ location_id: null | string
77
+ target: any
78
+ status: Api_Tasks_Status_Dto
79
+ project: Api_Tasks_Project_Dto
80
+ position: Api_Tasks_Position_Dto[]
81
+ assigned: Api_Tasks_Assigned_Dto[]
82
+ instruments: any[]
83
+ warehouse: any[]
84
+ responsible: Api_Tasks_Responsible_Dto[]
85
+ position_assigned: Api_Tasks_Position_Assigned_Dto[]
86
+ comments: any[]
87
+ files: any[]
88
+ teams: Api_Tasks_Teams_Dto[]
89
+ work_zone: string
90
+ planned_start: null | string
91
+ planned_end: null | string
92
+ fact_start_date: string
93
+ fact_end_date: null | string
94
+ work_sec: number
95
+ pause_sec: number
96
+ repair_object: null | string
97
+ isPause: boolean
98
+ equipment: Api_Tasks_Equipment_Dto[]
99
+ }
@@ -121,7 +121,7 @@ const isDisabled = computed(() => {
121
121
  border-radius: 14px;
122
122
  }
123
123
  &:global(.q-btn) {
124
- color: #0a1629;
124
+ color: #ea0e3f;
125
125
  font-size: 16px;
126
126
  font-style: normal;
127
127
  font-weight: 700;