@fleetbase/fleetops-engine 0.3.1 → 0.3.2
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.
- package/addon/components/contact-form-panel.hbs +82 -0
- package/addon/components/contact-form-panel.js +195 -0
- package/addon/components/contact-panel/details.hbs +36 -0
- package/addon/components/contact-panel/details.js +3 -0
- package/addon/components/contact-panel.hbs +52 -0
- package/addon/components/contact-panel.js +161 -0
- package/addon/components/driver-form-panel.hbs +39 -55
- package/addon/components/driver-form-panel.js +41 -0
- package/addon/components/driver-panel/details.hbs +2 -2
- package/addon/components/driver-panel.hbs +12 -10
- package/addon/components/driver-panel.js +13 -0
- package/addon/components/fleet-form-panel.hbs +28 -28
- package/addon/components/fleet-form-panel.js +150 -1
- package/addon/components/fleet-listing-panel.hbs +8 -0
- package/addon/components/fleet-listing-panel.js +34 -0
- package/addon/components/fleet-panel/details.hbs +30 -0
- package/addon/components/fleet-panel/driver-listing.hbs +72 -0
- package/addon/components/fleet-panel/driver-listing.js +149 -0
- package/addon/components/fleet-panel/vehicle-listing.hbs +72 -0
- package/addon/components/fleet-panel/vehicle-listing.js +149 -0
- package/addon/components/fleet-panel.hbs +12 -58
- package/addon/components/fleet-panel.js +148 -26
- package/addon/components/fleet-vehicle-listing.hbs +0 -1
- package/addon/components/fuel-report-form-panel.hbs +41 -0
- package/addon/components/fuel-report-form-panel.js +122 -0
- package/addon/components/fuel-report-panel/details.hbs +38 -0
- package/addon/components/fuel-report-panel.hbs +30 -0
- package/addon/components/fuel-report-panel.js +161 -0
- package/addon/components/issue-form-panel.hbs +85 -0
- package/addon/components/issue-form-panel.js +211 -0
- package/addon/components/issue-panel/details.hbs +48 -0
- package/addon/components/issue-panel.hbs +30 -0
- package/addon/components/issue-panel.js +160 -0
- package/addon/components/layout/fleet-ops-sidebar.hbs +2 -2
- package/addon/components/live-map.js +2 -0
- package/addon/components/map-container/toolbar.hbs +9 -9
- package/addon/components/map-container/topbar.hbs +1 -1
- package/addon/components/modals/issue-details.hbs +38 -0
- package/addon/components/modals/issue-from.hbs +138 -0
- package/addon/components/place-form-panel.hbs +50 -0
- package/addon/components/place-form-panel.js +134 -0
- package/addon/components/place-panel/details.hbs +95 -0
- package/addon/components/place-panel.hbs +30 -0
- package/addon/components/place-panel.js +161 -0
- package/addon/components/vehicle-form-panel.hbs +35 -44
- package/addon/components/vehicle-form-panel.js +41 -0
- package/addon/components/vehicle-panel/details.hbs +8 -2
- package/addon/components/vehicle-panel.hbs +8 -6
- package/addon/components/vendor-form-panel/create-form.hbs +114 -0
- package/addon/components/vendor-form-panel/create-form.js +158 -0
- package/addon/components/vendor-form-panel/edit-form.hbs +98 -0
- package/addon/components/vendor-form-panel/edit-form.js +51 -0
- package/addon/components/vendor-form-panel.hbs +48 -0
- package/addon/components/vendor-form-panel.js +226 -0
- package/addon/components/vendor-panel/details.hbs +77 -0
- package/addon/components/vendor-panel/details.js +12 -0
- package/addon/components/vendor-panel.hbs +58 -0
- package/addon/components/vendor-panel.js +161 -0
- package/addon/controllers/management/contacts/index/details.js +55 -0
- package/addon/controllers/management/contacts/index/edit.js +111 -0
- package/addon/controllers/management/contacts/index/new.js +88 -0
- package/addon/controllers/management/contacts/index.js +23 -128
- package/addon/controllers/management/drivers/index/new.js +2 -2
- package/addon/controllers/management/drivers/index.js +18 -32
- package/addon/controllers/management/fleets/index/details.js +53 -0
- package/addon/controllers/management/fleets/index/edit.js +75 -41
- package/addon/controllers/management/fleets/index/new.js +42 -57
- package/addon/controllers/management/fleets/index.js +0 -1
- package/addon/controllers/management/fuel-reports/index/details.js +63 -0
- package/addon/controllers/management/fuel-reports/index/edit.js +111 -0
- package/addon/controllers/management/fuel-reports/index/new.js +95 -0
- package/addon/controllers/management/fuel-reports/index.js +57 -127
- package/addon/controllers/management/issues/index/details.js +54 -0
- package/addon/controllers/management/issues/index/edit.js +111 -0
- package/addon/controllers/management/issues/index/new.js +94 -0
- package/addon/controllers/management/issues/index.js +131 -26
- package/addon/controllers/management/places/index/details.js +55 -0
- package/addon/controllers/management/places/index/edit.js +111 -0
- package/addon/controllers/management/places/index/new.js +88 -0
- package/addon/controllers/management/places/index.js +21 -182
- package/addon/controllers/management/vehicles/index/new.js +2 -6
- package/addon/controllers/management/vendors/index/details.js +55 -0
- package/addon/controllers/management/vendors/index/edit.js +111 -0
- package/addon/controllers/management/vendors/index/new.js +88 -0
- package/addon/controllers/management/vendors/index.js +43 -247
- package/addon/routes/management/contacts/index/details.js +14 -0
- package/addon/routes/management/contacts/index/edit.js +10 -0
- package/addon/routes/management/contacts/index/new.js +3 -0
- package/addon/routes/management/contacts/index.js +1 -1
- package/addon/routes/management/fleets/index/details.js +1 -1
- package/addon/routes/management/fleets/index/edit.js +1 -1
- package/addon/routes/management/fleets/index.js +1 -1
- package/addon/routes/management/fuel-reports/index/details.js +14 -0
- package/addon/routes/management/fuel-reports/index/edit.js +10 -0
- package/addon/routes/management/fuel-reports/index/new.js +3 -0
- package/addon/routes/management/fuel-reports/index.js +3 -1
- package/addon/routes/management/issues/index/details.js +14 -0
- package/addon/routes/management/issues/index/edit.js +10 -0
- package/addon/routes/management/issues/index/new.js +3 -0
- package/addon/routes/management/issues/index.js +1 -1
- package/addon/routes/management/places/index/details.js +14 -0
- package/addon/routes/management/places/index/edit.js +10 -0
- package/addon/routes/management/places/index/new.js +3 -0
- package/addon/routes/management/places/index.js +6 -1
- package/addon/routes/management/vendors/index/details.js +15 -0
- package/addon/routes/management/vendors/index/edit.js +11 -0
- package/addon/routes/management/vendors/index/new.js +3 -0
- package/addon/routes/management/vendors/index.js +1 -0
- package/addon/routes.js +27 -7
- package/addon/services/context-panel.js +60 -0
- package/addon/templates/management/contacts/index/details.hbs +1 -0
- package/addon/templates/management/contacts/index/edit.hbs +1 -0
- package/addon/templates/management/contacts/index/new.hbs +1 -0
- package/addon/templates/management/contacts/index.hbs +22 -3
- package/addon/templates/management/drivers/index.hbs +29 -5
- package/addon/templates/management/fleets/index/details.hbs +1 -1
- package/addon/templates/management/fleets/index/edit.hbs +1 -1
- package/addon/templates/management/fleets/index/new.hbs +1 -1
- package/addon/templates/management/fuel-reports/index/details.hbs +1 -0
- package/addon/templates/management/fuel-reports/index/edit.hbs +1 -0
- package/addon/templates/management/fuel-reports/index/new.hbs +1 -0
- package/addon/templates/management/fuel-reports/index.hbs +25 -4
- package/addon/templates/management/issues/index/details.hbs +1 -0
- package/addon/templates/management/issues/index/edit.hbs +1 -0
- package/addon/templates/management/issues/index/new.hbs +1 -0
- package/addon/templates/management/issues/index.hbs +5 -3
- package/addon/templates/management/places/index/details.hbs +1 -0
- package/addon/templates/management/places/index/edit.hbs +1 -0
- package/addon/templates/management/places/index/new.hbs +1 -0
- package/addon/templates/management/vendors/index/details.hbs +1 -0
- package/addon/templates/management/vendors/index/edit.hbs +1 -0
- package/addon/templates/management/vendors/index/new.hbs +1 -0
- package/addon/templates/operations/orders/index.hbs +3 -3
- package/app/components/contact-form-panel.js +1 -0
- package/app/components/contact-panel/details.js +1 -0
- package/app/components/contact-panel.js +1 -0
- package/app/components/fleet-listing-panel.js +1 -0
- package/app/components/fleet-panel/details.js +1 -0
- package/app/components/fleet-panel/driver-listing.js +1 -0
- package/app/components/fleet-panel/vehicle-listing.js +1 -0
- package/app/components/fuel-report-form-panel.js +1 -0
- package/app/components/fuel-report-panel.js +1 -0
- package/app/components/issue-form-panel.js +1 -0
- package/app/components/issue-panel.js +1 -0
- package/app/components/place-form-panel.js +1 -0
- package/app/components/place-panel.js +1 -0
- package/app/components/vendor-form-panel/create-form.js +1 -0
- package/app/components/vendor-form-panel/edit-form.js +1 -0
- package/app/components/vendor-form-panel.js +1 -0
- package/app/components/vendor-panel/details.js +1 -0
- package/app/components/vendor-panel.js +1 -0
- package/app/controllers/management/contacts/index/details.js +1 -0
- package/app/controllers/management/contacts/index/edit.js +1 -0
- package/app/controllers/management/contacts/index/new.js +1 -0
- package/app/controllers/management/fuel-reports/index/details.js +1 -0
- package/app/controllers/management/fuel-reports/index/edit.js +1 -0
- package/app/controllers/management/fuel-reports/index/new.js +1 -0
- package/app/controllers/management/issues/index/details.js +1 -0
- package/app/controllers/management/issues/index/edit.js +1 -0
- package/app/controllers/management/issues/index/new.js +1 -0
- package/app/controllers/management/places/index/details.js +1 -0
- package/app/controllers/management/places/index/edit.js +1 -0
- package/app/controllers/management/places/index/new.js +1 -0
- package/app/controllers/management/vendors/index/edit.js +1 -0
- package/app/controllers/management/vendors/index/new.js +1 -0
- package/app/routes/addon/routes/management/places/index/new.js +1 -0
- package/app/routes/management/contacts/index/details.js +1 -0
- package/app/routes/management/contacts/index/edit.js +1 -0
- package/app/routes/management/contacts/index/new.js +1 -0
- package/app/routes/management/fuel-reports/index/details.js +1 -0
- package/app/routes/management/fuel-reports/index/edit.js +1 -0
- package/app/routes/management/fuel-reports/index/new.js +1 -0
- package/app/routes/management/issues/index/details.js +1 -0
- package/app/routes/management/issues/index/edit.js +1 -0
- package/app/routes/management/issues/index/new.js +1 -0
- package/app/routes/management/places/index/details.js +1 -0
- package/app/routes/management/places/index/edit.js +1 -0
- package/app/routes/management/places/index/new.js +1 -0
- package/app/routes/management/vendors/index/details.js +1 -0
- package/app/routes/management/vendors/index/edit.js +1 -0
- package/app/routes/management/vendors/index/new.js +1 -0
- package/app/templates/addon/routes/management/places/index/new.js +1 -0
- package/app/templates/management/contacts/index/details.js +1 -0
- package/app/templates/management/contacts/index/edit.js +1 -0
- package/app/templates/management/contacts/index/new.js +1 -0
- package/app/templates/management/fuel-reports/index/details.js +1 -0
- package/app/templates/management/fuel-reports/index/edit.js +1 -0
- package/app/templates/management/fuel-reports/index/new.js +1 -0
- package/app/templates/management/issues/index/details.js +1 -0
- package/app/templates/management/issues/index/edit.js +1 -0
- package/app/templates/management/issues/index/new.js +1 -0
- package/app/templates/management/places/index/details.js +1 -0
- package/app/templates/management/places/index/edit.js +1 -0
- package/app/templates/management/places/index/new.js +1 -0
- package/app/templates/management/vendors/index/details.js +1 -0
- package/app/templates/management/vendors/index/edit.js +1 -0
- package/app/templates/management/vendors/index/new.js +1 -0
- package/composer.json +1 -1
- package/config/environment.js +2 -1
- package/extension.json +1 -1
- package/package.json +4 -3
- package/server/migrations/2023_11_03_072503_refactor_issues_table_columns.php +42 -0
- package/server/migrations/2023_11_06_040645_refactor_fuel_reports_table.php +38 -0
- package/server/src/Casts/Point.php +15 -1
- package/server/src/Http/Controllers/Internal/v1/DriverController.php +33 -15
- package/server/src/Http/Filter/FleetFilter.php +7 -0
- package/server/src/Http/Filter/FuelReportFilter.php +58 -0
- package/server/src/Http/Filter/IssueFilter.php +69 -0
- package/server/src/Http/Filter/VehicleFilter.php +10 -0
- package/server/src/Http/Middleware/TransformLocationMiddleware.php +48 -0
- package/server/src/Http/Resources/v1/Driver.php +1 -0
- package/server/src/Http/Resources/v1/Fleet.php +20 -21
- package/server/src/Http/Resources/v1/FuelReport.php +37 -35
- package/server/src/Http/Resources/v1/Issue.php +77 -0
- package/server/src/Http/Resources/v1/ParentFleet.php +60 -0
- package/server/src/Http/Resources/v1/SubFleet.php +60 -0
- package/server/src/Http/Resources/v1/Vehicle.php +4 -2
- package/server/src/Integrations/Lalamove/Lalamove.php +6 -6
- package/server/src/Models/Contact.php +7 -0
- package/server/src/Models/Driver.php +1 -1
- package/server/src/Models/Fleet.php +35 -4
- package/server/src/Models/FuelReport.php +53 -3
- package/server/src/Models/Issue.php +106 -7
- package/server/src/Models/Vehicle.php +1 -1
- package/server/src/Models/VehicleDevice.php +3 -1
- package/server/src/Models/VehicleDeviceEvent.php +7 -3
- package/server/src/Notifications/OrderAssigned.php +0 -6
- package/server/src/Notifications/OrderCanceled.php +0 -6
- package/server/src/Notifications/OrderDispatchFailed.php +0 -6
- package/server/src/Notifications/OrderDispatched.php +0 -6
- package/server/src/Notifications/OrderPing.php +0 -6
- package/server/src/Notifications/OrderSplit.php +0 -6
- package/server/src/Providers/NotificationServiceProvider.php +1 -1
- package/server/src/routes.php +2 -2
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { inject as service } from '@ember/service';
|
|
4
|
+
import { action } from '@ember/object';
|
|
5
|
+
import { isArray } from '@ember/array';
|
|
6
|
+
import getWithDefault from '@fleetbase/ember-core/utils/get-with-default';
|
|
7
|
+
import contextComponentCallback from '../utils/context-component-callback';
|
|
8
|
+
import applyContextComponentArguments from '../utils/apply-context-component-arguments';
|
|
9
|
+
|
|
10
|
+
export default class IssueFormPanelComponent extends Component {
|
|
11
|
+
/**
|
|
12
|
+
* @service store
|
|
13
|
+
*/
|
|
14
|
+
@service store;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @service fetch
|
|
18
|
+
*/
|
|
19
|
+
@service fetch;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @service notifications
|
|
23
|
+
*/
|
|
24
|
+
@service notifications;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @service hostRouter
|
|
28
|
+
*/
|
|
29
|
+
@service hostRouter;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @service loader
|
|
33
|
+
*/
|
|
34
|
+
@service loader;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @service contextPanel
|
|
38
|
+
*/
|
|
39
|
+
@service contextPanel;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Overlay context.
|
|
43
|
+
* @type {any}
|
|
44
|
+
*/
|
|
45
|
+
@tracked context;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Indicates whether the component is in a loading state.
|
|
49
|
+
* @type {boolean}
|
|
50
|
+
*/
|
|
51
|
+
@tracked isLoading = false;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* All possible issue types
|
|
55
|
+
*
|
|
56
|
+
* @var {String}
|
|
57
|
+
*/
|
|
58
|
+
@tracked issueTypes = ['vehicle', 'driver', 'route', 'payload-cargo', 'software-technical', 'operational', 'customer', 'security', 'environmental-sustainability'];
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The subcategories for issue types.
|
|
62
|
+
*
|
|
63
|
+
* @var {Object}
|
|
64
|
+
*/
|
|
65
|
+
@tracked issueCategoriesByType = {
|
|
66
|
+
vehicle: ['Mechanical Problems', 'Cosmetic Damages', 'Tire Issues', 'Electronics and Instruments', 'Maintenance Alerts', 'Fuel Efficiency Issues'],
|
|
67
|
+
driver: ['Behavior Concerns', 'Documentation', 'Time Management', 'Communication', 'Training Needs', 'Health and Safety Violations'],
|
|
68
|
+
route: ['Inefficient Routes', 'Safety Concerns', 'Blocked Routes', 'Environmental Considerations', 'Unfavorable Weather Conditions'],
|
|
69
|
+
'payload-cargo': ['Damaged Goods', 'Misplaced Goods', 'Documentation Issues', 'Temperature-Sensitive Goods', 'Incorrect Cargo Loading'],
|
|
70
|
+
'software-technical': ['Bugs', 'UI/UX Concerns', 'Integration Failures', 'Performance', 'Feature Requests', 'Security Vulnerabilities'],
|
|
71
|
+
operational: ['Compliance', 'Resource Allocation', 'Cost Overruns', 'Communication', 'Vendor Management Issues'],
|
|
72
|
+
customer: ['Service Quality', 'Billing Discrepancies', 'Communication Breakdown', 'Feedback and Suggestions', 'Order Errors'],
|
|
73
|
+
security: ['Unauthorized Access', 'Data Concerns', 'Physical Security', 'Data Integrity Issues'],
|
|
74
|
+
'environmental-sustainability': ['Fuel Consumption', 'Carbon Footprint', 'Waste Management', 'Green Initiatives Opportunities'],
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Selectable issue categories.
|
|
79
|
+
*
|
|
80
|
+
* @memberof IssueFormPanelComponent
|
|
81
|
+
*/
|
|
82
|
+
@tracked issueCategories = [];
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Issue status options.
|
|
86
|
+
*
|
|
87
|
+
* @memberof IssueFormPanelComponent
|
|
88
|
+
*/
|
|
89
|
+
@tracked issueStatusOptions = ['pending', 'in-progress', 'backlogged', 'requires-update', 'in-review', 're-opened', 'duplicate', 'pending-review', 'escalated', 'completed', 'canceled'];
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Issue priorty options.
|
|
93
|
+
*
|
|
94
|
+
* @memberof IssueFormPanelComponent
|
|
95
|
+
*/
|
|
96
|
+
@tracked issuePriorityOptions = ['low', 'medium', 'high', 'critical', 'scheduled-maintenance', 'operational-suggestion'];
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Constructs the component and applies initial state.
|
|
100
|
+
*/
|
|
101
|
+
constructor() {
|
|
102
|
+
super(...arguments);
|
|
103
|
+
this.issue = this.args.issue;
|
|
104
|
+
this.issueCategories = getWithDefault(this.issueCategoriesByType, this.issue.type, []);
|
|
105
|
+
applyContextComponentArguments(this);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Sets the overlay context.
|
|
110
|
+
*
|
|
111
|
+
* @action
|
|
112
|
+
* @param {OverlayContextObject} overlayContext
|
|
113
|
+
*/
|
|
114
|
+
@action setOverlayContext(overlayContext) {
|
|
115
|
+
this.context = overlayContext;
|
|
116
|
+
contextComponentCallback(this, 'onLoad', ...arguments);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Saves the issue changes.
|
|
121
|
+
*
|
|
122
|
+
* @action
|
|
123
|
+
* @returns {Promise<any>}
|
|
124
|
+
*/
|
|
125
|
+
@action save() {
|
|
126
|
+
const { issue } = this;
|
|
127
|
+
|
|
128
|
+
this.loader.showLoader('.next-content-overlay-panel-container', { loadingMessage: 'Saving issue...', preserveTargetPosition: true });
|
|
129
|
+
this.isLoading = true;
|
|
130
|
+
|
|
131
|
+
contextComponentCallback(this, 'onBeforeSave', issue);
|
|
132
|
+
|
|
133
|
+
try {
|
|
134
|
+
return issue
|
|
135
|
+
.save()
|
|
136
|
+
.then((issue) => {
|
|
137
|
+
this.notifications.success(`Issue (${issue.public_id}) saved successfully.`);
|
|
138
|
+
contextComponentCallback(this, 'onAfterSave', issue);
|
|
139
|
+
})
|
|
140
|
+
.catch((error) => {
|
|
141
|
+
this.notifications.serverError(error);
|
|
142
|
+
})
|
|
143
|
+
.finally(() => {
|
|
144
|
+
this.loader.removeLoader('.next-content-overlay-panel-container ');
|
|
145
|
+
this.isLoading = false;
|
|
146
|
+
});
|
|
147
|
+
} catch (error) {
|
|
148
|
+
this.loader.removeLoader('.next-content-overlay-panel-container ');
|
|
149
|
+
this.isLoading = false;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Trigger when the issue type is selected.
|
|
155
|
+
*
|
|
156
|
+
* @param {String} type
|
|
157
|
+
* @memberof IssueFormPanelComponent
|
|
158
|
+
*/
|
|
159
|
+
@action onSelectIssueType(type) {
|
|
160
|
+
this.issue.type = type;
|
|
161
|
+
this.issue.category = null;
|
|
162
|
+
this.issueCategories = getWithDefault(this.issueCategoriesByType, type, []);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Add a tag to the issue
|
|
167
|
+
*
|
|
168
|
+
* @param {String} tag
|
|
169
|
+
* @memberof IssueFormPanelComponent
|
|
170
|
+
*/
|
|
171
|
+
@action addTag(tag) {
|
|
172
|
+
if (!isArray(this.issue.tags)) {
|
|
173
|
+
this.issue.tags = [];
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
this.issue.tags.pushObject(tag);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Remove a tag from the issue tags.
|
|
181
|
+
*
|
|
182
|
+
* @param {Number} index
|
|
183
|
+
* @memberof IssueFormPanelComponent
|
|
184
|
+
*/
|
|
185
|
+
@action removeTag(index) {
|
|
186
|
+
this.issue.tags.removeAt(index);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* View the details of the issue.
|
|
191
|
+
*
|
|
192
|
+
* @action
|
|
193
|
+
*/
|
|
194
|
+
@action onViewDetails() {
|
|
195
|
+
const isActionOverrided = contextComponentCallback(this, 'onViewDetails', this.issue);
|
|
196
|
+
|
|
197
|
+
if (!isActionOverrided) {
|
|
198
|
+
this.contextPanel.focus(this.issue, 'viewing');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Handles cancel button press.
|
|
204
|
+
*
|
|
205
|
+
* @action
|
|
206
|
+
* @returns {any}
|
|
207
|
+
*/
|
|
208
|
+
@action onPressCancel() {
|
|
209
|
+
return contextComponentCallback(this, 'onPressCancel', this.issue);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<div class="p-4">
|
|
2
|
+
<ContentPanel @title="Details" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-900">
|
|
3
|
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-2 text-xs md:mb-6 dark:text-gray-100">
|
|
4
|
+
<div class="field-info-container">
|
|
5
|
+
<div class="field-name">Reporter</div>
|
|
6
|
+
<div class="field-value">{{n-a @issue.reporter_name}}</div>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="field-info-container">
|
|
9
|
+
<div class="field-name">Assigned To</div>
|
|
10
|
+
<div class="field-value">{{n-a @issue.assignee_name}}</div>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="field-info-container">
|
|
13
|
+
<div class="field-name">Driver</div>
|
|
14
|
+
<div class="field-value">{{n-a @issue.driver_name}}</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="field-info-container">
|
|
17
|
+
<div class="field-name">Vehicle</div>
|
|
18
|
+
<div class="field-value">{{n-a @issue.vehicle_name}}</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="field-info-container">
|
|
21
|
+
<div class="field-name">Issue Type</div>
|
|
22
|
+
<div class="field-value">{{n-a @issue.type}}</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="field-info-container">
|
|
25
|
+
<div class="field-name">Issue Category</div>
|
|
26
|
+
<div class="field-value">{{n-a @issue.category}}</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="field-info-container">
|
|
29
|
+
<div class="field-name">Issue Priority</div>
|
|
30
|
+
<div class="field-value">
|
|
31
|
+
<Badge @status={{@issue.priority}} />
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="field-info-container">
|
|
35
|
+
<div class="field-name">Date Created</div>
|
|
36
|
+
<div class="field-value">{{@issue.createdAtShort}}</div>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="field-info-container">
|
|
39
|
+
<div class="field-name">Coordinates</div>
|
|
40
|
+
<div class="field-value">{{point-coordinates @issue.location}}</div>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="field-info-container col-span-2">
|
|
43
|
+
<div class="field-name">Report</div>
|
|
44
|
+
<div class="field-value">{{n-a @issue.report}}</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</ContentPanel>
|
|
48
|
+
</div>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<Overlay
|
|
2
|
+
@onLoad={{this.setOverlayContext}}
|
|
3
|
+
@position="right"
|
|
4
|
+
@noBackdrop={{true}}
|
|
5
|
+
@fullHeight={{true}}
|
|
6
|
+
@isResizable={{or this.isResizable @isResizable}}
|
|
7
|
+
@width={{or this.width @width "600px"}}
|
|
8
|
+
>
|
|
9
|
+
<Overlay::Header @title="Issue Details" @status={{this.issue.public_id}} @hideStatusDot={{true}} @createdAt={{this.issue.createdAt}}>
|
|
10
|
+
<Button @type="default" @icon="pen" @helpText="Edit Issue" @onClick={{this.onEdit}} @wrapperClass="mr-2" />
|
|
11
|
+
<Button @type="default" @icon="times" @helpText={{if this.issue.id "Cancel edit Issue" "Cancel new Issue"}} @onClick={{this.onPressCancel}} />
|
|
12
|
+
</Overlay::Header>
|
|
13
|
+
<Overlay::Body class="no-padding" @increaseInnerBodyHeightBy={{1000}}>
|
|
14
|
+
<div class="section-header-actions w-full overflow-x-scroll lg:overflow-x-auto">
|
|
15
|
+
<div class="ui-tabs mt-4">
|
|
16
|
+
<nav>
|
|
17
|
+
{{#each this.tabs as |tab|}}
|
|
18
|
+
<a href="javascript:;" class="ui-tab {{if (eq this.tab.slug tab.slug) 'active'}}" {{on "click" (fn this.onTabChanged tab.slug)}}>
|
|
19
|
+
<FaIcon @icon={{tab.icon}} class="mr-1" />
|
|
20
|
+
<span>{{tab.title}}</span>
|
|
21
|
+
</a>
|
|
22
|
+
{{/each}}
|
|
23
|
+
</nav>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="tab-content tab-{{this.tab.slug}}">
|
|
27
|
+
{{component this.tab.component issue=this.issue tabOptions=this.tab options=this.tab.componentParams}}
|
|
28
|
+
</div>
|
|
29
|
+
</Overlay::Body>
|
|
30
|
+
</Overlay>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { action } from '@ember/object';
|
|
4
|
+
import { inject as service } from '@ember/service';
|
|
5
|
+
import { isArray } from '@ember/array';
|
|
6
|
+
import IssuePanelDetailComponent from './issue-panel/details';
|
|
7
|
+
import contextComponentCallback from '../utils/context-component-callback';
|
|
8
|
+
import applyContextComponentArguments from '../utils/apply-context-component-arguments';
|
|
9
|
+
export default class IssuePanelComponent extends Component {
|
|
10
|
+
/**
|
|
11
|
+
* Service for fetching data.
|
|
12
|
+
*
|
|
13
|
+
* @type {Service}
|
|
14
|
+
*/
|
|
15
|
+
@service fetch;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Service for managing modals.
|
|
19
|
+
*
|
|
20
|
+
* @type {Service}
|
|
21
|
+
*/
|
|
22
|
+
@service modalsManager;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Universe service for managing global data and settings.
|
|
26
|
+
*
|
|
27
|
+
* @type {Service}
|
|
28
|
+
*/
|
|
29
|
+
@service universe;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Ember data store service.
|
|
33
|
+
*
|
|
34
|
+
* @type {Service}
|
|
35
|
+
*/
|
|
36
|
+
@service store;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Service for managing routing within the host app.
|
|
40
|
+
*
|
|
41
|
+
* @type {Service}
|
|
42
|
+
*/
|
|
43
|
+
@service hostRouter;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Service for managing the context panel.
|
|
47
|
+
*
|
|
48
|
+
* @type {Service}
|
|
49
|
+
*/
|
|
50
|
+
@service contextPanel;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The current active tab.
|
|
54
|
+
*
|
|
55
|
+
* @type {Object}
|
|
56
|
+
* @tracked
|
|
57
|
+
*/
|
|
58
|
+
@tracked tab;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The Issue being displayed or edited.
|
|
62
|
+
*
|
|
63
|
+
* @type {IssueModel}
|
|
64
|
+
* @tracked
|
|
65
|
+
*/
|
|
66
|
+
@tracked issue;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns the array of tabs available for the panel.
|
|
70
|
+
*
|
|
71
|
+
* @type {Array}
|
|
72
|
+
*/
|
|
73
|
+
get tabs() {
|
|
74
|
+
const registeredTabs = this.universe.getMenuItemsFromRegistry('component:issue-panel');
|
|
75
|
+
// this.universe._createMenuItem('Tracking', null, { icon: 'satellite-dish', component: IssuePanelTrackingComponent }),
|
|
76
|
+
const defaultTabs = [this.universe._createMenuItem('Details', null, { icon: 'circle-info', component: IssuePanelDetailComponent })];
|
|
77
|
+
|
|
78
|
+
if (isArray(registeredTabs)) {
|
|
79
|
+
return [...defaultTabs, ...registeredTabs];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return defaultTabs;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Initializes the Issue panel component.
|
|
87
|
+
*/
|
|
88
|
+
constructor() {
|
|
89
|
+
super(...arguments);
|
|
90
|
+
this.issue = this.args.issue;
|
|
91
|
+
this.tab = this.getTabUsingSlug(this.args.tab);
|
|
92
|
+
applyContextComponentArguments(this);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Sets the overlay context.
|
|
97
|
+
*
|
|
98
|
+
* @action
|
|
99
|
+
* @param {OverlayContextObject} overlayContext
|
|
100
|
+
*/
|
|
101
|
+
@action setOverlayContext(overlayContext) {
|
|
102
|
+
this.context = overlayContext;
|
|
103
|
+
contextComponentCallback(this, 'onLoad', ...arguments);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Handles changing the active tab.
|
|
108
|
+
*
|
|
109
|
+
* @method
|
|
110
|
+
* @param {String} tab - The new tab to switch to.
|
|
111
|
+
* @action
|
|
112
|
+
*/
|
|
113
|
+
@action onTabChanged(tab) {
|
|
114
|
+
this.tab = this.getTabUsingSlug(tab);
|
|
115
|
+
contextComponentCallback(this, 'onTabChanged', tab);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Handles edit action for the Issue.
|
|
120
|
+
*
|
|
121
|
+
* @method
|
|
122
|
+
* @action
|
|
123
|
+
*/
|
|
124
|
+
@action onEdit() {
|
|
125
|
+
const isActionOverrided = contextComponentCallback(this, 'onEdit', this.issue);
|
|
126
|
+
|
|
127
|
+
if (!isActionOverrided) {
|
|
128
|
+
this.contextPanel.focus(this.issue, 'editing', {
|
|
129
|
+
onAfterSave: () => {
|
|
130
|
+
this.contextPanel.clear();
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Handles the cancel action.
|
|
138
|
+
*
|
|
139
|
+
* @method
|
|
140
|
+
* @action
|
|
141
|
+
* @returns {Boolean} Indicates whether the cancel action was overridden.
|
|
142
|
+
*/
|
|
143
|
+
@action onPressCancel() {
|
|
144
|
+
return contextComponentCallback(this, 'onPressCancel', this.issue);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Finds and returns a tab based on its slug.
|
|
149
|
+
*
|
|
150
|
+
* @param {String} tabSlug - The slug of the tab.
|
|
151
|
+
* @returns {Object|null} The found tab or null.
|
|
152
|
+
*/
|
|
153
|
+
getTabUsingSlug(tabSlug) {
|
|
154
|
+
if (tabSlug) {
|
|
155
|
+
return this.tabs.find(({ slug }) => slug === tabSlug);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return this.tabs[0];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<div class="mb-2">
|
|
2
|
-
<Button @text="Create new order" @type="primary" @size="xs" @icon="paper-plane" @iconPrefix="fas" @iconSize="sm" @wrapperClass="w-full" class="w-full" @onClick={{this.onClickCreateOrder}} />
|
|
1
|
+
<div id="create-order-button-menu-wrapper" class="create-order-menu-button-wrapper mb-2">
|
|
2
|
+
<Button @text="Create new order" @type="primary" @size="xs" @icon="paper-plane" @iconPrefix="fas" @iconSize="sm" @wrapperClass="w-full create-order-button-wrapper" class="w-full create-order-button" @onClick={{this.onClickCreateOrder}} />
|
|
3
3
|
</div>
|
|
4
4
|
{{#each this.universeMenuItems as |menuItem|}}
|
|
5
5
|
{{#if menuItem.renderComponentInPlace}}
|
|
@@ -989,6 +989,7 @@ export default class LiveMapComponent extends Component {
|
|
|
989
989
|
* @memberof LiveMapComponent
|
|
990
990
|
*/
|
|
991
991
|
@action onDriverClicked(driver) {
|
|
992
|
+
this.contextPanel.clear();
|
|
992
993
|
this.contextPanel.focus(driver);
|
|
993
994
|
}
|
|
994
995
|
|
|
@@ -1019,6 +1020,7 @@ export default class LiveMapComponent extends Component {
|
|
|
1019
1020
|
* @memberof LiveMapComponent
|
|
1020
1021
|
*/
|
|
1021
1022
|
@action onVehicleClicked(vehicle) {
|
|
1023
|
+
this.contextPanel.clear();
|
|
1022
1024
|
this.contextPanel.focus(vehicle);
|
|
1023
1025
|
}
|
|
1024
1026
|
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
<MapContainer::ToolbarContainer ...attributes>
|
|
2
2
|
<div class="next-map-container-toolbar next-map-container-toolbar-zoom-control">
|
|
3
|
-
<div>
|
|
4
|
-
<button type="button" class="toolbar-button" {{on "click" (fn this.onAction "onZoomIn")}}>
|
|
3
|
+
<div id="map-toolbar-zoom-in-button-wrapper">
|
|
4
|
+
<button type="button" id="map-toolbar-zoom-in-button" class="toolbar-button" {{on "click" (fn this.onAction "onZoomIn")}}>
|
|
5
5
|
<FaIcon @icon="plus" @prefix="fas" class="text-gray-100" />
|
|
6
6
|
</button>
|
|
7
7
|
</div>
|
|
8
|
-
<div>
|
|
8
|
+
<div id="map-toolbar-zoom-out-button-wrapper">
|
|
9
9
|
<button type="button" class="toolbar-button" {{on "click" (fn this.onAction "onZoomOut")}}>
|
|
10
|
-
<FaIcon @icon="minus" @prefix="fas" class="text-gray-100" />
|
|
10
|
+
<FaIcon @icon="minus" id="map-toolbar-zoom-out-button" @prefix="fas" class="text-gray-100" />
|
|
11
11
|
</button>
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
14
14
|
<div class="next-map-container-toolbar-panel next-map-container-toolbar-actions">
|
|
15
|
-
<button type="button" class="toolbar-button is-action" {{on "click" (fn this.onAction "onPressCreateOrder")}}>
|
|
15
|
+
<button type="button" id="map-toolbar-create-order-button" class="toolbar-button is-action" {{on "click" (fn this.onAction "onPressCreateOrder")}}>
|
|
16
16
|
<FaIcon @icon="paper-plane" />
|
|
17
17
|
<Attach::Tooltip @class="clean" @animation="scale" @placement="right">
|
|
18
18
|
<InputInfo @text="Create Order" @iconClass="hidden" class="py-1 px-2 bg-gray-900 -mt-1" />
|
|
19
19
|
</Attach::Tooltip>
|
|
20
20
|
</button>
|
|
21
|
-
<button type="button" class="toolbar-button" {{on "click" (fn this.onAction "onPressSearch")}}>
|
|
21
|
+
<button type="button" id="map-toolbar-search-button" class="toolbar-button" {{on "click" (fn this.onAction "onPressSearch")}}>
|
|
22
22
|
<FaIcon @icon="search" />
|
|
23
23
|
<Attach::Tooltip @class="clean" @animation="scale" @placement="right">
|
|
24
24
|
<InputInfo @text="Search" @iconClass="hidden" class="py-1 px-2 bg-gray-900 -mt-1" />
|
|
25
25
|
</Attach::Tooltip>
|
|
26
26
|
</button>
|
|
27
|
-
<button type="button" class="toolbar-button relative" {{on "click" (fn this.onAction "onPressViewOrders")}}>
|
|
27
|
+
<button type="button" id="map-toolbar-view-orders-button" class="toolbar-button relative" {{on "click" (fn this.onAction "onPressViewOrders")}}>
|
|
28
28
|
<div class="active-orders-count absolute top-0 right-0 -mr-2.5 -mt-1">
|
|
29
29
|
<div class="relative flex w-5 h-5 rounded-full">
|
|
30
30
|
<div class="absolute inset-0 rounded-full w-5 h-5 text-xs bg-blue-500 opacity-75 {{if @activeOrdersCount 'animate-ping'}}"></div>
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
<InputInfo @text="View Orders" @iconClass="hidden" class="py-1 px-2 bg-gray-900 -mt-1" />
|
|
37
37
|
</Attach::Tooltip>
|
|
38
38
|
</button>
|
|
39
|
-
<BasicDropdown @horizontalPosition="right" @calculatePosition={{this.calculatePosition}} @renderInPlace={{true}} as |dd|>
|
|
39
|
+
<BasicDropdown id="map-toolbar-service-areas-button" @horizontalPosition="right" @calculatePosition={{this.calculatePosition}} @renderInPlace={{true}} as |dd|>
|
|
40
40
|
<dd.Trigger class="toolbar-button">
|
|
41
41
|
<FaIcon @icon="map-marked-alt" />
|
|
42
42
|
<Attach::Tooltip @class="clean" @animation="scale" @placement="right">
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<MapContainer::Toolbar::ZonesPanel @dd={{dd}} @liveMap={{@liveMap}} @map={{@map}} @onPressCreateServiceArea={{@onPressCreateServiceArea}} />
|
|
48
48
|
</dd.Content>
|
|
49
49
|
</BasicDropdown>
|
|
50
|
-
<BasicDropdown @horizontalPosition="right" @calculatePosition={{this.calculatePosition}} @renderInPlace={{true}} as |dd|>
|
|
50
|
+
<BasicDropdown id="map-toolbar-visibility-controls-button" @horizontalPosition="right" @calculatePosition={{this.calculatePosition}} @renderInPlace={{true}} as |dd|>
|
|
51
51
|
<dd.Trigger class="toolbar-button">
|
|
52
52
|
<FaIcon @icon="eye" />
|
|
53
53
|
<Attach::Tooltip @class="clean" @animation="scale" @placement="right">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<div class="next-map-container-topbar" ...attributes>{{yield}}</div>
|
|
1
|
+
<div id="map-topbar-container" class="next-map-container-topbar" ...attributes>{{yield}}</div>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<Modal::Default @modalIsOpened={{@modalIsOpened}} @options={{@options}} @confirm={{@onConfirm}} @decline={{@onDecline}}>
|
|
2
|
+
<div class="modal-body-container">
|
|
3
|
+
<div class="grid grid-cols-2 flex-col md:flex-row gap-2 mb-6">
|
|
4
|
+
<div class="field-info-container">
|
|
5
|
+
<div class="field-name">Reporter</div>
|
|
6
|
+
<div class="field-value">{{n-a @issue.reporter}}</div>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="field-info-container">
|
|
9
|
+
<div class="field-name">Assigned To</div>
|
|
10
|
+
<div class="field-value">{{n-a @issue.assignee}}</div>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="field-info-container">
|
|
13
|
+
<div class="field-name">Driver</div>
|
|
14
|
+
<div class="field-value">{{n-a @issue.driver}}</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="field-info-container">
|
|
17
|
+
<div class="field-name">Vehicle</div>
|
|
18
|
+
<div class="field-value">{{n-a @issue.vehicle.displayName}}</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="field-info-container">
|
|
21
|
+
<div class="field-name">Issue Type</div>
|
|
22
|
+
<div class="field-value">{{n-a @issue.type}}</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="field-info-container">
|
|
25
|
+
<div class="field-name">Issue Category</div>
|
|
26
|
+
<div class="field-value">{{n-a @issue.category}}</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="field-info-container">
|
|
29
|
+
<div class="field-name">Date Created</div>
|
|
30
|
+
<div class="field-value">{{@issue.createdAtShort}}</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="field-info-container">
|
|
33
|
+
<div class="field-name">Coordinates</div>
|
|
34
|
+
<div class="field-value">{{point-coordinates @issue.location}}</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</Modal::Default>
|