@fleetbase/fleetops-engine 0.0.6 → 0.0.8
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/leaflet-draw-control.js +1 -1
- package/addon/components/live-map.js +6 -3
- package/addon/initializers/load-leaflet-assets.js +22 -0
- package/addon/routes/operations/orders/index.js +1 -1
- package/index.js +35 -27
- package/package.json +5 -4
- package/addon/components/modals/resend-verification-email.hbs +0 -25
- package/app/components/modals/resend-verification-email.js +0 -1
|
@@ -74,7 +74,7 @@ export default class LeafletDrawControl extends BaseLayer {
|
|
|
74
74
|
const { onDrawControlCreated, onDrawControlAddedToMap } = this.args;
|
|
75
75
|
const showDrawingLayer = getWithDefault(this.args, 'showDrawingLayer', true);
|
|
76
76
|
|
|
77
|
-
if (this.map && this._layer) {
|
|
77
|
+
if (this.map && this._layer && this.L.drawLocal) {
|
|
78
78
|
this.options.edit = assign({ featureGroup: this._layer }, this.options.edit);
|
|
79
79
|
this.options.draw = assign({}, this.L.drawLocal.draw, this.options.draw);
|
|
80
80
|
|
|
@@ -142,11 +142,14 @@ export default class LiveMapComponent extends Component {
|
|
|
142
142
|
|
|
143
143
|
@action toggleDrawControlContextMenuItem() {
|
|
144
144
|
const index = this.currentContextMenuItems.findIndex((options) => options.text?.includes('draw controls'));
|
|
145
|
-
const options = this.currentContextMenuItems.objectAt(index);
|
|
146
|
-
|
|
147
|
-
set(options, 'text', this.isDrawControlsVisible ? `Hide draw controls...` : `Enable draw controls...`);
|
|
148
145
|
|
|
149
146
|
if (index > 0) {
|
|
147
|
+
const options = this.currentContextMenuItems.objectAt(index);
|
|
148
|
+
|
|
149
|
+
if (!isEmpty(options)) {
|
|
150
|
+
options.text = this.isDrawControlsVisible ? 'Hide draw controls...' : 'Enable draw controls...';
|
|
151
|
+
}
|
|
152
|
+
|
|
150
153
|
this.leafletMap?.contextmenu?.removeItem(index);
|
|
151
154
|
this.leafletMap?.contextmenu?.insertItem(options, index);
|
|
152
155
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function initialize() {
|
|
2
|
+
const path = '/engines-dist/leaflet/';
|
|
3
|
+
const scripts = ['leaflet.contextmenu.js', 'leaflet.draw-src.js', 'leaflet.rotatedMarker.js'];
|
|
4
|
+
const stylesheets = ['leaflet.contextmenu.css', 'leaflet.draw.css'];
|
|
5
|
+
|
|
6
|
+
for (let i = 0; i < scripts.length; i++) {
|
|
7
|
+
const script = document.createElement('script');
|
|
8
|
+
script.src = path + scripts[i];
|
|
9
|
+
document.body.appendChild(script);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
for (let i = 0; i < stylesheets.length; i++) {
|
|
13
|
+
const link = document.createElement('link');
|
|
14
|
+
link.rel = 'stylesheet';
|
|
15
|
+
link.href = path + stylesheets[i];
|
|
16
|
+
document.body.appendChild(link);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
initialize,
|
|
22
|
+
};
|
package/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
const Funnel = require('broccoli-funnel');
|
|
3
|
-
const MergeTrees = require('broccoli-merge-trees');
|
|
4
2
|
const { buildEngine } = require('ember-engines/lib/engine-addon');
|
|
5
3
|
const { name } = require('./package');
|
|
4
|
+
const Funnel = require('broccoli-funnel');
|
|
5
|
+
const MergeTrees = require('broccoli-merge-trees');
|
|
6
|
+
const resolve = require('resolve');
|
|
6
7
|
const path = require('path');
|
|
7
8
|
|
|
8
9
|
module.exports = buildEngine({
|
|
@@ -12,44 +13,51 @@ module.exports = buildEngine({
|
|
|
12
13
|
enabled: true,
|
|
13
14
|
},
|
|
14
15
|
|
|
15
|
-
included: function () {
|
|
16
|
-
this._super.included.apply(this, arguments);
|
|
17
|
-
|
|
18
|
-
const importJs = (module, file, options) => {
|
|
19
|
-
const modulePath = path.dirname(require.resolve(module));
|
|
20
|
-
this.import(`${modulePath}/${file}`, options);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
importJs('leaflet-rotatedmarker', 'leaflet.rotatedMarker.js');
|
|
24
|
-
importJs('leaflet-draw', 'leaflet.draw-src.js');
|
|
25
|
-
importJs('leaflet-contextmenu', 'leaflet.contextmenu.js');
|
|
26
|
-
|
|
27
|
-
// import stylesheets
|
|
28
|
-
this.import('node_modules/leaflet-contextmenu/dist/leaflet.contextmenu.css');
|
|
29
|
-
this.import('node_modules/leaflet-draw/dist/leaflet.draw.css');
|
|
30
|
-
},
|
|
31
|
-
|
|
32
16
|
treeForPublic: function () {
|
|
33
17
|
const publicTree = this._super.treeForPublic.apply(this, arguments);
|
|
34
|
-
|
|
35
|
-
// Use a Funnel assets
|
|
36
18
|
const leafletPath = path.dirname(require.resolve('leaflet'));
|
|
37
19
|
const leafletImagesPath = path.join(leafletPath, 'images');
|
|
38
|
-
const
|
|
20
|
+
const alwaysExclude = ['LICENSE', 'package.json', 'example.html'];
|
|
21
|
+
const leafletAddons = [
|
|
22
|
+
{ package: 'leaflet', include: ['leaflet-src.js'], exclude: [...alwaysExclude], path: ['dist'] },
|
|
23
|
+
{ package: 'leaflet-contextmenu', include: undefined, exclude: [...alwaysExclude], path: ['dist'] },
|
|
24
|
+
{ package: 'leaflet-draw', include: undefined, exclude: [...alwaysExclude], path: ['dist'] },
|
|
25
|
+
{ package: 'leaflet-rotatedmarker', include: undefined, exclude: [...alwaysExclude], path: [] },
|
|
26
|
+
];
|
|
27
|
+
const trees = [];
|
|
28
|
+
|
|
29
|
+
for (let i = 0; i < leafletAddons.length; i++) {
|
|
30
|
+
const leafletAdddon = leafletAddons[i];
|
|
31
|
+
const leafletAddonDist = path.join(this.pathBase(leafletAdddon.package), ...leafletAdddon.path);
|
|
32
|
+
|
|
33
|
+
trees.push(
|
|
34
|
+
new Funnel(leafletAddonDist, {
|
|
35
|
+
destDir: 'leaflet',
|
|
36
|
+
include: leafletAdddon.include,
|
|
37
|
+
exclude: leafletAdddon.exclude,
|
|
38
|
+
})
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
trees.push(
|
|
39
43
|
new Funnel(leafletImagesPath, {
|
|
40
44
|
srcDir: '/',
|
|
41
45
|
destDir: '/leaflet-images',
|
|
42
|
-
})
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
trees.push(
|
|
43
49
|
new Funnel(path.join(__dirname, 'assets'), {
|
|
44
50
|
destDir: '/',
|
|
45
|
-
})
|
|
46
|
-
|
|
51
|
+
})
|
|
52
|
+
);
|
|
47
53
|
|
|
48
54
|
// Merge the addon tree with the existing tree
|
|
49
|
-
return publicTree ? new MergeTrees([publicTree, ...
|
|
55
|
+
return publicTree ? new MergeTrees([publicTree, ...trees], { overwrite: true }) : new MergeTrees([...trees], { overwrite: true });
|
|
50
56
|
},
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
pathBase(packageName) {
|
|
59
|
+
return path.dirname(resolve.sync(packageName + '/package.json', { basedir: __dirname }));
|
|
60
|
+
},
|
|
53
61
|
|
|
54
62
|
isDevelopingAddon() {
|
|
55
63
|
return true;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fleetbase/fleetops-engine",
|
|
3
3
|
"extension": "Fleet Ops",
|
|
4
4
|
"icon": "route",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.8",
|
|
6
6
|
"priority": 0,
|
|
7
7
|
"description": "Fleetbase Fleet-Ops extension provides a fleet management and last mile delivery operations system module.",
|
|
8
8
|
"keywords": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@fleetbase/ember-core": "^0.0.2",
|
|
40
|
-
"@fleetbase/ember-ui": "^0.0.
|
|
40
|
+
"@fleetbase/ember-ui": "^0.0.6",
|
|
41
41
|
"@fleetbase/fleetops-data": "^0.0.2",
|
|
42
42
|
"@fleetbase/leaflet-routing-machine": "^3.2.15",
|
|
43
43
|
"@fortawesome/ember-fontawesome": "^0.4.1",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"ember-cli-babel": "^7.26.11",
|
|
51
51
|
"ember-cli-es6-transform": "^1.0.0",
|
|
52
52
|
"ember-cli-htmlbars": "^6.1.0",
|
|
53
|
-
"ember-leaflet": "^5.
|
|
53
|
+
"ember-leaflet": "^5.1.1",
|
|
54
54
|
"ember-radio-button": "3.0.0-beta.1",
|
|
55
55
|
"ember-wormhole": "^0.6.0",
|
|
56
|
-
"leaflet": "^1.
|
|
56
|
+
"leaflet": "^1.9.4",
|
|
57
57
|
"leaflet-contextmenu": "^1.4.0",
|
|
58
58
|
"leaflet-draw": "^1.0.4",
|
|
59
59
|
"leaflet-rotatedmarker": "^0.2.0",
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
"prettier": "^2.7.1",
|
|
103
103
|
"qunit": "^2.19.1",
|
|
104
104
|
"qunit-dom": "^2.0.0",
|
|
105
|
+
"resolve": "^1.22.2",
|
|
105
106
|
"webpack": "^5.74.0"
|
|
106
107
|
},
|
|
107
108
|
"peerDependencies": {
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<Modal::Default @modalIsOpened={{@modalIsOpened}} @options={{@options}} @confirm={{@onConfirm}} @decline={{@onDecline}}>
|
|
2
|
-
<div class="modal-body-container">
|
|
3
|
-
<div class="bg-blue-50 rounded shadow-sm border-l-4 border-blue-400 p-4 mb-5">
|
|
4
|
-
<div class="flex">
|
|
5
|
-
<div class="flex-shrink-0">
|
|
6
|
-
<svg class="h-5 w-5 text-blue-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"
|
|
7
|
-
fill="currentColor" aria-hidden="true">
|
|
8
|
-
<path fill-rule="evenodd"
|
|
9
|
-
d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
|
|
10
|
-
clip-rule="evenodd" />
|
|
11
|
-
</svg>
|
|
12
|
-
</div>
|
|
13
|
-
<div class="ml-3 flex items-center">
|
|
14
|
-
<span class="font-extrabold text-blue-800">Verify your email address</span>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
<div class="py-3">
|
|
18
|
-
<p class="text-blue-700">Re-verify your email address and click Send to continue.</p>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
<InputGroup @type="email" @name="Verify your email address" @value={{@options.email}}
|
|
23
|
-
@helpText="Have a second look and confirm your email address is correct." @inputClass="input-lg" />
|
|
24
|
-
</div>
|
|
25
|
-
</Modal::Default>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@fleetbase/fleetops-engine/components/modals/resend-verification-email';
|