Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Create Release
on:
push:
tags:
- 'v*'

jobs:
create:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
generate_release_notes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64 changes: 64 additions & 0 deletions .github/workflows/ember.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,67 @@ jobs:

- name: Publish to GitHub registry
run: npm publish

fleetbase_publish:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2

- name: Setup Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 18.x

- name: Setup pnpm
uses: pnpm/action-setup@v2.0.1
with:
version: latest

- name: Install Dependencies
run: pnpm install

- name: Build
run: pnpm run build

- name: Install Fleetbase CLI
run: npm i -g @fleetbase/cli npm-cli-login

- name: Login to Fleetbase Registry
run: npm-cli-login -u ${{SECRETS.FLEETBASE_REGISTRY_USERNAME}} -p ${{SECRETS.FLEETBASE_REGISTRY_PASSWORD}} -e ${{SECRETS.FLEETBASE_REGISTRY_EMAIL}} -r https://registry.fleetbase.io

- name: Publish to Fleetbase registry
run: flb publish

fleetbase_publish_qa:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v2

- name: Setup Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 18.x

- name: Setup pnpm
uses: pnpm/action-setup@v2.0.1
with:
version: latest

- name: Install Dependencies
run: pnpm install

- name: Build
run: pnpm run build

- name: Install Fleetbase CLI
run: npm i -g @fleetbase/cli npm-cli-login

- name: Login to Fleetbase Registry
run: npm-cli-login -u ${{SECRETS.FLEETBASE_QA_REGISTRY_USERNAME}} -p ${{SECRETS.FLEETBASE_QA_REGISTRY_PASSWORD}} -e ${{SECRETS.FLEETBASE_QA_REGISTRY_EMAIL}} -r https://registry.qa.fleetbase.io

- name: Publish to Fleetbase registry
run: flb publish --registry https://registry.qa.fleetbase.io
25 changes: 23 additions & 2 deletions addon/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import loadInitializers from 'ember-load-initializers';
import Resolver from 'ember-resolver';
import config from './config/environment';
import services from '@fleetbase/ember-core/exports/services';
import { RoutingControl } from '@fleetbase/fleetops-engine/services/leaflet-routing-control';

const { modulePrefix } = config;
const externalRoutes = ['console', 'extensions'];
const FLEETOPS_ENGINE_NAME = '@fleetbase/fleetops-engine';
const L = window.L ?? {};

export default class ValhallaEngine extends Engine {
modulePrefix = modulePrefix;
Expand All @@ -14,9 +17,27 @@ export default class ValhallaEngine extends Engine {
services,
externalRoutes,
};
engineDependencies = [FLEETOPS_ENGINE_NAME];
/* eslint no-unused-vars: "off" */
setupExtension = function (app, engine, universe) {
// register menu item in header
universe.registerHeaderMenuItem('valhalla', 'console.valhalla', { icon: 'layer-group', priority: 5 });
const routeOptimization = app.lookup('service:route-optimization');
const valhalla = app.lookup('service:valhalla');
if (routeOptimization && valhalla) {
routeOptimization.register('valhalla', valhalla);
}

// Register Valhalla Routing Control
const leafletRoutingControl = app.lookup('service:leaflet-routing-control');
if (leafletRoutingControl) {
leafletRoutingControl.register(
'valhalla',
new RoutingControl({
name: 'Valhalla',
router: new L.Routing.Valhalla(),
formatter: new L.Routing.Valhalla.Formatter(),
})
);
}
};
}

Expand Down
11 changes: 11 additions & 0 deletions addon/instance-initializers/load-valhalla-routing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export function initialize(owner) {
const valhallaRoutingService = owner.lookup('service:valhalla-routing');
if (valhallaRoutingService) {
valhallaRoutingService.initialize();
}
}

export default {
name: 'load-valhalla-routing',
initialize,
};
Loading
Loading