Skip to content
This repository was archived by the owner on Oct 8, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
74efcc0
Adding location delete-button is done
MoeMaher Jul 14, 2019
ff632a6
fixing the text format of the destination in the dispatch directions
MoeMaher Jul 14, 2019
4351daf
Cleaning Code
MoeMaher Jul 14, 2019
0d351dd
in dispatching: adding the ability to list the chosen pins and delete…
MoeMaher Jul 17, 2019
9378ebf
UI bug fixes
MoeMaher Jul 17, 2019
9addab9
UI bug fixes
MoeMaher Jul 17, 2019
781af65
UI bug fixes
MoeMaher Jul 17, 2019
cb530f6
Adding information dialog for each component describing the component…
MoeMaher Jul 17, 2019
94088e1
UI bug fix
MoeMaher Jul 18, 2019
85f26a8
UI margins fixes
MoeMaher Jul 18, 2019
2a7e0b5
adding the ability to choose between routes in dispatching
MoeMaher Jul 21, 2019
f5fde1b
Backend return the full information of the alternative route in dispa…
MoeMaher Jul 21, 2019
dd515cf
Minor Bug fixes
MoeMaher Jul 28, 2019
1489f7d
Adding location delete-button is done
MoeMaher Jul 14, 2019
23b765f
fixing the text format of the destination in the dispatch directions
MoeMaher Jul 14, 2019
91120c2
Cleaning Code
MoeMaher Jul 14, 2019
a08f831
in dispatching: adding the ability to list the chosen pins and delete…
MoeMaher Jul 17, 2019
7d4690c
UI bug fixes
MoeMaher Jul 17, 2019
f9be731
UI bug fixes
MoeMaher Jul 17, 2019
08f5350
UI bug fixes
MoeMaher Jul 17, 2019
313536f
Adding information dialog for each component describing the component…
MoeMaher Jul 17, 2019
fb65d05
UI bug fix
MoeMaher Jul 18, 2019
3e0aff1
UI margins fixes
MoeMaher Jul 18, 2019
80a7abc
adding the ability to choose between routes in dispatching
MoeMaher Jul 21, 2019
b8b1ec0
Backend return the full information of the alternative route in dispa…
MoeMaher Jul 21, 2019
417b637
Minor Bug fixes
MoeMaher Jul 28, 2019
642a494
Minor bug fix
MoeMaher Jul 28, 2019
d9b9dbb
rebase with BMFT-Angular8
MoeMaher Jul 28, 2019
04924f3
solve rebase merging conflicts
MoeMaher Jul 28, 2019
c869b7c
add drag and drop to sort Pins in dispatching
MoeMaher Jul 31, 2019
cc030fe
fix a minor error
MoeMaher Jul 31, 2019
444679a
Adding location delete-button is done
MoeMaher Jul 14, 2019
b2a4556
fixing the text format of the destination in the dispatch directions
MoeMaher Jul 14, 2019
b4807ff
Cleaning Code
MoeMaher Jul 14, 2019
a974f8c
in dispatching: adding the ability to list the chosen pins and delete…
MoeMaher Jul 17, 2019
caf8508
UI bug fixes
MoeMaher Jul 17, 2019
2ddab9f
UI bug fixes
MoeMaher Jul 17, 2019
bacbffc
UI bug fixes
MoeMaher Jul 17, 2019
670d78b
Adding information dialog for each component describing the component…
MoeMaher Jul 17, 2019
e5f878f
UI bug fix
MoeMaher Jul 18, 2019
0894eb1
UI margins fixes
MoeMaher Jul 18, 2019
d33aa60
adding the ability to choose between routes in dispatching
MoeMaher Jul 21, 2019
1053432
Backend return the full information of the alternative route in dispa…
MoeMaher Jul 21, 2019
8ed9c3f
Minor Bug fixes
MoeMaher Jul 28, 2019
47fb018
Minor bug fix
MoeMaher Jul 28, 2019
42a830f
Adding location delete-button is done
MoeMaher Jul 14, 2019
ee814cc
fixing the text format of the destination in the dispatch directions
MoeMaher Jul 14, 2019
4f8f0bf
Cleaning Code
MoeMaher Jul 14, 2019
4be1366
in dispatching: adding the ability to list the chosen pins and delete…
MoeMaher Jul 17, 2019
257a6a2
UI bug fixes
MoeMaher Jul 17, 2019
d6a486a
UI bug fixes
MoeMaher Jul 17, 2019
0240919
UI bug fixes
MoeMaher Jul 17, 2019
b6c781d
Adding information dialog for each component describing the component…
MoeMaher Jul 17, 2019
5ff1dba
UI bug fix
MoeMaher Jul 18, 2019
9c1da23
UI margins fixes
MoeMaher Jul 18, 2019
084a476
adding the ability to choose between routes in dispatching
MoeMaher Jul 21, 2019
f692bee
Minor Bug fixes
MoeMaher Jul 28, 2019
c2dc534
solve rebase merging conflicts
MoeMaher Jul 28, 2019
edd9b10
add drag and drop to sort Pins in dispatching
MoeMaher Jul 31, 2019
c97c393
fix a minor error
MoeMaher Jul 31, 2019
f314b46
fix rebase errors
MoeMaher Aug 18, 2019
43dfd75
fix rebase with master errors
MoeMaher Aug 18, 2019
e882b12
fix rebase with master errors
MoeMaher Aug 18, 2019
59240da
solve PR Requested changes
MoeMaher Sep 24, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ public class DispatchingResults

public IEnumerable<Point> RoutePoints { get; set; }

public IEnumerable<Point> AlternativeCarRoutePoints { get; set; }
public IEnumerable<DispatchingResults> AlternativeCarRoutePoints { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public async Task<IEnumerable<DispatchingResults>> CallRoutingAPI(DispatchingPar
content = await response.Content.ReadAsStringAsync();
apiResult = JObject.Parse(content);

var alternativePath = ExtractAlternativeDispatchingResult(apiResult);
var alternativePath = ExtractDispatchingResults(apiResult);

foreach (var dispatchingResult in result)
{
Expand Down
1 change: 1 addition & 0 deletions Frontend/src/app/app.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ h1 {
.spinner {
vertical-align: text-bottom;
width: 25px;
margin-left: 10px;
}

.mat-raised-button{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. -->

<h2 mat-dialog-title>Assets</h2>
Comment thread
MoeMaher marked this conversation as resolved.
<mat-dialog-content>

<p>Create an asset by clicking on the + button. Give your asset a name,
choose its type (car, truck, etc.), link it to the corresponding device, and click submit. </p>


<p>In this page, you will see the current location of all assets in real time.
You can click on the name of any asset to zoom in and follow that asset around. </p>

<p>You can click on the points button (Bullseye icon) and view the entire location history of
that asset. Additionally, you can filter to show a specific time period only. </p>

<p>You can click on the trip button (Rising trend icon) and view the trips this asset has made.
Trips are summarized versions of the location history of an asset. They include information
about periods of motion of the asset, the start and ending locations, and any minor stops
along the way. You can click on a single trip and view detailed information about it. When in
single trip mode, you can click on the map and it will show you information like instantaneous
speed, acceleration and other detailed information. </p>

<br>
</mat-dialog-content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-asset-info-dialog',
templateUrl: './asset-info-dialog.component.html',
styleUrls: ['./asset-info-dialog.component.css']
})
export class AssetInfoDialogComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<a [appRoleLimiter]="Roles.Administrator" mat-icon-button mat-tooltip="Add New Asset" [routerLink]="['/assets/new']">
<mat-icon>add_circle</mat-icon>
</a>
<button mat-icon-button>
<button mat-icon-button (click)="openInfoDialog()">
<mat-icon>info</mat-icon>
</button>
</mat-toolbar>
Expand Down
16 changes: 12 additions & 4 deletions Frontend/src/app/assets/asset-list/asset-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// Licensed under the MIT License.

import { Component, OnDestroy, OnInit } from '@angular/core';
import { Observable, Subscription } from 'rxjs';
import { MatDialog } from '@angular/material/dialog';
import { Observable } from 'rxjs';
import { Subscription } from 'rxjs';
import { ToasterService } from 'angular2-toaster';

import { Asset } from '../asset';
Expand All @@ -16,8 +18,7 @@ import { Trip } from '../../shared/trip';
import { Roles } from '../../shared/role';

import { takeWhile, skipWhile } from 'rxjs/operators';


import { AssetInfoDialogComponent } from '../asset-info-dialog/asset-info-dialog.component';


enum SelectedAssetState {
Expand Down Expand Up @@ -52,7 +53,8 @@ export class AssetListComponent implements OnInit, OnDestroy {
private assetService: AssetService,
private locationService: LocationService,
private mapsService: MapsService,
private toasterService: ToasterService) {
private toasterService: ToasterService,
public dialog: MatDialog) {
this.isAlive = true;
}

Expand Down Expand Up @@ -163,6 +165,12 @@ export class AssetListComponent implements OnInit, OnDestroy {
}
}

openInfoDialog(): void {
this.dialog.open(AssetInfoDialogComponent, {
width: '600px',
});
}

isAssetListSeleceted() {
return this.selectedAssetState === SelectedAssetState.ListSelected;
}
Expand Down
11 changes: 9 additions & 2 deletions Frontend/src/app/assets/assets.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { AssetsRoutingModule, assetsRoutedComponents } from './assets-routing.module';
import { AssetService } from './asset.service';
import { MatDialogModule } from '@angular/material';
import { AssetInfoDialogComponent } from './asset-info-dialog/asset-info-dialog.component';


@NgModule({
declarations: [
assetsRoutedComponents
assetsRoutedComponents,
AssetInfoDialogComponent
],
imports: [
AssetsRoutingModule,
SharedModule
SharedModule,
MatDialogModule
],
entryComponents: [
AssetInfoDialogComponent
],
providers: [
AssetService
Expand Down
10 changes: 6 additions & 4 deletions Frontend/src/app/core/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ export class DataService {
const cache = this.getCache<T>(path);
const url = this.getUrl(path);

this.authHttpService.get<T[]>(url).subscribe(data => {
cache.set(data);
this.spinnerService.stop();
},
this.authHttpService.get(url).pipe(
map(response => response as unknown as T[]))
.subscribe(data => {
cache.set(data);
this.spinnerService.stop();
},
error => this.spinnerService.stop());

return cache.getItems();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<mat-icon>add_circle</mat-icon>
</a>
<button mat-icon-button>
<mat-icon>info</mat-icon>
<mat-icon (click)="openDevicesDialog()">info</mat-icon>
</button>
</mat-toolbar>

Expand Down
11 changes: 10 additions & 1 deletion Frontend/src/app/devices/device-list/device-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { Device } from '../device';
import { DeviceService } from '../device.service';
import { MapsService } from '../../maps/maps.service';
import { Roles } from '../../shared/role';
import { MatDialog } from '@angular/material/dialog';
import { DevicesInfoDialogComponent } from '../devices-info-dialog/devices-info-dialog.component';

enum SelectedDeviceState {
ListSelected,
Expand All @@ -36,7 +38,8 @@ export class DeviceListComponent implements OnInit, OnDestroy {
constructor(
private deviceService: DeviceService,
private mapsService: MapsService,
private toasterService: ToasterService) { }
private toasterService: ToasterService,
public dialog: MatDialog) { }

ngOnInit() {
this.devices = this.deviceService.getDevices();
Expand Down Expand Up @@ -95,6 +98,12 @@ export class DeviceListComponent implements OnInit, OnDestroy {
}
}

openDevicesDialog(): void {
this.dialog.open(DevicesInfoDialogComponent, {
width: '600px',
});
}

timeFilterChange(range) {
this.selectedDateRange = range;
this.showPoints(this.selectedDevice, true);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. -->

<h2 mat-dialog-title>Devices</h2>
<mat-dialog-content>

<p>Create a device by clicking on the + button. Download the Android apk or set up iOS mobile client on your
phone. Open the mobile application from your phone and scan the QR code to finish provisioning the device.
Alternatively, if you will be using your own background tracking client, dismiss the popup and give your
device a unique ID and a unique name. You can find the Linked Asset property and select the asset to
link it with the device. Click submit once you are done. You can still click on the edit (pencil icon)
button on each device to make modification after your submission. </p>

<br>
</mat-dialog-content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-devices-info-dialog',
templateUrl: './devices-info-dialog.component.html',
styleUrls: ['./devices-info-dialog.component.css']
})
export class DevicesInfoDialogComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}
7 changes: 5 additions & 2 deletions Frontend/src/app/devices/devices.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ import { SharedModule } from '../shared/shared.module';
import { DevicesRoutingModule, routedComponents } from './devices-routing.module';
import { DeviceService } from './device.service';
import { DeviceRegisterComponent } from './device-register/device-register.component';
import { DevicesInfoDialogComponent } from './devices-info-dialog/devices-info-dialog.component';


@NgModule({
declarations: [
routedComponents,
DeviceRegisterComponent
DeviceRegisterComponent,
DevicesInfoDialogComponent
],
entryComponents: [
DeviceRegisterComponent
DeviceRegisterComponent,
DevicesInfoDialogComponent
],
imports: [
DevicesRoutingModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,57 @@ h1 {
height: 28px;
padding: 10px 16px;
}

.mat-button {
width: 100%;
padding: 0;
}

.pins-list {
width: 500px;
max-width: 100%;
border: solid 1px #ccc;
min-height: 60px;
display: block;
background: white;
border-radius: 4px;
overflow: hidden;
}

.pins-list-box {
padding: 10px;
border-bottom: solid 1px #ccc;
color: rgba(0, 0, 0, 0.87);
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
cursor: move;
background: white;
font-size: 14px;
}

.cdk-drag-preview {
box-sizing: border-box;
border-radius: 4px;
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
0 8px 10px 1px rgba(0, 0, 0, 0.14),
0 3px 14px 2px rgba(0, 0, 0, 0.12);
}

.cdk-drag-placeholder {
opacity: 0;
}

.cdk-drag-animating {
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}

.pins-list-box:last-child {
border: none;
}

.pins-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder) {
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}
Loading