shared-ritm 1.1.70 → 1.1.71

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 (87) hide show
  1. package/README.md +103 -103
  2. package/dist/index.css +1 -1
  3. package/dist/shared-ritm.es.js +250 -243
  4. package/dist/shared-ritm.umd.js +3 -3
  5. package/dist/types/api/services/TasksService.d.ts +6 -1
  6. package/dist/types/api/types/Api_Tasks.d.ts +4 -0
  7. package/package.json +57 -57
  8. package/src/api/services/AuthService.ts +41 -41
  9. package/src/api/services/FileService.ts +15 -15
  10. package/src/api/services/GanttService.ts +17 -17
  11. package/src/api/services/MetricsService.ts +101 -101
  12. package/src/api/services/ProjectsService.ts +61 -61
  13. package/src/api/services/TasksService.ts +10 -0
  14. package/src/api/settings/ApiService.ts +125 -125
  15. package/src/api/types/Api_Files.ts +1 -1
  16. package/src/api/types/Api_Projects.ts +55 -55
  17. package/src/api/types/Api_Tasks.ts +5 -0
  18. package/src/common/app-button/AppButton.vue +173 -173
  19. package/src/common/app-checkbox/AppCheckbox.vue +26 -26
  20. package/src/common/app-date-picker/AppDatePicker.vue +74 -74
  21. package/src/common/app-dialogs/AppConfirmDialog.vue +100 -100
  22. package/src/common/app-dropdown/AppDropdown.vue +31 -31
  23. package/src/common/app-icon/AppIcon.vue +104 -104
  24. package/src/common/app-input/AppInput.vue +147 -147
  25. package/src/common/app-input-search/AppInputSearch.vue +170 -170
  26. package/src/common/app-layout/AppLayout.vue +63 -63
  27. package/src/common/app-layout/components/AppLayoutHeader.vue +123 -123
  28. package/src/common/app-loader/index.vue +43 -43
  29. package/src/common/app-page-layout/AppPageLayout.vue +122 -122
  30. package/src/common/app-select/AppSelect.vue +157 -157
  31. package/src/common/app-sheet/AppSheet.vue +114 -114
  32. package/src/common/app-sidebar/AppSidebar.vue +168 -168
  33. package/src/common/app-sidebar/components/SidebarMenu.vue +37 -37
  34. package/src/common/app-sidebar/components/SidebarMenuItem.vue +139 -139
  35. package/src/common/app-wrapper/AppWrapper.vue +28 -28
  36. package/src/global.d.ts +1 -1
  37. package/src/icons/components/arrow-down-icon.vue +25 -25
  38. package/src/icons/components/arrow-frame-icon.vue +19 -19
  39. package/src/icons/components/arrow-square.vue +22 -22
  40. package/src/icons/dialogs/RemoveIcon.vue +12 -12
  41. package/src/icons/dialogs/SafetyIcon.vue +12 -12
  42. package/src/icons/header/flashIcon.vue +24 -24
  43. package/src/icons/header/notificationIcon.vue +18 -18
  44. package/src/icons/header/searchStatusIcon.vue +24 -24
  45. package/src/icons/header/smallCapsIcon.vue +34 -34
  46. package/src/icons/sidebar/assign-module-icon.vue +36 -36
  47. package/src/icons/sidebar/instrument-history-icon.vue +32 -32
  48. package/src/icons/sidebar/instrument-order-icon.vue +38 -38
  49. package/src/icons/sidebar/instrument-work-zone-icon.vue +18 -18
  50. package/src/icons/sidebar/instruments-icon.vue +45 -45
  51. package/src/icons/sidebar/logo-icon.vue +15 -15
  52. package/src/icons/sidebar/logout-icon.vue +13 -13
  53. package/src/icons/sidebar/modules-icon.vue +16 -16
  54. package/src/icons/sidebar/notifications-icon.vue +24 -24
  55. package/src/icons/sidebar/order-icon.vue +44 -44
  56. package/src/icons/sidebar/pass-icon.vue +38 -38
  57. package/src/icons/sidebar/positions-icon.vue +42 -42
  58. package/src/icons/sidebar/preorder-icon.vue +19 -19
  59. package/src/icons/sidebar/projects-icon.vue +31 -31
  60. package/src/icons/sidebar/repair-object-icon.vue +18 -18
  61. package/src/icons/sidebar/repairs-icon.vue +20 -20
  62. package/src/icons/sidebar/roles-icon.vue +26 -26
  63. package/src/icons/sidebar/status-history-icon.vue +24 -24
  64. package/src/icons/sidebar/tasks-icon.vue +28 -28
  65. package/src/icons/sidebar/tasks_tasks-icon.vue +39 -39
  66. package/src/icons/sidebar/tasks_today-icon.vue +27 -27
  67. package/src/icons/sidebar/teams-icon.vue +32 -32
  68. package/src/icons/sidebar/user-icon.vue +18 -18
  69. package/src/icons/sidebar/users-icon.vue +46 -46
  70. package/src/icons/sidebar/videosources-icon.vue +19 -19
  71. package/src/icons/sidebar/videowall-icon.vue +13 -13
  72. package/src/icons/sidebar/videozones-icon.vue +21 -21
  73. package/src/icons/sidebar/warehouses-icon.vue +43 -43
  74. package/src/icons/sidebar/workshop-icon.vue +100 -100
  75. package/src/icons/sidebar/workzones-icon.vue +22 -22
  76. package/src/icons/task/attention-icon.vue +13 -13
  77. package/src/icons/task/clock-icon.vue +10 -10
  78. package/src/icons/task/delete-icon.vue +10 -10
  79. package/src/icons/task/fire-icon.vue +16 -16
  80. package/src/index.ts +62 -62
  81. package/src/main.ts +18 -18
  82. package/src/quasar-user-options.ts +17 -17
  83. package/src/router/index.ts +10 -10
  84. package/src/shared/styles/general.css +96 -96
  85. package/src/shims-vue.d.ts +5 -5
  86. package/src/utils/confirm.ts +12 -12
  87. package/src/utils/notification.ts +9 -9
@@ -1,125 +1,125 @@
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
-
53
- private getToken() {
54
- return localStorage.getItem('token')
55
- }
56
-
57
- private removeToken() {
58
- localStorage.removeItem('token')
59
- }
60
-
61
- public logout(): void {
62
- this.removeToken()
63
- window.location.href = '/sign-in'
64
- }
65
-
66
- private handleError(error: AxiosError): void {
67
- if (error.response) {
68
- console.error('API Error:', error.response.status, error.response.data)
69
- } else if (error.request) {
70
- console.error('No response received:', error.request)
71
- } else {
72
- console.error('Error during request setup:', error.message)
73
- }
74
- }
75
-
76
- protected async get<T>(url: string, options?: AxiosRequestConfig) {
77
- try {
78
- const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
79
- return response?.data ?? (response as unknown as T)
80
- } catch (error) {
81
- const axiosError = error as AxiosError
82
- this.handleError(axiosError)
83
- throw error
84
- }
85
- }
86
-
87
- protected async delete<T>(url: string, options?: AxiosRequestConfig) {
88
- try {
89
- return await this.axiosInstance.delete<T>(url, options)
90
- } catch (error) {
91
- const axiosError = error as AxiosError
92
- this.handleError(axiosError)
93
- throw error
94
- }
95
- }
96
-
97
- protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
98
- try {
99
- const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
100
- return response.data
101
- } catch (error) {
102
- const axiosError = error as AxiosError
103
- this.handleError(axiosError)
104
- throw error
105
- }
106
- }
107
-
108
- // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
109
- // return axios
110
- // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
111
- // .catch((err: AxiosError) => processError401<T2>(err))
112
- // .then(extractData)
113
- // }
114
- //
115
- protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
116
- try {
117
- const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
118
- return response.data
119
- } catch (error) {
120
- const axiosError = error as AxiosError
121
- this.handleError(axiosError)
122
- throw error
123
- }
124
- }
125
- }
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
+
53
+ private getToken() {
54
+ return localStorage.getItem('token')
55
+ }
56
+
57
+ private removeToken() {
58
+ localStorage.removeItem('token')
59
+ }
60
+
61
+ public logout(): void {
62
+ this.removeToken()
63
+ window.location.href = '/sign-in'
64
+ }
65
+
66
+ private handleError(error: AxiosError): void {
67
+ if (error.response) {
68
+ console.error('API Error:', error.response.status, error.response.data)
69
+ } else if (error.request) {
70
+ console.error('No response received:', error.request)
71
+ } else {
72
+ console.error('Error during request setup:', error.message)
73
+ }
74
+ }
75
+
76
+ protected async get<T>(url: string, options?: AxiosRequestConfig) {
77
+ try {
78
+ const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
79
+ return response?.data ?? (response as unknown as T)
80
+ } catch (error) {
81
+ const axiosError = error as AxiosError
82
+ this.handleError(axiosError)
83
+ throw error
84
+ }
85
+ }
86
+
87
+ protected async delete<T>(url: string, options?: AxiosRequestConfig) {
88
+ try {
89
+ return await this.axiosInstance.delete<T>(url, options)
90
+ } catch (error) {
91
+ const axiosError = error as AxiosError
92
+ this.handleError(axiosError)
93
+ throw error
94
+ }
95
+ }
96
+
97
+ protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
98
+ try {
99
+ const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
100
+ return response.data
101
+ } catch (error) {
102
+ const axiosError = error as AxiosError
103
+ this.handleError(axiosError)
104
+ throw error
105
+ }
106
+ }
107
+
108
+ // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
109
+ // return axios
110
+ // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
111
+ // .catch((err: AxiosError) => processError401<T2>(err))
112
+ // .then(extractData)
113
+ // }
114
+ //
115
+ protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
116
+ try {
117
+ const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
118
+ return response.data
119
+ } catch (error) {
120
+ const axiosError = error as AxiosError
121
+ this.handleError(axiosError)
122
+ throw error
123
+ }
124
+ }
125
+ }
@@ -1 +1 @@
1
- export type Api_Files_Responsible_Dto = unknown
1
+ export type Api_Files_Responsible_Dto = unknown
@@ -1,55 +1,55 @@
1
- export type Api_Project_Repair = {
2
- id: string
3
- name: string
4
- start_date: null | string
5
- end_date: null | string
6
- }
7
-
8
- export type Api_Project_Team = {
9
- id: string
10
- name: string
11
- display_name: string
12
- description: string
13
- created_at: string
14
- updated_at: string
15
- pivot: {
16
- project_id: string
17
- team_id: string
18
- }
19
- }
20
-
21
- export type Api_Project_Category = {
22
- code: number
23
- display_name: string
24
- name: string
25
- }
26
-
27
- export type Api_Project_Status = {
28
- id: string
29
- name: string
30
- title: string
31
- description: string
32
- created_at: string | null
33
- updated_at: string | null
34
- deleted_at: string | null
35
- }
36
-
37
- export type Api_Project_Dto = {
38
- id: string
39
- name: string
40
- description: null
41
- image: null
42
- plan_date: string | null
43
- deadline: string | null
44
- fact_start_date: string | null
45
- fact_end_date: string | null
46
- planned_start: string | null
47
- planned_end: string | null
48
- deleted_at: string | null
49
- total_tasks: number
50
- is_archive: boolean
51
- teams: Api_Project_Team[]
52
- status: Api_Project_Status
53
- category: Api_Project_Category
54
- repair: Api_Project_Repair | null
55
- }
1
+ export type Api_Project_Repair = {
2
+ id: string
3
+ name: string
4
+ start_date: null | string
5
+ end_date: null | string
6
+ }
7
+
8
+ export type Api_Project_Team = {
9
+ id: string
10
+ name: string
11
+ display_name: string
12
+ description: string
13
+ created_at: string
14
+ updated_at: string
15
+ pivot: {
16
+ project_id: string
17
+ team_id: string
18
+ }
19
+ }
20
+
21
+ export type Api_Project_Category = {
22
+ code: number
23
+ display_name: string
24
+ name: string
25
+ }
26
+
27
+ export type Api_Project_Status = {
28
+ id: string
29
+ name: string
30
+ title: string
31
+ description: string
32
+ created_at: string | null
33
+ updated_at: string | null
34
+ deleted_at: string | null
35
+ }
36
+
37
+ export type Api_Project_Dto = {
38
+ id: string
39
+ name: string
40
+ description: null
41
+ image: null
42
+ plan_date: string | null
43
+ deadline: string | null
44
+ fact_start_date: string | null
45
+ fact_end_date: string | null
46
+ planned_start: string | null
47
+ planned_end: string | null
48
+ deleted_at: string | null
49
+ total_tasks: number
50
+ is_archive: boolean
51
+ teams: Api_Project_Team[]
52
+ status: Api_Project_Status
53
+ category: Api_Project_Category
54
+ repair: Api_Project_Repair | null
55
+ }
@@ -148,3 +148,8 @@ export type Api_Task_Instrument_From_Warehouse = {
148
148
  has_responsible: boolean
149
149
  has_module: boolean
150
150
  }
151
+
152
+ export type Api_Task_Close_Reason = {
153
+ has_reason: boolean
154
+ category: string
155
+ }