add ability to delete Elines in Metronet GUI
Change-Id: I7cdcfb78417bed445e10384b65e0117cc5961d1a
diff --git a/xos/gui/conf/webpack-dist.conf.js b/xos/gui/conf/webpack-dist.conf.js
index 12aa031..bde7343 100755
--- a/xos/gui/conf/webpack-dist.conf.js
+++ b/xos/gui/conf/webpack-dist.conf.js
@@ -65,7 +65,7 @@
compress: {unused: true, dead_code: true, warnings: false}, // eslint-disable-line camelcase
mangle: false // NOTE mangling was breaking the build
}),
- new ExtractTextPlugin('index-[contenthash].css'),
+ new ExtractTextPlugin('index.css'),
new webpack.optimize.CommonsChunkPlugin({name: 'vendor'}),
new webpack.ProvidePlugin({
$: "jquery",
diff --git a/xos/gui/src/app/components/eline-side.component.html b/xos/gui/src/app/components/eline-side.component.html
index 09cf33e..2dc616c 100644
--- a/xos/gui/src/app/components/eline-side.component.html
+++ b/xos/gui/src/app/components/eline-side.component.html
@@ -1,4 +1,4 @@
-<div>
+<div class = "elinepanel">
<h1>ELine Overview</h1>
<form ng-submit="vm.saveEline(vm.mng.eline)">
<div class="form-group" ng-hide="vm.mng.createMode">
@@ -26,7 +26,7 @@
<select required class="form-control"
id="bwps"
ng-model="vm.mng.eline.bwp"
- ng-options="bwp.name as bwp.name for bwp in vm.mng.bwps"
+ ng-options="bwp.name as bwp.name for bwp in vm.mng.bwps | orderBy: 'name'"
>
</select>
</div>
@@ -43,4 +43,5 @@
</div>
</form>
<button type="button" class="btn btn-danger btn-block" ng-click="vm.mng.elinePanel({}, vm.mng.eline, false)">Close</button>
+ <button type="button" class = "btn btn-danger delete-eline" ng-click="vm.deleteEline(vm.mng.eline)">Delete Eline</button>
</div>
\ No newline at end of file
diff --git a/xos/gui/src/app/components/eline-side.component.ts b/xos/gui/src/app/components/eline-side.component.ts
index ca017c4..a3dde96 100644
--- a/xos/gui/src/app/components/eline-side.component.ts
+++ b/xos/gui/src/app/components/eline-side.component.ts
@@ -26,6 +26,15 @@
});
}
+ public deleteEline(item: any) {
+ let name = item.name;
+ item.$delete().then((res) => {
+ this.toastr.success(`${name} successfully deleted!`);
+ })
+ .catch((error) => {
+ this.toastr.error(`Error while deleting ${name}: ${error.specific_error}`);
+ });
+ }
}
diff --git a/xos/gui/src/app/components/mngMap.component.html b/xos/gui/src/app/components/mngMap.component.html
index e41422f..f809526 100644
--- a/xos/gui/src/app/components/mngMap.component.html
+++ b/xos/gui/src/app/components/mngMap.component.html
@@ -55,7 +55,7 @@
</ng-map>
</div>
-
+ Changes may not display until page refresh.
</div>
</div>
<!--"https://maps.googleapis.com/maps/api/js?key=AIzaSyA3rQOp26I5a21VQhwLal8Z1x3XGHjXfm4"-->
\ No newline at end of file
diff --git a/xos/gui/src/app/style/style.css b/xos/gui/src/app/style/style.css
index 59cdbe1..9c4ebe4 100644
--- a/xos/gui/src/app/style/style.css
+++ b/xos/gui/src/app/style/style.css
@@ -9,4 +9,15 @@
body > ui-view > xos > div > xos-side-panel > section > div:nth-child(1) {
display: none;
+}
+
+.elinepanel{
+ height: 100%;
+}
+
+.delete-eline{
+ position: absolute;
+ right: 0;
+ bottom: 0;
+ margin: 10px;
}
\ No newline at end of file
diff --git a/xos/gui/src/app/style/style.scss b/xos/gui/src/app/style/style.scss
deleted file mode 100644
index 2506519..0000000
--- a/xos/gui/src/app/style/style.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-ng-map, [map-lazy-load]{
- height: 600px;
- width: 100%;
-}
-
-.marker-info > p, .marker-info > h4{
- color: #000000;
-}
\ No newline at end of file